Included page name in chat info; added test for ChatInfo
This commit is contained in:
parent
e5994ae0f1
commit
085682d70f
73
chat.go
73
chat.go
|
@ -7,6 +7,7 @@ import (
|
||||||
"encoding/csv"
|
"encoding/csv"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -14,13 +15,15 @@ import (
|
||||||
|
|
||||||
"github.com/r3labs/sse/v2"
|
"github.com/r3labs/sse/v2"
|
||||||
"github.com/tylertravisty/go-utils/random"
|
"github.com/tylertravisty/go-utils/random"
|
||||||
|
"golang.org/x/net/html"
|
||||||
"gopkg.in/cenkalti/backoff.v1"
|
"gopkg.in/cenkalti/backoff.v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChatInfo struct {
|
type ChatInfo struct {
|
||||||
UrlPrefix string
|
|
||||||
ChatID string
|
|
||||||
ChannelID int
|
ChannelID int
|
||||||
|
ChatID string
|
||||||
|
Page string
|
||||||
|
UrlPrefix string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ci *ChatInfo) MessageUrl() string {
|
func (ci *ChatInfo) MessageUrl() string {
|
||||||
|
@ -31,14 +34,19 @@ func (ci *ChatInfo) StreamUrl() string {
|
||||||
return fmt.Sprintf("%s/chat/%s/stream", ci.UrlPrefix, ci.ChatID)
|
return fmt.Sprintf("%s/chat/%s/stream", ci.UrlPrefix, ci.ChatID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ChatInfo() error {
|
func (c *Client) ChatInfo(reload bool) (*ChatInfo, error) {
|
||||||
ci, err := c.getChatInfo()
|
var ci *ChatInfo
|
||||||
|
var err error
|
||||||
|
|
||||||
|
if c.chatInfo == nil || reload {
|
||||||
|
ci, err = c.getChatInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return pkgErr("error getting chat info", err)
|
return nil, pkgErr("error getting chat info", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.chatInfo = ci
|
c.chatInfo = ci
|
||||||
return nil
|
return ci, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) getChatInfo() (*ChatInfo, error) {
|
func (c *Client) getChatInfo() (*ChatInfo, error) {
|
||||||
|
@ -52,12 +60,11 @@ func (c *Client) getChatInfo() (*ChatInfo, error) {
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
var chatInfo *ChatInfo
|
||||||
|
var page string
|
||||||
r := bufio.NewReader(resp.Body)
|
r := bufio.NewReader(resp.Body)
|
||||||
//line, _, err := r.ReadLine()
|
|
||||||
lineS, err := r.ReadString('\n')
|
lineS, err := r.ReadString('\n')
|
||||||
//var lineS string
|
|
||||||
for err == nil {
|
for err == nil {
|
||||||
//lineS = string(line)
|
|
||||||
if strings.Contains(lineS, "RumbleChat(") {
|
if strings.Contains(lineS, "RumbleChat(") {
|
||||||
start := strings.Index(lineS, "RumbleChat(") + len("RumbleChat(")
|
start := strings.Index(lineS, "RumbleChat(") + len("RumbleChat(")
|
||||||
if start == -1 {
|
if start == -1 {
|
||||||
|
@ -81,18 +88,35 @@ func (c *Client) getChatInfo() (*ChatInfo, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error converting channel ID argument string to int: %v", err)
|
return nil, fmt.Errorf("error converting channel ID argument string to int: %v", err)
|
||||||
}
|
}
|
||||||
return &ChatInfo{info[0], info[1], channelID}, nil
|
chatInfo = &ChatInfo{ChannelID: channelID, ChatID: info[1], UrlPrefix: info[0]}
|
||||||
}
|
} else if strings.Contains(lineS, "media-by--a") && strings.Contains(lineS, "author") {
|
||||||
//line, _, err = r.ReadLine()
|
r := strings.NewReader(lineS)
|
||||||
lineS, err = r.ReadString('\n')
|
node, err := html.Parse(r)
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error reading line from stream webpage: %v", err)
|
return nil, fmt.Errorf("error parsing html tag with page name: %v", err)
|
||||||
|
}
|
||||||
|
if node.FirstChild != nil && node.FirstChild.LastChild != nil && node.FirstChild.LastChild.FirstChild != nil {
|
||||||
|
for _, attr := range node.FirstChild.LastChild.FirstChild.Attr {
|
||||||
|
if attr.Key == "href" {
|
||||||
|
page = attr.Val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lineS, err = r.ReadString('\n')
|
||||||
|
}
|
||||||
|
if err != nil && err != io.EOF {
|
||||||
|
return nil, fmt.Errorf("error reading line from stream webpage: %v", err)
|
||||||
|
}
|
||||||
|
if chatInfo == nil {
|
||||||
return nil, fmt.Errorf("did not find RumbleChat function call")
|
return nil, fmt.Errorf("did not find RumbleChat function call")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chatInfo.Page = page
|
||||||
|
return chatInfo, nil
|
||||||
|
}
|
||||||
|
|
||||||
type ChatMessage struct {
|
type ChatMessage struct {
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
}
|
}
|
||||||
|
@ -118,20 +142,17 @@ type ChatResponse struct {
|
||||||
Errors []Error `json:"errors"`
|
Errors []Error `json:"errors"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Chat(asChannel bool, message string) error {
|
func (c *Client) Chat(message string, channelID *int) error {
|
||||||
if c.httpClient == nil {
|
if c.httpClient == nil {
|
||||||
return pkgErr("", fmt.Errorf("http client is nil"))
|
return pkgErr("", fmt.Errorf("http client is nil"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// chatInfo, err := c.streamChatInfo()
|
|
||||||
// if err != nil {
|
|
||||||
// return pkgErr("error getting stream chat info", err)
|
|
||||||
// }
|
|
||||||
if c.chatInfo == nil {
|
if c.chatInfo == nil {
|
||||||
err := c.ChatInfo()
|
ci, err := c.getChatInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return pkgErr("error getting chat info", err)
|
||||||
}
|
}
|
||||||
|
c.chatInfo = ci
|
||||||
}
|
}
|
||||||
|
|
||||||
requestID, err := random.String(32)
|
requestID, err := random.String(32)
|
||||||
|
@ -145,12 +166,12 @@ func (c *Client) Chat(asChannel bool, message string) error {
|
||||||
Text: message,
|
Text: message,
|
||||||
},
|
},
|
||||||
Rant: nil,
|
Rant: nil,
|
||||||
ChannelID: nil,
|
ChannelID: channelID,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if asChannel {
|
// if asChannel {
|
||||||
body.Data.ChannelID = &c.chatInfo.ChannelID
|
// body.Data.ChannelID = &c.chatInfo.ChannelID
|
||||||
}
|
// }
|
||||||
|
|
||||||
bodyB, err := json.Marshal(body)
|
bodyB, err := json.Marshal(body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
46
chat_test.go
Normal file
46
chat_test.go
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
package rumblelivestreamlib
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
liveUrlEnvVar = "RUMBLE_LIVE_URL"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
exitCode := run(m)
|
||||||
|
os.Exit(exitCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
func run(m *testing.M) int {
|
||||||
|
return m.Run()
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestChatInfo(t *testing.T) {
|
||||||
|
url := os.Getenv(liveUrlEnvVar)
|
||||||
|
if url == "" {
|
||||||
|
t.Skipf("Set %s to run this test.", liveUrlEnvVar)
|
||||||
|
}
|
||||||
|
|
||||||
|
client, err := NewClient(NewClientOptions{StreamUrl: url})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Want NewClient err = nil, got: %v", err)
|
||||||
|
}
|
||||||
|
ci, err := client.ChatInfo(false)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Want client.ChatInfo err = nil, got: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ci.ChatID == "" {
|
||||||
|
t.Fatalf("Want non-empty chat ID")
|
||||||
|
}
|
||||||
|
if ci.Page == "" {
|
||||||
|
t.Fatal("Want non-empty page")
|
||||||
|
}
|
||||||
|
t.Log("Page:", ci.Page)
|
||||||
|
if ci.UrlPrefix == "" {
|
||||||
|
t.Fatal("Want non-empty url prefix")
|
||||||
|
}
|
||||||
|
}
|
8
go.mod
8
go.mod
|
@ -3,18 +3,14 @@ module github.com/tylertravisty/rumble-livestream-lib-go
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/juju/persistent-cookiejar v1.0.0
|
|
||||||
github.com/r3labs/sse/v2 v2.10.0
|
github.com/r3labs/sse/v2 v2.10.0
|
||||||
github.com/robertkrimen/otto v0.2.1
|
github.com/robertkrimen/otto v0.2.1
|
||||||
github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909
|
github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909
|
||||||
|
golang.org/x/net v0.24.0
|
||||||
gopkg.in/cenkalti/backoff.v1 v1.1.0
|
gopkg.in/cenkalti/backoff.v1 v1.1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/juju/go4 v0.0.0-20160222163258-40d72ab9641a // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
golang.org/x/net v0.0.0-20191116160921-f9c825593386 // indirect
|
|
||||||
golang.org/x/text v0.4.0 // indirect
|
|
||||||
gopkg.in/errgo.v1 v1.0.1 // indirect
|
|
||||||
gopkg.in/retry.v1 v1.0.3 // indirect
|
|
||||||
gopkg.in/sourcemap.v1 v1.0.5 // indirect
|
gopkg.in/sourcemap.v1 v1.0.5 // indirect
|
||||||
)
|
)
|
||||||
|
|
26
go.sum
26
go.sum
|
@ -1,45 +1,27 @@
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/frankban/quicktest v1.2.2 h1:xfmOhhoH5fGPgbEAlhLpJH9p0z/0Qizio9osmvn9IUY=
|
|
||||||
github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20=
|
|
||||||
github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42 h1:q3pnF5JFBNRz8sRD+IRj7Y6DMyYGTNqnZ9axTbSfoNI=
|
|
||||||
github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
|
||||||
github.com/juju/go4 v0.0.0-20160222163258-40d72ab9641a h1:45JtCyuNYE+QN9aPuR1ID9++BQU+NMTMudHSuaK0Las=
|
|
||||||
github.com/juju/go4 v0.0.0-20160222163258-40d72ab9641a/go.mod h1:RVHtZuvrpETIepiNUrNlih2OynoFf1eM6DGC6dloXzk=
|
|
||||||
github.com/juju/persistent-cookiejar v1.0.0 h1:Ag7+QLzqC2m+OYXy2QQnRjb3gTkEBSZagZ6QozwT3EQ=
|
|
||||||
github.com/juju/persistent-cookiejar v1.0.0/go.mod h1:zrbmo4nBKaiP/Ez3F67ewkMbzGYfXyMvRtbOfuAwG0w=
|
|
||||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
||||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
|
github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
|
||||||
github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
|
github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
|
||||||
github.com/robertkrimen/otto v0.2.1 h1:FVP0PJ0AHIjC+N4pKCG9yCDz6LHNPCwi/GKID5pGGF0=
|
github.com/robertkrimen/otto v0.2.1 h1:FVP0PJ0AHIjC+N4pKCG9yCDz6LHNPCwi/GKID5pGGF0=
|
||||||
github.com/robertkrimen/otto v0.2.1/go.mod h1:UPwtJ1Xu7JrLcZjNWN8orJaM5n5YEtqL//farB5FlRY=
|
github.com/robertkrimen/otto v0.2.1/go.mod h1:UPwtJ1Xu7JrLcZjNWN8orJaM5n5YEtqL//farB5FlRY=
|
||||||
github.com/rogpeppe/clock v0.0.0-20190514195947-2896927a307a h1:3QH7VyOaaiUHNrA9Se4YQIRkDTCw1EJls9xTUCaCeRM=
|
|
||||||
github.com/rogpeppe/clock v0.0.0-20190514195947-2896927a307a/go.mod h1:4r5QyqhjIWCcK8DO4KMclc5Iknq5qVBAlbYYzAbUScQ=
|
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||||
github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909 h1:xrjIFqzGQXlCrCdMPpW6+SodGFSlrQ3ZNUCr3f5tF1g=
|
github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909 h1:xrjIFqzGQXlCrCdMPpW6+SodGFSlrQ3ZNUCr3f5tF1g=
|
||||||
github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909/go.mod h1:2W31Jhs9YSy7y500wsCOW0bcamGi9foQV1CKrfvfTxk=
|
github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909/go.mod h1:2W31Jhs9YSy7y500wsCOW0bcamGi9foQV1CKrfvfTxk=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/net v0.0.0-20191116160921-f9c825593386 h1:ktbWvQrW08Txdxno1PiDpSxPXG6ndGsfnJjRRtkM0LQ=
|
|
||||||
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||||
|
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
|
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
|
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
|
||||||
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
|
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/errgo.v1 v1.0.1 h1:oQFRXzZ7CkBGdm1XZm/EbQYaYNNEElNBOd09M6cqNso=
|
|
||||||
gopkg.in/errgo.v1 v1.0.1/go.mod h1:3NjfXwocQRYAPTq4/fzX+CwUhPRcR/azYRhj8G+LqMo=
|
|
||||||
gopkg.in/retry.v1 v1.0.3 h1:a9CArYczAVv6Qs6VGoLMio99GEs7kY9UzSF9+LD+iGs=
|
|
||||||
gopkg.in/retry.v1 v1.0.3/go.mod h1:FJkXmWiMaAo7xB+xhvDF59zhfjDWyzmyAxiT4dB688g=
|
|
||||||
gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI=
|
gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI=
|
||||||
gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78=
|
gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
|
3
vendor/golang.org/x/net/AUTHORS
generated
vendored
3
vendor/golang.org/x/net/AUTHORS
generated
vendored
|
@ -1,3 +0,0 @@
|
||||||
# This source code refers to The Go Authors for copyright purposes.
|
|
||||||
# The master list of authors is in the main Go distribution,
|
|
||||||
# visible at http://tip.golang.org/AUTHORS.
|
|
3
vendor/golang.org/x/net/CONTRIBUTORS
generated
vendored
3
vendor/golang.org/x/net/CONTRIBUTORS
generated
vendored
|
@ -1,3 +0,0 @@
|
||||||
# This source code was written by the Go contributors.
|
|
||||||
# The master list of contributors is in the main Go distribution,
|
|
||||||
# visible at http://tip.golang.org/CONTRIBUTORS.
|
|
6
vendor/golang.org/x/net/context/go17.go
generated
vendored
6
vendor/golang.org/x/net/context/go17.go
generated
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// +build go1.7
|
//go:build go1.7
|
||||||
|
|
||||||
package context
|
package context
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ var DeadlineExceeded = context.DeadlineExceeded
|
||||||
// call cancel as soon as the operations running in this Context complete.
|
// call cancel as soon as the operations running in this Context complete.
|
||||||
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
|
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
|
||||||
ctx, f := context.WithCancel(parent)
|
ctx, f := context.WithCancel(parent)
|
||||||
return ctx, CancelFunc(f)
|
return ctx, f
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithDeadline returns a copy of the parent context with the deadline adjusted
|
// WithDeadline returns a copy of the parent context with the deadline adjusted
|
||||||
|
@ -45,7 +45,7 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
|
||||||
// call cancel as soon as the operations running in this Context complete.
|
// call cancel as soon as the operations running in this Context complete.
|
||||||
func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
|
func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
|
||||||
ctx, f := context.WithDeadline(parent, deadline)
|
ctx, f := context.WithDeadline(parent, deadline)
|
||||||
return ctx, CancelFunc(f)
|
return ctx, f
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
|
// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
|
||||||
|
|
2
vendor/golang.org/x/net/context/go19.go
generated
vendored
2
vendor/golang.org/x/net/context/go19.go
generated
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// +build go1.9
|
//go:build go1.9
|
||||||
|
|
||||||
package context
|
package context
|
||||||
|
|
||||||
|
|
2
vendor/golang.org/x/net/context/pre_go17.go
generated
vendored
2
vendor/golang.org/x/net/context/pre_go17.go
generated
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// +build !go1.7
|
//go:build !go1.7
|
||||||
|
|
||||||
package context
|
package context
|
||||||
|
|
||||||
|
|
2
vendor/golang.org/x/net/context/pre_go19.go
generated
vendored
2
vendor/golang.org/x/net/context/pre_go19.go
generated
vendored
|
@ -2,7 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// +build !go1.9
|
//go:build !go1.9
|
||||||
|
|
||||||
package context
|
package context
|
||||||
|
|
||||||
|
|
78
vendor/golang.org/x/net/html/atom/atom.go
generated
vendored
Normal file
78
vendor/golang.org/x/net/html/atom/atom.go
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Package atom provides integer codes (also known as atoms) for a fixed set of
|
||||||
|
// frequently occurring HTML strings: tag names and attribute keys such as "p"
|
||||||
|
// and "id".
|
||||||
|
//
|
||||||
|
// Sharing an atom's name between all elements with the same tag can result in
|
||||||
|
// fewer string allocations when tokenizing and parsing HTML. Integer
|
||||||
|
// comparisons are also generally faster than string comparisons.
|
||||||
|
//
|
||||||
|
// The value of an atom's particular code is not guaranteed to stay the same
|
||||||
|
// between versions of this package. Neither is any ordering guaranteed:
|
||||||
|
// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to
|
||||||
|
// be dense. The only guarantees are that e.g. looking up "div" will yield
|
||||||
|
// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0.
|
||||||
|
package atom // import "golang.org/x/net/html/atom"
|
||||||
|
|
||||||
|
// Atom is an integer code for a string. The zero value maps to "".
|
||||||
|
type Atom uint32
|
||||||
|
|
||||||
|
// String returns the atom's name.
|
||||||
|
func (a Atom) String() string {
|
||||||
|
start := uint32(a >> 8)
|
||||||
|
n := uint32(a & 0xff)
|
||||||
|
if start+n > uint32(len(atomText)) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return atomText[start : start+n]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a Atom) string() string {
|
||||||
|
return atomText[a>>8 : a>>8+a&0xff]
|
||||||
|
}
|
||||||
|
|
||||||
|
// fnv computes the FNV hash with an arbitrary starting value h.
|
||||||
|
func fnv(h uint32, s []byte) uint32 {
|
||||||
|
for i := range s {
|
||||||
|
h ^= uint32(s[i])
|
||||||
|
h *= 16777619
|
||||||
|
}
|
||||||
|
return h
|
||||||
|
}
|
||||||
|
|
||||||
|
func match(s string, t []byte) bool {
|
||||||
|
for i, c := range t {
|
||||||
|
if s[i] != c {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lookup returns the atom whose name is s. It returns zero if there is no
|
||||||
|
// such atom. The lookup is case sensitive.
|
||||||
|
func Lookup(s []byte) Atom {
|
||||||
|
if len(s) == 0 || len(s) > maxAtomLen {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
h := fnv(hash0, s)
|
||||||
|
if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns a string whose contents are equal to s. In that sense, it is
|
||||||
|
// equivalent to string(s) but may be more efficient.
|
||||||
|
func String(s []byte) string {
|
||||||
|
if a := Lookup(s); a != 0 {
|
||||||
|
return a.String()
|
||||||
|
}
|
||||||
|
return string(s)
|
||||||
|
}
|
783
vendor/golang.org/x/net/html/atom/table.go
generated
vendored
Normal file
783
vendor/golang.org/x/net/html/atom/table.go
generated
vendored
Normal file
|
@ -0,0 +1,783 @@
|
||||||
|
// Code generated by go generate gen.go; DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:generate go run gen.go
|
||||||
|
|
||||||
|
package atom
|
||||||
|
|
||||||
|
const (
|
||||||
|
A Atom = 0x1
|
||||||
|
Abbr Atom = 0x4
|
||||||
|
Accept Atom = 0x1a06
|
||||||
|
AcceptCharset Atom = 0x1a0e
|
||||||
|
Accesskey Atom = 0x2c09
|
||||||
|
Acronym Atom = 0xaa07
|
||||||
|
Action Atom = 0x27206
|
||||||
|
Address Atom = 0x6f307
|
||||||
|
Align Atom = 0xb105
|
||||||
|
Allowfullscreen Atom = 0x2080f
|
||||||
|
Allowpaymentrequest Atom = 0xc113
|
||||||
|
Allowusermedia Atom = 0xdd0e
|
||||||
|
Alt Atom = 0xf303
|
||||||
|
Annotation Atom = 0x1c90a
|
||||||
|
AnnotationXml Atom = 0x1c90e
|
||||||
|
Applet Atom = 0x31906
|
||||||
|
Area Atom = 0x35604
|
||||||
|
Article Atom = 0x3fc07
|
||||||
|
As Atom = 0x3c02
|
||||||
|
Aside Atom = 0x10705
|
||||||
|
Async Atom = 0xff05
|
||||||
|
Audio Atom = 0x11505
|
||||||
|
Autocomplete Atom = 0x2780c
|
||||||
|
Autofocus Atom = 0x12109
|
||||||
|
Autoplay Atom = 0x13c08
|
||||||
|
B Atom = 0x101
|
||||||
|
Base Atom = 0x3b04
|
||||||
|
Basefont Atom = 0x3b08
|
||||||
|
Bdi Atom = 0xba03
|
||||||
|
Bdo Atom = 0x14b03
|
||||||
|
Bgsound Atom = 0x15e07
|
||||||
|
Big Atom = 0x17003
|
||||||
|
Blink Atom = 0x17305
|
||||||
|
Blockquote Atom = 0x1870a
|
||||||
|
Body Atom = 0x2804
|
||||||
|
Br Atom = 0x202
|
||||||
|
Button Atom = 0x19106
|
||||||
|
Canvas Atom = 0x10306
|
||||||
|
Caption Atom = 0x23107
|
||||||
|
Center Atom = 0x22006
|
||||||
|
Challenge Atom = 0x29b09
|
||||||
|
Charset Atom = 0x2107
|
||||||
|
Checked Atom = 0x47907
|
||||||
|
Cite Atom = 0x19c04
|
||||||
|
Class Atom = 0x56405
|
||||||
|
Code Atom = 0x5c504
|
||||||
|
Col Atom = 0x1ab03
|
||||||
|
Colgroup Atom = 0x1ab08
|
||||||
|
Color Atom = 0x1bf05
|
||||||
|
Cols Atom = 0x1c404
|
||||||
|
Colspan Atom = 0x1c407
|
||||||
|
Command Atom = 0x1d707
|
||||||
|
Content Atom = 0x58b07
|
||||||
|
Contenteditable Atom = 0x58b0f
|
||||||
|
Contextmenu Atom = 0x3800b
|
||||||
|
Controls Atom = 0x1de08
|
||||||
|
Coords Atom = 0x1ea06
|
||||||
|
Crossorigin Atom = 0x1fb0b
|
||||||
|
Data Atom = 0x4a504
|
||||||
|
Datalist Atom = 0x4a508
|
||||||
|
Datetime Atom = 0x2b808
|
||||||
|
Dd Atom = 0x2d702
|
||||||
|
Default Atom = 0x10a07
|
||||||
|
Defer Atom = 0x5c705
|
||||||
|
Del Atom = 0x45203
|
||||||
|
Desc Atom = 0x56104
|
||||||
|
Details Atom = 0x7207
|
||||||
|
Dfn Atom = 0x8703
|
||||||
|
Dialog Atom = 0xbb06
|
||||||
|
Dir Atom = 0x9303
|
||||||
|
Dirname Atom = 0x9307
|
||||||
|
Disabled Atom = 0x16408
|
||||||
|
Div Atom = 0x16b03
|
||||||
|
Dl Atom = 0x5e602
|
||||||
|
Download Atom = 0x46308
|
||||||
|
Draggable Atom = 0x17a09
|
||||||
|
Dropzone Atom = 0x40508
|
||||||
|
Dt Atom = 0x64b02
|
||||||
|
Em Atom = 0x6e02
|
||||||
|
Embed Atom = 0x6e05
|
||||||
|
Enctype Atom = 0x28d07
|
||||||
|
Face Atom = 0x21e04
|
||||||
|
Fieldset Atom = 0x22608
|
||||||
|
Figcaption Atom = 0x22e0a
|
||||||
|
Figure Atom = 0x24806
|
||||||
|
Font Atom = 0x3f04
|
||||||
|
Footer Atom = 0xf606
|
||||||
|
For Atom = 0x25403
|
||||||
|
ForeignObject Atom = 0x2540d
|
||||||
|
Foreignobject Atom = 0x2610d
|
||||||
|
Form Atom = 0x26e04
|
||||||
|
Formaction Atom = 0x26e0a
|
||||||
|
Formenctype Atom = 0x2890b
|
||||||
|
Formmethod Atom = 0x2a40a
|
||||||
|
Formnovalidate Atom = 0x2ae0e
|
||||||
|
Formtarget Atom = 0x2c00a
|
||||||
|
Frame Atom = 0x8b05
|
||||||
|
Frameset Atom = 0x8b08
|
||||||
|
H1 Atom = 0x15c02
|
||||||
|
H2 Atom = 0x2de02
|
||||||
|
H3 Atom = 0x30d02
|
||||||
|
H4 Atom = 0x34502
|
||||||
|
H5 Atom = 0x34f02
|
||||||
|
H6 Atom = 0x64d02
|
||||||
|
Head Atom = 0x33104
|
||||||
|
Header Atom = 0x33106
|
||||||
|
Headers Atom = 0x33107
|
||||||
|
Height Atom = 0x5206
|
||||||
|
Hgroup Atom = 0x2ca06
|
||||||
|
Hidden Atom = 0x2d506
|
||||||
|
High Atom = 0x2db04
|
||||||
|
Hr Atom = 0x15702
|
||||||
|
Href Atom = 0x2e004
|
||||||
|
Hreflang Atom = 0x2e008
|
||||||
|
Html Atom = 0x5604
|
||||||
|
HttpEquiv Atom = 0x2e80a
|
||||||
|
I Atom = 0x601
|
||||||
|
Icon Atom = 0x58a04
|
||||||
|
Id Atom = 0x10902
|
||||||
|
Iframe Atom = 0x2fc06
|
||||||
|
Image Atom = 0x30205
|
||||||
|
Img Atom = 0x30703
|
||||||
|
Input Atom = 0x44b05
|
||||||
|
Inputmode Atom = 0x44b09
|
||||||
|
Ins Atom = 0x20403
|
||||||
|
Integrity Atom = 0x23f09
|
||||||
|
Is Atom = 0x16502
|
||||||
|
Isindex Atom = 0x30f07
|
||||||
|
Ismap Atom = 0x31605
|
||||||
|
Itemid Atom = 0x38b06
|
||||||
|
Itemprop Atom = 0x19d08
|
||||||
|
Itemref Atom = 0x3cd07
|
||||||
|
Itemscope Atom = 0x67109
|
||||||
|
Itemtype Atom = 0x31f08
|
||||||
|
Kbd Atom = 0xb903
|
||||||
|
Keygen Atom = 0x3206
|
||||||
|
Keytype Atom = 0xd607
|
||||||
|
Kind Atom = 0x17704
|
||||||
|
Label Atom = 0x5905
|
||||||
|
Lang Atom = 0x2e404
|
||||||
|
Legend Atom = 0x18106
|
||||||
|
Li Atom = 0xb202
|
||||||
|
Link Atom = 0x17404
|
||||||
|
List Atom = 0x4a904
|
||||||
|
Listing Atom = 0x4a907
|
||||||
|
Loop Atom = 0x5d04
|
||||||
|
Low Atom = 0xc303
|
||||||
|
Main Atom = 0x1004
|
||||||
|
Malignmark Atom = 0xb00a
|
||||||
|
Manifest Atom = 0x6d708
|
||||||
|
Map Atom = 0x31803
|
||||||
|
Mark Atom = 0xb604
|
||||||
|
Marquee Atom = 0x32707
|
||||||
|
Math Atom = 0x32e04
|
||||||
|
Max Atom = 0x33d03
|
||||||
|
Maxlength Atom = 0x33d09
|
||||||
|
Media Atom = 0xe605
|
||||||
|
Mediagroup Atom = 0xe60a
|
||||||
|
Menu Atom = 0x38704
|
||||||
|
Menuitem Atom = 0x38708
|
||||||
|
Meta Atom = 0x4b804
|
||||||
|
Meter Atom = 0x9805
|
||||||
|
Method Atom = 0x2a806
|
||||||
|
Mglyph Atom = 0x30806
|
||||||
|
Mi Atom = 0x34702
|
||||||
|
Min Atom = 0x34703
|
||||||
|
Minlength Atom = 0x34709
|
||||||
|
Mn Atom = 0x2b102
|
||||||
|
Mo Atom = 0xa402
|
||||||
|
Ms Atom = 0x67402
|
||||||
|
Mtext Atom = 0x35105
|
||||||
|
Multiple Atom = 0x35f08
|
||||||
|
Muted Atom = 0x36705
|
||||||
|
Name Atom = 0x9604
|
||||||
|
Nav Atom = 0x1303
|
||||||
|
Nobr Atom = 0x3704
|
||||||
|
Noembed Atom = 0x6c07
|
||||||
|
Noframes Atom = 0x8908
|
||||||
|
Nomodule Atom = 0xa208
|
||||||
|
Nonce Atom = 0x1a605
|
||||||
|
Noscript Atom = 0x21608
|
||||||
|
Novalidate Atom = 0x2b20a
|
||||||
|
Object Atom = 0x26806
|
||||||
|
Ol Atom = 0x13702
|
||||||
|
Onabort Atom = 0x19507
|
||||||
|
Onafterprint Atom = 0x2360c
|
||||||
|
Onautocomplete Atom = 0x2760e
|
||||||
|
Onautocompleteerror Atom = 0x27613
|
||||||
|
Onauxclick Atom = 0x61f0a
|
||||||
|
Onbeforeprint Atom = 0x69e0d
|
||||||
|
Onbeforeunload Atom = 0x6e70e
|
||||||
|
Onblur Atom = 0x56d06
|
||||||
|
Oncancel Atom = 0x11908
|
||||||
|
Oncanplay Atom = 0x14d09
|
||||||
|
Oncanplaythrough Atom = 0x14d10
|
||||||
|
Onchange Atom = 0x41b08
|
||||||
|
Onclick Atom = 0x2f507
|
||||||
|
Onclose Atom = 0x36c07
|
||||||
|
Oncontextmenu Atom = 0x37e0d
|
||||||
|
Oncopy Atom = 0x39106
|
||||||
|
Oncuechange Atom = 0x3970b
|
||||||
|
Oncut Atom = 0x3a205
|
||||||
|
Ondblclick Atom = 0x3a70a
|
||||||
|
Ondrag Atom = 0x3b106
|
||||||
|
Ondragend Atom = 0x3b109
|
||||||
|
Ondragenter Atom = 0x3ba0b
|
||||||
|
Ondragexit Atom = 0x3c50a
|
||||||
|
Ondragleave Atom = 0x3df0b
|
||||||
|
Ondragover Atom = 0x3ea0a
|
||||||
|
Ondragstart Atom = 0x3f40b
|
||||||
|
Ondrop Atom = 0x40306
|
||||||
|
Ondurationchange Atom = 0x41310
|
||||||
|
Onemptied Atom = 0x40a09
|
||||||
|
Onended Atom = 0x42307
|
||||||
|
Onerror Atom = 0x42a07
|
||||||
|
Onfocus Atom = 0x43107
|
||||||
|
Onhashchange Atom = 0x43d0c
|
||||||
|
Oninput Atom = 0x44907
|
||||||
|
Oninvalid Atom = 0x45509
|
||||||
|
Onkeydown Atom = 0x45e09
|
||||||
|
Onkeypress Atom = 0x46b0a
|
||||||
|
Onkeyup Atom = 0x48007
|
||||||
|
Onlanguagechange Atom = 0x48d10
|
||||||
|
Onload Atom = 0x49d06
|
||||||
|
Onloadeddata Atom = 0x49d0c
|
||||||
|
Onloadedmetadata Atom = 0x4b010
|
||||||
|
Onloadend Atom = 0x4c609
|
||||||
|
Onloadstart Atom = 0x4cf0b
|
||||||
|
Onmessage Atom = 0x4da09
|
||||||
|
Onmessageerror Atom = 0x4da0e
|
||||||
|
Onmousedown Atom = 0x4e80b
|
||||||
|
Onmouseenter Atom = 0x4f30c
|
||||||
|
Onmouseleave Atom = 0x4ff0c
|
||||||
|
Onmousemove Atom = 0x50b0b
|
||||||
|
Onmouseout Atom = 0x5160a
|
||||||
|
Onmouseover Atom = 0x5230b
|
||||||
|
Onmouseup Atom = 0x52e09
|
||||||
|
Onmousewheel Atom = 0x53c0c
|
||||||
|
Onoffline Atom = 0x54809
|
||||||
|
Ononline Atom = 0x55108
|
||||||
|
Onpagehide Atom = 0x5590a
|
||||||
|
Onpageshow Atom = 0x5730a
|
||||||
|
Onpaste Atom = 0x57f07
|
||||||
|
Onpause Atom = 0x59a07
|
||||||
|
Onplay Atom = 0x5a406
|
||||||
|
Onplaying Atom = 0x5a409
|
||||||
|
Onpopstate Atom = 0x5ad0a
|
||||||
|
Onprogress Atom = 0x5b70a
|
||||||
|
Onratechange Atom = 0x5cc0c
|
||||||
|
Onrejectionhandled Atom = 0x5d812
|
||||||
|
Onreset Atom = 0x5ea07
|
||||||
|
Onresize Atom = 0x5f108
|
||||||
|
Onscroll Atom = 0x60008
|
||||||
|
Onsecuritypolicyviolation Atom = 0x60819
|
||||||
|
Onseeked Atom = 0x62908
|
||||||
|
Onseeking Atom = 0x63109
|
||||||
|
Onselect Atom = 0x63a08
|
||||||
|
Onshow Atom = 0x64406
|
||||||
|
Onsort Atom = 0x64f06
|
||||||
|
Onstalled Atom = 0x65909
|
||||||
|
Onstorage Atom = 0x66209
|
||||||
|
Onsubmit Atom = 0x66b08
|
||||||
|
Onsuspend Atom = 0x67b09
|
||||||
|
Ontimeupdate Atom = 0x400c
|
||||||
|
Ontoggle Atom = 0x68408
|
||||||
|
Onunhandledrejection Atom = 0x68c14
|
||||||
|
Onunload Atom = 0x6ab08
|
||||||
|
Onvolumechange Atom = 0x6b30e
|
||||||
|
Onwaiting Atom = 0x6c109
|
||||||
|
Onwheel Atom = 0x6ca07
|
||||||
|
Open Atom = 0x1a304
|
||||||
|
Optgroup Atom = 0x5f08
|
||||||
|
Optimum Atom = 0x6d107
|
||||||
|
Option Atom = 0x6e306
|
||||||
|
Output Atom = 0x51d06
|
||||||
|
P Atom = 0xc01
|
||||||
|
Param Atom = 0xc05
|
||||||
|
Pattern Atom = 0x6607
|
||||||
|
Picture Atom = 0x7b07
|
||||||
|
Ping Atom = 0xef04
|
||||||
|
Placeholder Atom = 0x1310b
|
||||||
|
Plaintext Atom = 0x1b209
|
||||||
|
Playsinline Atom = 0x1400b
|
||||||
|
Poster Atom = 0x2cf06
|
||||||
|
Pre Atom = 0x47003
|
||||||
|
Preload Atom = 0x48607
|
||||||
|
Progress Atom = 0x5b908
|
||||||
|
Prompt Atom = 0x53606
|
||||||
|
Public Atom = 0x58606
|
||||||
|
Q Atom = 0xcf01
|
||||||
|
Radiogroup Atom = 0x30a
|
||||||
|
Rb Atom = 0x3a02
|
||||||
|
Readonly Atom = 0x35708
|
||||||
|
Referrerpolicy Atom = 0x3d10e
|
||||||
|
Rel Atom = 0x48703
|
||||||
|
Required Atom = 0x24c08
|
||||||
|
Reversed Atom = 0x8008
|
||||||
|
Rows Atom = 0x9c04
|
||||||
|
Rowspan Atom = 0x9c07
|
||||||
|
Rp Atom = 0x23c02
|
||||||
|
Rt Atom = 0x19a02
|
||||||
|
Rtc Atom = 0x19a03
|
||||||
|
Ruby Atom = 0xfb04
|
||||||
|
S Atom = 0x2501
|
||||||
|
Samp Atom = 0x7804
|
||||||
|
Sandbox Atom = 0x12907
|
||||||
|
Scope Atom = 0x67505
|
||||||
|
Scoped Atom = 0x67506
|
||||||
|
Script Atom = 0x21806
|
||||||
|
Seamless Atom = 0x37108
|
||||||
|
Section Atom = 0x56807
|
||||||
|
Select Atom = 0x63c06
|
||||||
|
Selected Atom = 0x63c08
|
||||||
|
Shape Atom = 0x1e505
|
||||||
|
Size Atom = 0x5f504
|
||||||
|
Sizes Atom = 0x5f505
|
||||||
|
Slot Atom = 0x1ef04
|
||||||
|
Small Atom = 0x20605
|
||||||
|
Sortable Atom = 0x65108
|
||||||
|
Sorted Atom = 0x33706
|
||||||
|
Source Atom = 0x37806
|
||||||
|
Spacer Atom = 0x43706
|
||||||
|
Span Atom = 0x9f04
|
||||||
|
Spellcheck Atom = 0x4740a
|
||||||
|
Src Atom = 0x5c003
|
||||||
|
Srcdoc Atom = 0x5c006
|
||||||
|
Srclang Atom = 0x5f907
|
||||||
|
Srcset Atom = 0x6f906
|
||||||
|
Start Atom = 0x3fa05
|
||||||
|
Step Atom = 0x58304
|
||||||
|
Strike Atom = 0xd206
|
||||||
|
Strong Atom = 0x6dd06
|
||||||
|
Style Atom = 0x6ff05
|
||||||
|
Sub Atom = 0x66d03
|
||||||
|
Summary Atom = 0x70407
|
||||||
|
Sup Atom = 0x70b03
|
||||||
|
Svg Atom = 0x70e03
|
||||||
|
System Atom = 0x71106
|
||||||
|
Tabindex Atom = 0x4be08
|
||||||
|
Table Atom = 0x59505
|
||||||
|
Target Atom = 0x2c406
|
||||||
|
Tbody Atom = 0x2705
|
||||||
|
Td Atom = 0x9202
|
||||||
|
Template Atom = 0x71408
|
||||||
|
Textarea Atom = 0x35208
|
||||||
|
Tfoot Atom = 0xf505
|
||||||
|
Th Atom = 0x15602
|
||||||
|
Thead Atom = 0x33005
|
||||||
|
Time Atom = 0x4204
|
||||||
|
Title Atom = 0x11005
|
||||||
|
Tr Atom = 0xcc02
|
||||||
|
Track Atom = 0x1ba05
|
||||||
|
Translate Atom = 0x1f209
|
||||||
|
Tt Atom = 0x6802
|
||||||
|
Type Atom = 0xd904
|
||||||
|
Typemustmatch Atom = 0x2900d
|
||||||
|
U Atom = 0xb01
|
||||||
|
Ul Atom = 0xa702
|
||||||
|
Updateviacache Atom = 0x460e
|
||||||
|
Usemap Atom = 0x59e06
|
||||||
|
Value Atom = 0x1505
|
||||||
|
Var Atom = 0x16d03
|
||||||
|
Video Atom = 0x2f105
|
||||||
|
Wbr Atom = 0x57c03
|
||||||
|
Width Atom = 0x64905
|
||||||
|
Workertype Atom = 0x71c0a
|
||||||
|
Wrap Atom = 0x72604
|
||||||
|
Xmp Atom = 0x12f03
|
||||||
|
)
|
||||||
|
|
||||||
|
const hash0 = 0x81cdf10e
|
||||||
|
|
||||||
|
const maxAtomLen = 25
|
||||||
|
|
||||||
|
var table = [1 << 9]Atom{
|
||||||
|
0x1: 0xe60a, // mediagroup
|
||||||
|
0x2: 0x2e404, // lang
|
||||||
|
0x4: 0x2c09, // accesskey
|
||||||
|
0x5: 0x8b08, // frameset
|
||||||
|
0x7: 0x63a08, // onselect
|
||||||
|
0x8: 0x71106, // system
|
||||||
|
0xa: 0x64905, // width
|
||||||
|
0xc: 0x2890b, // formenctype
|
||||||
|
0xd: 0x13702, // ol
|
||||||
|
0xe: 0x3970b, // oncuechange
|
||||||
|
0x10: 0x14b03, // bdo
|
||||||
|
0x11: 0x11505, // audio
|
||||||
|
0x12: 0x17a09, // draggable
|
||||||
|
0x14: 0x2f105, // video
|
||||||
|
0x15: 0x2b102, // mn
|
||||||
|
0x16: 0x38704, // menu
|
||||||
|
0x17: 0x2cf06, // poster
|
||||||
|
0x19: 0xf606, // footer
|
||||||
|
0x1a: 0x2a806, // method
|
||||||
|
0x1b: 0x2b808, // datetime
|
||||||
|
0x1c: 0x19507, // onabort
|
||||||
|
0x1d: 0x460e, // updateviacache
|
||||||
|
0x1e: 0xff05, // async
|
||||||
|
0x1f: 0x49d06, // onload
|
||||||
|
0x21: 0x11908, // oncancel
|
||||||
|
0x22: 0x62908, // onseeked
|
||||||
|
0x23: 0x30205, // image
|
||||||
|
0x24: 0x5d812, // onrejectionhandled
|
||||||
|
0x26: 0x17404, // link
|
||||||
|
0x27: 0x51d06, // output
|
||||||
|
0x28: 0x33104, // head
|
||||||
|
0x29: 0x4ff0c, // onmouseleave
|
||||||
|
0x2a: 0x57f07, // onpaste
|
||||||
|
0x2b: 0x5a409, // onplaying
|
||||||
|
0x2c: 0x1c407, // colspan
|
||||||
|
0x2f: 0x1bf05, // color
|
||||||
|
0x30: 0x5f504, // size
|
||||||
|
0x31: 0x2e80a, // http-equiv
|
||||||
|
0x33: 0x601, // i
|
||||||
|
0x34: 0x5590a, // onpagehide
|
||||||
|
0x35: 0x68c14, // onunhandledrejection
|
||||||
|
0x37: 0x42a07, // onerror
|
||||||
|
0x3a: 0x3b08, // basefont
|
||||||
|
0x3f: 0x1303, // nav
|
||||||
|
0x40: 0x17704, // kind
|
||||||
|
0x41: 0x35708, // readonly
|
||||||
|
0x42: 0x30806, // mglyph
|
||||||
|
0x44: 0xb202, // li
|
||||||
|
0x46: 0x2d506, // hidden
|
||||||
|
0x47: 0x70e03, // svg
|
||||||
|
0x48: 0x58304, // step
|
||||||
|
0x49: 0x23f09, // integrity
|
||||||
|
0x4a: 0x58606, // public
|
||||||
|
0x4c: 0x1ab03, // col
|
||||||
|
0x4d: 0x1870a, // blockquote
|
||||||
|
0x4e: 0x34f02, // h5
|
||||||
|
0x50: 0x5b908, // progress
|
||||||
|
0x51: 0x5f505, // sizes
|
||||||
|
0x52: 0x34502, // h4
|
||||||
|
0x56: 0x33005, // thead
|
||||||
|
0x57: 0xd607, // keytype
|
||||||
|
0x58: 0x5b70a, // onprogress
|
||||||
|
0x59: 0x44b09, // inputmode
|
||||||
|
0x5a: 0x3b109, // ondragend
|
||||||
|
0x5d: 0x3a205, // oncut
|
||||||
|
0x5e: 0x43706, // spacer
|
||||||
|
0x5f: 0x1ab08, // colgroup
|
||||||
|
0x62: 0x16502, // is
|
||||||
|
0x65: 0x3c02, // as
|
||||||
|
0x66: 0x54809, // onoffline
|
||||||
|
0x67: 0x33706, // sorted
|
||||||
|
0x69: 0x48d10, // onlanguagechange
|
||||||
|
0x6c: 0x43d0c, // onhashchange
|
||||||
|
0x6d: 0x9604, // name
|
||||||
|
0x6e: 0xf505, // tfoot
|
||||||
|
0x6f: 0x56104, // desc
|
||||||
|
0x70: 0x33d03, // max
|
||||||
|
0x72: 0x1ea06, // coords
|
||||||
|
0x73: 0x30d02, // h3
|
||||||
|
0x74: 0x6e70e, // onbeforeunload
|
||||||
|
0x75: 0x9c04, // rows
|
||||||
|
0x76: 0x63c06, // select
|
||||||
|
0x77: 0x9805, // meter
|
||||||
|
0x78: 0x38b06, // itemid
|
||||||
|
0x79: 0x53c0c, // onmousewheel
|
||||||
|
0x7a: 0x5c006, // srcdoc
|
||||||
|
0x7d: 0x1ba05, // track
|
||||||
|
0x7f: 0x31f08, // itemtype
|
||||||
|
0x82: 0xa402, // mo
|
||||||
|
0x83: 0x41b08, // onchange
|
||||||
|
0x84: 0x33107, // headers
|
||||||
|
0x85: 0x5cc0c, // onratechange
|
||||||
|
0x86: 0x60819, // onsecuritypolicyviolation
|
||||||
|
0x88: 0x4a508, // datalist
|
||||||
|
0x89: 0x4e80b, // onmousedown
|
||||||
|
0x8a: 0x1ef04, // slot
|
||||||
|
0x8b: 0x4b010, // onloadedmetadata
|
||||||
|
0x8c: 0x1a06, // accept
|
||||||
|
0x8d: 0x26806, // object
|
||||||
|
0x91: 0x6b30e, // onvolumechange
|
||||||
|
0x92: 0x2107, // charset
|
||||||
|
0x93: 0x27613, // onautocompleteerror
|
||||||
|
0x94: 0xc113, // allowpaymentrequest
|
||||||
|
0x95: 0x2804, // body
|
||||||
|
0x96: 0x10a07, // default
|
||||||
|
0x97: 0x63c08, // selected
|
||||||
|
0x98: 0x21e04, // face
|
||||||
|
0x99: 0x1e505, // shape
|
||||||
|
0x9b: 0x68408, // ontoggle
|
||||||
|
0x9e: 0x64b02, // dt
|
||||||
|
0x9f: 0xb604, // mark
|
||||||
|
0xa1: 0xb01, // u
|
||||||
|
0xa4: 0x6ab08, // onunload
|
||||||
|
0xa5: 0x5d04, // loop
|
||||||
|
0xa6: 0x16408, // disabled
|
||||||
|
0xaa: 0x42307, // onended
|
||||||
|
0xab: 0xb00a, // malignmark
|
||||||
|
0xad: 0x67b09, // onsuspend
|
||||||
|
0xae: 0x35105, // mtext
|
||||||
|
0xaf: 0x64f06, // onsort
|
||||||
|
0xb0: 0x19d08, // itemprop
|
||||||
|
0xb3: 0x67109, // itemscope
|
||||||
|
0xb4: 0x17305, // blink
|
||||||
|
0xb6: 0x3b106, // ondrag
|
||||||
|
0xb7: 0xa702, // ul
|
||||||
|
0xb8: 0x26e04, // form
|
||||||
|
0xb9: 0x12907, // sandbox
|
||||||
|
0xba: 0x8b05, // frame
|
||||||
|
0xbb: 0x1505, // value
|
||||||
|
0xbc: 0x66209, // onstorage
|
||||||
|
0xbf: 0xaa07, // acronym
|
||||||
|
0xc0: 0x19a02, // rt
|
||||||
|
0xc2: 0x202, // br
|
||||||
|
0xc3: 0x22608, // fieldset
|
||||||
|
0xc4: 0x2900d, // typemustmatch
|
||||||
|
0xc5: 0xa208, // nomodule
|
||||||
|
0xc6: 0x6c07, // noembed
|
||||||
|
0xc7: 0x69e0d, // onbeforeprint
|
||||||
|
0xc8: 0x19106, // button
|
||||||
|
0xc9: 0x2f507, // onclick
|
||||||
|
0xca: 0x70407, // summary
|
||||||
|
0xcd: 0xfb04, // ruby
|
||||||
|
0xce: 0x56405, // class
|
||||||
|
0xcf: 0x3f40b, // ondragstart
|
||||||
|
0xd0: 0x23107, // caption
|
||||||
|
0xd4: 0xdd0e, // allowusermedia
|
||||||
|
0xd5: 0x4cf0b, // onloadstart
|
||||||
|
0xd9: 0x16b03, // div
|
||||||
|
0xda: 0x4a904, // list
|
||||||
|
0xdb: 0x32e04, // math
|
||||||
|
0xdc: 0x44b05, // input
|
||||||
|
0xdf: 0x3ea0a, // ondragover
|
||||||
|
0xe0: 0x2de02, // h2
|
||||||
|
0xe2: 0x1b209, // plaintext
|
||||||
|
0xe4: 0x4f30c, // onmouseenter
|
||||||
|
0xe7: 0x47907, // checked
|
||||||
|
0xe8: 0x47003, // pre
|
||||||
|
0xea: 0x35f08, // multiple
|
||||||
|
0xeb: 0xba03, // bdi
|
||||||
|
0xec: 0x33d09, // maxlength
|
||||||
|
0xed: 0xcf01, // q
|
||||||
|
0xee: 0x61f0a, // onauxclick
|
||||||
|
0xf0: 0x57c03, // wbr
|
||||||
|
0xf2: 0x3b04, // base
|
||||||
|
0xf3: 0x6e306, // option
|
||||||
|
0xf5: 0x41310, // ondurationchange
|
||||||
|
0xf7: 0x8908, // noframes
|
||||||
|
0xf9: 0x40508, // dropzone
|
||||||
|
0xfb: 0x67505, // scope
|
||||||
|
0xfc: 0x8008, // reversed
|
||||||
|
0xfd: 0x3ba0b, // ondragenter
|
||||||
|
0xfe: 0x3fa05, // start
|
||||||
|
0xff: 0x12f03, // xmp
|
||||||
|
0x100: 0x5f907, // srclang
|
||||||
|
0x101: 0x30703, // img
|
||||||
|
0x104: 0x101, // b
|
||||||
|
0x105: 0x25403, // for
|
||||||
|
0x106: 0x10705, // aside
|
||||||
|
0x107: 0x44907, // oninput
|
||||||
|
0x108: 0x35604, // area
|
||||||
|
0x109: 0x2a40a, // formmethod
|
||||||
|
0x10a: 0x72604, // wrap
|
||||||
|
0x10c: 0x23c02, // rp
|
||||||
|
0x10d: 0x46b0a, // onkeypress
|
||||||
|
0x10e: 0x6802, // tt
|
||||||
|
0x110: 0x34702, // mi
|
||||||
|
0x111: 0x36705, // muted
|
||||||
|
0x112: 0xf303, // alt
|
||||||
|
0x113: 0x5c504, // code
|
||||||
|
0x114: 0x6e02, // em
|
||||||
|
0x115: 0x3c50a, // ondragexit
|
||||||
|
0x117: 0x9f04, // span
|
||||||
|
0x119: 0x6d708, // manifest
|
||||||
|
0x11a: 0x38708, // menuitem
|
||||||
|
0x11b: 0x58b07, // content
|
||||||
|
0x11d: 0x6c109, // onwaiting
|
||||||
|
0x11f: 0x4c609, // onloadend
|
||||||
|
0x121: 0x37e0d, // oncontextmenu
|
||||||
|
0x123: 0x56d06, // onblur
|
||||||
|
0x124: 0x3fc07, // article
|
||||||
|
0x125: 0x9303, // dir
|
||||||
|
0x126: 0xef04, // ping
|
||||||
|
0x127: 0x24c08, // required
|
||||||
|
0x128: 0x45509, // oninvalid
|
||||||
|
0x129: 0xb105, // align
|
||||||
|
0x12b: 0x58a04, // icon
|
||||||
|
0x12c: 0x64d02, // h6
|
||||||
|
0x12d: 0x1c404, // cols
|
||||||
|
0x12e: 0x22e0a, // figcaption
|
||||||
|
0x12f: 0x45e09, // onkeydown
|
||||||
|
0x130: 0x66b08, // onsubmit
|
||||||
|
0x131: 0x14d09, // oncanplay
|
||||||
|
0x132: 0x70b03, // sup
|
||||||
|
0x133: 0xc01, // p
|
||||||
|
0x135: 0x40a09, // onemptied
|
||||||
|
0x136: 0x39106, // oncopy
|
||||||
|
0x137: 0x19c04, // cite
|
||||||
|
0x138: 0x3a70a, // ondblclick
|
||||||
|
0x13a: 0x50b0b, // onmousemove
|
||||||
|
0x13c: 0x66d03, // sub
|
||||||
|
0x13d: 0x48703, // rel
|
||||||
|
0x13e: 0x5f08, // optgroup
|
||||||
|
0x142: 0x9c07, // rowspan
|
||||||
|
0x143: 0x37806, // source
|
||||||
|
0x144: 0x21608, // noscript
|
||||||
|
0x145: 0x1a304, // open
|
||||||
|
0x146: 0x20403, // ins
|
||||||
|
0x147: 0x2540d, // foreignObject
|
||||||
|
0x148: 0x5ad0a, // onpopstate
|
||||||
|
0x14a: 0x28d07, // enctype
|
||||||
|
0x14b: 0x2760e, // onautocomplete
|
||||||
|
0x14c: 0x35208, // textarea
|
||||||
|
0x14e: 0x2780c, // autocomplete
|
||||||
|
0x14f: 0x15702, // hr
|
||||||
|
0x150: 0x1de08, // controls
|
||||||
|
0x151: 0x10902, // id
|
||||||
|
0x153: 0x2360c, // onafterprint
|
||||||
|
0x155: 0x2610d, // foreignobject
|
||||||
|
0x156: 0x32707, // marquee
|
||||||
|
0x157: 0x59a07, // onpause
|
||||||
|
0x158: 0x5e602, // dl
|
||||||
|
0x159: 0x5206, // height
|
||||||
|
0x15a: 0x34703, // min
|
||||||
|
0x15b: 0x9307, // dirname
|
||||||
|
0x15c: 0x1f209, // translate
|
||||||
|
0x15d: 0x5604, // html
|
||||||
|
0x15e: 0x34709, // minlength
|
||||||
|
0x15f: 0x48607, // preload
|
||||||
|
0x160: 0x71408, // template
|
||||||
|
0x161: 0x3df0b, // ondragleave
|
||||||
|
0x162: 0x3a02, // rb
|
||||||
|
0x164: 0x5c003, // src
|
||||||
|
0x165: 0x6dd06, // strong
|
||||||
|
0x167: 0x7804, // samp
|
||||||
|
0x168: 0x6f307, // address
|
||||||
|
0x169: 0x55108, // ononline
|
||||||
|
0x16b: 0x1310b, // placeholder
|
||||||
|
0x16c: 0x2c406, // target
|
||||||
|
0x16d: 0x20605, // small
|
||||||
|
0x16e: 0x6ca07, // onwheel
|
||||||
|
0x16f: 0x1c90a, // annotation
|
||||||
|
0x170: 0x4740a, // spellcheck
|
||||||
|
0x171: 0x7207, // details
|
||||||
|
0x172: 0x10306, // canvas
|
||||||
|
0x173: 0x12109, // autofocus
|
||||||
|
0x174: 0xc05, // param
|
||||||
|
0x176: 0x46308, // download
|
||||||
|
0x177: 0x45203, // del
|
||||||
|
0x178: 0x36c07, // onclose
|
||||||
|
0x179: 0xb903, // kbd
|
||||||
|
0x17a: 0x31906, // applet
|
||||||
|
0x17b: 0x2e004, // href
|
||||||
|
0x17c: 0x5f108, // onresize
|
||||||
|
0x17e: 0x49d0c, // onloadeddata
|
||||||
|
0x180: 0xcc02, // tr
|
||||||
|
0x181: 0x2c00a, // formtarget
|
||||||
|
0x182: 0x11005, // title
|
||||||
|
0x183: 0x6ff05, // style
|
||||||
|
0x184: 0xd206, // strike
|
||||||
|
0x185: 0x59e06, // usemap
|
||||||
|
0x186: 0x2fc06, // iframe
|
||||||
|
0x187: 0x1004, // main
|
||||||
|
0x189: 0x7b07, // picture
|
||||||
|
0x18c: 0x31605, // ismap
|
||||||
|
0x18e: 0x4a504, // data
|
||||||
|
0x18f: 0x5905, // label
|
||||||
|
0x191: 0x3d10e, // referrerpolicy
|
||||||
|
0x192: 0x15602, // th
|
||||||
|
0x194: 0x53606, // prompt
|
||||||
|
0x195: 0x56807, // section
|
||||||
|
0x197: 0x6d107, // optimum
|
||||||
|
0x198: 0x2db04, // high
|
||||||
|
0x199: 0x15c02, // h1
|
||||||
|
0x19a: 0x65909, // onstalled
|
||||||
|
0x19b: 0x16d03, // var
|
||||||
|
0x19c: 0x4204, // time
|
||||||
|
0x19e: 0x67402, // ms
|
||||||
|
0x19f: 0x33106, // header
|
||||||
|
0x1a0: 0x4da09, // onmessage
|
||||||
|
0x1a1: 0x1a605, // nonce
|
||||||
|
0x1a2: 0x26e0a, // formaction
|
||||||
|
0x1a3: 0x22006, // center
|
||||||
|
0x1a4: 0x3704, // nobr
|
||||||
|
0x1a5: 0x59505, // table
|
||||||
|
0x1a6: 0x4a907, // listing
|
||||||
|
0x1a7: 0x18106, // legend
|
||||||
|
0x1a9: 0x29b09, // challenge
|
||||||
|
0x1aa: 0x24806, // figure
|
||||||
|
0x1ab: 0xe605, // media
|
||||||
|
0x1ae: 0xd904, // type
|
||||||
|
0x1af: 0x3f04, // font
|
||||||
|
0x1b0: 0x4da0e, // onmessageerror
|
||||||
|
0x1b1: 0x37108, // seamless
|
||||||
|
0x1b2: 0x8703, // dfn
|
||||||
|
0x1b3: 0x5c705, // defer
|
||||||
|
0x1b4: 0xc303, // low
|
||||||
|
0x1b5: 0x19a03, // rtc
|
||||||
|
0x1b6: 0x5230b, // onmouseover
|
||||||
|
0x1b7: 0x2b20a, // novalidate
|
||||||
|
0x1b8: 0x71c0a, // workertype
|
||||||
|
0x1ba: 0x3cd07, // itemref
|
||||||
|
0x1bd: 0x1, // a
|
||||||
|
0x1be: 0x31803, // map
|
||||||
|
0x1bf: 0x400c, // ontimeupdate
|
||||||
|
0x1c0: 0x15e07, // bgsound
|
||||||
|
0x1c1: 0x3206, // keygen
|
||||||
|
0x1c2: 0x2705, // tbody
|
||||||
|
0x1c5: 0x64406, // onshow
|
||||||
|
0x1c7: 0x2501, // s
|
||||||
|
0x1c8: 0x6607, // pattern
|
||||||
|
0x1cc: 0x14d10, // oncanplaythrough
|
||||||
|
0x1ce: 0x2d702, // dd
|
||||||
|
0x1cf: 0x6f906, // srcset
|
||||||
|
0x1d0: 0x17003, // big
|
||||||
|
0x1d2: 0x65108, // sortable
|
||||||
|
0x1d3: 0x48007, // onkeyup
|
||||||
|
0x1d5: 0x5a406, // onplay
|
||||||
|
0x1d7: 0x4b804, // meta
|
||||||
|
0x1d8: 0x40306, // ondrop
|
||||||
|
0x1da: 0x60008, // onscroll
|
||||||
|
0x1db: 0x1fb0b, // crossorigin
|
||||||
|
0x1dc: 0x5730a, // onpageshow
|
||||||
|
0x1dd: 0x4, // abbr
|
||||||
|
0x1de: 0x9202, // td
|
||||||
|
0x1df: 0x58b0f, // contenteditable
|
||||||
|
0x1e0: 0x27206, // action
|
||||||
|
0x1e1: 0x1400b, // playsinline
|
||||||
|
0x1e2: 0x43107, // onfocus
|
||||||
|
0x1e3: 0x2e008, // hreflang
|
||||||
|
0x1e5: 0x5160a, // onmouseout
|
||||||
|
0x1e6: 0x5ea07, // onreset
|
||||||
|
0x1e7: 0x13c08, // autoplay
|
||||||
|
0x1e8: 0x63109, // onseeking
|
||||||
|
0x1ea: 0x67506, // scoped
|
||||||
|
0x1ec: 0x30a, // radiogroup
|
||||||
|
0x1ee: 0x3800b, // contextmenu
|
||||||
|
0x1ef: 0x52e09, // onmouseup
|
||||||
|
0x1f1: 0x2ca06, // hgroup
|
||||||
|
0x1f2: 0x2080f, // allowfullscreen
|
||||||
|
0x1f3: 0x4be08, // tabindex
|
||||||
|
0x1f6: 0x30f07, // isindex
|
||||||
|
0x1f7: 0x1a0e, // accept-charset
|
||||||
|
0x1f8: 0x2ae0e, // formnovalidate
|
||||||
|
0x1fb: 0x1c90e, // annotation-xml
|
||||||
|
0x1fc: 0x6e05, // embed
|
||||||
|
0x1fd: 0x21806, // script
|
||||||
|
0x1fe: 0xbb06, // dialog
|
||||||
|
0x1ff: 0x1d707, // command
|
||||||
|
}
|
||||||
|
|
||||||
|
const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobrb" +
|
||||||
|
"asefontimeupdateviacacheightmlabelooptgroupatternoembedetail" +
|
||||||
|
"sampictureversedfnoframesetdirnameterowspanomoduleacronymali" +
|
||||||
|
"gnmarkbdialogallowpaymentrequestrikeytypeallowusermediagroup" +
|
||||||
|
"ingaltfooterubyasyncanvasidefaultitleaudioncancelautofocusan" +
|
||||||
|
"dboxmplaceholderautoplaysinlinebdoncanplaythrough1bgsoundisa" +
|
||||||
|
"bledivarbigblinkindraggablegendblockquotebuttonabortcitempro" +
|
||||||
|
"penoncecolgrouplaintextrackcolorcolspannotation-xmlcommandco" +
|
||||||
|
"ntrolshapecoordslotranslatecrossoriginsmallowfullscreenoscri" +
|
||||||
|
"ptfacenterfieldsetfigcaptionafterprintegrityfigurequiredfore" +
|
||||||
|
"ignObjectforeignobjectformactionautocompleteerrorformenctype" +
|
||||||
|
"mustmatchallengeformmethodformnovalidatetimeformtargethgroup" +
|
||||||
|
"osterhiddenhigh2hreflanghttp-equivideonclickiframeimageimgly" +
|
||||||
|
"ph3isindexismappletitemtypemarqueematheadersortedmaxlength4m" +
|
||||||
|
"inlength5mtextareadonlymultiplemutedoncloseamlessourceoncont" +
|
||||||
|
"extmenuitemidoncopyoncuechangeoncutondblclickondragendondrag" +
|
||||||
|
"enterondragexitemreferrerpolicyondragleaveondragoverondragst" +
|
||||||
|
"articleondropzonemptiedondurationchangeonendedonerroronfocus" +
|
||||||
|
"paceronhashchangeoninputmodeloninvalidonkeydownloadonkeypres" +
|
||||||
|
"spellcheckedonkeyupreloadonlanguagechangeonloadeddatalisting" +
|
||||||
|
"onloadedmetadatabindexonloadendonloadstartonmessageerroronmo" +
|
||||||
|
"usedownonmouseenteronmouseleaveonmousemoveonmouseoutputonmou" +
|
||||||
|
"seoveronmouseupromptonmousewheelonofflineononlineonpagehides" +
|
||||||
|
"classectionbluronpageshowbronpastepublicontenteditableonpaus" +
|
||||||
|
"emaponplayingonpopstateonprogressrcdocodeferonratechangeonre" +
|
||||||
|
"jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" +
|
||||||
|
"violationauxclickonseekedonseekingonselectedonshowidth6onsor" +
|
||||||
|
"tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" +
|
||||||
|
"handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" +
|
||||||
|
"wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" +
|
||||||
|
"arysupsvgsystemplateworkertypewrap"
|
111
vendor/golang.org/x/net/html/const.go
generated
vendored
Normal file
111
vendor/golang.org/x/net/html/const.go
generated
vendored
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package html
|
||||||
|
|
||||||
|
// Section 12.2.4.2 of the HTML5 specification says "The following elements
|
||||||
|
// have varying levels of special parsing rules".
|
||||||
|
// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements
|
||||||
|
var isSpecialElementMap = map[string]bool{
|
||||||
|
"address": true,
|
||||||
|
"applet": true,
|
||||||
|
"area": true,
|
||||||
|
"article": true,
|
||||||
|
"aside": true,
|
||||||
|
"base": true,
|
||||||
|
"basefont": true,
|
||||||
|
"bgsound": true,
|
||||||
|
"blockquote": true,
|
||||||
|
"body": true,
|
||||||
|
"br": true,
|
||||||
|
"button": true,
|
||||||
|
"caption": true,
|
||||||
|
"center": true,
|
||||||
|
"col": true,
|
||||||
|
"colgroup": true,
|
||||||
|
"dd": true,
|
||||||
|
"details": true,
|
||||||
|
"dir": true,
|
||||||
|
"div": true,
|
||||||
|
"dl": true,
|
||||||
|
"dt": true,
|
||||||
|
"embed": true,
|
||||||
|
"fieldset": true,
|
||||||
|
"figcaption": true,
|
||||||
|
"figure": true,
|
||||||
|
"footer": true,
|
||||||
|
"form": true,
|
||||||
|
"frame": true,
|
||||||
|
"frameset": true,
|
||||||
|
"h1": true,
|
||||||
|
"h2": true,
|
||||||
|
"h3": true,
|
||||||
|
"h4": true,
|
||||||
|
"h5": true,
|
||||||
|
"h6": true,
|
||||||
|
"head": true,
|
||||||
|
"header": true,
|
||||||
|
"hgroup": true,
|
||||||
|
"hr": true,
|
||||||
|
"html": true,
|
||||||
|
"iframe": true,
|
||||||
|
"img": true,
|
||||||
|
"input": true,
|
||||||
|
"keygen": true, // "keygen" has been removed from the spec, but are kept here for backwards compatibility.
|
||||||
|
"li": true,
|
||||||
|
"link": true,
|
||||||
|
"listing": true,
|
||||||
|
"main": true,
|
||||||
|
"marquee": true,
|
||||||
|
"menu": true,
|
||||||
|
"meta": true,
|
||||||
|
"nav": true,
|
||||||
|
"noembed": true,
|
||||||
|
"noframes": true,
|
||||||
|
"noscript": true,
|
||||||
|
"object": true,
|
||||||
|
"ol": true,
|
||||||
|
"p": true,
|
||||||
|
"param": true,
|
||||||
|
"plaintext": true,
|
||||||
|
"pre": true,
|
||||||
|
"script": true,
|
||||||
|
"section": true,
|
||||||
|
"select": true,
|
||||||
|
"source": true,
|
||||||
|
"style": true,
|
||||||
|
"summary": true,
|
||||||
|
"table": true,
|
||||||
|
"tbody": true,
|
||||||
|
"td": true,
|
||||||
|
"template": true,
|
||||||
|
"textarea": true,
|
||||||
|
"tfoot": true,
|
||||||
|
"th": true,
|
||||||
|
"thead": true,
|
||||||
|
"title": true,
|
||||||
|
"tr": true,
|
||||||
|
"track": true,
|
||||||
|
"ul": true,
|
||||||
|
"wbr": true,
|
||||||
|
"xmp": true,
|
||||||
|
}
|
||||||
|
|
||||||
|
func isSpecialElement(element *Node) bool {
|
||||||
|
switch element.Namespace {
|
||||||
|
case "", "html":
|
||||||
|
return isSpecialElementMap[element.Data]
|
||||||
|
case "math":
|
||||||
|
switch element.Data {
|
||||||
|
case "mi", "mo", "mn", "ms", "mtext", "annotation-xml":
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
case "svg":
|
||||||
|
switch element.Data {
|
||||||
|
case "foreignObject", "desc", "title":
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
127
vendor/golang.org/x/net/html/doc.go
generated
vendored
Normal file
127
vendor/golang.org/x/net/html/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
// Copyright 2010 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package html implements an HTML5-compliant tokenizer and parser.
|
||||||
|
|
||||||
|
Tokenization is done by creating a Tokenizer for an io.Reader r. It is the
|
||||||
|
caller's responsibility to ensure that r provides UTF-8 encoded HTML.
|
||||||
|
|
||||||
|
z := html.NewTokenizer(r)
|
||||||
|
|
||||||
|
Given a Tokenizer z, the HTML is tokenized by repeatedly calling z.Next(),
|
||||||
|
which parses the next token and returns its type, or an error:
|
||||||
|
|
||||||
|
for {
|
||||||
|
tt := z.Next()
|
||||||
|
if tt == html.ErrorToken {
|
||||||
|
// ...
|
||||||
|
return ...
|
||||||
|
}
|
||||||
|
// Process the current token.
|
||||||
|
}
|
||||||
|
|
||||||
|
There are two APIs for retrieving the current token. The high-level API is to
|
||||||
|
call Token; the low-level API is to call Text or TagName / TagAttr. Both APIs
|
||||||
|
allow optionally calling Raw after Next but before Token, Text, TagName, or
|
||||||
|
TagAttr. In EBNF notation, the valid call sequence per token is:
|
||||||
|
|
||||||
|
Next {Raw} [ Token | Text | TagName {TagAttr} ]
|
||||||
|
|
||||||
|
Token returns an independent data structure that completely describes a token.
|
||||||
|
Entities (such as "<") are unescaped, tag names and attribute keys are
|
||||||
|
lower-cased, and attributes are collected into a []Attribute. For example:
|
||||||
|
|
||||||
|
for {
|
||||||
|
if z.Next() == html.ErrorToken {
|
||||||
|
// Returning io.EOF indicates success.
|
||||||
|
return z.Err()
|
||||||
|
}
|
||||||
|
emitToken(z.Token())
|
||||||
|
}
|
||||||
|
|
||||||
|
The low-level API performs fewer allocations and copies, but the contents of
|
||||||
|
the []byte values returned by Text, TagName and TagAttr may change on the next
|
||||||
|
call to Next. For example, to extract an HTML page's anchor text:
|
||||||
|
|
||||||
|
depth := 0
|
||||||
|
for {
|
||||||
|
tt := z.Next()
|
||||||
|
switch tt {
|
||||||
|
case html.ErrorToken:
|
||||||
|
return z.Err()
|
||||||
|
case html.TextToken:
|
||||||
|
if depth > 0 {
|
||||||
|
// emitBytes should copy the []byte it receives,
|
||||||
|
// if it doesn't process it immediately.
|
||||||
|
emitBytes(z.Text())
|
||||||
|
}
|
||||||
|
case html.StartTagToken, html.EndTagToken:
|
||||||
|
tn, _ := z.TagName()
|
||||||
|
if len(tn) == 1 && tn[0] == 'a' {
|
||||||
|
if tt == html.StartTagToken {
|
||||||
|
depth++
|
||||||
|
} else {
|
||||||
|
depth--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Parsing is done by calling Parse with an io.Reader, which returns the root of
|
||||||
|
the parse tree (the document element) as a *Node. It is the caller's
|
||||||
|
responsibility to ensure that the Reader provides UTF-8 encoded HTML. For
|
||||||
|
example, to process each anchor node in depth-first order:
|
||||||
|
|
||||||
|
doc, err := html.Parse(r)
|
||||||
|
if err != nil {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
var f func(*html.Node)
|
||||||
|
f = func(n *html.Node) {
|
||||||
|
if n.Type == html.ElementNode && n.Data == "a" {
|
||||||
|
// Do something with n...
|
||||||
|
}
|
||||||
|
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||||
|
f(c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
f(doc)
|
||||||
|
|
||||||
|
The relevant specifications include:
|
||||||
|
https://html.spec.whatwg.org/multipage/syntax.html and
|
||||||
|
https://html.spec.whatwg.org/multipage/syntax.html#tokenization
|
||||||
|
|
||||||
|
# Security Considerations
|
||||||
|
|
||||||
|
Care should be taken when parsing and interpreting HTML, whether full documents
|
||||||
|
or fragments, within the framework of the HTML specification, especially with
|
||||||
|
regard to untrusted inputs.
|
||||||
|
|
||||||
|
This package provides both a tokenizer and a parser, which implement the
|
||||||
|
tokenization, and tokenization and tree construction stages of the WHATWG HTML
|
||||||
|
parsing specification respectively. While the tokenizer parses and normalizes
|
||||||
|
individual HTML tokens, only the parser constructs the DOM tree from the
|
||||||
|
tokenized HTML, as described in the tree construction stage of the
|
||||||
|
specification, dynamically modifying or extending the docuemnt's DOM tree.
|
||||||
|
|
||||||
|
If your use case requires semantically well-formed HTML documents, as defined by
|
||||||
|
the WHATWG specification, the parser should be used rather than the tokenizer.
|
||||||
|
|
||||||
|
In security contexts, if trust decisions are being made using the tokenized or
|
||||||
|
parsed content, the input must be re-serialized (for instance by using Render or
|
||||||
|
Token.String) in order for those trust decisions to hold, as the process of
|
||||||
|
tokenization or parsing may alter the content.
|
||||||
|
*/
|
||||||
|
package html // import "golang.org/x/net/html"
|
||||||
|
|
||||||
|
// The tokenization algorithm implemented by this package is not a line-by-line
|
||||||
|
// transliteration of the relatively verbose state-machine in the WHATWG
|
||||||
|
// specification. A more direct approach is used instead, where the program
|
||||||
|
// counter implies the state, such as whether it is tokenizing a tag or a text
|
||||||
|
// node. Specification compliance is verified by checking expected and actual
|
||||||
|
// outputs over a test suite rather than aiming for algorithmic fidelity.
|
||||||
|
|
||||||
|
// TODO(nigeltao): Does a DOM API belong in this package or a separate one?
|
||||||
|
// TODO(nigeltao): How does parsing interact with a JavaScript engine?
|
156
vendor/golang.org/x/net/html/doctype.go
generated
vendored
Normal file
156
vendor/golang.org/x/net/html/doctype.go
generated
vendored
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package html
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// parseDoctype parses the data from a DoctypeToken into a name,
|
||||||
|
// public identifier, and system identifier. It returns a Node whose Type
|
||||||
|
// is DoctypeNode, whose Data is the name, and which has attributes
|
||||||
|
// named "system" and "public" for the two identifiers if they were present.
|
||||||
|
// quirks is whether the document should be parsed in "quirks mode".
|
||||||
|
func parseDoctype(s string) (n *Node, quirks bool) {
|
||||||
|
n = &Node{Type: DoctypeNode}
|
||||||
|
|
||||||
|
// Find the name.
|
||||||
|
space := strings.IndexAny(s, whitespace)
|
||||||
|
if space == -1 {
|
||||||
|
space = len(s)
|
||||||
|
}
|
||||||
|
n.Data = s[:space]
|
||||||
|
// The comparison to "html" is case-sensitive.
|
||||||
|
if n.Data != "html" {
|
||||||
|
quirks = true
|
||||||
|
}
|
||||||
|
n.Data = strings.ToLower(n.Data)
|
||||||
|
s = strings.TrimLeft(s[space:], whitespace)
|
||||||
|
|
||||||
|
if len(s) < 6 {
|
||||||
|
// It can't start with "PUBLIC" or "SYSTEM".
|
||||||
|
// Ignore the rest of the string.
|
||||||
|
return n, quirks || s != ""
|
||||||
|
}
|
||||||
|
|
||||||
|
key := strings.ToLower(s[:6])
|
||||||
|
s = s[6:]
|
||||||
|
for key == "public" || key == "system" {
|
||||||
|
s = strings.TrimLeft(s, whitespace)
|
||||||
|
if s == "" {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
quote := s[0]
|
||||||
|
if quote != '"' && quote != '\'' {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
s = s[1:]
|
||||||
|
q := strings.IndexRune(s, rune(quote))
|
||||||
|
var id string
|
||||||
|
if q == -1 {
|
||||||
|
id = s
|
||||||
|
s = ""
|
||||||
|
} else {
|
||||||
|
id = s[:q]
|
||||||
|
s = s[q+1:]
|
||||||
|
}
|
||||||
|
n.Attr = append(n.Attr, Attribute{Key: key, Val: id})
|
||||||
|
if key == "public" {
|
||||||
|
key = "system"
|
||||||
|
} else {
|
||||||
|
key = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if key != "" || s != "" {
|
||||||
|
quirks = true
|
||||||
|
} else if len(n.Attr) > 0 {
|
||||||
|
if n.Attr[0].Key == "public" {
|
||||||
|
public := strings.ToLower(n.Attr[0].Val)
|
||||||
|
switch public {
|
||||||
|
case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html":
|
||||||
|
quirks = true
|
||||||
|
default:
|
||||||
|
for _, q := range quirkyIDs {
|
||||||
|
if strings.HasPrefix(public, q) {
|
||||||
|
quirks = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// The following two public IDs only cause quirks mode if there is no system ID.
|
||||||
|
if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") ||
|
||||||
|
strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) {
|
||||||
|
quirks = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" &&
|
||||||
|
strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" {
|
||||||
|
quirks = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return n, quirks
|
||||||
|
}
|
||||||
|
|
||||||
|
// quirkyIDs is a list of public doctype identifiers that cause a document
|
||||||
|
// to be interpreted in quirks mode. The identifiers should be in lower case.
|
||||||
|
var quirkyIDs = []string{
|
||||||
|
"+//silmaril//dtd html pro v0r11 19970101//",
|
||||||
|
"-//advasoft ltd//dtd html 3.0 aswedit + extensions//",
|
||||||
|
"-//as//dtd html 3.0 aswedit + extensions//",
|
||||||
|
"-//ietf//dtd html 2.0 level 1//",
|
||||||
|
"-//ietf//dtd html 2.0 level 2//",
|
||||||
|
"-//ietf//dtd html 2.0 strict level 1//",
|
||||||
|
"-//ietf//dtd html 2.0 strict level 2//",
|
||||||
|
"-//ietf//dtd html 2.0 strict//",
|
||||||
|
"-//ietf//dtd html 2.0//",
|
||||||
|
"-//ietf//dtd html 2.1e//",
|
||||||
|
"-//ietf//dtd html 3.0//",
|
||||||
|
"-//ietf//dtd html 3.2 final//",
|
||||||
|
"-//ietf//dtd html 3.2//",
|
||||||
|
"-//ietf//dtd html 3//",
|
||||||
|
"-//ietf//dtd html level 0//",
|
||||||
|
"-//ietf//dtd html level 1//",
|
||||||
|
"-//ietf//dtd html level 2//",
|
||||||
|
"-//ietf//dtd html level 3//",
|
||||||
|
"-//ietf//dtd html strict level 0//",
|
||||||
|
"-//ietf//dtd html strict level 1//",
|
||||||
|
"-//ietf//dtd html strict level 2//",
|
||||||
|
"-//ietf//dtd html strict level 3//",
|
||||||
|
"-//ietf//dtd html strict//",
|
||||||
|
"-//ietf//dtd html//",
|
||||||
|
"-//metrius//dtd metrius presentational//",
|
||||||
|
"-//microsoft//dtd internet explorer 2.0 html strict//",
|
||||||
|
"-//microsoft//dtd internet explorer 2.0 html//",
|
||||||
|
"-//microsoft//dtd internet explorer 2.0 tables//",
|
||||||
|
"-//microsoft//dtd internet explorer 3.0 html strict//",
|
||||||
|
"-//microsoft//dtd internet explorer 3.0 html//",
|
||||||
|
"-//microsoft//dtd internet explorer 3.0 tables//",
|
||||||
|
"-//netscape comm. corp.//dtd html//",
|
||||||
|
"-//netscape comm. corp.//dtd strict html//",
|
||||||
|
"-//o'reilly and associates//dtd html 2.0//",
|
||||||
|
"-//o'reilly and associates//dtd html extended 1.0//",
|
||||||
|
"-//o'reilly and associates//dtd html extended relaxed 1.0//",
|
||||||
|
"-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//",
|
||||||
|
"-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//",
|
||||||
|
"-//spyglass//dtd html 2.0 extended//",
|
||||||
|
"-//sq//dtd html 2.0 hotmetal + extensions//",
|
||||||
|
"-//sun microsystems corp.//dtd hotjava html//",
|
||||||
|
"-//sun microsystems corp.//dtd hotjava strict html//",
|
||||||
|
"-//w3c//dtd html 3 1995-03-24//",
|
||||||
|
"-//w3c//dtd html 3.2 draft//",
|
||||||
|
"-//w3c//dtd html 3.2 final//",
|
||||||
|
"-//w3c//dtd html 3.2//",
|
||||||
|
"-//w3c//dtd html 3.2s draft//",
|
||||||
|
"-//w3c//dtd html 4.0 frameset//",
|
||||||
|
"-//w3c//dtd html 4.0 transitional//",
|
||||||
|
"-//w3c//dtd html experimental 19960712//",
|
||||||
|
"-//w3c//dtd html experimental 970421//",
|
||||||
|
"-//w3c//dtd w3 html//",
|
||||||
|
"-//w3o//dtd w3 html 3.0//",
|
||||||
|
"-//webtechs//dtd mozilla html 2.0//",
|
||||||
|
"-//webtechs//dtd mozilla html//",
|
||||||
|
}
|
2253
vendor/golang.org/x/net/html/entity.go
generated
vendored
Normal file
2253
vendor/golang.org/x/net/html/entity.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
339
vendor/golang.org/x/net/html/escape.go
generated
vendored
Normal file
339
vendor/golang.org/x/net/html/escape.go
generated
vendored
Normal file
|
@ -0,0 +1,339 @@
|
||||||
|
// Copyright 2010 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package html
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"strings"
|
||||||
|
"unicode/utf8"
|
||||||
|
)
|
||||||
|
|
||||||
|
// These replacements permit compatibility with old numeric entities that
|
||||||
|
// assumed Windows-1252 encoding.
|
||||||
|
// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference
|
||||||
|
var replacementTable = [...]rune{
|
||||||
|
'\u20AC', // First entry is what 0x80 should be replaced with.
|
||||||
|
'\u0081',
|
||||||
|
'\u201A',
|
||||||
|
'\u0192',
|
||||||
|
'\u201E',
|
||||||
|
'\u2026',
|
||||||
|
'\u2020',
|
||||||
|
'\u2021',
|
||||||
|
'\u02C6',
|
||||||
|
'\u2030',
|
||||||
|
'\u0160',
|
||||||
|
'\u2039',
|
||||||
|
'\u0152',
|
||||||
|
'\u008D',
|
||||||
|
'\u017D',
|
||||||
|
'\u008F',
|
||||||
|
'\u0090',
|
||||||
|
'\u2018',
|
||||||
|
'\u2019',
|
||||||
|
'\u201C',
|
||||||
|
'\u201D',
|
||||||
|
'\u2022',
|
||||||
|
'\u2013',
|
||||||
|
'\u2014',
|
||||||
|
'\u02DC',
|
||||||
|
'\u2122',
|
||||||
|
'\u0161',
|
||||||
|
'\u203A',
|
||||||
|
'\u0153',
|
||||||
|
'\u009D',
|
||||||
|
'\u017E',
|
||||||
|
'\u0178', // Last entry is 0x9F.
|
||||||
|
// 0x00->'\uFFFD' is handled programmatically.
|
||||||
|
// 0x0D->'\u000D' is a no-op.
|
||||||
|
}
|
||||||
|
|
||||||
|
// unescapeEntity reads an entity like "<" from b[src:] and writes the
|
||||||
|
// corresponding "<" to b[dst:], returning the incremented dst and src cursors.
|
||||||
|
// Precondition: b[src] == '&' && dst <= src.
|
||||||
|
// attribute should be true if parsing an attribute value.
|
||||||
|
func unescapeEntity(b []byte, dst, src int, attribute bool) (dst1, src1 int) {
|
||||||
|
// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference
|
||||||
|
|
||||||
|
// i starts at 1 because we already know that s[0] == '&'.
|
||||||
|
i, s := 1, b[src:]
|
||||||
|
|
||||||
|
if len(s) <= 1 {
|
||||||
|
b[dst] = b[src]
|
||||||
|
return dst + 1, src + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if s[i] == '#' {
|
||||||
|
if len(s) <= 3 { // We need to have at least "&#.".
|
||||||
|
b[dst] = b[src]
|
||||||
|
return dst + 1, src + 1
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
c := s[i]
|
||||||
|
hex := false
|
||||||
|
if c == 'x' || c == 'X' {
|
||||||
|
hex = true
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
|
x := '\x00'
|
||||||
|
for i < len(s) {
|
||||||
|
c = s[i]
|
||||||
|
i++
|
||||||
|
if hex {
|
||||||
|
if '0' <= c && c <= '9' {
|
||||||
|
x = 16*x + rune(c) - '0'
|
||||||
|
continue
|
||||||
|
} else if 'a' <= c && c <= 'f' {
|
||||||
|
x = 16*x + rune(c) - 'a' + 10
|
||||||
|
continue
|
||||||
|
} else if 'A' <= c && c <= 'F' {
|
||||||
|
x = 16*x + rune(c) - 'A' + 10
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
} else if '0' <= c && c <= '9' {
|
||||||
|
x = 10*x + rune(c) - '0'
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if c != ';' {
|
||||||
|
i--
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if i <= 3 { // No characters matched.
|
||||||
|
b[dst] = b[src]
|
||||||
|
return dst + 1, src + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if 0x80 <= x && x <= 0x9F {
|
||||||
|
// Replace characters from Windows-1252 with UTF-8 equivalents.
|
||||||
|
x = replacementTable[x-0x80]
|
||||||
|
} else if x == 0 || (0xD800 <= x && x <= 0xDFFF) || x > 0x10FFFF {
|
||||||
|
// Replace invalid characters with the replacement character.
|
||||||
|
x = '\uFFFD'
|
||||||
|
}
|
||||||
|
|
||||||
|
return dst + utf8.EncodeRune(b[dst:], x), src + i
|
||||||
|
}
|
||||||
|
|
||||||
|
// Consume the maximum number of characters possible, with the
|
||||||
|
// consumed characters matching one of the named references.
|
||||||
|
|
||||||
|
for i < len(s) {
|
||||||
|
c := s[i]
|
||||||
|
i++
|
||||||
|
// Lower-cased characters are more common in entities, so we check for them first.
|
||||||
|
if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if c != ';' {
|
||||||
|
i--
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
entityName := string(s[1:i])
|
||||||
|
if entityName == "" {
|
||||||
|
// No-op.
|
||||||
|
} else if attribute && entityName[len(entityName)-1] != ';' && len(s) > i && s[i] == '=' {
|
||||||
|
// No-op.
|
||||||
|
} else if x := entity[entityName]; x != 0 {
|
||||||
|
return dst + utf8.EncodeRune(b[dst:], x), src + i
|
||||||
|
} else if x := entity2[entityName]; x[0] != 0 {
|
||||||
|
dst1 := dst + utf8.EncodeRune(b[dst:], x[0])
|
||||||
|
return dst1 + utf8.EncodeRune(b[dst1:], x[1]), src + i
|
||||||
|
} else if !attribute {
|
||||||
|
maxLen := len(entityName) - 1
|
||||||
|
if maxLen > longestEntityWithoutSemicolon {
|
||||||
|
maxLen = longestEntityWithoutSemicolon
|
||||||
|
}
|
||||||
|
for j := maxLen; j > 1; j-- {
|
||||||
|
if x := entity[entityName[:j]]; x != 0 {
|
||||||
|
return dst + utf8.EncodeRune(b[dst:], x), src + j + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dst1, src1 = dst+i, src+i
|
||||||
|
copy(b[dst:dst1], b[src:src1])
|
||||||
|
return dst1, src1
|
||||||
|
}
|
||||||
|
|
||||||
|
// unescape unescapes b's entities in-place, so that "a<b" becomes "a<b".
|
||||||
|
// attribute should be true if parsing an attribute value.
|
||||||
|
func unescape(b []byte, attribute bool) []byte {
|
||||||
|
for i, c := range b {
|
||||||
|
if c == '&' {
|
||||||
|
dst, src := unescapeEntity(b, i, i, attribute)
|
||||||
|
for src < len(b) {
|
||||||
|
c := b[src]
|
||||||
|
if c == '&' {
|
||||||
|
dst, src = unescapeEntity(b, dst, src, attribute)
|
||||||
|
} else {
|
||||||
|
b[dst] = c
|
||||||
|
dst, src = dst+1, src+1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b[0:dst]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// lower lower-cases the A-Z bytes in b in-place, so that "aBc" becomes "abc".
|
||||||
|
func lower(b []byte) []byte {
|
||||||
|
for i, c := range b {
|
||||||
|
if 'A' <= c && c <= 'Z' {
|
||||||
|
b[i] = c + 'a' - 'A'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// escapeComment is like func escape but escapes its input bytes less often.
|
||||||
|
// Per https://github.com/golang/go/issues/58246 some HTML comments are (1)
|
||||||
|
// meaningful and (2) contain angle brackets that we'd like to avoid escaping
|
||||||
|
// unless we have to.
|
||||||
|
//
|
||||||
|
// "We have to" includes the '&' byte, since that introduces other escapes.
|
||||||
|
//
|
||||||
|
// It also includes those bytes (not including EOF) that would otherwise end
|
||||||
|
// the comment. Per the summary table at the bottom of comment_test.go, this is
|
||||||
|
// the '>' byte that, per above, we'd like to avoid escaping unless we have to.
|
||||||
|
//
|
||||||
|
// Studying the summary table (and T actions in its '>' column) closely, we
|
||||||
|
// only need to escape in states 43, 44, 49, 51 and 52. State 43 is at the
|
||||||
|
// start of the comment data. State 52 is after a '!'. The other three states
|
||||||
|
// are after a '-'.
|
||||||
|
//
|
||||||
|
// Our algorithm is thus to escape every '&' and to escape '>' if and only if:
|
||||||
|
// - The '>' is after a '!' or '-' (in the unescaped data) or
|
||||||
|
// - The '>' is at the start of the comment data (after the opening "<!--").
|
||||||
|
func escapeComment(w writer, s string) error {
|
||||||
|
// When modifying this function, consider manually increasing the
|
||||||
|
// maxSuffixLen constant in func TestComments, from 6 to e.g. 9 or more.
|
||||||
|
// That increase should only be temporary, not committed, as it
|
||||||
|
// exponentially affects the test running time.
|
||||||
|
|
||||||
|
if len(s) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Loop:
|
||||||
|
// - Grow j such that s[i:j] does not need escaping.
|
||||||
|
// - If s[j] does need escaping, output s[i:j] and an escaped s[j],
|
||||||
|
// resetting i and j to point past that s[j] byte.
|
||||||
|
i := 0
|
||||||
|
for j := 0; j < len(s); j++ {
|
||||||
|
escaped := ""
|
||||||
|
switch s[j] {
|
||||||
|
case '&':
|
||||||
|
escaped = "&"
|
||||||
|
|
||||||
|
case '>':
|
||||||
|
if j > 0 {
|
||||||
|
if prev := s[j-1]; (prev != '!') && (prev != '-') {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
escaped = ">"
|
||||||
|
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if i < j {
|
||||||
|
if _, err := w.WriteString(s[i:j]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString(escaped); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
i = j + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if i < len(s) {
|
||||||
|
if _, err := w.WriteString(s[i:]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// escapeCommentString is to EscapeString as escapeComment is to escape.
|
||||||
|
func escapeCommentString(s string) string {
|
||||||
|
if strings.IndexAny(s, "&>") == -1 {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
var buf bytes.Buffer
|
||||||
|
escapeComment(&buf, s)
|
||||||
|
return buf.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
const escapedChars = "&'<>\"\r"
|
||||||
|
|
||||||
|
func escape(w writer, s string) error {
|
||||||
|
i := strings.IndexAny(s, escapedChars)
|
||||||
|
for i != -1 {
|
||||||
|
if _, err := w.WriteString(s[:i]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var esc string
|
||||||
|
switch s[i] {
|
||||||
|
case '&':
|
||||||
|
esc = "&"
|
||||||
|
case '\'':
|
||||||
|
// "'" is shorter than "'" and apos was not in HTML until HTML5.
|
||||||
|
esc = "'"
|
||||||
|
case '<':
|
||||||
|
esc = "<"
|
||||||
|
case '>':
|
||||||
|
esc = ">"
|
||||||
|
case '"':
|
||||||
|
// """ is shorter than """.
|
||||||
|
esc = """
|
||||||
|
case '\r':
|
||||||
|
esc = " "
|
||||||
|
default:
|
||||||
|
panic("unrecognized escape character")
|
||||||
|
}
|
||||||
|
s = s[i+1:]
|
||||||
|
if _, err := w.WriteString(esc); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
i = strings.IndexAny(s, escapedChars)
|
||||||
|
}
|
||||||
|
_, err := w.WriteString(s)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// EscapeString escapes special characters like "<" to become "<". It
|
||||||
|
// escapes only five such characters: <, >, &, ' and ".
|
||||||
|
// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't
|
||||||
|
// always true.
|
||||||
|
func EscapeString(s string) string {
|
||||||
|
if strings.IndexAny(s, escapedChars) == -1 {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
var buf bytes.Buffer
|
||||||
|
escape(&buf, s)
|
||||||
|
return buf.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnescapeString unescapes entities like "<" to become "<". It unescapes a
|
||||||
|
// larger range of entities than EscapeString escapes. For example, "á"
|
||||||
|
// unescapes to "á", as does "á" and "&xE1;".
|
||||||
|
// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't
|
||||||
|
// always true.
|
||||||
|
func UnescapeString(s string) string {
|
||||||
|
for _, c := range s {
|
||||||
|
if c == '&' {
|
||||||
|
return string(unescape([]byte(s), false))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
222
vendor/golang.org/x/net/html/foreign.go
generated
vendored
Normal file
222
vendor/golang.org/x/net/html/foreign.go
generated
vendored
Normal file
|
@ -0,0 +1,222 @@
|
||||||
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package html
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func adjustAttributeNames(aa []Attribute, nameMap map[string]string) {
|
||||||
|
for i := range aa {
|
||||||
|
if newName, ok := nameMap[aa[i].Key]; ok {
|
||||||
|
aa[i].Key = newName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func adjustForeignAttributes(aa []Attribute) {
|
||||||
|
for i, a := range aa {
|
||||||
|
if a.Key == "" || a.Key[0] != 'x' {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch a.Key {
|
||||||
|
case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show",
|
||||||
|
"xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink":
|
||||||
|
j := strings.Index(a.Key, ":")
|
||||||
|
aa[i].Namespace = a.Key[:j]
|
||||||
|
aa[i].Key = a.Key[j+1:]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func htmlIntegrationPoint(n *Node) bool {
|
||||||
|
if n.Type != ElementNode {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
switch n.Namespace {
|
||||||
|
case "math":
|
||||||
|
if n.Data == "annotation-xml" {
|
||||||
|
for _, a := range n.Attr {
|
||||||
|
if a.Key == "encoding" {
|
||||||
|
val := strings.ToLower(a.Val)
|
||||||
|
if val == "text/html" || val == "application/xhtml+xml" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "svg":
|
||||||
|
switch n.Data {
|
||||||
|
case "desc", "foreignObject", "title":
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func mathMLTextIntegrationPoint(n *Node) bool {
|
||||||
|
if n.Namespace != "math" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
switch n.Data {
|
||||||
|
case "mi", "mo", "mn", "ms", "mtext":
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Section 12.2.6.5.
|
||||||
|
var breakout = map[string]bool{
|
||||||
|
"b": true,
|
||||||
|
"big": true,
|
||||||
|
"blockquote": true,
|
||||||
|
"body": true,
|
||||||
|
"br": true,
|
||||||
|
"center": true,
|
||||||
|
"code": true,
|
||||||
|
"dd": true,
|
||||||
|
"div": true,
|
||||||
|
"dl": true,
|
||||||
|
"dt": true,
|
||||||
|
"em": true,
|
||||||
|
"embed": true,
|
||||||
|
"h1": true,
|
||||||
|
"h2": true,
|
||||||
|
"h3": true,
|
||||||
|
"h4": true,
|
||||||
|
"h5": true,
|
||||||
|
"h6": true,
|
||||||
|
"head": true,
|
||||||
|
"hr": true,
|
||||||
|
"i": true,
|
||||||
|
"img": true,
|
||||||
|
"li": true,
|
||||||
|
"listing": true,
|
||||||
|
"menu": true,
|
||||||
|
"meta": true,
|
||||||
|
"nobr": true,
|
||||||
|
"ol": true,
|
||||||
|
"p": true,
|
||||||
|
"pre": true,
|
||||||
|
"ruby": true,
|
||||||
|
"s": true,
|
||||||
|
"small": true,
|
||||||
|
"span": true,
|
||||||
|
"strong": true,
|
||||||
|
"strike": true,
|
||||||
|
"sub": true,
|
||||||
|
"sup": true,
|
||||||
|
"table": true,
|
||||||
|
"tt": true,
|
||||||
|
"u": true,
|
||||||
|
"ul": true,
|
||||||
|
"var": true,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Section 12.2.6.5.
|
||||||
|
var svgTagNameAdjustments = map[string]string{
|
||||||
|
"altglyph": "altGlyph",
|
||||||
|
"altglyphdef": "altGlyphDef",
|
||||||
|
"altglyphitem": "altGlyphItem",
|
||||||
|
"animatecolor": "animateColor",
|
||||||
|
"animatemotion": "animateMotion",
|
||||||
|
"animatetransform": "animateTransform",
|
||||||
|
"clippath": "clipPath",
|
||||||
|
"feblend": "feBlend",
|
||||||
|
"fecolormatrix": "feColorMatrix",
|
||||||
|
"fecomponenttransfer": "feComponentTransfer",
|
||||||
|
"fecomposite": "feComposite",
|
||||||
|
"feconvolvematrix": "feConvolveMatrix",
|
||||||
|
"fediffuselighting": "feDiffuseLighting",
|
||||||
|
"fedisplacementmap": "feDisplacementMap",
|
||||||
|
"fedistantlight": "feDistantLight",
|
||||||
|
"feflood": "feFlood",
|
||||||
|
"fefunca": "feFuncA",
|
||||||
|
"fefuncb": "feFuncB",
|
||||||
|
"fefuncg": "feFuncG",
|
||||||
|
"fefuncr": "feFuncR",
|
||||||
|
"fegaussianblur": "feGaussianBlur",
|
||||||
|
"feimage": "feImage",
|
||||||
|
"femerge": "feMerge",
|
||||||
|
"femergenode": "feMergeNode",
|
||||||
|
"femorphology": "feMorphology",
|
||||||
|
"feoffset": "feOffset",
|
||||||
|
"fepointlight": "fePointLight",
|
||||||
|
"fespecularlighting": "feSpecularLighting",
|
||||||
|
"fespotlight": "feSpotLight",
|
||||||
|
"fetile": "feTile",
|
||||||
|
"feturbulence": "feTurbulence",
|
||||||
|
"foreignobject": "foreignObject",
|
||||||
|
"glyphref": "glyphRef",
|
||||||
|
"lineargradient": "linearGradient",
|
||||||
|
"radialgradient": "radialGradient",
|
||||||
|
"textpath": "textPath",
|
||||||
|
}
|
||||||
|
|
||||||
|
// Section 12.2.6.1
|
||||||
|
var mathMLAttributeAdjustments = map[string]string{
|
||||||
|
"definitionurl": "definitionURL",
|
||||||
|
}
|
||||||
|
|
||||||
|
var svgAttributeAdjustments = map[string]string{
|
||||||
|
"attributename": "attributeName",
|
||||||
|
"attributetype": "attributeType",
|
||||||
|
"basefrequency": "baseFrequency",
|
||||||
|
"baseprofile": "baseProfile",
|
||||||
|
"calcmode": "calcMode",
|
||||||
|
"clippathunits": "clipPathUnits",
|
||||||
|
"diffuseconstant": "diffuseConstant",
|
||||||
|
"edgemode": "edgeMode",
|
||||||
|
"filterunits": "filterUnits",
|
||||||
|
"glyphref": "glyphRef",
|
||||||
|
"gradienttransform": "gradientTransform",
|
||||||
|
"gradientunits": "gradientUnits",
|
||||||
|
"kernelmatrix": "kernelMatrix",
|
||||||
|
"kernelunitlength": "kernelUnitLength",
|
||||||
|
"keypoints": "keyPoints",
|
||||||
|
"keysplines": "keySplines",
|
||||||
|
"keytimes": "keyTimes",
|
||||||
|
"lengthadjust": "lengthAdjust",
|
||||||
|
"limitingconeangle": "limitingConeAngle",
|
||||||
|
"markerheight": "markerHeight",
|
||||||
|
"markerunits": "markerUnits",
|
||||||
|
"markerwidth": "markerWidth",
|
||||||
|
"maskcontentunits": "maskContentUnits",
|
||||||
|
"maskunits": "maskUnits",
|
||||||
|
"numoctaves": "numOctaves",
|
||||||
|
"pathlength": "pathLength",
|
||||||
|
"patterncontentunits": "patternContentUnits",
|
||||||
|
"patterntransform": "patternTransform",
|
||||||
|
"patternunits": "patternUnits",
|
||||||
|
"pointsatx": "pointsAtX",
|
||||||
|
"pointsaty": "pointsAtY",
|
||||||
|
"pointsatz": "pointsAtZ",
|
||||||
|
"preservealpha": "preserveAlpha",
|
||||||
|
"preserveaspectratio": "preserveAspectRatio",
|
||||||
|
"primitiveunits": "primitiveUnits",
|
||||||
|
"refx": "refX",
|
||||||
|
"refy": "refY",
|
||||||
|
"repeatcount": "repeatCount",
|
||||||
|
"repeatdur": "repeatDur",
|
||||||
|
"requiredextensions": "requiredExtensions",
|
||||||
|
"requiredfeatures": "requiredFeatures",
|
||||||
|
"specularconstant": "specularConstant",
|
||||||
|
"specularexponent": "specularExponent",
|
||||||
|
"spreadmethod": "spreadMethod",
|
||||||
|
"startoffset": "startOffset",
|
||||||
|
"stddeviation": "stdDeviation",
|
||||||
|
"stitchtiles": "stitchTiles",
|
||||||
|
"surfacescale": "surfaceScale",
|
||||||
|
"systemlanguage": "systemLanguage",
|
||||||
|
"tablevalues": "tableValues",
|
||||||
|
"targetx": "targetX",
|
||||||
|
"targety": "targetY",
|
||||||
|
"textlength": "textLength",
|
||||||
|
"viewbox": "viewBox",
|
||||||
|
"viewtarget": "viewTarget",
|
||||||
|
"xchannelselector": "xChannelSelector",
|
||||||
|
"ychannelselector": "yChannelSelector",
|
||||||
|
"zoomandpan": "zoomAndPan",
|
||||||
|
}
|
225
vendor/golang.org/x/net/html/node.go
generated
vendored
Normal file
225
vendor/golang.org/x/net/html/node.go
generated
vendored
Normal file
|
@ -0,0 +1,225 @@
|
||||||
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package html
|
||||||
|
|
||||||
|
import (
|
||||||
|
"golang.org/x/net/html/atom"
|
||||||
|
)
|
||||||
|
|
||||||
|
// A NodeType is the type of a Node.
|
||||||
|
type NodeType uint32
|
||||||
|
|
||||||
|
const (
|
||||||
|
ErrorNode NodeType = iota
|
||||||
|
TextNode
|
||||||
|
DocumentNode
|
||||||
|
ElementNode
|
||||||
|
CommentNode
|
||||||
|
DoctypeNode
|
||||||
|
// RawNode nodes are not returned by the parser, but can be part of the
|
||||||
|
// Node tree passed to func Render to insert raw HTML (without escaping).
|
||||||
|
// If so, this package makes no guarantee that the rendered HTML is secure
|
||||||
|
// (from e.g. Cross Site Scripting attacks) or well-formed.
|
||||||
|
RawNode
|
||||||
|
scopeMarkerNode
|
||||||
|
)
|
||||||
|
|
||||||
|
// Section 12.2.4.3 says "The markers are inserted when entering applet,
|
||||||
|
// object, marquee, template, td, th, and caption elements, and are used
|
||||||
|
// to prevent formatting from "leaking" into applet, object, marquee,
|
||||||
|
// template, td, th, and caption elements".
|
||||||
|
var scopeMarker = Node{Type: scopeMarkerNode}
|
||||||
|
|
||||||
|
// A Node consists of a NodeType and some Data (tag name for element nodes,
|
||||||
|
// content for text) and are part of a tree of Nodes. Element nodes may also
|
||||||
|
// have a Namespace and contain a slice of Attributes. Data is unescaped, so
|
||||||
|
// that it looks like "a<b" rather than "a<b". For element nodes, DataAtom
|
||||||
|
// is the atom for Data, or zero if Data is not a known tag name.
|
||||||
|
//
|
||||||
|
// An empty Namespace implies a "http://www.w3.org/1999/xhtml" namespace.
|
||||||
|
// Similarly, "math" is short for "http://www.w3.org/1998/Math/MathML", and
|
||||||
|
// "svg" is short for "http://www.w3.org/2000/svg".
|
||||||
|
type Node struct {
|
||||||
|
Parent, FirstChild, LastChild, PrevSibling, NextSibling *Node
|
||||||
|
|
||||||
|
Type NodeType
|
||||||
|
DataAtom atom.Atom
|
||||||
|
Data string
|
||||||
|
Namespace string
|
||||||
|
Attr []Attribute
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertBefore inserts newChild as a child of n, immediately before oldChild
|
||||||
|
// in the sequence of n's children. oldChild may be nil, in which case newChild
|
||||||
|
// is appended to the end of n's children.
|
||||||
|
//
|
||||||
|
// It will panic if newChild already has a parent or siblings.
|
||||||
|
func (n *Node) InsertBefore(newChild, oldChild *Node) {
|
||||||
|
if newChild.Parent != nil || newChild.PrevSibling != nil || newChild.NextSibling != nil {
|
||||||
|
panic("html: InsertBefore called for an attached child Node")
|
||||||
|
}
|
||||||
|
var prev, next *Node
|
||||||
|
if oldChild != nil {
|
||||||
|
prev, next = oldChild.PrevSibling, oldChild
|
||||||
|
} else {
|
||||||
|
prev = n.LastChild
|
||||||
|
}
|
||||||
|
if prev != nil {
|
||||||
|
prev.NextSibling = newChild
|
||||||
|
} else {
|
||||||
|
n.FirstChild = newChild
|
||||||
|
}
|
||||||
|
if next != nil {
|
||||||
|
next.PrevSibling = newChild
|
||||||
|
} else {
|
||||||
|
n.LastChild = newChild
|
||||||
|
}
|
||||||
|
newChild.Parent = n
|
||||||
|
newChild.PrevSibling = prev
|
||||||
|
newChild.NextSibling = next
|
||||||
|
}
|
||||||
|
|
||||||
|
// AppendChild adds a node c as a child of n.
|
||||||
|
//
|
||||||
|
// It will panic if c already has a parent or siblings.
|
||||||
|
func (n *Node) AppendChild(c *Node) {
|
||||||
|
if c.Parent != nil || c.PrevSibling != nil || c.NextSibling != nil {
|
||||||
|
panic("html: AppendChild called for an attached child Node")
|
||||||
|
}
|
||||||
|
last := n.LastChild
|
||||||
|
if last != nil {
|
||||||
|
last.NextSibling = c
|
||||||
|
} else {
|
||||||
|
n.FirstChild = c
|
||||||
|
}
|
||||||
|
n.LastChild = c
|
||||||
|
c.Parent = n
|
||||||
|
c.PrevSibling = last
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveChild removes a node c that is a child of n. Afterwards, c will have
|
||||||
|
// no parent and no siblings.
|
||||||
|
//
|
||||||
|
// It will panic if c's parent is not n.
|
||||||
|
func (n *Node) RemoveChild(c *Node) {
|
||||||
|
if c.Parent != n {
|
||||||
|
panic("html: RemoveChild called for a non-child Node")
|
||||||
|
}
|
||||||
|
if n.FirstChild == c {
|
||||||
|
n.FirstChild = c.NextSibling
|
||||||
|
}
|
||||||
|
if c.NextSibling != nil {
|
||||||
|
c.NextSibling.PrevSibling = c.PrevSibling
|
||||||
|
}
|
||||||
|
if n.LastChild == c {
|
||||||
|
n.LastChild = c.PrevSibling
|
||||||
|
}
|
||||||
|
if c.PrevSibling != nil {
|
||||||
|
c.PrevSibling.NextSibling = c.NextSibling
|
||||||
|
}
|
||||||
|
c.Parent = nil
|
||||||
|
c.PrevSibling = nil
|
||||||
|
c.NextSibling = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// reparentChildren reparents all of src's child nodes to dst.
|
||||||
|
func reparentChildren(dst, src *Node) {
|
||||||
|
for {
|
||||||
|
child := src.FirstChild
|
||||||
|
if child == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
src.RemoveChild(child)
|
||||||
|
dst.AppendChild(child)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// clone returns a new node with the same type, data and attributes.
|
||||||
|
// The clone has no parent, no siblings and no children.
|
||||||
|
func (n *Node) clone() *Node {
|
||||||
|
m := &Node{
|
||||||
|
Type: n.Type,
|
||||||
|
DataAtom: n.DataAtom,
|
||||||
|
Data: n.Data,
|
||||||
|
Attr: make([]Attribute, len(n.Attr)),
|
||||||
|
}
|
||||||
|
copy(m.Attr, n.Attr)
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
// nodeStack is a stack of nodes.
|
||||||
|
type nodeStack []*Node
|
||||||
|
|
||||||
|
// pop pops the stack. It will panic if s is empty.
|
||||||
|
func (s *nodeStack) pop() *Node {
|
||||||
|
i := len(*s)
|
||||||
|
n := (*s)[i-1]
|
||||||
|
*s = (*s)[:i-1]
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
// top returns the most recently pushed node, or nil if s is empty.
|
||||||
|
func (s *nodeStack) top() *Node {
|
||||||
|
if i := len(*s); i > 0 {
|
||||||
|
return (*s)[i-1]
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// index returns the index of the top-most occurrence of n in the stack, or -1
|
||||||
|
// if n is not present.
|
||||||
|
func (s *nodeStack) index(n *Node) int {
|
||||||
|
for i := len(*s) - 1; i >= 0; i-- {
|
||||||
|
if (*s)[i] == n {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
// contains returns whether a is within s.
|
||||||
|
func (s *nodeStack) contains(a atom.Atom) bool {
|
||||||
|
for _, n := range *s {
|
||||||
|
if n.DataAtom == a && n.Namespace == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// insert inserts a node at the given index.
|
||||||
|
func (s *nodeStack) insert(i int, n *Node) {
|
||||||
|
(*s) = append(*s, nil)
|
||||||
|
copy((*s)[i+1:], (*s)[i:])
|
||||||
|
(*s)[i] = n
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove removes a node from the stack. It is a no-op if n is not present.
|
||||||
|
func (s *nodeStack) remove(n *Node) {
|
||||||
|
i := s.index(n)
|
||||||
|
if i == -1 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
copy((*s)[i:], (*s)[i+1:])
|
||||||
|
j := len(*s) - 1
|
||||||
|
(*s)[j] = nil
|
||||||
|
*s = (*s)[:j]
|
||||||
|
}
|
||||||
|
|
||||||
|
type insertionModeStack []insertionMode
|
||||||
|
|
||||||
|
func (s *insertionModeStack) pop() (im insertionMode) {
|
||||||
|
i := len(*s)
|
||||||
|
im = (*s)[i-1]
|
||||||
|
*s = (*s)[:i-1]
|
||||||
|
return im
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *insertionModeStack) top() insertionMode {
|
||||||
|
if i := len(*s); i > 0 {
|
||||||
|
return (*s)[i-1]
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
2460
vendor/golang.org/x/net/html/parse.go
generated
vendored
Normal file
2460
vendor/golang.org/x/net/html/parse.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
293
vendor/golang.org/x/net/html/render.go
generated
vendored
Normal file
293
vendor/golang.org/x/net/html/render.go
generated
vendored
Normal file
|
@ -0,0 +1,293 @@
|
||||||
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package html
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
type writer interface {
|
||||||
|
io.Writer
|
||||||
|
io.ByteWriter
|
||||||
|
WriteString(string) (int, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render renders the parse tree n to the given writer.
|
||||||
|
//
|
||||||
|
// Rendering is done on a 'best effort' basis: calling Parse on the output of
|
||||||
|
// Render will always result in something similar to the original tree, but it
|
||||||
|
// is not necessarily an exact clone unless the original tree was 'well-formed'.
|
||||||
|
// 'Well-formed' is not easily specified; the HTML5 specification is
|
||||||
|
// complicated.
|
||||||
|
//
|
||||||
|
// Calling Parse on arbitrary input typically results in a 'well-formed' parse
|
||||||
|
// tree. However, it is possible for Parse to yield a 'badly-formed' parse tree.
|
||||||
|
// For example, in a 'well-formed' parse tree, no <a> element is a child of
|
||||||
|
// another <a> element: parsing "<a><a>" results in two sibling elements.
|
||||||
|
// Similarly, in a 'well-formed' parse tree, no <a> element is a child of a
|
||||||
|
// <table> element: parsing "<p><table><a>" results in a <p> with two sibling
|
||||||
|
// children; the <a> is reparented to the <table>'s parent. However, calling
|
||||||
|
// Parse on "<a><table><a>" does not return an error, but the result has an <a>
|
||||||
|
// element with an <a> child, and is therefore not 'well-formed'.
|
||||||
|
//
|
||||||
|
// Programmatically constructed trees are typically also 'well-formed', but it
|
||||||
|
// is possible to construct a tree that looks innocuous but, when rendered and
|
||||||
|
// re-parsed, results in a different tree. A simple example is that a solitary
|
||||||
|
// text node would become a tree containing <html>, <head> and <body> elements.
|
||||||
|
// Another example is that the programmatic equivalent of "a<head>b</head>c"
|
||||||
|
// becomes "<html><head><head/><body>abc</body></html>".
|
||||||
|
func Render(w io.Writer, n *Node) error {
|
||||||
|
if x, ok := w.(writer); ok {
|
||||||
|
return render(x, n)
|
||||||
|
}
|
||||||
|
buf := bufio.NewWriter(w)
|
||||||
|
if err := render(buf, n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return buf.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
|
// plaintextAbort is returned from render1 when a <plaintext> element
|
||||||
|
// has been rendered. No more end tags should be rendered after that.
|
||||||
|
var plaintextAbort = errors.New("html: internal error (plaintext abort)")
|
||||||
|
|
||||||
|
func render(w writer, n *Node) error {
|
||||||
|
err := render1(w, n)
|
||||||
|
if err == plaintextAbort {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func render1(w writer, n *Node) error {
|
||||||
|
// Render non-element nodes; these are the easy cases.
|
||||||
|
switch n.Type {
|
||||||
|
case ErrorNode:
|
||||||
|
return errors.New("html: cannot render an ErrorNode node")
|
||||||
|
case TextNode:
|
||||||
|
return escape(w, n.Data)
|
||||||
|
case DocumentNode:
|
||||||
|
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||||
|
if err := render1(w, c); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case ElementNode:
|
||||||
|
// No-op.
|
||||||
|
case CommentNode:
|
||||||
|
if _, err := w.WriteString("<!--"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := escapeComment(w, n.Data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString("-->"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case DoctypeNode:
|
||||||
|
if _, err := w.WriteString("<!DOCTYPE "); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := escape(w, n.Data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if n.Attr != nil {
|
||||||
|
var p, s string
|
||||||
|
for _, a := range n.Attr {
|
||||||
|
switch a.Key {
|
||||||
|
case "public":
|
||||||
|
p = a.Val
|
||||||
|
case "system":
|
||||||
|
s = a.Val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if p != "" {
|
||||||
|
if _, err := w.WriteString(" PUBLIC "); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := writeQuoted(w, p); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if s != "" {
|
||||||
|
if err := w.WriteByte(' '); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := writeQuoted(w, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if s != "" {
|
||||||
|
if _, err := w.WriteString(" SYSTEM "); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := writeQuoted(w, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return w.WriteByte('>')
|
||||||
|
case RawNode:
|
||||||
|
_, err := w.WriteString(n.Data)
|
||||||
|
return err
|
||||||
|
default:
|
||||||
|
return errors.New("html: unknown node type")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render the <xxx> opening tag.
|
||||||
|
if err := w.WriteByte('<'); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString(n.Data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, a := range n.Attr {
|
||||||
|
if err := w.WriteByte(' '); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if a.Namespace != "" {
|
||||||
|
if _, err := w.WriteString(a.Namespace); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := w.WriteByte(':'); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString(a.Key); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString(`="`); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := escape(w, a.Val); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := w.WriteByte('"'); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if voidElements[n.Data] {
|
||||||
|
if n.FirstChild != nil {
|
||||||
|
return fmt.Errorf("html: void element <%s> has child nodes", n.Data)
|
||||||
|
}
|
||||||
|
_, err := w.WriteString("/>")
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := w.WriteByte('>'); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add initial newline where there is danger of a newline beging ignored.
|
||||||
|
if c := n.FirstChild; c != nil && c.Type == TextNode && strings.HasPrefix(c.Data, "\n") {
|
||||||
|
switch n.Data {
|
||||||
|
case "pre", "listing", "textarea":
|
||||||
|
if err := w.WriteByte('\n'); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render any child nodes
|
||||||
|
if childTextNodesAreLiteral(n) {
|
||||||
|
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||||
|
if c.Type == TextNode {
|
||||||
|
if _, err := w.WriteString(c.Data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := render1(w, c); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if n.Data == "plaintext" {
|
||||||
|
// Don't render anything else. <plaintext> must be the
|
||||||
|
// last element in the file, with no closing tag.
|
||||||
|
return plaintextAbort
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||||
|
if err := render1(w, c); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Render the </xxx> closing tag.
|
||||||
|
if _, err := w.WriteString("</"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString(n.Data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return w.WriteByte('>')
|
||||||
|
}
|
||||||
|
|
||||||
|
func childTextNodesAreLiteral(n *Node) bool {
|
||||||
|
// Per WHATWG HTML 13.3, if the parent of the current node is a style,
|
||||||
|
// script, xmp, iframe, noembed, noframes, or plaintext element, and the
|
||||||
|
// current node is a text node, append the value of the node's data
|
||||||
|
// literally. The specification is not explicit about it, but we only
|
||||||
|
// enforce this if we are in the HTML namespace (i.e. when the namespace is
|
||||||
|
// "").
|
||||||
|
// NOTE: we also always include noscript elements, although the
|
||||||
|
// specification states that they should only be rendered as such if
|
||||||
|
// scripting is enabled for the node (which is not something we track).
|
||||||
|
if n.Namespace != "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
switch n.Data {
|
||||||
|
case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp":
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// writeQuoted writes s to w surrounded by quotes. Normally it will use double
|
||||||
|
// quotes, but if s contains a double quote, it will use single quotes.
|
||||||
|
// It is used for writing the identifiers in a doctype declaration.
|
||||||
|
// In valid HTML, they can't contain both types of quotes.
|
||||||
|
func writeQuoted(w writer, s string) error {
|
||||||
|
var q byte = '"'
|
||||||
|
if strings.Contains(s, `"`) {
|
||||||
|
q = '\''
|
||||||
|
}
|
||||||
|
if err := w.WriteByte(q); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := w.WriteString(s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := w.WriteByte(q); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Section 12.1.2, "Elements", gives this list of void elements. Void elements
|
||||||
|
// are those that can't have any contents.
|
||||||
|
var voidElements = map[string]bool{
|
||||||
|
"area": true,
|
||||||
|
"base": true,
|
||||||
|
"br": true,
|
||||||
|
"col": true,
|
||||||
|
"embed": true,
|
||||||
|
"hr": true,
|
||||||
|
"img": true,
|
||||||
|
"input": true,
|
||||||
|
"keygen": true, // "keygen" has been removed from the spec, but are kept here for backwards compatibility.
|
||||||
|
"link": true,
|
||||||
|
"meta": true,
|
||||||
|
"param": true,
|
||||||
|
"source": true,
|
||||||
|
"track": true,
|
||||||
|
"wbr": true,
|
||||||
|
}
|
1272
vendor/golang.org/x/net/html/token.go
generated
vendored
Normal file
1272
vendor/golang.org/x/net/html/token.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
2
vendor/golang.org/x/text/feature/plural/tables.go
generated
vendored
2
vendor/golang.org/x/text/feature/plural/tables.go
generated
vendored
|
@ -549,4 +549,4 @@ var cardinalInclusionMasks = []uint64{ // 100 elements
|
||||||
|
|
||||||
// Slots used for cardinal: A6 of 0xFF rules; 24 of 0xFF indexes; 37 of 64 sets
|
// Slots used for cardinal: A6 of 0xFF rules; 24 of 0xFF indexes; 37 of 64 sets
|
||||||
|
|
||||||
// Total table size 3860 bytes (3KiB); checksum: 4E56F7B1
|
// Total table size 3860 bytes (3KiB); checksum: AAFBF21
|
||||||
|
|
2
vendor/golang.org/x/text/internal/language/compact/language.go
generated
vendored
2
vendor/golang.org/x/text/internal/language/compact/language.go
generated
vendored
|
@ -118,7 +118,7 @@ func (t Tag) Parent() Tag {
|
||||||
return Tag{language: lang, locale: lang}
|
return Tag{language: lang, locale: lang}
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns token t and the rest of the string.
|
// nextToken returns token t and the rest of the string.
|
||||||
func nextToken(s string) (t, tail string) {
|
func nextToken(s string) (t, tail string) {
|
||||||
p := strings.Index(s[1:], "-")
|
p := strings.Index(s[1:], "-")
|
||||||
if p == -1 {
|
if p == -1 {
|
||||||
|
|
356
vendor/golang.org/x/text/internal/language/compact/tables.go
generated
vendored
356
vendor/golang.org/x/text/internal/language/compact/tables.go
generated
vendored
|
@ -790,226 +790,226 @@ const (
|
||||||
|
|
||||||
var coreTags = []language.CompactCoreInfo{ // 773 elements
|
var coreTags = []language.CompactCoreInfo{ // 773 elements
|
||||||
// Entry 0 - 1F
|
// Entry 0 - 1F
|
||||||
0x00000000, 0x01600000, 0x016000d2, 0x01600161,
|
0x00000000, 0x01600000, 0x016000d3, 0x01600162,
|
||||||
0x01c00000, 0x01c00052, 0x02100000, 0x02100080,
|
0x01c00000, 0x01c00052, 0x02100000, 0x02100081,
|
||||||
0x02700000, 0x0270006f, 0x03a00000, 0x03a00001,
|
0x02700000, 0x02700070, 0x03a00000, 0x03a00001,
|
||||||
0x03a00023, 0x03a00039, 0x03a00062, 0x03a00067,
|
0x03a00023, 0x03a00039, 0x03a00063, 0x03a00068,
|
||||||
0x03a0006b, 0x03a0006c, 0x03a0006d, 0x03a00097,
|
0x03a0006c, 0x03a0006d, 0x03a0006e, 0x03a00098,
|
||||||
0x03a0009b, 0x03a000a1, 0x03a000a8, 0x03a000ac,
|
0x03a0009c, 0x03a000a2, 0x03a000a9, 0x03a000ad,
|
||||||
0x03a000b0, 0x03a000b9, 0x03a000ba, 0x03a000c9,
|
0x03a000b1, 0x03a000ba, 0x03a000bb, 0x03a000ca,
|
||||||
0x03a000e1, 0x03a000ed, 0x03a000f3, 0x03a00108,
|
0x03a000e2, 0x03a000ee, 0x03a000f4, 0x03a00109,
|
||||||
// Entry 20 - 3F
|
// Entry 20 - 3F
|
||||||
0x03a0010b, 0x03a00115, 0x03a00117, 0x03a0011c,
|
0x03a0010c, 0x03a00116, 0x03a00118, 0x03a0011d,
|
||||||
0x03a00120, 0x03a00128, 0x03a0015e, 0x04000000,
|
0x03a00121, 0x03a00129, 0x03a0015f, 0x04000000,
|
||||||
0x04300000, 0x04300099, 0x04400000, 0x0440012f,
|
0x04300000, 0x0430009a, 0x04400000, 0x04400130,
|
||||||
0x04800000, 0x0480006e, 0x05800000, 0x05820000,
|
0x04800000, 0x0480006f, 0x05800000, 0x05820000,
|
||||||
0x05820032, 0x0585a000, 0x0585a032, 0x05e00000,
|
0x05820032, 0x0585b000, 0x0585b032, 0x05e00000,
|
||||||
0x05e00052, 0x07100000, 0x07100047, 0x07500000,
|
0x05e00052, 0x07100000, 0x07100047, 0x07500000,
|
||||||
0x07500162, 0x07900000, 0x0790012f, 0x07e00000,
|
0x07500163, 0x07900000, 0x07900130, 0x07e00000,
|
||||||
0x07e00038, 0x08200000, 0x0a000000, 0x0a0000c3,
|
0x07e00038, 0x08200000, 0x0a000000, 0x0a0000c4,
|
||||||
// Entry 40 - 5F
|
// Entry 40 - 5F
|
||||||
0x0a500000, 0x0a500035, 0x0a500099, 0x0a900000,
|
0x0a500000, 0x0a500035, 0x0a50009a, 0x0a900000,
|
||||||
0x0a900053, 0x0a900099, 0x0b200000, 0x0b200078,
|
0x0a900053, 0x0a90009a, 0x0b200000, 0x0b200079,
|
||||||
0x0b500000, 0x0b500099, 0x0b700000, 0x0b720000,
|
0x0b500000, 0x0b50009a, 0x0b700000, 0x0b720000,
|
||||||
0x0b720033, 0x0b75a000, 0x0b75a033, 0x0d700000,
|
0x0b720033, 0x0b75b000, 0x0b75b033, 0x0d700000,
|
||||||
0x0d700022, 0x0d70006e, 0x0d700078, 0x0d70009e,
|
0x0d700022, 0x0d70006f, 0x0d700079, 0x0d70009f,
|
||||||
0x0db00000, 0x0db00035, 0x0db00099, 0x0dc00000,
|
0x0db00000, 0x0db00035, 0x0db0009a, 0x0dc00000,
|
||||||
0x0dc00106, 0x0df00000, 0x0df00131, 0x0e500000,
|
0x0dc00107, 0x0df00000, 0x0df00132, 0x0e500000,
|
||||||
0x0e500135, 0x0e900000, 0x0e90009b, 0x0e90009c,
|
0x0e500136, 0x0e900000, 0x0e90009c, 0x0e90009d,
|
||||||
// Entry 60 - 7F
|
// Entry 60 - 7F
|
||||||
0x0fa00000, 0x0fa0005e, 0x0fe00000, 0x0fe00106,
|
0x0fa00000, 0x0fa0005f, 0x0fe00000, 0x0fe00107,
|
||||||
0x10000000, 0x1000007b, 0x10100000, 0x10100063,
|
0x10000000, 0x1000007c, 0x10100000, 0x10100064,
|
||||||
0x10100082, 0x10800000, 0x108000a4, 0x10d00000,
|
0x10100083, 0x10800000, 0x108000a5, 0x10d00000,
|
||||||
0x10d0002e, 0x10d00036, 0x10d0004e, 0x10d00060,
|
0x10d0002e, 0x10d00036, 0x10d0004e, 0x10d00061,
|
||||||
0x10d0009e, 0x10d000b2, 0x10d000b7, 0x11700000,
|
0x10d0009f, 0x10d000b3, 0x10d000b8, 0x11700000,
|
||||||
0x117000d4, 0x11f00000, 0x11f00060, 0x12400000,
|
0x117000d5, 0x11f00000, 0x11f00061, 0x12400000,
|
||||||
0x12400052, 0x12800000, 0x12b00000, 0x12b00114,
|
0x12400052, 0x12800000, 0x12b00000, 0x12b00115,
|
||||||
0x12d00000, 0x12d00043, 0x12f00000, 0x12f000a4,
|
0x12d00000, 0x12d00043, 0x12f00000, 0x12f000a5,
|
||||||
// Entry 80 - 9F
|
// Entry 80 - 9F
|
||||||
0x13000000, 0x13000080, 0x13000122, 0x13600000,
|
0x13000000, 0x13000081, 0x13000123, 0x13600000,
|
||||||
0x1360005d, 0x13600087, 0x13900000, 0x13900001,
|
0x1360005e, 0x13600088, 0x13900000, 0x13900001,
|
||||||
0x1390001a, 0x13900025, 0x13900026, 0x1390002d,
|
0x1390001a, 0x13900025, 0x13900026, 0x1390002d,
|
||||||
0x1390002e, 0x1390002f, 0x13900034, 0x13900036,
|
0x1390002e, 0x1390002f, 0x13900034, 0x13900036,
|
||||||
0x1390003a, 0x1390003d, 0x13900042, 0x13900046,
|
0x1390003a, 0x1390003d, 0x13900042, 0x13900046,
|
||||||
0x13900048, 0x13900049, 0x1390004a, 0x1390004e,
|
0x13900048, 0x13900049, 0x1390004a, 0x1390004e,
|
||||||
0x13900050, 0x13900052, 0x1390005c, 0x1390005d,
|
0x13900050, 0x13900052, 0x1390005d, 0x1390005e,
|
||||||
0x13900060, 0x13900061, 0x13900063, 0x13900064,
|
0x13900061, 0x13900062, 0x13900064, 0x13900065,
|
||||||
// Entry A0 - BF
|
// Entry A0 - BF
|
||||||
0x1390006d, 0x13900072, 0x13900073, 0x13900074,
|
0x1390006e, 0x13900073, 0x13900074, 0x13900075,
|
||||||
0x13900075, 0x1390007b, 0x1390007c, 0x1390007f,
|
0x13900076, 0x1390007c, 0x1390007d, 0x13900080,
|
||||||
0x13900080, 0x13900081, 0x13900083, 0x1390008a,
|
0x13900081, 0x13900082, 0x13900084, 0x1390008b,
|
||||||
0x1390008c, 0x1390008d, 0x13900096, 0x13900097,
|
0x1390008d, 0x1390008e, 0x13900097, 0x13900098,
|
||||||
0x13900098, 0x13900099, 0x1390009a, 0x1390009f,
|
0x13900099, 0x1390009a, 0x1390009b, 0x139000a0,
|
||||||
0x139000a0, 0x139000a4, 0x139000a7, 0x139000a9,
|
0x139000a1, 0x139000a5, 0x139000a8, 0x139000aa,
|
||||||
0x139000ad, 0x139000b1, 0x139000b4, 0x139000b5,
|
0x139000ae, 0x139000b2, 0x139000b5, 0x139000b6,
|
||||||
0x139000bf, 0x139000c0, 0x139000c6, 0x139000c7,
|
0x139000c0, 0x139000c1, 0x139000c7, 0x139000c8,
|
||||||
// Entry C0 - DF
|
// Entry C0 - DF
|
||||||
0x139000ca, 0x139000cb, 0x139000cc, 0x139000ce,
|
0x139000cb, 0x139000cc, 0x139000cd, 0x139000cf,
|
||||||
0x139000d0, 0x139000d2, 0x139000d5, 0x139000d6,
|
0x139000d1, 0x139000d3, 0x139000d6, 0x139000d7,
|
||||||
0x139000d9, 0x139000dd, 0x139000df, 0x139000e0,
|
0x139000da, 0x139000de, 0x139000e0, 0x139000e1,
|
||||||
0x139000e6, 0x139000e7, 0x139000e8, 0x139000eb,
|
0x139000e7, 0x139000e8, 0x139000e9, 0x139000ec,
|
||||||
0x139000ec, 0x139000f0, 0x13900107, 0x13900109,
|
0x139000ed, 0x139000f1, 0x13900108, 0x1390010a,
|
||||||
0x1390010a, 0x1390010b, 0x1390010c, 0x1390010d,
|
0x1390010b, 0x1390010c, 0x1390010d, 0x1390010e,
|
||||||
0x1390010e, 0x1390010f, 0x13900112, 0x13900117,
|
0x1390010f, 0x13900110, 0x13900113, 0x13900118,
|
||||||
0x1390011b, 0x1390011d, 0x1390011f, 0x13900125,
|
0x1390011c, 0x1390011e, 0x13900120, 0x13900126,
|
||||||
// Entry E0 - FF
|
// Entry E0 - FF
|
||||||
0x13900129, 0x1390012c, 0x1390012d, 0x1390012f,
|
0x1390012a, 0x1390012d, 0x1390012e, 0x13900130,
|
||||||
0x13900131, 0x13900133, 0x13900135, 0x13900139,
|
0x13900132, 0x13900134, 0x13900136, 0x1390013a,
|
||||||
0x1390013c, 0x1390013d, 0x1390013f, 0x13900142,
|
0x1390013d, 0x1390013e, 0x13900140, 0x13900143,
|
||||||
0x13900161, 0x13900162, 0x13900164, 0x13c00000,
|
0x13900162, 0x13900163, 0x13900165, 0x13c00000,
|
||||||
0x13c00001, 0x13e00000, 0x13e0001f, 0x13e0002c,
|
0x13c00001, 0x13e00000, 0x13e0001f, 0x13e0002c,
|
||||||
0x13e0003f, 0x13e00041, 0x13e00048, 0x13e00051,
|
0x13e0003f, 0x13e00041, 0x13e00048, 0x13e00051,
|
||||||
0x13e00054, 0x13e00056, 0x13e00059, 0x13e00065,
|
0x13e00054, 0x13e00057, 0x13e0005a, 0x13e00066,
|
||||||
0x13e00068, 0x13e00069, 0x13e0006e, 0x13e00086,
|
0x13e00069, 0x13e0006a, 0x13e0006f, 0x13e00087,
|
||||||
// Entry 100 - 11F
|
// Entry 100 - 11F
|
||||||
0x13e00089, 0x13e0008f, 0x13e00094, 0x13e000cf,
|
0x13e0008a, 0x13e00090, 0x13e00095, 0x13e000d0,
|
||||||
0x13e000d8, 0x13e000e2, 0x13e000e4, 0x13e000e7,
|
0x13e000d9, 0x13e000e3, 0x13e000e5, 0x13e000e8,
|
||||||
0x13e000ec, 0x13e000f1, 0x13e0011a, 0x13e00135,
|
0x13e000ed, 0x13e000f2, 0x13e0011b, 0x13e00136,
|
||||||
0x13e00136, 0x13e0013b, 0x14000000, 0x1400006a,
|
0x13e00137, 0x13e0013c, 0x14000000, 0x1400006b,
|
||||||
0x14500000, 0x1450006e, 0x14600000, 0x14600052,
|
0x14500000, 0x1450006f, 0x14600000, 0x14600052,
|
||||||
0x14800000, 0x14800024, 0x1480009c, 0x14e00000,
|
0x14800000, 0x14800024, 0x1480009d, 0x14e00000,
|
||||||
0x14e00052, 0x14e00084, 0x14e000c9, 0x14e00114,
|
0x14e00052, 0x14e00085, 0x14e000ca, 0x14e00115,
|
||||||
0x15100000, 0x15100072, 0x15300000, 0x153000e7,
|
0x15100000, 0x15100073, 0x15300000, 0x153000e8,
|
||||||
// Entry 120 - 13F
|
// Entry 120 - 13F
|
||||||
0x15800000, 0x15800063, 0x15800076, 0x15e00000,
|
0x15800000, 0x15800064, 0x15800077, 0x15e00000,
|
||||||
0x15e00036, 0x15e00037, 0x15e0003a, 0x15e0003b,
|
0x15e00036, 0x15e00037, 0x15e0003a, 0x15e0003b,
|
||||||
0x15e0003c, 0x15e00049, 0x15e0004b, 0x15e0004c,
|
0x15e0003c, 0x15e00049, 0x15e0004b, 0x15e0004c,
|
||||||
0x15e0004d, 0x15e0004e, 0x15e0004f, 0x15e00052,
|
0x15e0004d, 0x15e0004e, 0x15e0004f, 0x15e00052,
|
||||||
0x15e00062, 0x15e00067, 0x15e00078, 0x15e0007a,
|
0x15e00063, 0x15e00068, 0x15e00079, 0x15e0007b,
|
||||||
0x15e0007e, 0x15e00084, 0x15e00085, 0x15e00086,
|
0x15e0007f, 0x15e00085, 0x15e00086, 0x15e00087,
|
||||||
0x15e00091, 0x15e000a8, 0x15e000b7, 0x15e000ba,
|
0x15e00092, 0x15e000a9, 0x15e000b8, 0x15e000bb,
|
||||||
0x15e000bb, 0x15e000be, 0x15e000bf, 0x15e000c3,
|
0x15e000bc, 0x15e000bf, 0x15e000c0, 0x15e000c4,
|
||||||
// Entry 140 - 15F
|
// Entry 140 - 15F
|
||||||
0x15e000c8, 0x15e000c9, 0x15e000cc, 0x15e000d3,
|
0x15e000c9, 0x15e000ca, 0x15e000cd, 0x15e000d4,
|
||||||
0x15e000d4, 0x15e000e5, 0x15e000ea, 0x15e00102,
|
0x15e000d5, 0x15e000e6, 0x15e000eb, 0x15e00103,
|
||||||
0x15e00107, 0x15e0010a, 0x15e00114, 0x15e0011c,
|
0x15e00108, 0x15e0010b, 0x15e00115, 0x15e0011d,
|
||||||
0x15e00120, 0x15e00122, 0x15e00128, 0x15e0013f,
|
0x15e00121, 0x15e00123, 0x15e00129, 0x15e00140,
|
||||||
0x15e00140, 0x15e0015f, 0x16900000, 0x1690009e,
|
0x15e00141, 0x15e00160, 0x16900000, 0x1690009f,
|
||||||
0x16d00000, 0x16d000d9, 0x16e00000, 0x16e00096,
|
0x16d00000, 0x16d000da, 0x16e00000, 0x16e00097,
|
||||||
0x17e00000, 0x17e0007b, 0x19000000, 0x1900006e,
|
0x17e00000, 0x17e0007c, 0x19000000, 0x1900006f,
|
||||||
0x1a300000, 0x1a30004e, 0x1a300078, 0x1a3000b2,
|
0x1a300000, 0x1a30004e, 0x1a300079, 0x1a3000b3,
|
||||||
// Entry 160 - 17F
|
// Entry 160 - 17F
|
||||||
0x1a400000, 0x1a400099, 0x1a900000, 0x1ab00000,
|
0x1a400000, 0x1a40009a, 0x1a900000, 0x1ab00000,
|
||||||
0x1ab000a4, 0x1ac00000, 0x1ac00098, 0x1b400000,
|
0x1ab000a5, 0x1ac00000, 0x1ac00099, 0x1b400000,
|
||||||
0x1b400080, 0x1b4000d4, 0x1b4000d6, 0x1b800000,
|
0x1b400081, 0x1b4000d5, 0x1b4000d7, 0x1b800000,
|
||||||
0x1b800135, 0x1bc00000, 0x1bc00097, 0x1be00000,
|
0x1b800136, 0x1bc00000, 0x1bc00098, 0x1be00000,
|
||||||
0x1be00099, 0x1d100000, 0x1d100033, 0x1d100090,
|
0x1be0009a, 0x1d100000, 0x1d100033, 0x1d100091,
|
||||||
0x1d200000, 0x1d200060, 0x1d500000, 0x1d500092,
|
0x1d200000, 0x1d200061, 0x1d500000, 0x1d500093,
|
||||||
0x1d700000, 0x1d700028, 0x1e100000, 0x1e100095,
|
0x1d700000, 0x1d700028, 0x1e100000, 0x1e100096,
|
||||||
0x1e700000, 0x1e7000d6, 0x1ea00000, 0x1ea00053,
|
0x1e700000, 0x1e7000d7, 0x1ea00000, 0x1ea00053,
|
||||||
// Entry 180 - 19F
|
// Entry 180 - 19F
|
||||||
0x1f300000, 0x1f500000, 0x1f800000, 0x1f80009d,
|
0x1f300000, 0x1f500000, 0x1f800000, 0x1f80009e,
|
||||||
0x1f900000, 0x1f90004e, 0x1f90009e, 0x1f900113,
|
0x1f900000, 0x1f90004e, 0x1f90009f, 0x1f900114,
|
||||||
0x1f900138, 0x1fa00000, 0x1fb00000, 0x20000000,
|
0x1f900139, 0x1fa00000, 0x1fb00000, 0x20000000,
|
||||||
0x200000a2, 0x20300000, 0x20700000, 0x20700052,
|
0x200000a3, 0x20300000, 0x20700000, 0x20700052,
|
||||||
0x20800000, 0x20a00000, 0x20a0012f, 0x20e00000,
|
0x20800000, 0x20a00000, 0x20a00130, 0x20e00000,
|
||||||
0x20f00000, 0x21000000, 0x2100007d, 0x21200000,
|
0x20f00000, 0x21000000, 0x2100007e, 0x21200000,
|
||||||
0x21200067, 0x21600000, 0x21700000, 0x217000a4,
|
0x21200068, 0x21600000, 0x21700000, 0x217000a5,
|
||||||
0x21f00000, 0x22300000, 0x2230012f, 0x22700000,
|
0x21f00000, 0x22300000, 0x22300130, 0x22700000,
|
||||||
// Entry 1A0 - 1BF
|
// Entry 1A0 - 1BF
|
||||||
0x2270005a, 0x23400000, 0x234000c3, 0x23900000,
|
0x2270005b, 0x23400000, 0x234000c4, 0x23900000,
|
||||||
0x239000a4, 0x24200000, 0x242000ae, 0x24400000,
|
0x239000a5, 0x24200000, 0x242000af, 0x24400000,
|
||||||
0x24400052, 0x24500000, 0x24500082, 0x24600000,
|
0x24400052, 0x24500000, 0x24500083, 0x24600000,
|
||||||
0x246000a4, 0x24a00000, 0x24a000a6, 0x25100000,
|
0x246000a5, 0x24a00000, 0x24a000a7, 0x25100000,
|
||||||
0x25100099, 0x25400000, 0x254000aa, 0x254000ab,
|
0x2510009a, 0x25400000, 0x254000ab, 0x254000ac,
|
||||||
0x25600000, 0x25600099, 0x26a00000, 0x26a00099,
|
0x25600000, 0x2560009a, 0x26a00000, 0x26a0009a,
|
||||||
0x26b00000, 0x26b0012f, 0x26d00000, 0x26d00052,
|
0x26b00000, 0x26b00130, 0x26d00000, 0x26d00052,
|
||||||
0x26e00000, 0x26e00060, 0x27400000, 0x28100000,
|
0x26e00000, 0x26e00061, 0x27400000, 0x28100000,
|
||||||
// Entry 1C0 - 1DF
|
// Entry 1C0 - 1DF
|
||||||
0x2810007b, 0x28a00000, 0x28a000a5, 0x29100000,
|
0x2810007c, 0x28a00000, 0x28a000a6, 0x29100000,
|
||||||
0x2910012f, 0x29500000, 0x295000b7, 0x2a300000,
|
0x29100130, 0x29500000, 0x295000b8, 0x2a300000,
|
||||||
0x2a300131, 0x2af00000, 0x2af00135, 0x2b500000,
|
0x2a300132, 0x2af00000, 0x2af00136, 0x2b500000,
|
||||||
0x2b50002a, 0x2b50004b, 0x2b50004c, 0x2b50004d,
|
0x2b50002a, 0x2b50004b, 0x2b50004c, 0x2b50004d,
|
||||||
0x2b800000, 0x2b8000af, 0x2bf00000, 0x2bf0009b,
|
0x2b800000, 0x2b8000b0, 0x2bf00000, 0x2bf0009c,
|
||||||
0x2bf0009c, 0x2c000000, 0x2c0000b6, 0x2c200000,
|
0x2bf0009d, 0x2c000000, 0x2c0000b7, 0x2c200000,
|
||||||
0x2c20004b, 0x2c400000, 0x2c4000a4, 0x2c500000,
|
0x2c20004b, 0x2c400000, 0x2c4000a5, 0x2c500000,
|
||||||
0x2c5000a4, 0x2c700000, 0x2c7000b8, 0x2d100000,
|
0x2c5000a5, 0x2c700000, 0x2c7000b9, 0x2d100000,
|
||||||
// Entry 1E0 - 1FF
|
// Entry 1E0 - 1FF
|
||||||
0x2d1000a4, 0x2d10012f, 0x2e900000, 0x2e9000a4,
|
0x2d1000a5, 0x2d100130, 0x2e900000, 0x2e9000a5,
|
||||||
0x2ed00000, 0x2ed000cc, 0x2f100000, 0x2f1000bf,
|
0x2ed00000, 0x2ed000cd, 0x2f100000, 0x2f1000c0,
|
||||||
0x2f200000, 0x2f2000d1, 0x2f400000, 0x2f400052,
|
0x2f200000, 0x2f2000d2, 0x2f400000, 0x2f400052,
|
||||||
0x2ff00000, 0x2ff000c2, 0x30400000, 0x30400099,
|
0x2ff00000, 0x2ff000c3, 0x30400000, 0x3040009a,
|
||||||
0x30b00000, 0x30b000c5, 0x31000000, 0x31b00000,
|
0x30b00000, 0x30b000c6, 0x31000000, 0x31b00000,
|
||||||
0x31b00099, 0x31f00000, 0x31f0003e, 0x31f000d0,
|
0x31b0009a, 0x31f00000, 0x31f0003e, 0x31f000d1,
|
||||||
0x31f0010d, 0x32000000, 0x320000cb, 0x32500000,
|
0x31f0010e, 0x32000000, 0x320000cc, 0x32500000,
|
||||||
0x32500052, 0x33100000, 0x331000c4, 0x33a00000,
|
0x32500052, 0x33100000, 0x331000c5, 0x33a00000,
|
||||||
// Entry 200 - 21F
|
// Entry 200 - 21F
|
||||||
0x33a0009c, 0x34100000, 0x34500000, 0x345000d2,
|
0x33a0009d, 0x34100000, 0x34500000, 0x345000d3,
|
||||||
0x34700000, 0x347000da, 0x34700110, 0x34e00000,
|
0x34700000, 0x347000db, 0x34700111, 0x34e00000,
|
||||||
0x34e00164, 0x35000000, 0x35000060, 0x350000d9,
|
0x34e00165, 0x35000000, 0x35000061, 0x350000da,
|
||||||
0x35100000, 0x35100099, 0x351000db, 0x36700000,
|
0x35100000, 0x3510009a, 0x351000dc, 0x36700000,
|
||||||
0x36700030, 0x36700036, 0x36700040, 0x3670005b,
|
0x36700030, 0x36700036, 0x36700040, 0x3670005c,
|
||||||
0x367000d9, 0x36700116, 0x3670011b, 0x36800000,
|
0x367000da, 0x36700117, 0x3670011c, 0x36800000,
|
||||||
0x36800052, 0x36a00000, 0x36a000da, 0x36c00000,
|
0x36800052, 0x36a00000, 0x36a000db, 0x36c00000,
|
||||||
0x36c00052, 0x36f00000, 0x37500000, 0x37600000,
|
0x36c00052, 0x36f00000, 0x37500000, 0x37600000,
|
||||||
// Entry 220 - 23F
|
// Entry 220 - 23F
|
||||||
0x37a00000, 0x38000000, 0x38000117, 0x38700000,
|
0x37a00000, 0x38000000, 0x38000118, 0x38700000,
|
||||||
0x38900000, 0x38900131, 0x39000000, 0x3900006f,
|
0x38900000, 0x38900132, 0x39000000, 0x39000070,
|
||||||
0x390000a4, 0x39500000, 0x39500099, 0x39800000,
|
0x390000a5, 0x39500000, 0x3950009a, 0x39800000,
|
||||||
0x3980007d, 0x39800106, 0x39d00000, 0x39d05000,
|
0x3980007e, 0x39800107, 0x39d00000, 0x39d05000,
|
||||||
0x39d050e8, 0x39d36000, 0x39d36099, 0x3a100000,
|
0x39d050e9, 0x39d36000, 0x39d3609a, 0x3a100000,
|
||||||
0x3b300000, 0x3b3000e9, 0x3bd00000, 0x3bd00001,
|
0x3b300000, 0x3b3000ea, 0x3bd00000, 0x3bd00001,
|
||||||
0x3be00000, 0x3be00024, 0x3c000000, 0x3c00002a,
|
0x3be00000, 0x3be00024, 0x3c000000, 0x3c00002a,
|
||||||
0x3c000041, 0x3c00004e, 0x3c00005a, 0x3c000086,
|
0x3c000041, 0x3c00004e, 0x3c00005b, 0x3c000087,
|
||||||
// Entry 240 - 25F
|
// Entry 240 - 25F
|
||||||
0x3c00008b, 0x3c0000b7, 0x3c0000c6, 0x3c0000d1,
|
0x3c00008c, 0x3c0000b8, 0x3c0000c7, 0x3c0000d2,
|
||||||
0x3c0000ee, 0x3c000118, 0x3c000126, 0x3c400000,
|
0x3c0000ef, 0x3c000119, 0x3c000127, 0x3c400000,
|
||||||
0x3c40003f, 0x3c400069, 0x3c4000e4, 0x3d400000,
|
0x3c40003f, 0x3c40006a, 0x3c4000e5, 0x3d400000,
|
||||||
0x3d40004e, 0x3d900000, 0x3d90003a, 0x3dc00000,
|
0x3d40004e, 0x3d900000, 0x3d90003a, 0x3dc00000,
|
||||||
0x3dc000bc, 0x3dc00104, 0x3de00000, 0x3de0012f,
|
0x3dc000bd, 0x3dc00105, 0x3de00000, 0x3de00130,
|
||||||
0x3e200000, 0x3e200047, 0x3e2000a5, 0x3e2000ae,
|
0x3e200000, 0x3e200047, 0x3e2000a6, 0x3e2000af,
|
||||||
0x3e2000bc, 0x3e200106, 0x3e200130, 0x3e500000,
|
0x3e2000bd, 0x3e200107, 0x3e200131, 0x3e500000,
|
||||||
0x3e500107, 0x3e600000, 0x3e60012f, 0x3eb00000,
|
0x3e500108, 0x3e600000, 0x3e600130, 0x3eb00000,
|
||||||
// Entry 260 - 27F
|
// Entry 260 - 27F
|
||||||
0x3eb00106, 0x3ec00000, 0x3ec000a4, 0x3f300000,
|
0x3eb00107, 0x3ec00000, 0x3ec000a5, 0x3f300000,
|
||||||
0x3f30012f, 0x3fa00000, 0x3fa000e8, 0x3fc00000,
|
0x3f300130, 0x3fa00000, 0x3fa000e9, 0x3fc00000,
|
||||||
0x3fd00000, 0x3fd00072, 0x3fd000da, 0x3fd0010c,
|
0x3fd00000, 0x3fd00073, 0x3fd000db, 0x3fd0010d,
|
||||||
0x3ff00000, 0x3ff000d1, 0x40100000, 0x401000c3,
|
0x3ff00000, 0x3ff000d2, 0x40100000, 0x401000c4,
|
||||||
0x40200000, 0x4020004c, 0x40700000, 0x40800000,
|
0x40200000, 0x4020004c, 0x40700000, 0x40800000,
|
||||||
0x4085a000, 0x4085a0ba, 0x408e8000, 0x408e80ba,
|
0x4085b000, 0x4085b0bb, 0x408eb000, 0x408eb0bb,
|
||||||
0x40c00000, 0x40c000b3, 0x41200000, 0x41200111,
|
0x40c00000, 0x40c000b4, 0x41200000, 0x41200112,
|
||||||
0x41600000, 0x4160010f, 0x41c00000, 0x41d00000,
|
0x41600000, 0x41600110, 0x41c00000, 0x41d00000,
|
||||||
// Entry 280 - 29F
|
// Entry 280 - 29F
|
||||||
0x41e00000, 0x41f00000, 0x41f00072, 0x42200000,
|
0x41e00000, 0x41f00000, 0x41f00073, 0x42200000,
|
||||||
0x42300000, 0x42300164, 0x42900000, 0x42900062,
|
0x42300000, 0x42300165, 0x42900000, 0x42900063,
|
||||||
0x4290006f, 0x429000a4, 0x42900115, 0x43100000,
|
0x42900070, 0x429000a5, 0x42900116, 0x43100000,
|
||||||
0x43100027, 0x431000c2, 0x4310014d, 0x43200000,
|
0x43100027, 0x431000c3, 0x4310014e, 0x43200000,
|
||||||
0x43220000, 0x43220033, 0x432200bd, 0x43220105,
|
0x43220000, 0x43220033, 0x432200be, 0x43220106,
|
||||||
0x4322014d, 0x4325a000, 0x4325a033, 0x4325a0bd,
|
0x4322014e, 0x4325b000, 0x4325b033, 0x4325b0be,
|
||||||
0x4325a105, 0x4325a14d, 0x43700000, 0x43a00000,
|
0x4325b106, 0x4325b14e, 0x43700000, 0x43a00000,
|
||||||
0x43b00000, 0x44400000, 0x44400031, 0x44400072,
|
0x43b00000, 0x44400000, 0x44400031, 0x44400073,
|
||||||
// Entry 2A0 - 2BF
|
// Entry 2A0 - 2BF
|
||||||
0x4440010c, 0x44500000, 0x4450004b, 0x445000a4,
|
0x4440010d, 0x44500000, 0x4450004b, 0x445000a5,
|
||||||
0x4450012f, 0x44500131, 0x44e00000, 0x45000000,
|
0x44500130, 0x44500132, 0x44e00000, 0x45000000,
|
||||||
0x45000099, 0x450000b3, 0x450000d0, 0x4500010d,
|
0x4500009a, 0x450000b4, 0x450000d1, 0x4500010e,
|
||||||
0x46100000, 0x46100099, 0x46400000, 0x464000a4,
|
0x46100000, 0x4610009a, 0x46400000, 0x464000a5,
|
||||||
0x46400131, 0x46700000, 0x46700124, 0x46b00000,
|
0x46400132, 0x46700000, 0x46700125, 0x46b00000,
|
||||||
0x46b00123, 0x46f00000, 0x46f0006d, 0x46f0006f,
|
0x46b00124, 0x46f00000, 0x46f0006e, 0x46f00070,
|
||||||
0x47100000, 0x47600000, 0x47600127, 0x47a00000,
|
0x47100000, 0x47600000, 0x47600128, 0x47a00000,
|
||||||
0x48000000, 0x48200000, 0x48200129, 0x48a00000,
|
0x48000000, 0x48200000, 0x4820012a, 0x48a00000,
|
||||||
// Entry 2C0 - 2DF
|
// Entry 2C0 - 2DF
|
||||||
0x48a0005d, 0x48a0012b, 0x48e00000, 0x49400000,
|
0x48a0005e, 0x48a0012c, 0x48e00000, 0x49400000,
|
||||||
0x49400106, 0x4a400000, 0x4a4000d4, 0x4a900000,
|
0x49400107, 0x4a400000, 0x4a4000d5, 0x4a900000,
|
||||||
0x4a9000ba, 0x4ac00000, 0x4ac00053, 0x4ae00000,
|
0x4a9000bb, 0x4ac00000, 0x4ac00053, 0x4ae00000,
|
||||||
0x4ae00130, 0x4b400000, 0x4b400099, 0x4b4000e8,
|
0x4ae00131, 0x4b400000, 0x4b40009a, 0x4b4000e9,
|
||||||
0x4bc00000, 0x4bc05000, 0x4bc05024, 0x4bc20000,
|
0x4bc00000, 0x4bc05000, 0x4bc05024, 0x4bc20000,
|
||||||
0x4bc20137, 0x4bc5a000, 0x4bc5a137, 0x4be00000,
|
0x4bc20138, 0x4bc5b000, 0x4bc5b138, 0x4be00000,
|
||||||
0x4be5a000, 0x4be5a0b4, 0x4bef1000, 0x4bef10b4,
|
0x4be5b000, 0x4be5b0b5, 0x4bef4000, 0x4bef40b5,
|
||||||
0x4c000000, 0x4c300000, 0x4c30013e, 0x4c900000,
|
0x4c000000, 0x4c300000, 0x4c30013f, 0x4c900000,
|
||||||
// Entry 2E0 - 2FF
|
// Entry 2E0 - 2FF
|
||||||
0x4c900001, 0x4cc00000, 0x4cc0012f, 0x4ce00000,
|
0x4c900001, 0x4cc00000, 0x4cc00130, 0x4ce00000,
|
||||||
0x4cf00000, 0x4cf0004e, 0x4e500000, 0x4e500114,
|
0x4cf00000, 0x4cf0004e, 0x4e500000, 0x4e500115,
|
||||||
0x4f200000, 0x4fb00000, 0x4fb00131, 0x50900000,
|
0x4f200000, 0x4fb00000, 0x4fb00132, 0x50900000,
|
||||||
0x50900052, 0x51200000, 0x51200001, 0x51800000,
|
0x50900052, 0x51200000, 0x51200001, 0x51800000,
|
||||||
0x5180003b, 0x518000d6, 0x51f00000, 0x51f3b000,
|
0x5180003b, 0x518000d7, 0x51f00000, 0x51f3b000,
|
||||||
0x51f3b053, 0x51f3c000, 0x51f3c08d, 0x52800000,
|
0x51f3b053, 0x51f3c000, 0x51f3c08e, 0x52800000,
|
||||||
0x528000ba, 0x52900000, 0x5293b000, 0x5293b053,
|
0x528000bb, 0x52900000, 0x5293b000, 0x5293b053,
|
||||||
0x5293b08d, 0x5293b0c6, 0x5293b10d, 0x5293c000,
|
0x5293b08e, 0x5293b0c7, 0x5293b10e, 0x5293c000,
|
||||||
// Entry 300 - 31F
|
// Entry 300 - 31F
|
||||||
0x5293c08d, 0x5293c0c6, 0x5293c12e, 0x52f00000,
|
0x5293c08e, 0x5293c0c7, 0x5293c12f, 0x52f00000,
|
||||||
0x52f00161,
|
0x52f00162,
|
||||||
} // Size: 3116 bytes
|
} // Size: 3116 bytes
|
||||||
|
|
||||||
const specialTagsStr string = "ca-ES-valencia en-US-u-va-posix"
|
const specialTagsStr string = "ca-ES-valencia en-US-u-va-posix"
|
||||||
|
|
||||||
// Total table size 3147 bytes (3KiB); checksum: 6772C83C
|
// Total table size 3147 bytes (3KiB); checksum: 5A8FFFA5
|
||||||
|
|
2
vendor/golang.org/x/text/internal/language/language.go
generated
vendored
2
vendor/golang.org/x/text/internal/language/language.go
generated
vendored
|
@ -409,7 +409,7 @@ func (t Tag) SetTypeForKey(key, value string) (Tag, error) {
|
||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// findKeyAndType returns the start and end position for the type corresponding
|
// findTypeForKey returns the start and end position for the type corresponding
|
||||||
// to key or the point at which to insert the key-value pair if the type
|
// to key or the point at which to insert the key-value pair if the type
|
||||||
// wasn't found. The hasExt return value reports whether an -u extension was present.
|
// wasn't found. The hasExt return value reports whether an -u extension was present.
|
||||||
// Note: the extensions are typically very small and are likely to contain
|
// Note: the extensions are typically very small and are likely to contain
|
||||||
|
|
4682
vendor/golang.org/x/text/internal/language/tables.go
generated
vendored
4682
vendor/golang.org/x/text/internal/language/tables.go
generated
vendored
File diff suppressed because it is too large
Load diff
2
vendor/golang.org/x/text/internal/number/decimal.go
generated
vendored
2
vendor/golang.org/x/text/internal/number/decimal.go
generated
vendored
|
@ -419,7 +419,7 @@ func (d *Decimal) ConvertFloat(r RoundingContext, x float64, size int) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: At this point strconv's rounding is imprecise to the point that
|
// TODO: At this point strconv's rounding is imprecise to the point that
|
||||||
// it is not useable for this purpose.
|
// it is not usable for this purpose.
|
||||||
// See https://github.com/golang/go/issues/21714
|
// See https://github.com/golang/go/issues/21714
|
||||||
// If rounding is requested, we ask for a large number of digits and
|
// If rounding is requested, we ask for a large number of digits and
|
||||||
// round from there to simulate rounding only once.
|
// round from there to simulate rounding only once.
|
||||||
|
|
2
vendor/golang.org/x/text/internal/number/tables.go
generated
vendored
2
vendor/golang.org/x/text/internal/number/tables.go
generated
vendored
|
@ -1216,4 +1216,4 @@ var formats = []Pattern{Pattern{RoundingContext: RoundingContext{MaxSignificantD
|
||||||
0x0},
|
0x0},
|
||||||
Flags: 0x0}}
|
Flags: 0x0}}
|
||||||
|
|
||||||
// Total table size 8634 bytes (8KiB); checksum: BE6D4A33
|
// Total table size 8634 bytes (8KiB); checksum: 8F23386D
|
||||||
|
|
2
vendor/golang.org/x/text/language/language.go
generated
vendored
2
vendor/golang.org/x/text/language/language.go
generated
vendored
|
@ -344,7 +344,7 @@ func (t Tag) Parent() Tag {
|
||||||
return Tag(compact.Tag(t).Parent())
|
return Tag(compact.Tag(t).Parent())
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns token t and the rest of the string.
|
// nextToken returns token t and the rest of the string.
|
||||||
func nextToken(s string) (t, tail string) {
|
func nextToken(s string) (t, tail string) {
|
||||||
p := strings.Index(s[1:], "-")
|
p := strings.Index(s[1:], "-")
|
||||||
if p == -1 {
|
if p == -1 {
|
||||||
|
|
2
vendor/golang.org/x/text/language/match.go
generated
vendored
2
vendor/golang.org/x/text/language/match.go
generated
vendored
|
@ -434,7 +434,7 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher {
|
||||||
// (their canonicalization simply substitutes a different language code, but
|
// (their canonicalization simply substitutes a different language code, but
|
||||||
// nothing else), the match confidence is Exact, otherwise it is High.
|
// nothing else), the match confidence is Exact, otherwise it is High.
|
||||||
for i, lm := range language.AliasMap {
|
for i, lm := range language.AliasMap {
|
||||||
// If deprecated codes match and there is no fiddling with the script or
|
// If deprecated codes match and there is no fiddling with the script
|
||||||
// or region, we consider it an exact match.
|
// or region, we consider it an exact match.
|
||||||
conf := Exact
|
conf := Exact
|
||||||
if language.AliasTypes[i] != language.Macro {
|
if language.AliasTypes[i] != language.Macro {
|
||||||
|
|
146
vendor/golang.org/x/text/language/tables.go
generated
vendored
146
vendor/golang.org/x/text/language/tables.go
generated
vendored
|
@ -23,31 +23,31 @@ const (
|
||||||
_419 = 31
|
_419 = 31
|
||||||
_BR = 65
|
_BR = 65
|
||||||
_CA = 73
|
_CA = 73
|
||||||
_ES = 110
|
_ES = 111
|
||||||
_GB = 123
|
_GB = 124
|
||||||
_MD = 188
|
_MD = 189
|
||||||
_PT = 238
|
_PT = 239
|
||||||
_UK = 306
|
_UK = 307
|
||||||
_US = 309
|
_US = 310
|
||||||
_ZZ = 357
|
_ZZ = 358
|
||||||
_XA = 323
|
_XA = 324
|
||||||
_XC = 325
|
_XC = 326
|
||||||
_XK = 333
|
_XK = 334
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
_Latn = 90
|
_Latn = 91
|
||||||
_Hani = 57
|
_Hani = 57
|
||||||
_Hans = 59
|
_Hans = 59
|
||||||
_Hant = 60
|
_Hant = 60
|
||||||
_Qaaa = 147
|
_Qaaa = 149
|
||||||
_Qaai = 155
|
_Qaai = 157
|
||||||
_Qabx = 196
|
_Qabx = 198
|
||||||
_Zinh = 252
|
_Zinh = 255
|
||||||
_Zyyy = 257
|
_Zyyy = 260
|
||||||
_Zzzz = 258
|
_Zzzz = 261
|
||||||
)
|
)
|
||||||
|
|
||||||
var regionToGroups = []uint8{ // 358 elements
|
var regionToGroups = []uint8{ // 359 elements
|
||||||
// Entry 0 - 3F
|
// Entry 0 - 3F
|
||||||
0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04,
|
0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00,
|
||||||
|
@ -60,51 +60,51 @@ var regionToGroups = []uint8{ // 358 elements
|
||||||
// Entry 40 - 7F
|
// Entry 40 - 7F
|
||||||
0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
|
0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04,
|
||||||
0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x08,
|
|
||||||
0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
|
|
||||||
// Entry 80 - BF
|
|
||||||
0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00, 0x04,
|
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00,
|
|
||||||
// Entry C0 - FF
|
|
||||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
|
|
||||||
0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00,
|
||||||
|
0x08, 0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04,
|
||||||
|
// Entry 80 - BF
|
||||||
|
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00,
|
||||||
|
0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00,
|
||||||
|
0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||||
|
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04,
|
||||||
|
// Entry C0 - FF
|
||||||
|
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
|
||||||
|
0x01, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
// Entry 100 - 13F
|
// Entry 100 - 13F
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
|
||||||
0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04,
|
0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04,
|
||||||
0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00, 0x00,
|
0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00,
|
||||||
// Entry 140 - 17F
|
// Entry 140 - 17F
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
} // Size: 382 bytes
|
} // Size: 383 bytes
|
||||||
|
|
||||||
var paradigmLocales = [][3]uint16{ // 3 elements
|
var paradigmLocales = [][3]uint16{ // 3 elements
|
||||||
0: [3]uint16{0x139, 0x0, 0x7b},
|
0: [3]uint16{0x139, 0x0, 0x7c},
|
||||||
1: [3]uint16{0x13e, 0x0, 0x1f},
|
1: [3]uint16{0x13e, 0x0, 0x1f},
|
||||||
2: [3]uint16{0x3c0, 0x41, 0xee},
|
2: [3]uint16{0x3c0, 0x41, 0xef},
|
||||||
} // Size: 42 bytes
|
} // Size: 42 bytes
|
||||||
|
|
||||||
type mutualIntelligibility struct {
|
type mutualIntelligibility struct {
|
||||||
|
@ -249,30 +249,30 @@ var matchLang = []mutualIntelligibility{ // 113 elements
|
||||||
// matchScript holds pairs of scriptIDs where readers of one script
|
// matchScript holds pairs of scriptIDs where readers of one script
|
||||||
// can typically also read the other. Each is associated with a confidence.
|
// can typically also read the other. Each is associated with a confidence.
|
||||||
var matchScript = []scriptIntelligibility{ // 26 elements
|
var matchScript = []scriptIntelligibility{ // 26 elements
|
||||||
0: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x5a, haveScript: 0x20, distance: 0x5},
|
0: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x5b, haveScript: 0x20, distance: 0x5},
|
||||||
1: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x20, haveScript: 0x5a, distance: 0x5},
|
1: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x20, haveScript: 0x5b, distance: 0x5},
|
||||||
2: {wantLang: 0x58, haveLang: 0x3e2, wantScript: 0x5a, haveScript: 0x20, distance: 0xa},
|
2: {wantLang: 0x58, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa},
|
||||||
3: {wantLang: 0xa5, haveLang: 0x139, wantScript: 0xe, haveScript: 0x5a, distance: 0xa},
|
3: {wantLang: 0xa5, haveLang: 0x139, wantScript: 0xe, haveScript: 0x5b, distance: 0xa},
|
||||||
4: {wantLang: 0x1d7, haveLang: 0x3e2, wantScript: 0x8, haveScript: 0x20, distance: 0xa},
|
4: {wantLang: 0x1d7, haveLang: 0x3e2, wantScript: 0x8, haveScript: 0x20, distance: 0xa},
|
||||||
5: {wantLang: 0x210, haveLang: 0x139, wantScript: 0x2e, haveScript: 0x5a, distance: 0xa},
|
5: {wantLang: 0x210, haveLang: 0x139, wantScript: 0x2e, haveScript: 0x5b, distance: 0xa},
|
||||||
6: {wantLang: 0x24a, haveLang: 0x139, wantScript: 0x4e, haveScript: 0x5a, distance: 0xa},
|
6: {wantLang: 0x24a, haveLang: 0x139, wantScript: 0x4f, haveScript: 0x5b, distance: 0xa},
|
||||||
7: {wantLang: 0x251, haveLang: 0x139, wantScript: 0x52, haveScript: 0x5a, distance: 0xa},
|
7: {wantLang: 0x251, haveLang: 0x139, wantScript: 0x53, haveScript: 0x5b, distance: 0xa},
|
||||||
8: {wantLang: 0x2b8, haveLang: 0x139, wantScript: 0x57, haveScript: 0x5a, distance: 0xa},
|
8: {wantLang: 0x2b8, haveLang: 0x139, wantScript: 0x58, haveScript: 0x5b, distance: 0xa},
|
||||||
9: {wantLang: 0x304, haveLang: 0x139, wantScript: 0x6e, haveScript: 0x5a, distance: 0xa},
|
9: {wantLang: 0x304, haveLang: 0x139, wantScript: 0x6f, haveScript: 0x5b, distance: 0xa},
|
||||||
10: {wantLang: 0x331, haveLang: 0x139, wantScript: 0x75, haveScript: 0x5a, distance: 0xa},
|
10: {wantLang: 0x331, haveLang: 0x139, wantScript: 0x76, haveScript: 0x5b, distance: 0xa},
|
||||||
11: {wantLang: 0x351, haveLang: 0x139, wantScript: 0x22, haveScript: 0x5a, distance: 0xa},
|
11: {wantLang: 0x351, haveLang: 0x139, wantScript: 0x22, haveScript: 0x5b, distance: 0xa},
|
||||||
12: {wantLang: 0x395, haveLang: 0x139, wantScript: 0x81, haveScript: 0x5a, distance: 0xa},
|
12: {wantLang: 0x395, haveLang: 0x139, wantScript: 0x83, haveScript: 0x5b, distance: 0xa},
|
||||||
13: {wantLang: 0x39d, haveLang: 0x139, wantScript: 0x36, haveScript: 0x5a, distance: 0xa},
|
13: {wantLang: 0x39d, haveLang: 0x139, wantScript: 0x36, haveScript: 0x5b, distance: 0xa},
|
||||||
14: {wantLang: 0x3be, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5a, distance: 0xa},
|
14: {wantLang: 0x3be, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa},
|
||||||
15: {wantLang: 0x3fa, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5a, distance: 0xa},
|
15: {wantLang: 0x3fa, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa},
|
||||||
16: {wantLang: 0x40c, haveLang: 0x139, wantScript: 0xd4, haveScript: 0x5a, distance: 0xa},
|
16: {wantLang: 0x40c, haveLang: 0x139, wantScript: 0xd6, haveScript: 0x5b, distance: 0xa},
|
||||||
17: {wantLang: 0x450, haveLang: 0x139, wantScript: 0xe3, haveScript: 0x5a, distance: 0xa},
|
17: {wantLang: 0x450, haveLang: 0x139, wantScript: 0xe6, haveScript: 0x5b, distance: 0xa},
|
||||||
18: {wantLang: 0x461, haveLang: 0x139, wantScript: 0xe6, haveScript: 0x5a, distance: 0xa},
|
18: {wantLang: 0x461, haveLang: 0x139, wantScript: 0xe9, haveScript: 0x5b, distance: 0xa},
|
||||||
19: {wantLang: 0x46f, haveLang: 0x139, wantScript: 0x2c, haveScript: 0x5a, distance: 0xa},
|
19: {wantLang: 0x46f, haveLang: 0x139, wantScript: 0x2c, haveScript: 0x5b, distance: 0xa},
|
||||||
20: {wantLang: 0x476, haveLang: 0x3e2, wantScript: 0x5a, haveScript: 0x20, distance: 0xa},
|
20: {wantLang: 0x476, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa},
|
||||||
21: {wantLang: 0x4b4, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5a, distance: 0xa},
|
21: {wantLang: 0x4b4, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa},
|
||||||
22: {wantLang: 0x4bc, haveLang: 0x3e2, wantScript: 0x5a, haveScript: 0x20, distance: 0xa},
|
22: {wantLang: 0x4bc, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa},
|
||||||
23: {wantLang: 0x512, haveLang: 0x139, wantScript: 0x3e, haveScript: 0x5a, distance: 0xa},
|
23: {wantLang: 0x512, haveLang: 0x139, wantScript: 0x3e, haveScript: 0x5b, distance: 0xa},
|
||||||
24: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3b, haveScript: 0x3c, distance: 0xf},
|
24: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3b, haveScript: 0x3c, distance: 0xf},
|
||||||
25: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3c, haveScript: 0x3b, distance: 0x13},
|
25: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3c, haveScript: 0x3b, distance: 0x13},
|
||||||
} // Size: 232 bytes
|
} // Size: 232 bytes
|
||||||
|
@ -295,4 +295,4 @@ var matchRegion = []regionIntelligibility{ // 15 elements
|
||||||
14: {lang: 0x529, script: 0x3c, group: 0x80, distance: 0x5},
|
14: {lang: 0x529, script: 0x3c, group: 0x80, distance: 0x5},
|
||||||
} // Size: 114 bytes
|
} // Size: 114 bytes
|
||||||
|
|
||||||
// Total table size 1472 bytes (1KiB); checksum: F86C669
|
// Total table size 1473 bytes (1KiB); checksum: 7BB90B5C
|
||||||
|
|
1
vendor/golang.org/x/text/message/catalog/go19.go
generated
vendored
1
vendor/golang.org/x/text/message/catalog/go19.go
generated
vendored
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build go1.9
|
//go:build go1.9
|
||||||
// +build go1.9
|
|
||||||
|
|
||||||
package catalog
|
package catalog
|
||||||
|
|
||||||
|
|
1
vendor/golang.org/x/text/message/catalog/gopre19.go
generated
vendored
1
vendor/golang.org/x/text/message/catalog/gopre19.go
generated
vendored
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build !go1.9
|
//go:build !go1.9
|
||||||
// +build !go1.9
|
|
||||||
|
|
||||||
package catalog
|
package catalog
|
||||||
|
|
||||||
|
|
2
vendor/golang.org/x/text/number/option.go
generated
vendored
2
vendor/golang.org/x/text/number/option.go
generated
vendored
|
@ -172,6 +172,6 @@ func Pad(r rune) Option {
|
||||||
// - FormatPosition (using type aliasing?)
|
// - FormatPosition (using type aliasing?)
|
||||||
// - Multiplier: find a better way to represent and figure out what to do
|
// - Multiplier: find a better way to represent and figure out what to do
|
||||||
// with clashes with percent/permille.
|
// with clashes with percent/permille.
|
||||||
// - NumberingSystem(nu string): not accessable in number.Info now. Also, should
|
// - NumberingSystem(nu string): not accessible in number.Info now. Also, should
|
||||||
// this be keyed by language or generic?
|
// this be keyed by language or generic?
|
||||||
// - SymbolOverrides(symbols map[string]map[number.SymbolType]string) Option
|
// - SymbolOverrides(symbols map[string]map[number.SymbolType]string) Option
|
||||||
|
|
18
vendor/modules.txt
vendored
18
vendor/modules.txt
vendored
|
@ -1,7 +1,3 @@
|
||||||
# github.com/juju/go4 v0.0.0-20160222163258-40d72ab9641a
|
|
||||||
## explicit
|
|
||||||
# github.com/juju/persistent-cookiejar v1.0.0
|
|
||||||
## explicit
|
|
||||||
# github.com/r3labs/sse/v2 v2.10.0
|
# github.com/r3labs/sse/v2 v2.10.0
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/r3labs/sse/v2
|
github.com/r3labs/sse/v2
|
||||||
|
@ -17,11 +13,13 @@ github.com/robertkrimen/otto/token
|
||||||
# github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909
|
# github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
github.com/tylertravisty/go-utils/random
|
github.com/tylertravisty/go-utils/random
|
||||||
# golang.org/x/net v0.0.0-20191116160921-f9c825593386
|
# golang.org/x/net v0.24.0
|
||||||
## explicit; go 1.11
|
## explicit; go 1.18
|
||||||
golang.org/x/net/context
|
golang.org/x/net/context
|
||||||
# golang.org/x/text v0.4.0
|
golang.org/x/net/html
|
||||||
## explicit; go 1.17
|
golang.org/x/net/html/atom
|
||||||
|
# golang.org/x/text v0.14.0
|
||||||
|
## explicit; go 1.18
|
||||||
golang.org/x/text/feature/plural
|
golang.org/x/text/feature/plural
|
||||||
golang.org/x/text/internal
|
golang.org/x/text/internal
|
||||||
golang.org/x/text/internal/catmsg
|
golang.org/x/text/internal/catmsg
|
||||||
|
@ -38,10 +36,6 @@ golang.org/x/text/number
|
||||||
# gopkg.in/cenkalti/backoff.v1 v1.1.0
|
# gopkg.in/cenkalti/backoff.v1 v1.1.0
|
||||||
## explicit
|
## explicit
|
||||||
gopkg.in/cenkalti/backoff.v1
|
gopkg.in/cenkalti/backoff.v1
|
||||||
# gopkg.in/errgo.v1 v1.0.1
|
|
||||||
## explicit
|
|
||||||
# gopkg.in/retry.v1 v1.0.3
|
|
||||||
## explicit; go 1.12
|
|
||||||
# gopkg.in/sourcemap.v1 v1.0.5
|
# gopkg.in/sourcemap.v1 v1.0.5
|
||||||
## explicit
|
## explicit
|
||||||
gopkg.in/sourcemap.v1
|
gopkg.in/sourcemap.v1
|
||||||
|
|
Loading…
Reference in a new issue