diff --git a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/list b/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/list deleted file mode 100644 index 5aff472dd..000000000 --- a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.4.1 diff --git a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.info b/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.info deleted file mode 100644 index b383e9f58..000000000 --- a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.4.1","Time":"2021-08-05T08:14:45Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.lock b/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.mod b/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.mod deleted file mode 100644 index 82989481d..000000000 --- a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/BurntSushi/toml - -go 1.16 diff --git a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.zip b/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.zip deleted file mode 100644 index efe126b98..000000000 Binary files a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.ziphash b/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.ziphash deleted file mode 100644 index dfb9adf0b..000000000 --- a/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.4.1.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/list b/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/list deleted file mode 100644 index 804a616da..000000000 --- a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/list +++ /dev/null @@ -1 +0,0 @@ -v1.8.0 diff --git a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.info b/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.info deleted file mode 100644 index 0d556ce78..000000000 --- a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.8.0","Time":"2021-10-26T00:24:24Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.lock b/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.mod b/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.mod deleted file mode 100644 index 4b5a30963..000000000 --- a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/PuerkitoBio/goquery - -require ( - github.com/andybalholm/cascadia v1.3.1 - golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 -) - -go 1.13 diff --git a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.zip b/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.zip deleted file mode 100644 index dd51c43b5..000000000 Binary files a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.ziphash b/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.ziphash deleted file mode 100644 index 7080e132d..000000000 --- a/pkg/mod/cache/download/github.com/!puerkito!bio/goquery/@v/v1.8.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/list b/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/list deleted file mode 100644 index 268b0334e..000000000 --- a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.3.0 diff --git a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.info b/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.info deleted file mode 100644 index 230ceda42..000000000 --- a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.3.0","Time":"2021-03-26T02:32:41Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.lock b/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.mod b/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.mod deleted file mode 100644 index 85ed866c5..000000000 --- a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/abhinav/goldmark-wikilink - -go 1.16 - -require ( - github.com/stretchr/testify v1.7.0 - github.com/yuin/goldmark v1.1.32 -) diff --git a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.zip b/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.zip deleted file mode 100644 index 0371b06d3..000000000 Binary files a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.ziphash b/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.ziphash deleted file mode 100644 index 7e12ca0eb..000000000 --- a/pkg/mod/cache/download/github.com/abhinav/goldmark-wikilink/@v/v0.3.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:ry8CBaULn410PKCSkwLz/WVI2f/g7EB+yqY7LKHDcPQ= \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/list b/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/list deleted file mode 100644 index 757407982..000000000 --- a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/list +++ /dev/null @@ -1 +0,0 @@ -v1.3.1 diff --git a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.info b/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.info deleted file mode 100644 index 0f6a41988..000000000 --- a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.3.1","Time":"2021-09-22T16:08:20Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.lock b/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.mod b/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.mod deleted file mode 100644 index ee72d3fe0..000000000 --- a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/andybalholm/cascadia - -go 1.16 - -require golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 diff --git a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.zip b/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.zip deleted file mode 100644 index 4ecceac0b..000000000 Binary files a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.ziphash b/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.ziphash deleted file mode 100644 index 6d0ba5ab1..000000000 --- a/pkg/mod/cache/download/github.com/andybalholm/cascadia/@v/v1.3.1.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/list b/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/list deleted file mode 100644 index 795460fce..000000000 --- a/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/list +++ /dev/null @@ -1 +0,0 @@ -v1.1.0 diff --git a/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.0.mod b/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.0.mod deleted file mode 100644 index 5e4b0f5d7..000000000 --- a/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.0.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/davecgh/go-spew diff --git a/pkg/mod/cache/download/github.com/gernest/front/@v/list b/pkg/mod/cache/download/github.com/gernest/front/@v/list deleted file mode 100644 index e666c2f05..000000000 --- a/pkg/mod/cache/download/github.com/gernest/front/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.0.0-20210301115436-8a0b0a782d0a diff --git a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.info b/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.info deleted file mode 100644 index e527e6f9b..000000000 --- a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.0.0-20210301115436-8a0b0a782d0a","Time":"2021-03-01T11:54:36Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.lock b/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.mod b/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.mod deleted file mode 100644 index d0d89f508..000000000 --- a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/gernest/front diff --git a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.zip b/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.zip deleted file mode 100644 index e2da9fef0..000000000 Binary files a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.ziphash b/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.ziphash deleted file mode 100644 index 362f56c31..000000000 --- a/pkg/mod/cache/download/github.com/gernest/front/@v/v0.0.0-20210301115436-8a0b0a782d0a.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:z7BePknRd4Nz3CeWDhcmCkuCliM2YY/RnjWpdPUuQQo= \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/list b/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/list deleted file mode 100644 index f991dab84..000000000 --- a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.0.0-20220403030921-3ce308411ee3 diff --git a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.info b/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.info deleted file mode 100644 index 5653b0fa3..000000000 --- a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.0.0-20220403030921-3ce308411ee3","Time":"2022-04-03T03:09:21Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.lock b/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.mod b/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.mod deleted file mode 100644 index 81f6c7842..000000000 --- a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.mod +++ /dev/null @@ -1,13 +0,0 @@ -module github.com/jackyzha0/hugo-obsidian - -go 1.16 - -require ( - github.com/BurntSushi/toml v0.4.1 // indirect - github.com/PuerkitoBio/goquery v1.8.0 - github.com/abhinav/goldmark-wikilink v0.3.0 - github.com/gernest/front v0.0.0-20210301115436-8a0b0a782d0a - github.com/yuin/goldmark v1.4.4 - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b -) diff --git a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.zip b/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.zip deleted file mode 100644 index a4972ca49..000000000 Binary files a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.ziphash b/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.ziphash deleted file mode 100644 index b7b51ca20..000000000 --- a/pkg/mod/cache/download/github.com/jackyzha0/hugo-obsidian/@v/v0.0.0-20220403030921-3ce308411ee3.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:MovdN2bkRb6YEAYarv6yNsKhSIYiI9FAeKhDcBwPvak= \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/pmezard/go-difflib/@v/list b/pkg/mod/cache/download/github.com/pmezard/go-difflib/@v/list deleted file mode 100644 index 0ec25f750..000000000 --- a/pkg/mod/cache/download/github.com/pmezard/go-difflib/@v/list +++ /dev/null @@ -1 +0,0 @@ -v1.0.0 diff --git a/pkg/mod/cache/download/github.com/pmezard/go-difflib/@v/v1.0.0.mod b/pkg/mod/cache/download/github.com/pmezard/go-difflib/@v/v1.0.0.mod deleted file mode 100644 index a03051fbb..000000000 --- a/pkg/mod/cache/download/github.com/pmezard/go-difflib/@v/v1.0.0.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/pmezard/go-difflib diff --git a/pkg/mod/cache/download/github.com/stretchr/objx/@v/list b/pkg/mod/cache/download/github.com/stretchr/objx/@v/list deleted file mode 100644 index b82608c0b..000000000 --- a/pkg/mod/cache/download/github.com/stretchr/objx/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.1.0 diff --git a/pkg/mod/cache/download/github.com/stretchr/objx/@v/v0.1.0.mod b/pkg/mod/cache/download/github.com/stretchr/objx/@v/v0.1.0.mod deleted file mode 100644 index cbaa42114..000000000 --- a/pkg/mod/cache/download/github.com/stretchr/objx/@v/v0.1.0.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/stretchr/objx diff --git a/pkg/mod/cache/download/github.com/stretchr/testify/@v/list b/pkg/mod/cache/download/github.com/stretchr/testify/@v/list deleted file mode 100644 index a20e2d82d..000000000 --- a/pkg/mod/cache/download/github.com/stretchr/testify/@v/list +++ /dev/null @@ -1 +0,0 @@ -v1.7.0 diff --git a/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.7.0.mod b/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.7.0.mod deleted file mode 100644 index ed0b50bf9..000000000 --- a/pkg/mod/cache/download/github.com/stretchr/testify/@v/v1.7.0.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/stretchr/testify - -go 1.13 - -require ( - github.com/davecgh/go-spew v1.1.0 - github.com/pmezard/go-difflib v1.0.0 - github.com/stretchr/objx v0.1.0 - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c -) diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/list b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/list deleted file mode 100644 index 42b5eb39e..000000000 --- a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/list +++ /dev/null @@ -1,2 +0,0 @@ -v1.1.32 -v1.4.4 diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.1.32.mod b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.1.32.mod deleted file mode 100644 index a10efcad5..000000000 --- a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.1.32.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/yuin/goldmark - -go 1.13 diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.info b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.info deleted file mode 100644 index 6111e737e..000000000 --- a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v1.4.4","Time":"2021-11-14T10:49:34Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.lock b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.mod b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.mod deleted file mode 100644 index 27712f225..000000000 --- a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/yuin/goldmark - -go 1.16 diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.zip b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.zip deleted file mode 100644 index a8d2654f0..000000000 Binary files a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.zip and /dev/null differ diff --git a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.ziphash b/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.ziphash deleted file mode 100644 index afe494d3b..000000000 --- a/pkg/mod/cache/download/github.com/yuin/goldmark/@v/v1.4.4.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs= \ No newline at end of file diff --git a/pkg/mod/cache/download/golang.org/x/net/@v/list b/pkg/mod/cache/download/golang.org/x/net/@v/list deleted file mode 100644 index 57a57c1f2..000000000 --- a/pkg/mod/cache/download/golang.org/x/net/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.0.0-20210916014120-12bc252f5db8 diff --git a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.info b/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.info deleted file mode 100644 index f3a8eca46..000000000 --- a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v0.0.0-20210916014120-12bc252f5db8","Time":"2021-09-16T01:41:20Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.lock b/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.mod b/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.mod deleted file mode 100644 index 7fd3c796a..000000000 --- a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.mod +++ /dev/null @@ -1,9 +0,0 @@ -module golang.org/x/net - -go 1.17 - -require ( - golang.org/x/sys v0.0.0-20210423082822-04245dca01da - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 - golang.org/x/text v0.3.6 -) diff --git a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.zip b/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.zip deleted file mode 100644 index 8505440f1..000000000 Binary files a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.zip and /dev/null differ diff --git a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.ziphash b/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.ziphash deleted file mode 100644 index b4ce0d1db..000000000 --- a/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20210916014120-12bc252f5db8.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= \ No newline at end of file diff --git a/pkg/mod/cache/download/golang.org/x/sys/@v/list b/pkg/mod/cache/download/golang.org/x/sys/@v/list deleted file mode 100644 index 652865fd2..000000000 --- a/pkg/mod/cache/download/golang.org/x/sys/@v/list +++ /dev/null @@ -1,2 +0,0 @@ -v0.0.0-20201119102817-f84b799fce68 -v0.0.0-20210423082822-04245dca01da diff --git a/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20201119102817-f84b799fce68.mod b/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20201119102817-f84b799fce68.mod deleted file mode 100644 index b12171fdc..000000000 --- a/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20201119102817-f84b799fce68.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/sys - -go 1.12 diff --git a/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20210423082822-04245dca01da.mod b/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20210423082822-04245dca01da.mod deleted file mode 100644 index b12171fdc..000000000 --- a/pkg/mod/cache/download/golang.org/x/sys/@v/v0.0.0-20210423082822-04245dca01da.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/sys - -go 1.12 diff --git a/pkg/mod/cache/download/golang.org/x/term/@v/list b/pkg/mod/cache/download/golang.org/x/term/@v/list deleted file mode 100644 index df2ac0ba1..000000000 --- a/pkg/mod/cache/download/golang.org/x/term/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.0.0-20201126162022-7de9c90e9dd1 diff --git a/pkg/mod/cache/download/golang.org/x/term/@v/v0.0.0-20201126162022-7de9c90e9dd1.mod b/pkg/mod/cache/download/golang.org/x/term/@v/v0.0.0-20201126162022-7de9c90e9dd1.mod deleted file mode 100644 index d45f52851..000000000 --- a/pkg/mod/cache/download/golang.org/x/term/@v/v0.0.0-20201126162022-7de9c90e9dd1.mod +++ /dev/null @@ -1,5 +0,0 @@ -module golang.org/x/term - -go 1.11 - -require golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 diff --git a/pkg/mod/cache/download/golang.org/x/text/@v/list b/pkg/mod/cache/download/golang.org/x/text/@v/list deleted file mode 100644 index d379b578a..000000000 --- a/pkg/mod/cache/download/golang.org/x/text/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.3.6 diff --git a/pkg/mod/cache/download/golang.org/x/text/@v/v0.3.6.mod b/pkg/mod/cache/download/golang.org/x/text/@v/v0.3.6.mod deleted file mode 100644 index 8ff7ecb6f..000000000 --- a/pkg/mod/cache/download/golang.org/x/text/@v/v0.3.6.mod +++ /dev/null @@ -1,5 +0,0 @@ -module golang.org/x/text - -require golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e - -go 1.11 diff --git a/pkg/mod/cache/download/golang.org/x/tools/@v/list b/pkg/mod/cache/download/golang.org/x/tools/@v/list deleted file mode 100644 index 1676b10df..000000000 --- a/pkg/mod/cache/download/golang.org/x/tools/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.0.0-20180917221912-90fa682c2a6e diff --git a/pkg/mod/cache/download/golang.org/x/tools/@v/v0.0.0-20180917221912-90fa682c2a6e.mod b/pkg/mod/cache/download/golang.org/x/tools/@v/v0.0.0-20180917221912-90fa682c2a6e.mod deleted file mode 100644 index 552f8783c..000000000 --- a/pkg/mod/cache/download/golang.org/x/tools/@v/v0.0.0-20180917221912-90fa682c2a6e.mod +++ /dev/null @@ -1 +0,0 @@ -module golang.org/x/tools diff --git a/pkg/mod/cache/download/gopkg.in/check.v1/@v/list b/pkg/mod/cache/download/gopkg.in/check.v1/@v/list deleted file mode 100644 index d4c3e4343..000000000 --- a/pkg/mod/cache/download/gopkg.in/check.v1/@v/list +++ /dev/null @@ -1 +0,0 @@ -v0.0.0-20161208181325-20d25e280405 diff --git a/pkg/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod b/pkg/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod deleted file mode 100644 index 7cec6a030..000000000 --- a/pkg/mod/cache/download/gopkg.in/check.v1/@v/v0.0.0-20161208181325-20d25e280405.mod +++ /dev/null @@ -1 +0,0 @@ -module gopkg.in/check.v1 diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/list b/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/list deleted file mode 100644 index 8721bbc46..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/list +++ /dev/null @@ -1 +0,0 @@ -v2.4.0 diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.info b/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.info deleted file mode 100644 index 8df9e64d0..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.info +++ /dev/null @@ -1 +0,0 @@ -{"Version":"v2.4.0","Time":"2020-11-17T15:46:20Z"} \ No newline at end of file diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.lock b/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.mod b/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.mod deleted file mode 100644 index 2cbb85aea..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.mod +++ /dev/null @@ -1,5 +0,0 @@ -module gopkg.in/yaml.v2 - -go 1.15 - -require gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.zip b/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.zip deleted file mode 100644 index 3d41c723c..000000000 Binary files a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.zip and /dev/null differ diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.ziphash b/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.ziphash deleted file mode 100644 index 91a236b93..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.4.0.ziphash +++ /dev/null @@ -1 +0,0 @@ -h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= \ No newline at end of file diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/list b/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/list deleted file mode 100644 index ab6b93918..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/list +++ /dev/null @@ -1,2 +0,0 @@ -v3.0.0-20200313102051-9f266ea9e77c -v3.0.0-20210107192922-496545a6307b diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/v3.0.0-20200313102051-9f266ea9e77c.mod b/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/v3.0.0-20200313102051-9f266ea9e77c.mod deleted file mode 100644 index f407ea321..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/v3.0.0-20200313102051-9f266ea9e77c.mod +++ /dev/null @@ -1,5 +0,0 @@ -module "gopkg.in/yaml.v3" - -require ( - "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 -) diff --git a/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/v3.0.0-20210107192922-496545a6307b.mod b/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/v3.0.0-20210107192922-496545a6307b.mod deleted file mode 100644 index f407ea321..000000000 --- a/pkg/mod/cache/download/gopkg.in/yaml.v3/@v/v3.0.0-20210107192922-496545a6307b.mod +++ /dev/null @@ -1,5 +0,0 @@ -module "gopkg.in/yaml.v3" - -require ( - "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 -) diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/!burnt!sushi/toml@v0.4.1 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/!burnt!sushi/toml@v0.4.1 deleted file mode 100644 index f12a2385b..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/!burnt!sushi/toml@v0.4.1 +++ /dev/null @@ -1,9 +0,0 @@ -6386277 -github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= - -go.sum database tree -10367076 -fBTXt8pWUZw478GH68rGELcW+pFvGEUY/iEQL9mU/BU= - -— sum.golang.org Az3gruFEZBicRqOTPD85x9yQmTFD3QYTvuCvJXrt4euSokOHpgzlq7XD7BmnysmQSi3AlPQRSALanx9j6xQ2PSTW6As= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/!puerkito!bio/goquery@v1.8.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/!puerkito!bio/goquery@v1.8.0 deleted file mode 100644 index 8817ca109..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/!puerkito!bio/goquery@v1.8.0 +++ /dev/null @@ -1,9 +0,0 @@ -7428479 -github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= -github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= - -go.sum database tree -10367335 -zHd3JL3wynQXMhcR2wzzCm6kmRAUzQK3o7kiIG7mPl0= - -— sum.golang.org Az3grmnVqYFN2TFOrHdbxAr3LpbJP+SvXwMlq5l+g6yOt9hU0uP5EokPhh3Ug3NV8TJL3/pz1cjhqGDYSJAIiU+Zpgw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/abhinav/goldmark-wikilink@v0.3.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/abhinav/goldmark-wikilink@v0.3.0 deleted file mode 100644 index 2f33f2ca4..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/abhinav/goldmark-wikilink@v0.3.0 +++ /dev/null @@ -1,9 +0,0 @@ -3467230 -github.com/abhinav/goldmark-wikilink v0.3.0 h1:ry8CBaULn410PKCSkwLz/WVI2f/g7EB+yqY7LKHDcPQ= -github.com/abhinav/goldmark-wikilink v0.3.0/go.mod h1:MHRZiLRE1ZDZDjHCFYwKEEgITXGbB7N0Yr00dbmfHM8= - -go.sum database tree -10367586 -392S2hhc8e66YbVx153qW7Lx+E2+pa1TFIaTVYvyp8Q= - -— sum.golang.org Az3grsf5OXXz1jOoGFAUz1IT2cys8hkxESXHxiqUN2w6V5nSwac7qtCI8YxPLDhG1Irc3s0yNPAeBI1j9FX0VhHm1Qs= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/andybalholm/cascadia@v1.3.1 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/andybalholm/cascadia@v1.3.1 deleted file mode 100644 index 270af00d1..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/andybalholm/cascadia@v1.3.1 +++ /dev/null @@ -1,9 +0,0 @@ -7023271 -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= -github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= - -go.sum database tree -10367336 -LdTyiFDFPefLG+tOlARecrNkZ3hwkyVT7jj9RnhNF6k= - -— sum.golang.org Az3grmKjos63FwkvyAFh4YmMMzsU9K7F2964W2I9rfaZpRX91Y+1yYrrFWkaW5GVy2McGLGlAwkPHvPD72h34s71SQI= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 deleted file mode 100644 index ef691908c..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/davecgh/go-spew@v1.1.0 +++ /dev/null @@ -1,9 +0,0 @@ -422 -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= - -go.sum database tree -10366527 -/ZwiTbszhwURiQd6o24JUcHrCsY1XfYgPPlb46p7Mz4= - -— sum.golang.org Az3gruSS/D+tGi1hhQxgupq7zVHQ8y1CotijyujHD5ZSxv4x0CU1n8hpDTcH9vviSTpQ4cgP/zA+7uAZbEgOkVZrzAw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a deleted file mode 100644 index 20601ceb7..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a +++ /dev/null @@ -1,9 +0,0 @@ -3113885 -github.com/gernest/front v0.0.0-20210301115436-8a0b0a782d0a h1:z7BePknRd4Nz3CeWDhcmCkuCliM2YY/RnjWpdPUuQQo= -github.com/gernest/front v0.0.0-20210301115436-8a0b0a782d0a/go.mod h1:FwEMwQ5+xky8tbzDLj72k2RAqXnFByLNwxg+9UZDtqU= - -go.sum database tree -10367586 -392S2hhc8e66YbVx153qW7Lx+E2+pa1TFIaTVYvyp8Q= - -— sum.golang.org Az3grsf5OXXz1jOoGFAUz1IT2cys8hkxESXHxiqUN2w6V5nSwac7qtCI8YxPLDhG1Irc3s0yNPAeBI1j9FX0VhHm1Qs= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3 deleted file mode 100644 index 45d04223e..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3 +++ /dev/null @@ -1,9 +0,0 @@ -9963028 -github.com/jackyzha0/hugo-obsidian v0.0.0-20220403030921-3ce308411ee3 h1:MovdN2bkRb6YEAYarv6yNsKhSIYiI9FAeKhDcBwPvak= -github.com/jackyzha0/hugo-obsidian v0.0.0-20220403030921-3ce308411ee3/go.mod h1:qwvdGfxIYQnKtH4WTfmpY1TRbg8iP0La3vLZv+HFCac= - -go.sum database tree -10367586 -392S2hhc8e66YbVx153qW7Lx+E2+pa1TFIaTVYvyp8Q= - -— sum.golang.org Az3grsf5OXXz1jOoGFAUz1IT2cys8hkxESXHxiqUN2w6V5nSwac7qtCI8YxPLDhG1Irc3s0yNPAeBI1j9FX0VhHm1Qs= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/pmezard/go-difflib@v1.0.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/pmezard/go-difflib@v1.0.0 deleted file mode 100644 index a0cad9f6d..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/pmezard/go-difflib@v1.0.0 +++ /dev/null @@ -1,9 +0,0 @@ -176 -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= - -go.sum database tree -10366483 -AhWglonbLKdjQk3nlFitHzslyX104PH20Ox5t4tMt4w= - -— sum.golang.org Az3grrEHhC/Ilb4GA14FapMo4qjLKMv8Ln/o2vqeq+zftYi8ZQsPv4PZ04YfhShmXOjMC2A3SofV5eFlWnpsn7oRPQI= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 deleted file mode 100644 index 1f950caea..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/objx@v0.1.0 +++ /dev/null @@ -1,9 +0,0 @@ -574 -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= - -go.sum database tree -10366527 -/ZwiTbszhwURiQd6o24JUcHrCsY1XfYgPPlb46p7Mz4= - -— sum.golang.org Az3gruSS/D+tGi1hhQxgupq7zVHQ8y1CotijyujHD5ZSxv4x0CU1n8hpDTcH9vviSTpQ4cgP/zA+7uAZbEgOkVZrzAw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 deleted file mode 100644 index b540ab7db..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/stretchr/testify@v1.7.0 +++ /dev/null @@ -1,9 +0,0 @@ -2491589 -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= - -go.sum database tree -10366508 -/bhzJE60Ob5XPe3lotCVp+AtGBuBdUHlpEeuI5cjvrQ= - -— sum.golang.org Az3gro0Pc5p09PfqjKbgB3/kMbc0+ECPbGVCyDZ4p4KBo13S4s++SN7kbUzy2w27oM6lk959CErb6n+a93Qxt1A4ggA= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/yuin/goldmark@v1.1.32 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/yuin/goldmark@v1.1.32 deleted file mode 100644 index d9c25af49..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/yuin/goldmark@v1.1.32 +++ /dev/null @@ -1,9 +0,0 @@ -1275590 -github.com/yuin/goldmark v1.1.32 h1:5tjfNdR2ki3yYQ842+eX2sQHeiwpKJ0RnHO4IYOc4V8= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= - -go.sum database tree -10367391 -7NjWyvuUUy7aBF3K407v2/iQqkx2/QO00Sc30fR2YoQ= - -— sum.golang.org Az3grtZEZHZN3hef9ZUOGzZOpBi7hzvTjtUvo4Fcd/xkdn0GFrPlaK7zGuCImMC4pxPoDKQpIeftbHJOBMkEaseHGgY= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/yuin/goldmark@v1.4.4 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/yuin/goldmark@v1.4.4 deleted file mode 100644 index 2e731e369..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/yuin/goldmark@v1.4.4 +++ /dev/null @@ -1,9 +0,0 @@ -7892938 -github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs= -github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= - -go.sum database tree -10367586 -392S2hhc8e66YbVx153qW7Lx+E2+pa1TFIaTVYvyp8Q= - -— sum.golang.org Az3grsf5OXXz1jOoGFAUz1IT2cys8hkxESXHxiqUN2w6V5nSwac7qtCI8YxPLDhG1Irc3s0yNPAeBI1j9FX0VhHm1Qs= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8 deleted file mode 100644 index 82f308904..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8 +++ /dev/null @@ -1,9 +0,0 @@ -6939558 -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= - -go.sum database tree -10367586 -392S2hhc8e66YbVx153qW7Lx+E2+pa1TFIaTVYvyp8Q= - -— sum.golang.org Az3grsf5OXXz1jOoGFAUz1IT2cys8hkxESXHxiqUN2w6V5nSwac7qtCI8YxPLDhG1Irc3s0yNPAeBI1j9FX0VhHm1Qs= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20201119102817-f84b799fce68 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20201119102817-f84b799fce68 deleted file mode 100644 index 9b4837849..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20201119102817-f84b799fce68 +++ /dev/null @@ -1,9 +0,0 @@ -1855921 -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= - -go.sum database tree -10366484 -OcdWiwqlXv1VUyE0swSKUmtFLmjeNoR7IikUDxFWpe4= - -— sum.golang.org Az3groPvmRS89Po8ktR/N1Tdm/qVTxGWqXRhdC6fxZhfaoKraLmBz1p6okQL1dLjGLuOMH0gy5jINfESCGJF2Dz0wQw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20210423082822-04245dca01da b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20210423082822-04245dca01da deleted file mode 100644 index b8ae86a5d..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/sys@v0.0.0-20210423082822-04245dca01da +++ /dev/null @@ -1,9 +0,0 @@ -3968026 -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= - -go.sum database tree -10366484 -OcdWiwqlXv1VUyE0swSKUmtFLmjeNoR7IikUDxFWpe4= - -— sum.golang.org Az3groPvmRS89Po8ktR/N1Tdm/qVTxGWqXRhdC6fxZhfaoKraLmBz1p6okQL1dLjGLuOMH0gy5jINfESCGJF2Dz0wQw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/term@v0.0.0-20201126162022-7de9c90e9dd1 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/term@v0.0.0-20201126162022-7de9c90e9dd1 deleted file mode 100644 index 13a38c6a6..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/term@v0.0.0-20201126162022-7de9c90e9dd1 +++ /dev/null @@ -1,9 +0,0 @@ -1928783 -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= - -go.sum database tree -10368238 -bI47ic/mwqP9S2NlYi+rtp3ZKoM2SWebhY74D/A6Pxc= - -— sum.golang.org Az3grpBPnh7HeBSWxT7xHj3v7XR9rAdSZ6+gHeq7MH/+yCQtfAT6jkeudljxFmS4NfePB5sZjeSfnQaXm3k+hgcPogo= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/text@v0.3.6 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/text@v0.3.6 deleted file mode 100644 index 2cf93999b..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/text@v0.3.6 +++ /dev/null @@ -1,9 +0,0 @@ -3563748 -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= - -go.sum database tree -10366484 -OcdWiwqlXv1VUyE0swSKUmtFLmjeNoR7IikUDxFWpe4= - -— sum.golang.org Az3groPvmRS89Po8ktR/N1Tdm/qVTxGWqXRhdC6fxZhfaoKraLmBz1p6okQL1dLjGLuOMH0gy5jINfESCGJF2Dz0wQw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e deleted file mode 100644 index d71f1fa2c..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e +++ /dev/null @@ -1,9 +0,0 @@ -1175 -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= - -go.sum database tree -10366484 -OcdWiwqlXv1VUyE0swSKUmtFLmjeNoR7IikUDxFWpe4= - -— sum.golang.org Az3groPvmRS89Po8ktR/N1Tdm/qVTxGWqXRhdC6fxZhfaoKraLmBz1p6okQL1dLjGLuOMH0gy5jINfESCGJF2Dz0wQw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405 deleted file mode 100644 index 1d3e51312..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/check.v1@v0.0.0-20161208181325-20d25e280405 +++ /dev/null @@ -1,9 +0,0 @@ -409 -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= - -go.sum database tree -10366527 -/ZwiTbszhwURiQd6o24JUcHrCsY1XfYgPPlb46p7Mz4= - -— sum.golang.org Az3gruSS/D+tGi1hhQxgupq7zVHQ8y1CotijyujHD5ZSxv4x0CU1n8hpDTcH9vviSTpQ4cgP/zA+7uAZbEgOkVZrzAw= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v2@v2.4.0 b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v2@v2.4.0 deleted file mode 100644 index 2d90912cc..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v2@v2.4.0 +++ /dev/null @@ -1,9 +0,0 @@ -1908176 -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= - -go.sum database tree -10366508 -/bhzJE60Ob5XPe3lotCVp+AtGBuBdUHlpEeuI5cjvrQ= - -— sum.golang.org Az3gro0Pc5p09PfqjKbgB3/kMbc0+ECPbGVCyDZ4p4KBo13S4s++SN7kbUzy2w27oM6lk959CErb6n+a93Qxt1A4ggA= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c deleted file mode 100644 index 6cd11ae24..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c +++ /dev/null @@ -1,9 +0,0 @@ -867903 -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= - -go.sum database tree -10366505 -Cttq1EagdqcNMo6B3i59dh7Jdwfc6wkMh4lzUZaa1Gw= - -— sum.golang.org Az3grjYRhZWeuFxm/oYe63WUsSQLGMR7wG4X7wuh1H8jevDOyMDLSODH5ULCwF5VR5LbdnmIwERuq5+Aatw7L+VnkgI= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20210107192922-496545a6307b b/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20210107192922-496545a6307b deleted file mode 100644 index ec3afe7c1..000000000 --- a/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/gopkg.in/yaml.v3@v3.0.0-20210107192922-496545a6307b +++ /dev/null @@ -1,9 +0,0 @@ -2423492 -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= - -go.sum database tree -10367442 -dqXRoYiLpsGB7yjKIZCReHQ4hu0YHP8zpY3bh3QFPQo= - -— sum.golang.org Az3grupKQx6fufBPRFpSt4fCNM1+sECVXpChP3VM8Rf/a8iTgQi89D9sdk/nOfVk/yTXugIBUqLO7bKxtqAwMIaBbQM= diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/000 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/000 deleted file mode 100644 index 2a373459b..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/000 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/001 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/001 deleted file mode 100644 index b55ea2628..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/001 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/002 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/002 deleted file mode 100644 index 57e896109..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/002 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/004 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/004 deleted file mode 100644 index bda471a18..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/004 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x003/390 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x003/390 deleted file mode 100644 index 72b81813e..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x003/390 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x004/982 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x004/982 deleted file mode 100644 index bbdea9a8d..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x004/982 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/249 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/249 deleted file mode 100644 index a794ccfb2..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/249 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/453 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/453 deleted file mode 100644 index f523e2761..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/453 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/534 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/534 deleted file mode 100644 index 4cbb5d5a1..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x007/534 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x009/466 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x009/466 deleted file mode 100644 index 82a3d0478..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x009/466 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x009/732 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x009/732 deleted file mode 100644 index 494334c48..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x009/732 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x012/163 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x012/163 deleted file mode 100644 index 9e55a3c24..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x012/163 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x013/543 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x013/543 deleted file mode 100644 index e4ba462e3..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x013/543 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x013/920 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x013/920 deleted file mode 100644 index 8e3ebf662..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x013/920 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x015/500 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x015/500 deleted file mode 100644 index 18fc656b1..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x015/500 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x024/946 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x024/946 deleted file mode 100644 index 5e34576ea..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x024/946 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x027/107 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x027/107 deleted file mode 100644 index 7f02a19e0..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x027/107 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x027/434 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x027/434 deleted file mode 100644 index 39fa718ca..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x027/434 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x029/017 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x029/017 deleted file mode 100644 index 9c0d873a9..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x029/017 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x030/831 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x030/831 deleted file mode 100644 index 783072f48..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x030/831 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x038/918 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x038/918 deleted file mode 100644 index 2f88668ae..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x038/918 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/494 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/494 deleted file mode 100644 index 61db968cb..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/494 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/496 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/496 deleted file mode 100644 index 75f6dd108..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/496 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/497 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/497 deleted file mode 100644 index 9c3a3dc89..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/497 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/498 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/498 deleted file mode 100644 index 899eb112a..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/498 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/498.p/98 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/498.p/98 deleted file mode 100644 index 81bd66a65..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/498.p/98 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/500.p/238 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/500.p/238 deleted file mode 100644 index 2a2de517d..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/0/x040/500.p/238 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/000 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/000 deleted file mode 100644 index d4b0b5f3d..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/000 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/013 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/013 deleted file mode 100644 index 8670895d5..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/013 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/019 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/019 deleted file mode 100644 index f55637fde..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/019 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/028 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/028 deleted file mode 100644 index 501a7becf..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/028 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/029 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/029 deleted file mode 100644 index 89b8f9f06..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/029 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/036 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/036 deleted file mode 100644 index 0eea88c25..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/036 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/038 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/038 deleted file mode 100644 index 2efecdc91..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/038 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/047 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/047 deleted file mode 100644 index e718fcc2c..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/047 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/052 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/052 deleted file mode 100644 index 60df44d1d..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/052 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/054 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/054 deleted file mode 100644 index d3784f4aa..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/054 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/060 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/060 deleted file mode 100644 index 403e5bb1a..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/060 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/097 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/097 deleted file mode 100644 index 7bcba62ad..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/097 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/105 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/105 deleted file mode 100644 index 2ce1200ed..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/105 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/107 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/107 deleted file mode 100644 index 14632b5e8..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/107 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/113 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/113 deleted file mode 100644 index 2c750c50b..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/113 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/120 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/120 deleted file mode 100644 index 4b4515f7f..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/120 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/152 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/152 deleted file mode 100644 index d62d9e688..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/152 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/158.p/50 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/158.p/50 deleted file mode 100644 index c7496d4c6..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/158.p/50 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/158.p/52 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/158.p/52 deleted file mode 100644 index 46b3f0ce4..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/1/158.p/52 and /dev/null differ diff --git a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/000.p/158 b/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/000.p/158 deleted file mode 100644 index db4db4627..000000000 Binary files a/pkg/mod/cache/download/sumdb/sum.golang.org/tile/8/2/000.p/158 and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/.github/workflows/test.yml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/.github/workflows/test.yml deleted file mode 100644 index bda1efbac..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/.github/workflows/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "go test", - "on": ["push", "pull_request"], - "jobs": { - "test": { - "strategy": { - "matrix": { - "go-version": ["1.13.x", "1.14.x", "1.15.x", "1.16.x"], - "os": ["ubuntu-latest", "macos-latest", "windows-latest"] - } - }, - "runs-on": "${{ matrix.os }}", - "env": {"GOPROXY": "direct"}, - "steps": [ - { - "name": "Install Go", - "uses": "actions/setup-go@v2", - "with": {"go-version": "${{ matrix.go-version }}"} - }, - { - "name": "Checkout code", - "uses": "actions/checkout@v2" - }, - { - "name": "Test", - "run": "go test -v ./..." - } - ] - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/.gitignore b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/.gitignore deleted file mode 100644 index cd11be965..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -toml.test -/toml-test diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/COMPATIBLE b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/COMPATIBLE deleted file mode 100644 index f621b0119..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/COMPATIBLE +++ /dev/null @@ -1 +0,0 @@ -Compatible with TOML version [v1.0.0](https://toml.io/en/v1.0.0). diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/COPYING b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/COPYING deleted file mode 100644 index 01b574320..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 TOML authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/README.md b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/README.md deleted file mode 100644 index 64410cf75..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/README.md +++ /dev/null @@ -1,220 +0,0 @@ -## TOML parser and encoder for Go with reflection - -TOML stands for Tom's Obvious, Minimal Language. This Go package provides a -reflection interface similar to Go's standard library `json` and `xml` -packages. This package also supports the `encoding.TextUnmarshaler` and -`encoding.TextMarshaler` interfaces so that you can define custom data -representations. (There is an example of this below.) - -Compatible with TOML version [v1.0.0](https://toml.io/en/v1.0.0). - -Documentation: https://godocs.io/github.com/BurntSushi/toml - -See the [releases page](https://github.com/BurntSushi/toml/releases) for a -changelog; this information is also in the git tag annotations (e.g. `git show -v0.4.0`). - -This library requires Go 1.13 or newer; install it with: - - $ go get github.com/BurntSushi/toml - -It also comes with a TOML validator CLI tool: - - $ go get github.com/BurntSushi/toml/cmd/tomlv - $ tomlv some-toml-file.toml - -### Testing - -This package passes all tests in -[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder -and the encoder. - -### Examples - -This package works similarly to how the Go standard library handles XML and -JSON. Namely, data is loaded into Go values via reflection. - -For the simplest example, consider some TOML file as just a list of keys -and values: - -```toml -Age = 25 -Cats = [ "Cauchy", "Plato" ] -Pi = 3.14 -Perfection = [ 6, 28, 496, 8128 ] -DOB = 1987-07-05T05:45:00Z -``` - -Which could be defined in Go as: - -```go -type Config struct { - Age int - Cats []string - Pi float64 - Perfection []int - DOB time.Time // requires `import time` -} -``` - -And then decoded with: - -```go -var conf Config -if _, err := toml.Decode(tomlData, &conf); err != nil { - // handle error -} -``` - -You can also use struct tags if your struct field name doesn't map to a TOML -key value directly: - -```toml -some_key_NAME = "wat" -``` - -```go -type TOML struct { - ObscureKey string `toml:"some_key_NAME"` -} -``` - -Beware that like other most other decoders **only exported fields** are -considered when encoding and decoding; private fields are silently ignored. - -### Using the `encoding.TextUnmarshaler` interface - -Here's an example that automatically parses duration strings into -`time.Duration` values: - -```toml -[[song]] -name = "Thunder Road" -duration = "4m49s" - -[[song]] -name = "Stairway to Heaven" -duration = "8m03s" -``` - -Which can be decoded with: - -```go -type song struct { - Name string - Duration duration -} -type songs struct { - Song []song -} -var favorites songs -if _, err := toml.Decode(blob, &favorites); err != nil { - log.Fatal(err) -} - -for _, s := range favorites.Song { - fmt.Printf("%s (%s)\n", s.Name, s.Duration) -} -``` - -And you'll also need a `duration` type that satisfies the -`encoding.TextUnmarshaler` interface: - -```go -type duration struct { - time.Duration -} - -func (d *duration) UnmarshalText(text []byte) error { - var err error - d.Duration, err = time.ParseDuration(string(text)) - return err -} -``` - -To target TOML specifically you can implement `UnmarshalTOML` TOML interface in -a similar way. - -### More complex usage - -Here's an example of how to load the example from the official spec page: - -```toml -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T07:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] -``` - -And the corresponding Go types are: - -```go -type tomlConfig struct { - Title string - Owner ownerInfo - DB database `toml:"database"` - Servers map[string]server - Clients clients -} - -type ownerInfo struct { - Name string - Org string `toml:"organization"` - Bio string - DOB time.Time -} - -type database struct { - Server string - Ports []int - ConnMax int `toml:"connection_max"` - Enabled bool -} - -type server struct { - IP string - DC string -} - -type clients struct { - Data [][]interface{} - Hosts []string -} -``` - -Note that a case insensitive match will be tried if an exact match can't be -found. - -A working example of the above can be found in `_examples/example.{go,toml}`. - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/example.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/example.go deleted file mode 100644 index 79f31f275..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/example.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "fmt" - "time" - - "github.com/BurntSushi/toml" -) - -type tomlConfig struct { - Title string - Owner ownerInfo - DB database `toml:"database"` - Servers map[string]server - Clients clients -} - -type ownerInfo struct { - Name string - Org string `toml:"organization"` - Bio string - DOB time.Time -} - -type database struct { - Server string - Ports []int - ConnMax int `toml:"connection_max"` - Enabled bool -} - -type server struct { - IP string - DC string -} - -type clients struct { - Data [][]interface{} - Hosts []string -} - -func main() { - var config tomlConfig - if _, err := toml.DecodeFile("example.toml", &config); err != nil { - fmt.Println(err) - return - } - - fmt.Printf("Title: %s\n", config.Title) - fmt.Printf("Owner: %s (%s, %s), Born: %s\n", - config.Owner.Name, config.Owner.Org, config.Owner.Bio, - config.Owner.DOB) - fmt.Printf("Database: %s %v (Max conn. %d), Enabled? %v\n", - config.DB.Server, config.DB.Ports, config.DB.ConnMax, - config.DB.Enabled) - for serverName, server := range config.Servers { - fmt.Printf("Server: %s (%s, %s)\n", serverName, server.IP, server.DC) - } - fmt.Printf("Client data: %v\n", config.Clients.Data) - fmt.Printf("Client hosts: %v\n", config.Clients.Hosts) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/example.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/example.toml deleted file mode 100644 index 32c7a4faa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/example.toml +++ /dev/null @@ -1,35 +0,0 @@ -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T07:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/hard.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/hard.toml deleted file mode 100644 index 26145d2b4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/hard.toml +++ /dev/null @@ -1,22 +0,0 @@ -# Test file for TOML -# Only this one tries to emulate a TOML file written by a user of the kind of parser writers probably hate -# This part you'll really hate - -[the] -test_string = "You'll hate me after this - #" # " Annoying, isn't it? - - [the.hard] - test_array = [ "] ", " # "] # ] There you go, parse this! - test_array2 = [ "Test #11 ]proved that", "Experiment #9 was a success" ] - # You didn't think it'd as easy as chucking out the last #, did you? - another_test_string = " Same thing, but with a string #" - harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" - # Things will get harder - - [the.hard.bit#] - what? = "You don't think some user won't do that?" - multi_line_array = [ - "]", - # ] Oh yes I did - ] - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/implicit.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/implicit.toml deleted file mode 100644 index 1dea5ceb4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/implicit.toml +++ /dev/null @@ -1,4 +0,0 @@ -# [x] you -# [x.y] don't -# [x.y.z] need these -[x.y.z.w] # for this to work diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/invalid-apples.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/invalid-apples.toml deleted file mode 100644 index 74e9e337e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/invalid-apples.toml +++ /dev/null @@ -1,6 +0,0 @@ -# DO NOT WANT -[fruit] -type = "apple" - -[fruit.type] -apple = "yes" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/invalid.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/invalid.toml deleted file mode 100644 index beb1dba54..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/invalid.toml +++ /dev/null @@ -1,35 +0,0 @@ -# This is an INVALID TOML document. Boom. -# Can you spot the error without help? - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T7:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/readme1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/readme1.toml deleted file mode 100644 index 3e1261d4c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/readme1.toml +++ /dev/null @@ -1,5 +0,0 @@ -Age = 25 -Cats = [ "Cauchy", "Plato" ] -Pi = 3.14 -Perfection = [ 6, 28, 496, 8128 ] -DOB = 1987-07-05T05:45:00Z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/readme2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/readme2.toml deleted file mode 100644 index b51cd9340..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/_examples/readme2.toml +++ /dev/null @@ -1 +0,0 @@ -some_key_NAME = "wat" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/COPYING b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/COPYING deleted file mode 100644 index 01b574320..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 TOML authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/README.md b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/README.md deleted file mode 100644 index 75b501c96..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Implements the TOML test suite interface - -This is an implementation of the interface expected by -[toml-test](https://github.com/BurntSushi/toml-test) for my -[toml parser written in Go](https://github.com/BurntSushi/toml). -In particular, it maps TOML data on `stdin` to a JSON format on `stdout`. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/main.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/main.go deleted file mode 100644 index 344047f1f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-decoder/main.go +++ /dev/null @@ -1,43 +0,0 @@ -// Command toml-test-decoder satisfies the toml-test interface for testing TOML -// decoders. Namely, it accepts TOML on stdin and outputs JSON on stdout. -package main - -import ( - "encoding/json" - "flag" - "log" - "os" - "path" - - "github.com/BurntSushi/toml" - "github.com/BurntSushi/toml/internal/tag" -) - -func init() { - log.SetFlags(0) - flag.Usage = usage - flag.Parse() -} - -func usage() { - log.Printf("Usage: %s < toml-file\n", path.Base(os.Args[0])) - flag.PrintDefaults() - os.Exit(1) -} - -func main() { - if flag.NArg() != 0 { - flag.Usage() - } - - var decoded interface{} - if _, err := toml.DecodeReader(os.Stdin, &decoded); err != nil { - log.Fatalf("Error decoding TOML: %s", err) - } - - j := json.NewEncoder(os.Stdout) - j.SetIndent("", " ") - if err := j.Encode(tag.Add("", decoded)); err != nil { - log.Fatalf("Error encoding JSON: %s", err) - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/COPYING b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/COPYING deleted file mode 100644 index 01b574320..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 TOML authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/README.md b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/README.md deleted file mode 100644 index a10653215..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Implements the TOML test suite interface for TOML encoders - -This is an implementation of the interface expected by -[toml-test](https://github.com/BurntSushi/toml-test) for the -[TOML encoder](https://github.com/BurntSushi/toml). -In particular, it maps JSON data on `stdin` to a TOML format on `stdout`. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/main.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/main.go deleted file mode 100644 index 2f16d1e5e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/toml-test-encoder/main.go +++ /dev/null @@ -1,41 +0,0 @@ -// Command toml-test-encoder satisfies the toml-test interface for testing TOML -// encoders. Namely, it accepts JSON on stdin and outputs TOML on stdout. -package main - -import ( - "encoding/json" - "flag" - "log" - "os" - "path" - - "github.com/BurntSushi/toml" - "github.com/BurntSushi/toml/internal/tag" -) - -func init() { - log.SetFlags(0) - flag.Usage = usage - flag.Parse() -} - -func usage() { - log.Printf("Usage: %s < json-file\n", path.Base(os.Args[0])) - flag.PrintDefaults() - os.Exit(1) -} - -func main() { - if flag.NArg() != 0 { - flag.Usage() - } - - var tmp interface{} - if err := json.NewDecoder(os.Stdin).Decode(&tmp); err != nil { - log.Fatalf("Error decoding JSON: %s", err) - } - - if err := toml.NewEncoder(os.Stdout).Encode(tag.Remove(tmp)); err != nil { - log.Fatalf("Error encoding TOML: %s", err) - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/COPYING b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/COPYING deleted file mode 100644 index 01b574320..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 TOML authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/README.md b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/README.md deleted file mode 100644 index 53c6fb065..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# TOML Validator - -If Go is installed, it's simple to try it out: - - $ go install github.com/BurntSushi/toml/cmd/tomlv@master - $ tomlv some-toml-file.toml - -You can see the types of every key in a TOML file with: - - $ tomlv -types some-toml-file.toml - -At the moment, only one error message is reported at a time. Error messages -include line numbers. No output means that the files given are valid TOML, or -there is a bug in `tomlv`. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/main.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/main.go deleted file mode 100644 index 0eeb3cecd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/cmd/tomlv/main.go +++ /dev/null @@ -1,56 +0,0 @@ -// Command tomlv validates TOML documents and prints each key's type. -package main - -import ( - "flag" - "fmt" - "log" - "os" - "path" - "strings" - "text/tabwriter" - - "github.com/BurntSushi/toml" -) - -var ( - flagTypes = false -) - -func init() { - log.SetFlags(0) - flag.BoolVar(&flagTypes, "types", flagTypes, "Show the types for every key.") - flag.Usage = usage - flag.Parse() -} - -func usage() { - log.Printf("Usage: %s toml-file [ toml-file ... ]\n", path.Base(os.Args[0])) - flag.PrintDefaults() - os.Exit(1) -} - -func main() { - if flag.NArg() < 1 { - flag.Usage() - } - for _, f := range flag.Args() { - var tmp interface{} - md, err := toml.DecodeFile(f, &tmp) - if err != nil { - log.Fatalf("Error in '%s': %s", f, err) - } - if flagTypes { - printTypes(md) - } - } -} - -func printTypes(md toml.MetaData) { - tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) - for _, key := range md.Keys() { - fmt.Fprintf(tabw, "%s%s\t%s\n", - strings.Repeat(" ", len(key)-1), key, md.Type(key...)) - } - tabw.Flush() -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode.go deleted file mode 100644 index d3d3b8397..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode.go +++ /dev/null @@ -1,511 +0,0 @@ -package toml - -import ( - "encoding" - "fmt" - "io" - "io/ioutil" - "math" - "os" - "reflect" - "strings" - "time" -) - -// Unmarshaler is the interface implemented by objects that can unmarshal a -// TOML description of themselves. -type Unmarshaler interface { - UnmarshalTOML(interface{}) error -} - -// Unmarshal decodes the contents of `p` in TOML format into a pointer `v`. -func Unmarshal(p []byte, v interface{}) error { - _, err := Decode(string(p), v) - return err -} - -// Primitive is a TOML value that hasn't been decoded into a Go value. -// -// This type can be used for any value, which will cause decoding to be delayed. -// You can use the PrimitiveDecode() function to "manually" decode these values. -// -// NOTE: The underlying representation of a `Primitive` value is subject to -// change. Do not rely on it. -// -// NOTE: Primitive values are still parsed, so using them will only avoid the -// overhead of reflection. They can be useful when you don't know the exact type -// of TOML data until runtime. -type Primitive struct { - undecoded interface{} - context Key -} - -// PrimitiveDecode is just like the other `Decode*` functions, except it -// decodes a TOML value that has already been parsed. Valid primitive values -// can *only* be obtained from values filled by the decoder functions, -// including this method. (i.e., `v` may contain more `Primitive` -// values.) -// -// Meta data for primitive values is included in the meta data returned by -// the `Decode*` functions with one exception: keys returned by the Undecoded -// method will only reflect keys that were decoded. Namely, any keys hidden -// behind a Primitive will be considered undecoded. Executing this method will -// update the undecoded keys in the meta data. (See the example.) -func (md *MetaData) PrimitiveDecode(primValue Primitive, v interface{}) error { - md.context = primValue.context - defer func() { md.context = nil }() - return md.unify(primValue.undecoded, rvalue(v)) -} - -// Decoder decodes TOML data. -// -// TOML tables correspond to Go structs or maps (dealer's choice – they can be -// used interchangeably). -// -// TOML table arrays correspond to either a slice of structs or a slice of maps. -// -// TOML datetimes correspond to Go time.Time values. Local datetimes are parsed -// in the local timezone. -// -// All other TOML types (float, string, int, bool and array) correspond to the -// obvious Go types. -// -// An exception to the above rules is if a type implements the TextUnmarshaler -// interface, in which case any primitive TOML value (floats, strings, integers, -// booleans, datetimes) will be converted to a []byte and given to the value's -// UnmarshalText method. See the Unmarshaler example for a demonstration with -// time duration strings. -// -// Key mapping -// -// TOML keys can map to either keys in a Go map or field names in a Go struct. -// The special `toml` struct tag can be used to map TOML keys to struct fields -// that don't match the key name exactly (see the example). A case insensitive -// match to struct names will be tried if an exact match can't be found. -// -// The mapping between TOML values and Go values is loose. That is, there may -// exist TOML values that cannot be placed into your representation, and there -// may be parts of your representation that do not correspond to TOML values. -// This loose mapping can be made stricter by using the IsDefined and/or -// Undecoded methods on the MetaData returned. -// -// This decoder does not handle cyclic types. Decode will not terminate if a -// cyclic type is passed. -type Decoder struct { - r io.Reader -} - -// NewDecoder creates a new Decoder. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{r: r} -} - -// Decode TOML data in to the pointer `v`. -func (dec *Decoder) Decode(v interface{}) (MetaData, error) { - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr { - return MetaData{}, e("Decode of non-pointer %s", reflect.TypeOf(v)) - } - if rv.IsNil() { - return MetaData{}, e("Decode of nil %s", reflect.TypeOf(v)) - } - - // TODO: have parser should read from io.Reader? Or at the very least, make - // it read from []byte rather than string - data, err := ioutil.ReadAll(dec.r) - if err != nil { - return MetaData{}, err - } - - p, err := parse(string(data)) - if err != nil { - return MetaData{}, err - } - md := MetaData{ - p.mapping, p.types, p.ordered, - make(map[string]bool, len(p.ordered)), nil, - } - return md, md.unify(p.mapping, indirect(rv)) -} - -// Decode the TOML data in to the pointer v. -// -// See the documentation on Decoder for a description of the decoding process. -func Decode(data string, v interface{}) (MetaData, error) { - return NewDecoder(strings.NewReader(data)).Decode(v) -} - -// DecodeFile is just like Decode, except it will automatically read the -// contents of the file at path and decode it for you. -func DecodeFile(path string, v interface{}) (MetaData, error) { - fp, err := os.Open(path) - if err != nil { - return MetaData{}, err - } - defer fp.Close() - return NewDecoder(fp).Decode(v) -} - -// unify performs a sort of type unification based on the structure of `rv`, -// which is the client representation. -// -// Any type mismatch produces an error. Finding a type that we don't know -// how to handle produces an unsupported type error. -func (md *MetaData) unify(data interface{}, rv reflect.Value) error { - // Special case. Look for a `Primitive` value. - // TODO: #76 would make this superfluous after implemented. - if rv.Type() == reflect.TypeOf((*Primitive)(nil)).Elem() { - // Save the undecoded data and the key context into the primitive - // value. - context := make(Key, len(md.context)) - copy(context, md.context) - rv.Set(reflect.ValueOf(Primitive{ - undecoded: data, - context: context, - })) - return nil - } - - // Special case. Unmarshaler Interface support. - if rv.CanAddr() { - if v, ok := rv.Addr().Interface().(Unmarshaler); ok { - return v.UnmarshalTOML(data) - } - } - - // Special case. Look for a value satisfying the TextUnmarshaler interface. - if v, ok := rv.Interface().(encoding.TextUnmarshaler); ok { - return md.unifyText(data, v) - } - // TODO: - // The behavior here is incorrect whenever a Go type satisfies the - // encoding.TextUnmarshaler interface but also corresponds to a TOML hash or - // array. In particular, the unmarshaler should only be applied to primitive - // TOML values. But at this point, it will be applied to all kinds of values - // and produce an incorrect error whenever those values are hashes or arrays - // (including arrays of tables). - - k := rv.Kind() - - // laziness - if k >= reflect.Int && k <= reflect.Uint64 { - return md.unifyInt(data, rv) - } - switch k { - case reflect.Ptr: - elem := reflect.New(rv.Type().Elem()) - err := md.unify(data, reflect.Indirect(elem)) - if err != nil { - return err - } - rv.Set(elem) - return nil - case reflect.Struct: - return md.unifyStruct(data, rv) - case reflect.Map: - return md.unifyMap(data, rv) - case reflect.Array: - return md.unifyArray(data, rv) - case reflect.Slice: - return md.unifySlice(data, rv) - case reflect.String: - return md.unifyString(data, rv) - case reflect.Bool: - return md.unifyBool(data, rv) - case reflect.Interface: - // we only support empty interfaces. - if rv.NumMethod() > 0 { - return e("unsupported type %s", rv.Type()) - } - return md.unifyAnything(data, rv) - case reflect.Float32: - fallthrough - case reflect.Float64: - return md.unifyFloat64(data, rv) - } - return e("unsupported type %s", rv.Kind()) -} - -func (md *MetaData) unifyStruct(mapping interface{}, rv reflect.Value) error { - tmap, ok := mapping.(map[string]interface{}) - if !ok { - if mapping == nil { - return nil - } - return e("type mismatch for %s: expected table but found %T", - rv.Type().String(), mapping) - } - - for key, datum := range tmap { - var f *field - fields := cachedTypeFields(rv.Type()) - for i := range fields { - ff := &fields[i] - if ff.name == key { - f = ff - break - } - if f == nil && strings.EqualFold(ff.name, key) { - f = ff - } - } - if f != nil { - subv := rv - for _, i := range f.index { - subv = indirect(subv.Field(i)) - } - if isUnifiable(subv) { - md.decoded[md.context.add(key).String()] = true - md.context = append(md.context, key) - if err := md.unify(datum, subv); err != nil { - return err - } - md.context = md.context[0 : len(md.context)-1] - } else if f.name != "" { - // Bad user! No soup for you! - return e("cannot write unexported field %s.%s", - rv.Type().String(), f.name) - } - } - } - return nil -} - -func (md *MetaData) unifyMap(mapping interface{}, rv reflect.Value) error { - if k := rv.Type().Key().Kind(); k != reflect.String { - return fmt.Errorf( - "toml: cannot decode to a map with non-string key type (%s in %q)", - k, rv.Type()) - } - - tmap, ok := mapping.(map[string]interface{}) - if !ok { - if tmap == nil { - return nil - } - return badtype("map", mapping) - } - if rv.IsNil() { - rv.Set(reflect.MakeMap(rv.Type())) - } - for k, v := range tmap { - md.decoded[md.context.add(k).String()] = true - md.context = append(md.context, k) - - rvkey := indirect(reflect.New(rv.Type().Key())) - rvval := reflect.Indirect(reflect.New(rv.Type().Elem())) - if err := md.unify(v, rvval); err != nil { - return err - } - md.context = md.context[0 : len(md.context)-1] - - rvkey.SetString(k) - rv.SetMapIndex(rvkey, rvval) - } - return nil -} - -func (md *MetaData) unifyArray(data interface{}, rv reflect.Value) error { - datav := reflect.ValueOf(data) - if datav.Kind() != reflect.Slice { - if !datav.IsValid() { - return nil - } - return badtype("slice", data) - } - if l := datav.Len(); l != rv.Len() { - return e("expected array length %d; got TOML array of length %d", rv.Len(), l) - } - return md.unifySliceArray(datav, rv) -} - -func (md *MetaData) unifySlice(data interface{}, rv reflect.Value) error { - datav := reflect.ValueOf(data) - if datav.Kind() != reflect.Slice { - if !datav.IsValid() { - return nil - } - return badtype("slice", data) - } - n := datav.Len() - if rv.IsNil() || rv.Cap() < n { - rv.Set(reflect.MakeSlice(rv.Type(), n, n)) - } - rv.SetLen(n) - return md.unifySliceArray(datav, rv) -} - -func (md *MetaData) unifySliceArray(data, rv reflect.Value) error { - l := data.Len() - for i := 0; i < l; i++ { - err := md.unify(data.Index(i).Interface(), indirect(rv.Index(i))) - if err != nil { - return err - } - } - return nil -} - -func (md *MetaData) unifyDatetime(data interface{}, rv reflect.Value) error { - if _, ok := data.(time.Time); ok { - rv.Set(reflect.ValueOf(data)) - return nil - } - return badtype("time.Time", data) -} - -func (md *MetaData) unifyString(data interface{}, rv reflect.Value) error { - if s, ok := data.(string); ok { - rv.SetString(s) - return nil - } - return badtype("string", data) -} - -func (md *MetaData) unifyFloat64(data interface{}, rv reflect.Value) error { - if num, ok := data.(float64); ok { - switch rv.Kind() { - case reflect.Float32: - fallthrough - case reflect.Float64: - rv.SetFloat(num) - default: - panic("bug") - } - return nil - } - return badtype("float", data) -} - -func (md *MetaData) unifyInt(data interface{}, rv reflect.Value) error { - if num, ok := data.(int64); ok { - if rv.Kind() >= reflect.Int && rv.Kind() <= reflect.Int64 { - switch rv.Kind() { - case reflect.Int, reflect.Int64: - // No bounds checking necessary. - case reflect.Int8: - if num < math.MinInt8 || num > math.MaxInt8 { - return e("value %d is out of range for int8", num) - } - case reflect.Int16: - if num < math.MinInt16 || num > math.MaxInt16 { - return e("value %d is out of range for int16", num) - } - case reflect.Int32: - if num < math.MinInt32 || num > math.MaxInt32 { - return e("value %d is out of range for int32", num) - } - } - rv.SetInt(num) - } else if rv.Kind() >= reflect.Uint && rv.Kind() <= reflect.Uint64 { - unum := uint64(num) - switch rv.Kind() { - case reflect.Uint, reflect.Uint64: - // No bounds checking necessary. - case reflect.Uint8: - if num < 0 || unum > math.MaxUint8 { - return e("value %d is out of range for uint8", num) - } - case reflect.Uint16: - if num < 0 || unum > math.MaxUint16 { - return e("value %d is out of range for uint16", num) - } - case reflect.Uint32: - if num < 0 || unum > math.MaxUint32 { - return e("value %d is out of range for uint32", num) - } - } - rv.SetUint(unum) - } else { - panic("unreachable") - } - return nil - } - return badtype("integer", data) -} - -func (md *MetaData) unifyBool(data interface{}, rv reflect.Value) error { - if b, ok := data.(bool); ok { - rv.SetBool(b) - return nil - } - return badtype("boolean", data) -} - -func (md *MetaData) unifyAnything(data interface{}, rv reflect.Value) error { - rv.Set(reflect.ValueOf(data)) - return nil -} - -func (md *MetaData) unifyText(data interface{}, v encoding.TextUnmarshaler) error { - var s string - switch sdata := data.(type) { - case TextMarshaler: - text, err := sdata.MarshalText() - if err != nil { - return err - } - s = string(text) - case fmt.Stringer: - s = sdata.String() - case string: - s = sdata - case bool: - s = fmt.Sprintf("%v", sdata) - case int64: - s = fmt.Sprintf("%d", sdata) - case float64: - s = fmt.Sprintf("%f", sdata) - default: - return badtype("primitive (string-like)", data) - } - if err := v.UnmarshalText([]byte(s)); err != nil { - return err - } - return nil -} - -// rvalue returns a reflect.Value of `v`. All pointers are resolved. -func rvalue(v interface{}) reflect.Value { - return indirect(reflect.ValueOf(v)) -} - -// indirect returns the value pointed to by a pointer. -// Pointers are followed until the value is not a pointer. -// New values are allocated for each nil pointer. -// -// An exception to this rule is if the value satisfies an interface of -// interest to us (like encoding.TextUnmarshaler). -func indirect(v reflect.Value) reflect.Value { - if v.Kind() != reflect.Ptr { - if v.CanSet() { - pv := v.Addr() - if _, ok := pv.Interface().(encoding.TextUnmarshaler); ok { - return pv - } - } - return v - } - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - return indirect(reflect.Indirect(v)) -} - -func isUnifiable(rv reflect.Value) bool { - if rv.CanSet() { - return true - } - if _, ok := rv.Interface().(encoding.TextUnmarshaler); ok { - return true - } - return false -} - -func e(format string, args ...interface{}) error { - return fmt.Errorf("toml: "+format, args...) -} - -func badtype(expected string, data interface{}) error { - return e("cannot load TOML value of type %T into a Go %s", data, expected) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116.go deleted file mode 100644 index 38aa75fdc..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build go1.16 - -package toml - -import ( - "io/fs" -) - -// DecodeFS is just like Decode, except it will automatically read the contents -// of the file at `path` from a fs.FS instance. -func DecodeFS(fsys fs.FS, path string, v interface{}) (MetaData, error) { - fp, err := fsys.Open(path) - if err != nil { - return MetaData{}, err - } - defer fp.Close() - return NewDecoder(fp).Decode(v) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116_test.go deleted file mode 100644 index 5d36789b6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_go116_test.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build go1.16 - -package toml - -import ( - "fmt" - "testing" - "testing/fstest" -) - -func TestDecodeFS(t *testing.T) { - fsys := fstest.MapFS{ - "test.toml": &fstest.MapFile{ - Data: []byte("a = 42"), - }, - } - - var i struct{ A int } - meta, err := DecodeFS(fsys, "test.toml", &i) - if err != nil { - t.Fatal(err) - } - have := fmt.Sprintf("%v %v %v", i, meta.Keys(), meta.Type("a")) - want := "{42} [a] Integer" - if have != want { - t.Errorf("\nhave: %s\nwant: %s", have, want) - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_meta.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_meta.go deleted file mode 100644 index ad8899c6c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_meta.go +++ /dev/null @@ -1,123 +0,0 @@ -package toml - -import "strings" - -// MetaData allows access to meta information about TOML data that may not be -// inferable via reflection. In particular, whether a key has been defined and -// the TOML type of a key. -type MetaData struct { - mapping map[string]interface{} - types map[string]tomlType - keys []Key - decoded map[string]bool - context Key // Used only during decoding. -} - -// IsDefined reports if the key exists in the TOML data. -// -// The key should be specified hierarchically, for example to access the TOML -// key "a.b.c" you would use: -// -// IsDefined("a", "b", "c") -// -// IsDefined will return false if an empty key given. Keys are case sensitive. -func (md *MetaData) IsDefined(key ...string) bool { - if len(key) == 0 { - return false - } - - var hash map[string]interface{} - var ok bool - var hashOrVal interface{} = md.mapping - for _, k := range key { - if hash, ok = hashOrVal.(map[string]interface{}); !ok { - return false - } - if hashOrVal, ok = hash[k]; !ok { - return false - } - } - return true -} - -// Type returns a string representation of the type of the key specified. -// -// Type will return the empty string if given an empty key or a key that does -// not exist. Keys are case sensitive. -func (md *MetaData) Type(key ...string) string { - fullkey := strings.Join(key, ".") - if typ, ok := md.types[fullkey]; ok { - return typ.typeString() - } - return "" -} - -// Key represents any TOML key, including key groups. Use (MetaData).Keys to get -// values of this type. -type Key []string - -func (k Key) String() string { return strings.Join(k, ".") } - -func (k Key) maybeQuotedAll() string { - var ss []string - for i := range k { - ss = append(ss, k.maybeQuoted(i)) - } - return strings.Join(ss, ".") -} - -func (k Key) maybeQuoted(i int) string { - if k[i] == "" { - return `""` - } - quote := false - for _, c := range k[i] { - if !isBareKeyChar(c) { - quote = true - break - } - } - if quote { - return `"` + quotedReplacer.Replace(k[i]) + `"` - } - return k[i] -} - -func (k Key) add(piece string) Key { - newKey := make(Key, len(k)+1) - copy(newKey, k) - newKey[len(k)] = piece - return newKey -} - -// Keys returns a slice of every key in the TOML data, including key groups. -// -// Each key is itself a slice, where the first element is the top of the -// hierarchy and the last is the most specific. The list will have the same -// order as the keys appeared in the TOML data. -// -// All keys returned are non-empty. -func (md *MetaData) Keys() []Key { - return md.keys -} - -// Undecoded returns all keys that have not been decoded in the order in which -// they appear in the original TOML document. -// -// This includes keys that haven't been decoded because of a Primitive value. -// Once the Primitive value is decoded, the keys will be considered decoded. -// -// Also note that decoding into an empty interface will result in no decoding, -// and so no keys will be considered decoded. -// -// In this sense, the Undecoded keys correspond to keys in the TOML document -// that do not have a concrete type in your representation. -func (md *MetaData) Undecoded() []Key { - undecoded := make([]Key, 0, len(md.keys)) - for _, key := range md.keys { - if !md.decoded[key.String()] { - undecoded = append(undecoded, key) - } - } - return undecoded -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_test.go deleted file mode 100644 index f51101f9b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/decode_test.go +++ /dev/null @@ -1,759 +0,0 @@ -package toml - -import ( - "errors" - "fmt" - "io/ioutil" - "os" - "reflect" - "strings" - "testing" - "time" - - "github.com/BurntSushi/toml/internal" -) - -func TestDecodeReader(t *testing.T) { - var i struct{ A int } - meta, err := DecodeReader(strings.NewReader("a = 42"), &i) - if err != nil { - t.Fatal(err) - } - have := fmt.Sprintf("%v %v %v", i, meta.Keys(), meta.Type("a")) - want := "{42} [a] Integer" - if have != want { - t.Errorf("\nhave: %s\nwant: %s", have, want) - } -} - -func TestDecodeFile(t *testing.T) { - tmp, err := ioutil.TempFile("", "toml-") - if err != nil { - t.Fatal(err) - } - defer os.Remove(tmp.Name()) - if _, err := tmp.WriteString("a = 42"); err != nil { - t.Fatal(err) - } - if err := tmp.Close(); err != nil { - t.Fatal(err) - } - - var i struct{ A int } - meta, err := DecodeFile(tmp.Name(), &i) - if err != nil { - t.Fatal(err) - } - - have := fmt.Sprintf("%v %v %v", i, meta.Keys(), meta.Type("a")) - want := "{42} [a] Integer" - if have != want { - t.Errorf("\nhave: %s\nwant: %s", have, want) - } -} - -func TestDecodeBOM(t *testing.T) { - for _, tt := range [][]byte{ - []byte("\xff\xfea = \"b\""), - []byte("\xfe\xffa = \"b\""), - } { - t.Run("", func(t *testing.T) { - var s struct{ A string } - _, err := Decode(string(tt), &s) - if err != nil { - t.Fatal(err) - } - if s.A != "b" { - t.Errorf(`s.A is not "b" but %q`, s.A) - } - }) - } -} - -func TestDecodeEmbedded(t *testing.T) { - type Dog struct{ Name string } - type Age int - type cat struct{ Name string } - - for _, test := range []struct { - label string - input string - decodeInto interface{} - wantDecoded interface{} - }{ - { - label: "embedded struct", - input: `Name = "milton"`, - decodeInto: &struct{ Dog }{}, - wantDecoded: &struct{ Dog }{Dog{"milton"}}, - }, - { - label: "embedded non-nil pointer to struct", - input: `Name = "milton"`, - decodeInto: &struct{ *Dog }{}, - wantDecoded: &struct{ *Dog }{&Dog{"milton"}}, - }, - { - label: "embedded nil pointer to struct", - input: ``, - decodeInto: &struct{ *Dog }{}, - wantDecoded: &struct{ *Dog }{nil}, - }, - { - label: "unexported embedded struct", - input: `Name = "socks"`, - decodeInto: &struct{ cat }{}, - wantDecoded: &struct{ cat }{cat{"socks"}}, - }, - { - label: "embedded int", - input: `Age = -5`, - decodeInto: &struct{ Age }{}, - wantDecoded: &struct{ Age }{-5}, - }, - } { - _, err := Decode(test.input, test.decodeInto) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(test.wantDecoded, test.decodeInto) { - t.Errorf("%s: want decoded == %+v, got %+v", - test.label, test.wantDecoded, test.decodeInto) - } - } -} - -func TestDecodeIgnoreFields(t *testing.T) { - const input = ` -Number = 123 -- = 234 -` - var s struct { - Number int `toml:"-"` - } - if _, err := Decode(input, &s); err != nil { - t.Fatal(err) - } - if s.Number != 0 { - t.Errorf("got: %d; want 0", s.Number) - } -} - -func TestDecodeTableArrays(t *testing.T) { - var tomlTableArrays = ` -[[albums]] -name = "Born to Run" - - [[albums.songs]] - name = "Jungleland" - - [[albums.songs]] - name = "Meeting Across the River" - -[[albums]] -name = "Born in the USA" - - [[albums.songs]] - name = "Glory Days" - - [[albums.songs]] - name = "Dancing in the Dark" -` - - type Song struct { - Name string - } - - type Album struct { - Name string - Songs []Song - } - - type Music struct { - Albums []Album - } - - expected := Music{[]Album{ - {"Born to Run", []Song{{"Jungleland"}, {"Meeting Across the River"}}}, - {"Born in the USA", []Song{{"Glory Days"}, {"Dancing in the Dark"}}}, - }} - var got Music - if _, err := Decode(tomlTableArrays, &got); err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(expected, got) { - t.Fatalf("\n%#v\n!=\n%#v\n", expected, got) - } -} - -func TestDecodePointers(t *testing.T) { - type Object struct { - Type string - Description string - } - - type Dict struct { - NamedObject map[string]*Object - BaseObject *Object - Strptr *string - Strptrs []*string - } - s1, s2, s3 := "blah", "abc", "def" - expected := &Dict{ - Strptr: &s1, - Strptrs: []*string{&s2, &s3}, - NamedObject: map[string]*Object{ - "foo": {"FOO", "fooooo!!!"}, - "bar": {"BAR", "ba-ba-ba-ba-barrrr!!!"}, - }, - BaseObject: &Object{"BASE", "da base"}, - } - - ex1 := ` -Strptr = "blah" -Strptrs = ["abc", "def"] - -[NamedObject.foo] -Type = "FOO" -Description = "fooooo!!!" - -[NamedObject.bar] -Type = "BAR" -Description = "ba-ba-ba-ba-barrrr!!!" - -[BaseObject] -Type = "BASE" -Description = "da base" -` - dict := new(Dict) - _, err := Decode(ex1, dict) - if err != nil { - t.Errorf("Decode error: %v", err) - } - if !reflect.DeepEqual(expected, dict) { - t.Fatalf("\n%#v\n!=\n%#v\n", expected, dict) - } -} - -func TestDecodeBadDatetime(t *testing.T) { - var x struct{ T time.Time } - for _, s := range []string{"123", "1230"} { - input := "T = " + s - if _, err := Decode(input, &x); err == nil { - t.Errorf("Expected invalid DateTime error for %q", s) - } - } -} - -type sphere struct { - Center [3]float64 - Radius float64 -} - -func TestDecodeArrayWrongSize(t *testing.T) { - var s1 sphere - if _, err := Decode(`center = [0.1, 2.3]`, &s1); err == nil { - t.Fatal("Expected array type mismatch error") - } -} - -func TestDecodeIntOverflow(t *testing.T) { - type table struct { - Value int8 - } - var tab table - if _, err := Decode(`value = 500`, &tab); err == nil { - t.Fatal("Expected integer out-of-bounds error.") - } -} - -func TestDecodeSizedInts(t *testing.T) { - type table struct { - U8 uint8 - U16 uint16 - U32 uint32 - U64 uint64 - U uint - I8 int8 - I16 int16 - I32 int32 - I64 int64 - I int - } - answer := table{1, 1, 1, 1, 1, -1, -1, -1, -1, -1} - toml := ` - u8 = 1 - u16 = 1 - u32 = 1 - u64 = 1 - u = 1 - i8 = -1 - i16 = -1 - i32 = -1 - i64 = -1 - i = -1 - ` - var tab table - if _, err := Decode(toml, &tab); err != nil { - t.Fatal(err.Error()) - } - if answer != tab { - t.Fatalf("Expected %#v but got %#v", answer, tab) - } -} - -func TestDecodeTypes(t *testing.T) { - type mystr string - - for _, tt := range []struct { - v interface{} - want string - }{ - {new(map[string]int64), ""}, - {new(map[mystr]int64), ""}, - - {3, "non-pointer int"}, - {(*int)(nil), "nil"}, - {new(map[int]string), "cannot decode to a map with non-string key type"}, - {new(map[interface{}]string), "cannot decode to a map with non-string key type"}, - } { - t.Run(fmt.Sprintf("%T", tt.v), func(t *testing.T) { - _, err := Decode(`x = 3`, tt.v) - if !errorContains(err, tt.want) { - t.Errorf("wrong error\nhave: %q\nwant: %q", err, tt.want) - } - }) - } -} - -func TestUnmarshaler(t *testing.T) { - var tomlBlob = ` -[dishes.hamboogie] -name = "Hamboogie with fries" -price = 10.99 - -[[dishes.hamboogie.ingredients]] -name = "Bread Bun" - -[[dishes.hamboogie.ingredients]] -name = "Lettuce" - -[[dishes.hamboogie.ingredients]] -name = "Real Beef Patty" - -[[dishes.hamboogie.ingredients]] -name = "Tomato" - -[dishes.eggsalad] -name = "Egg Salad with rice" -price = 3.99 - -[[dishes.eggsalad.ingredients]] -name = "Egg" - -[[dishes.eggsalad.ingredients]] -name = "Mayo" - -[[dishes.eggsalad.ingredients]] -name = "Rice" -` - m := &menu{} - if _, err := Decode(tomlBlob, m); err != nil { - t.Fatal(err) - } - - if len(m.Dishes) != 2 { - t.Log("two dishes should be loaded with UnmarshalTOML()") - t.Errorf("expected %d but got %d", 2, len(m.Dishes)) - } - - eggSalad := m.Dishes["eggsalad"] - if _, ok := interface{}(eggSalad).(dish); !ok { - t.Errorf("expected a dish") - } - - if eggSalad.Name != "Egg Salad with rice" { - t.Errorf("expected the dish to be named 'Egg Salad with rice'") - } - - if len(eggSalad.Ingredients) != 3 { - t.Log("dish should be loaded with UnmarshalTOML()") - t.Errorf("expected %d but got %d", 3, len(eggSalad.Ingredients)) - } - - found := false - for _, i := range eggSalad.Ingredients { - if i.Name == "Rice" { - found = true - break - } - } - if !found { - t.Error("Rice was not loaded in UnmarshalTOML()") - } - - // test on a value - must be passed as * - o := menu{} - if _, err := Decode(tomlBlob, &o); err != nil { - t.Fatal(err) - } - -} - -func TestDecodeInlineTable(t *testing.T) { - input := ` -[CookieJar] -Types = {Chocolate = "yummy", Oatmeal = "best ever"} - -[Seasons] -Locations = {NY = {Temp = "not cold", Rating = 4}, MI = {Temp = "freezing", Rating = 9}} -` - type cookieJar struct { - Types map[string]string - } - type properties struct { - Temp string - Rating int - } - type seasons struct { - Locations map[string]properties - } - type wrapper struct { - CookieJar cookieJar - Seasons seasons - } - var got wrapper - - meta, err := Decode(input, &got) - if err != nil { - t.Fatal(err) - } - want := wrapper{ - CookieJar: cookieJar{ - Types: map[string]string{ - "Chocolate": "yummy", - "Oatmeal": "best ever", - }, - }, - Seasons: seasons{ - Locations: map[string]properties{ - "NY": { - Temp: "not cold", - Rating: 4, - }, - "MI": { - Temp: "freezing", - Rating: 9, - }, - }, - }, - } - if !reflect.DeepEqual(got, want) { - t.Fatalf("after decode, got:\n\n%#v\n\nwant:\n\n%#v", got, want) - } - if len(meta.keys) != 12 { - t.Errorf("after decode, got %d meta keys; want 12", len(meta.keys)) - } - if len(meta.types) != 12 { - t.Errorf("after decode, got %d meta types; want 12", len(meta.types)) - } -} - -func TestDecodeInlineTableArray(t *testing.T) { - type point struct { - X, Y, Z int - } - var got struct { - Points []point - } - // Example inline table array from the spec. - const in = ` -points = [ { x = 1, y = 2, z = 3 }, - { x = 7, y = 8, z = 9 }, - { x = 2, y = 4, z = 8 } ] - -` - if _, err := Decode(in, &got); err != nil { - t.Fatal(err) - } - want := []point{ - {X: 1, Y: 2, Z: 3}, - {X: 7, Y: 8, Z: 9}, - {X: 2, Y: 4, Z: 8}, - } - if !reflect.DeepEqual(got.Points, want) { - t.Errorf("got %#v; want %#v", got.Points, want) - } -} - -type menu struct { - Dishes map[string]dish -} - -func (m *menu) UnmarshalTOML(p interface{}) error { - m.Dishes = make(map[string]dish) - data, _ := p.(map[string]interface{}) - dishes := data["dishes"].(map[string]interface{}) - for n, v := range dishes { - if d, ok := v.(map[string]interface{}); ok { - nd := dish{} - nd.UnmarshalTOML(d) - m.Dishes[n] = nd - } else { - return fmt.Errorf("not a dish") - } - } - return nil -} - -type dish struct { - Name string - Price float32 - Ingredients []ingredient -} - -func (d *dish) UnmarshalTOML(p interface{}) error { - data, _ := p.(map[string]interface{}) - d.Name, _ = data["name"].(string) - d.Price, _ = data["price"].(float32) - ingredients, _ := data["ingredients"].([]map[string]interface{}) - for _, e := range ingredients { - n, _ := interface{}(e).(map[string]interface{}) - name, _ := n["name"].(string) - i := ingredient{name} - d.Ingredients = append(d.Ingredients, i) - } - return nil -} - -type ingredient struct { - Name string -} - -func TestDecodeSlices(t *testing.T) { - type T struct { - S []string - } - for i, tt := range []struct { - v T - input string - want T - }{ - {T{}, "", T{}}, - {T{[]string{}}, "", T{[]string{}}}, - {T{[]string{"a", "b"}}, "", T{[]string{"a", "b"}}}, - {T{}, "S = []", T{[]string{}}}, - {T{[]string{}}, "S = []", T{[]string{}}}, - {T{[]string{"a", "b"}}, "S = []", T{[]string{}}}, - {T{}, `S = ["x"]`, T{[]string{"x"}}}, - {T{[]string{}}, `S = ["x"]`, T{[]string{"x"}}}, - {T{[]string{"a", "b"}}, `S = ["x"]`, T{[]string{"x"}}}, - } { - if _, err := Decode(tt.input, &tt.v); err != nil { - t.Errorf("[%d] %s", i, err) - continue - } - if !reflect.DeepEqual(tt.v, tt.want) { - t.Errorf("[%d] got %#v; want %#v", i, tt.v, tt.want) - } - } -} - -func TestDecodePrimitive(t *testing.T) { - type S struct { - P Primitive - } - type T struct { - S []int - } - slicep := func(s []int) *[]int { return &s } - arrayp := func(a [2]int) *[2]int { return &a } - mapp := func(m map[string]int) *map[string]int { return &m } - for i, tt := range []struct { - v interface{} - input string - want interface{} - }{ - // slices - {slicep(nil), "", slicep(nil)}, - {slicep([]int{}), "", slicep([]int{})}, - {slicep([]int{1, 2, 3}), "", slicep([]int{1, 2, 3})}, - {slicep(nil), "P = [1,2]", slicep([]int{1, 2})}, - {slicep([]int{}), "P = [1,2]", slicep([]int{1, 2})}, - {slicep([]int{1, 2, 3}), "P = [1,2]", slicep([]int{1, 2})}, - - // arrays - {arrayp([2]int{2, 3}), "", arrayp([2]int{2, 3})}, - {arrayp([2]int{2, 3}), "P = [3,4]", arrayp([2]int{3, 4})}, - - // maps - {mapp(nil), "", mapp(nil)}, - {mapp(map[string]int{}), "", mapp(map[string]int{})}, - {mapp(map[string]int{"a": 1}), "", mapp(map[string]int{"a": 1})}, - {mapp(nil), "[P]\na = 2", mapp(map[string]int{"a": 2})}, - {mapp(map[string]int{}), "[P]\na = 2", mapp(map[string]int{"a": 2})}, - {mapp(map[string]int{"a": 1, "b": 3}), "[P]\na = 2", mapp(map[string]int{"a": 2, "b": 3})}, - - // structs - {&T{nil}, "[P]", &T{nil}}, - {&T{[]int{}}, "[P]", &T{[]int{}}}, - {&T{[]int{1, 2, 3}}, "[P]", &T{[]int{1, 2, 3}}}, - {&T{nil}, "[P]\nS = [1,2]", &T{[]int{1, 2}}}, - {&T{[]int{}}, "[P]\nS = [1,2]", &T{[]int{1, 2}}}, - {&T{[]int{1, 2, 3}}, "[P]\nS = [1,2]", &T{[]int{1, 2}}}, - } { - var s S - md, err := Decode(tt.input, &s) - if err != nil { - t.Errorf("[%d] Decode error: %s", i, err) - continue - } - if err := md.PrimitiveDecode(s.P, tt.v); err != nil { - t.Errorf("[%d] PrimitiveDecode error: %s", i, err) - continue - } - if !reflect.DeepEqual(tt.v, tt.want) { - t.Errorf("[%d] got %#v; want %#v", i, tt.v, tt.want) - } - } -} - -func BenchmarkDecode(b *testing.B) { - var testSimple = ` -age = 250 -andrew = "gallant" -kait = "brady" -now = 1987-07-05T05:45:00Z -nowEast = 2017-06-22T16:15:21+08:00 -nowWest = 2017-06-22T02:14:36-06:00 -yesOrNo = true -pi = 3.14 -colors = [ - ["red", "green", "blue"], - ["cyan", "magenta", "yellow", "black"], -] - -[My.Cats] -plato = "cat 1" -cauchy = """ cat 2 -""" -` - - type cats struct { - Plato string - Cauchy string - } - type simple struct { - Age int - Colors [][]string - Pi float64 - YesOrNo bool - Now time.Time - NowEast time.Time - NowWest time.Time - Andrew string - Kait string - My map[string]cats - } - - var val simple - _, err := Decode(testSimple, &val) - if err != nil { - b.Fatal(err) - } - - b.ResetTimer() - for n := 0; n < b.N; n++ { - Decode(testSimple, &val) - } -} - -func TestDecodeDatetime(t *testing.T) { - // Test here in addition to toml-test to ensure the TZs are correct. - tz7 := time.FixedZone("", -3600*7) - - for _, tt := range []struct { - in string - want time.Time - }{ - // Offset datetime - {"1979-05-27T07:32:00Z", time.Date(1979, 05, 27, 07, 32, 0, 0, time.UTC)}, - {"1979-05-27T07:32:00.999999Z", time.Date(1979, 05, 27, 07, 32, 0, 999999000, time.UTC)}, - {"1979-05-27T00:32:00-07:00", time.Date(1979, 05, 27, 00, 32, 0, 0, tz7)}, - {"1979-05-27T00:32:00.999999-07:00", time.Date(1979, 05, 27, 00, 32, 0, 999999000, tz7)}, - {"1979-05-27T00:32:00.24-07:00", time.Date(1979, 05, 27, 00, 32, 0, 240000000, tz7)}, - {"1979-05-27 07:32:00Z", time.Date(1979, 05, 27, 07, 32, 0, 0, time.UTC)}, - {"1979-05-27t07:32:00z", time.Date(1979, 05, 27, 07, 32, 0, 0, time.UTC)}, - - // Make sure the space between the datetime and "#" isn't lexed. - {"1979-05-27T07:32:12-07:00 # c", time.Date(1979, 05, 27, 07, 32, 12, 0, tz7)}, - - // Local times. - {"1979-05-27T07:32:00", time.Date(1979, 05, 27, 07, 32, 0, 0, internal.LocalDatetime)}, - {"1979-05-27T07:32:00.999999", time.Date(1979, 05, 27, 07, 32, 0, 999999000, internal.LocalDatetime)}, - {"1979-05-27T07:32:00.25", time.Date(1979, 05, 27, 07, 32, 0, 250000000, internal.LocalDatetime)}, - {"1979-05-27", time.Date(1979, 05, 27, 0, 0, 0, 0, internal.LocalDate)}, - {"07:32:00", time.Date(0, 1, 1, 07, 32, 0, 0, internal.LocalTime)}, - {"07:32:00.999999", time.Date(0, 1, 1, 07, 32, 0, 999999000, internal.LocalTime)}, - } { - t.Run(tt.in, func(t *testing.T) { - var x struct{ D time.Time } - input := "d = " + tt.in - if _, err := Decode(input, &x); err != nil { - t.Fatalf("got error: %s", err) - } - - if h, w := x.D.Format(time.RFC3339Nano), tt.want.Format(time.RFC3339Nano); h != w { - t.Errorf("\nhave: %s\nwant: %s", h, w) - } - }) - } -} - -func TestParseError(t *testing.T) { - file := - `a = "a" -b = "b" -c = 001 # invalid -` - - var s struct { - A, B string - C int - } - _, err := Decode(file, &s) - if err == nil { - t.Fatal("err is nil") - } - - var pErr ParseError - if !errors.As(err, &pErr) { - t.Fatalf("err is not a ParseError: %T %[1]v", err) - } - - want := ParseError{ - Line: 3, - LastKey: "c", - Message: `Invalid integer "001": cannot have leading zeroes`, - } - if !strings.Contains(pErr.Message, want.Message) || - pErr.Line != want.Line || - pErr.LastKey != want.LastKey { - t.Errorf("unexpected data\nhave: %#v\nwant: %#v", pErr, want) - } -} - -// errorContains checks if the error message in have contains the text in -// want. -// -// This is safe when have is nil. Use an empty string for want if you want to -// test that err is nil. -func errorContains(have error, want string) bool { - if have == nil { - return want == "" - } - if want == "" { - return false - } - return strings.Contains(have.Error(), want) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/deprecated.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/deprecated.go deleted file mode 100644 index db89eac1d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/deprecated.go +++ /dev/null @@ -1,33 +0,0 @@ -package toml - -import ( - "encoding" - "io" -) - -// DEPRECATED! -// -// Use the identical encoding.TextMarshaler instead. It is defined here to -// support Go 1.1 and older. -type TextMarshaler encoding.TextMarshaler - -// DEPRECATED! -// -// Use the identical encoding.TextUnmarshaler instead. It is defined here to -// support Go 1.1 and older. -type TextUnmarshaler encoding.TextUnmarshaler - -// DEPRECATED! -// -// Use MetaData.PrimitiveDecode instead. -func PrimitiveDecode(primValue Primitive, v interface{}) error { - md := MetaData{decoded: make(map[string]bool)} - return md.unify(primValue.undecoded, rvalue(v)) -} - -// DEPRECATED! -// -// Use NewDecoder(reader).Decode(&v) instead. -func DecodeReader(r io.Reader, v interface{}) (MetaData, error) { - return NewDecoder(r).Decode(v) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/doc.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/doc.go deleted file mode 100644 index 099c4a77d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/doc.go +++ /dev/null @@ -1,13 +0,0 @@ -/* -Package toml implements decoding and encoding of TOML files. - -This package supports TOML v1.0.0, as listed on https://toml.io - -There is also support for delaying decoding with the Primitive type, and -querying the set of keys in a TOML document with the MetaData type. - -The github.com/BurntSushi/toml/cmd/tomlv package implements a TOML validator, -and can be used to verify if TOML document is valid. It can also be used to -print the type of each key. -*/ -package toml diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/encode.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/encode.go deleted file mode 100644 index 10d88ac63..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/encode.go +++ /dev/null @@ -1,650 +0,0 @@ -package toml - -import ( - "bufio" - "encoding" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/BurntSushi/toml/internal" -) - -type tomlEncodeError struct{ error } - -var ( - errArrayNilElement = errors.New("toml: cannot encode array with nil element") - errNonString = errors.New("toml: cannot encode a map with non-string key type") - errAnonNonStruct = errors.New("toml: cannot encode an anonymous field that is not a struct") - errNoKey = errors.New("toml: top-level values must be Go maps or structs") - errAnything = errors.New("") // used in testing -) - -var quotedReplacer = strings.NewReplacer( - "\"", "\\\"", - "\\", "\\\\", - "\x00", `\u0000`, - "\x01", `\u0001`, - "\x02", `\u0002`, - "\x03", `\u0003`, - "\x04", `\u0004`, - "\x05", `\u0005`, - "\x06", `\u0006`, - "\x07", `\u0007`, - "\b", `\b`, - "\t", `\t`, - "\n", `\n`, - "\x0b", `\u000b`, - "\f", `\f`, - "\r", `\r`, - "\x0e", `\u000e`, - "\x0f", `\u000f`, - "\x10", `\u0010`, - "\x11", `\u0011`, - "\x12", `\u0012`, - "\x13", `\u0013`, - "\x14", `\u0014`, - "\x15", `\u0015`, - "\x16", `\u0016`, - "\x17", `\u0017`, - "\x18", `\u0018`, - "\x19", `\u0019`, - "\x1a", `\u001a`, - "\x1b", `\u001b`, - "\x1c", `\u001c`, - "\x1d", `\u001d`, - "\x1e", `\u001e`, - "\x1f", `\u001f`, - "\x7f", `\u007f`, -) - -// Encoder encodes a Go to a TOML document. -// -// The mapping between Go values and TOML values should be precisely the same as -// for the Decode* functions. Similarly, the TextMarshaler interface is -// supported by encoding the resulting bytes as strings. If you want to write -// arbitrary binary data then you will need to use something like base64 since -// TOML does not have any binary types. -// -// When encoding TOML hashes (Go maps or structs), keys without any sub-hashes -// are encoded first. -// -// Go maps will be sorted alphabetically by key for deterministic output. -// -// Encoding Go values without a corresponding TOML representation will return an -// error. Examples of this includes maps with non-string keys, slices with nil -// elements, embedded non-struct types, and nested slices containing maps or -// structs. (e.g. [][]map[string]string is not allowed but []map[string]string -// is okay, as is []map[string][]string). -// -// NOTE: Only exported keys are encoded due to the use of reflection. Unexported -// keys are silently discarded. -type Encoder struct { - // The string to use for a single indentation level. The default is two - // spaces. - Indent string - - // hasWritten is whether we have written any output to w yet. - hasWritten bool - w *bufio.Writer -} - -// NewEncoder create a new Encoder. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - w: bufio.NewWriter(w), - Indent: " ", - } -} - -// Encode writes a TOML representation of the Go value to the Encoder's writer. -// -// An error is returned if the value given cannot be encoded to a valid TOML -// document. -func (enc *Encoder) Encode(v interface{}) error { - rv := eindirect(reflect.ValueOf(v)) - if err := enc.safeEncode(Key([]string{}), rv); err != nil { - return err - } - return enc.w.Flush() -} - -func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) { - defer func() { - if r := recover(); r != nil { - if terr, ok := r.(tomlEncodeError); ok { - err = terr.error - return - } - panic(r) - } - }() - enc.encode(key, rv) - return nil -} - -func (enc *Encoder) encode(key Key, rv reflect.Value) { - // Special case. Time needs to be in ISO8601 format. - // Special case. If we can marshal the type to text, then we used that. - // Basically, this prevents the encoder for handling these types as - // generic structs (or whatever the underlying type of a TextMarshaler is). - switch t := rv.Interface().(type) { - case time.Time, encoding.TextMarshaler: - enc.writeKeyValue(key, rv, false) - return - // TODO: #76 would make this superfluous after implemented. - case Primitive: - enc.encode(key, reflect.ValueOf(t.undecoded)) - return - } - - k := rv.Kind() - switch k { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, - reflect.Uint64, - reflect.Float32, reflect.Float64, reflect.String, reflect.Bool: - enc.writeKeyValue(key, rv, false) - case reflect.Array, reflect.Slice: - if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) { - enc.eArrayOfTables(key, rv) - } else { - enc.writeKeyValue(key, rv, false) - } - case reflect.Interface: - if rv.IsNil() { - return - } - enc.encode(key, rv.Elem()) - case reflect.Map: - if rv.IsNil() { - return - } - enc.eTable(key, rv) - case reflect.Ptr: - if rv.IsNil() { - return - } - enc.encode(key, rv.Elem()) - case reflect.Struct: - enc.eTable(key, rv) - default: - encPanic(fmt.Errorf("unsupported type for key '%s': %s", key, k)) - } -} - -// eElement encodes any value that can be an array element. -func (enc *Encoder) eElement(rv reflect.Value) { - switch v := rv.Interface().(type) { - case time.Time: // Using TextMarshaler adds extra quotes, which we don't want. - format := time.RFC3339Nano - switch v.Location() { - case internal.LocalDatetime: - format = "2006-01-02T15:04:05.999999999" - case internal.LocalDate: - format = "2006-01-02" - case internal.LocalTime: - format = "15:04:05.999999999" - } - switch v.Location() { - default: - enc.wf(v.Format(format)) - case internal.LocalDatetime, internal.LocalDate, internal.LocalTime: - enc.wf(v.In(time.UTC).Format(format)) - } - return - case encoding.TextMarshaler: - // Use text marshaler if it's available for this value. - if s, err := v.MarshalText(); err != nil { - encPanic(err) - } else { - enc.writeQuoted(string(s)) - } - return - } - - switch rv.Kind() { - case reflect.String: - enc.writeQuoted(rv.String()) - case reflect.Bool: - enc.wf(strconv.FormatBool(rv.Bool())) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - enc.wf(strconv.FormatInt(rv.Int(), 10)) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - enc.wf(strconv.FormatUint(rv.Uint(), 10)) - case reflect.Float32: - f := rv.Float() - if math.IsNaN(f) { - enc.wf("nan") - } else if math.IsInf(f, 0) { - enc.wf("%cinf", map[bool]byte{true: '-', false: '+'}[math.Signbit(f)]) - } else { - enc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 32))) - } - case reflect.Float64: - f := rv.Float() - if math.IsNaN(f) { - enc.wf("nan") - } else if math.IsInf(f, 0) { - enc.wf("%cinf", map[bool]byte{true: '-', false: '+'}[math.Signbit(f)]) - } else { - enc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 64))) - } - case reflect.Array, reflect.Slice: - enc.eArrayOrSliceElement(rv) - case reflect.Struct: - enc.eStruct(nil, rv, true) - case reflect.Map: - enc.eMap(nil, rv, true) - case reflect.Interface: - enc.eElement(rv.Elem()) - default: - encPanic(fmt.Errorf("unexpected primitive type: %T", rv.Interface())) - } -} - -// By the TOML spec, all floats must have a decimal with at least one number on -// either side. -func floatAddDecimal(fstr string) string { - if !strings.Contains(fstr, ".") { - return fstr + ".0" - } - return fstr -} - -func (enc *Encoder) writeQuoted(s string) { - enc.wf("\"%s\"", quotedReplacer.Replace(s)) -} - -func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) { - length := rv.Len() - enc.wf("[") - for i := 0; i < length; i++ { - elem := rv.Index(i) - enc.eElement(elem) - if i != length-1 { - enc.wf(", ") - } - } - enc.wf("]") -} - -func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) { - if len(key) == 0 { - encPanic(errNoKey) - } - for i := 0; i < rv.Len(); i++ { - trv := rv.Index(i) - if isNil(trv) { - continue - } - enc.newline() - enc.wf("%s[[%s]]", enc.indentStr(key), key.maybeQuotedAll()) - enc.newline() - enc.eMapOrStruct(key, trv, false) - } -} - -func (enc *Encoder) eTable(key Key, rv reflect.Value) { - if len(key) == 1 { - // Output an extra newline between top-level tables. - // (The newline isn't written if nothing else has been written though.) - enc.newline() - } - if len(key) > 0 { - enc.wf("%s[%s]", enc.indentStr(key), key.maybeQuotedAll()) - enc.newline() - } - enc.eMapOrStruct(key, rv, false) -} - -func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value, inline bool) { - switch rv := eindirect(rv); rv.Kind() { - case reflect.Map: - enc.eMap(key, rv, inline) - case reflect.Struct: - enc.eStruct(key, rv, inline) - default: - // Should never happen? - panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String()) - } -} - -func (enc *Encoder) eMap(key Key, rv reflect.Value, inline bool) { - rt := rv.Type() - if rt.Key().Kind() != reflect.String { - encPanic(errNonString) - } - - // Sort keys so that we have deterministic output. And write keys directly - // underneath this key first, before writing sub-structs or sub-maps. - var mapKeysDirect, mapKeysSub []string - for _, mapKey := range rv.MapKeys() { - k := mapKey.String() - if typeIsHash(tomlTypeOfGo(rv.MapIndex(mapKey))) { - mapKeysSub = append(mapKeysSub, k) - } else { - mapKeysDirect = append(mapKeysDirect, k) - } - } - - var writeMapKeys = func(mapKeys []string, trailC bool) { - sort.Strings(mapKeys) - for i, mapKey := range mapKeys { - val := rv.MapIndex(reflect.ValueOf(mapKey)) - if isNil(val) { - continue - } - - if inline { - enc.writeKeyValue(Key{mapKey}, val, true) - if trailC || i != len(mapKeys)-1 { - enc.wf(", ") - } - } else { - enc.encode(key.add(mapKey), val) - } - } - } - - if inline { - enc.wf("{") - } - writeMapKeys(mapKeysDirect, len(mapKeysSub) > 0) - writeMapKeys(mapKeysSub, false) - if inline { - enc.wf("}") - } -} - -func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { - // Write keys for fields directly under this key first, because if we write - // a field that creates a new table then all keys under it will be in that - // table (not the one we're writing here). - // - // Fields is a [][]int: for fieldsDirect this always has one entry (the - // struct index). For fieldsSub it contains two entries: the parent field - // index from tv, and the field indexes for the fields of the sub. - var ( - rt = rv.Type() - fieldsDirect, fieldsSub [][]int - addFields func(rt reflect.Type, rv reflect.Value, start []int) - ) - addFields = func(rt reflect.Type, rv reflect.Value, start []int) { - for i := 0; i < rt.NumField(); i++ { - f := rt.Field(i) - if f.PkgPath != "" && !f.Anonymous { /// Skip unexported fields. - continue - } - - frv := rv.Field(i) - - // Treat anonymous struct fields with tag names as though they are - // not anonymous, like encoding/json does. - // - // Non-struct anonymous fields use the normal encoding logic. - if f.Anonymous { - t := f.Type - switch t.Kind() { - case reflect.Struct: - if getOptions(f.Tag).name == "" { - addFields(t, frv, append(start, f.Index...)) - continue - } - case reflect.Ptr: - if t.Elem().Kind() == reflect.Struct && getOptions(f.Tag).name == "" { - if !frv.IsNil() { - addFields(t.Elem(), frv.Elem(), append(start, f.Index...)) - } - continue - } - } - } - - if typeIsHash(tomlTypeOfGo(frv)) { - fieldsSub = append(fieldsSub, append(start, f.Index...)) - } else { - fieldsDirect = append(fieldsDirect, append(start, f.Index...)) - } - } - } - addFields(rt, rv, nil) - - writeFields := func(fields [][]int) { - for _, fieldIndex := range fields { - fieldType := rt.FieldByIndex(fieldIndex) - fieldVal := rv.FieldByIndex(fieldIndex) - - if isNil(fieldVal) { /// Don't write anything for nil fields. - continue - } - - opts := getOptions(fieldType.Tag) - if opts.skip { - continue - } - keyName := fieldType.Name - if opts.name != "" { - keyName = opts.name - } - if opts.omitempty && isEmpty(fieldVal) { - continue - } - if opts.omitzero && isZero(fieldVal) { - continue - } - - if inline { - enc.writeKeyValue(Key{keyName}, fieldVal, true) - if fieldIndex[0] != len(fields)-1 { - enc.wf(", ") - } - } else { - enc.encode(key.add(keyName), fieldVal) - } - } - } - - if inline { - enc.wf("{") - } - writeFields(fieldsDirect) - writeFields(fieldsSub) - if inline { - enc.wf("}") - } -} - -// tomlTypeName returns the TOML type name of the Go value's type. It is -// used to determine whether the types of array elements are mixed (which is -// forbidden). If the Go value is nil, then it is illegal for it to be an array -// element, and valueIsNil is returned as true. - -// Returns the TOML type of a Go value. The type may be `nil`, which means -// no concrete TOML type could be found. -func tomlTypeOfGo(rv reflect.Value) tomlType { - if isNil(rv) || !rv.IsValid() { - return nil - } - switch rv.Kind() { - case reflect.Bool: - return tomlBool - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, - reflect.Uint64: - return tomlInteger - case reflect.Float32, reflect.Float64: - return tomlFloat - case reflect.Array, reflect.Slice: - if typeEqual(tomlHash, tomlArrayType(rv)) { - return tomlArrayHash - } - return tomlArray - case reflect.Ptr, reflect.Interface: - return tomlTypeOfGo(rv.Elem()) - case reflect.String: - return tomlString - case reflect.Map: - return tomlHash - case reflect.Struct: - switch rv.Interface().(type) { - case time.Time: - return tomlDatetime - case encoding.TextMarshaler: - return tomlString - default: - // Someone used a pointer receiver: we can make it work for pointer - // values. - if rv.CanAddr() { - _, ok := rv.Addr().Interface().(encoding.TextMarshaler) - if ok { - return tomlString - } - } - return tomlHash - } - default: - _, ok := rv.Interface().(encoding.TextMarshaler) - if ok { - return tomlString - } - encPanic(errors.New("unsupported type: " + rv.Kind().String())) - panic("") // Need *some* return value - } -} - -// tomlArrayType returns the element type of a TOML array. The type returned -// may be nil if it cannot be determined (e.g., a nil slice or a zero length -// slize). This function may also panic if it finds a type that cannot be -// expressed in TOML (such as nil elements, heterogeneous arrays or directly -// nested arrays of tables). -func tomlArrayType(rv reflect.Value) tomlType { - if isNil(rv) || !rv.IsValid() || rv.Len() == 0 { - return nil - } - - /// Don't allow nil. - rvlen := rv.Len() - for i := 1; i < rvlen; i++ { - if tomlTypeOfGo(rv.Index(i)) == nil { - encPanic(errArrayNilElement) - } - } - - firstType := tomlTypeOfGo(rv.Index(0)) - if firstType == nil { - encPanic(errArrayNilElement) - } - return firstType -} - -type tagOptions struct { - skip bool // "-" - name string - omitempty bool - omitzero bool -} - -func getOptions(tag reflect.StructTag) tagOptions { - t := tag.Get("toml") - if t == "-" { - return tagOptions{skip: true} - } - var opts tagOptions - parts := strings.Split(t, ",") - opts.name = parts[0] - for _, s := range parts[1:] { - switch s { - case "omitempty": - opts.omitempty = true - case "omitzero": - opts.omitzero = true - } - } - return opts -} - -func isZero(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return rv.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return rv.Uint() == 0 - case reflect.Float32, reflect.Float64: - return rv.Float() == 0.0 - } - return false -} - -func isEmpty(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Array, reflect.Slice, reflect.Map, reflect.String: - return rv.Len() == 0 - case reflect.Bool: - return !rv.Bool() - } - return false -} - -func (enc *Encoder) newline() { - if enc.hasWritten { - enc.wf("\n") - } -} - -// Write a key/value pair: -// -// key = -// -// If inline is true it won't add a newline at the end. -func (enc *Encoder) writeKeyValue(key Key, val reflect.Value, inline bool) { - if len(key) == 0 { - encPanic(errNoKey) - } - enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1)) - enc.eElement(val) - if !inline { - enc.newline() - } -} - -func (enc *Encoder) wf(format string, v ...interface{}) { - if _, err := fmt.Fprintf(enc.w, format, v...); err != nil { - encPanic(err) - } - enc.hasWritten = true -} - -func (enc *Encoder) indentStr(key Key) string { - return strings.Repeat(enc.Indent, len(key)-1) -} - -func encPanic(err error) { - panic(tomlEncodeError{err}) -} - -func eindirect(v reflect.Value) reflect.Value { - switch v.Kind() { - case reflect.Ptr, reflect.Interface: - return eindirect(v.Elem()) - default: - return v - } -} - -func isNil(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - return rv.IsNil() - default: - return false - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/encode_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/encode_test.go deleted file mode 100644 index 0da645861..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/encode_test.go +++ /dev/null @@ -1,427 +0,0 @@ -package toml - -import ( - "bytes" - "fmt" - "math" - "net" - "os" - "strings" - "testing" - "time" -) - -func TestEncodeRoundTrip(t *testing.T) { - type Config struct { - Age int - Cats []string - Pi float64 - Perfection []int - DOB time.Time - Ipaddress net.IP - } - - var inputs = Config{ - 13, - []string{"one", "two", "three"}, - 3.145, - []int{11, 2, 3, 4}, - time.Now(), - net.ParseIP("192.168.59.254"), - } - - var firstBuffer bytes.Buffer - e := NewEncoder(&firstBuffer) - err := e.Encode(inputs) - if err != nil { - t.Fatal(err) - } - var outputs Config - if _, err := Decode(firstBuffer.String(), &outputs); err != nil { - t.Logf("Could not decode:\n-----\n%s\n-----\n", - firstBuffer.String()) - t.Fatal(err) - } - - // could test each value individually, but I'm lazy - var secondBuffer bytes.Buffer - e2 := NewEncoder(&secondBuffer) - err = e2.Encode(outputs) - if err != nil { - t.Fatal(err) - } - if firstBuffer.String() != secondBuffer.String() { - t.Error( - firstBuffer.String(), - "\n\n is not identical to\n\n", - secondBuffer.String()) - } -} - -func TestEncodeNestedTableArrays(t *testing.T) { - type song struct { - Name string `toml:"name"` - } - type album struct { - Name string `toml:"name"` - Songs []song `toml:"songs"` - } - type springsteen struct { - Albums []album `toml:"albums"` - } - value := springsteen{ - []album{ - {"Born to Run", - []song{{"Jungleland"}, {"Meeting Across the River"}}}, - {"Born in the USA", - []song{{"Glory Days"}, {"Dancing in the Dark"}}}, - }, - } - expected := `[[albums]] - name = "Born to Run" - - [[albums.songs]] - name = "Jungleland" - - [[albums.songs]] - name = "Meeting Across the River" - -[[albums]] - name = "Born in the USA" - - [[albums.songs]] - name = "Glory Days" - - [[albums.songs]] - name = "Dancing in the Dark" -` - encodeExpected(t, "nested table arrays", value, expected, nil) -} - -func TestEncodeArrayHashWithNormalHashOrder(t *testing.T) { - type Alpha struct { - V int - } - type Beta struct { - V int - } - type Conf struct { - V int - A Alpha - B []Beta - } - - val := Conf{ - V: 1, - A: Alpha{2}, - B: []Beta{{3}}, - } - expected := "V = 1\n\n[A]\n V = 2\n\n[[B]]\n V = 3\n" - encodeExpected(t, "array hash with normal hash order", val, expected, nil) -} - -func TestEncodeWithOmitEmpty(t *testing.T) { - type simple struct { - Bool bool `toml:"bool,omitempty"` - String string `toml:"string,omitempty"` - Array [0]byte `toml:"array,omitempty"` - Slice []int `toml:"slice,omitempty"` - Map map[string]string `toml:"map,omitempty"` - } - - var v simple - encodeExpected(t, "fields with omitempty are omitted when empty", v, "", nil) - v = simple{ - Bool: true, - String: " ", - Slice: []int{2, 3, 4}, - Map: map[string]string{"foo": "bar"}, - } - expected := `bool = true -string = " " -slice = [2, 3, 4] - -[map] - foo = "bar" -` - encodeExpected(t, "fields with omitempty are not omitted when non-empty", - v, expected, nil) -} - -func TestEncodeWithOmitZero(t *testing.T) { - type simple struct { - Number int `toml:"number,omitzero"` - Real float64 `toml:"real,omitzero"` - Unsigned uint `toml:"unsigned,omitzero"` - } - - value := simple{0, 0.0, uint(0)} - expected := "" - - encodeExpected(t, "simple with omitzero, all zero", value, expected, nil) - - value.Number = 10 - value.Real = 20 - value.Unsigned = 5 - expected = `number = 10 -real = 20.0 -unsigned = 5 -` - encodeExpected(t, "simple with omitzero, non-zero", value, expected, nil) -} - -func TestEncodeOmitemptyWithEmptyName(t *testing.T) { - type simple struct { - S []int `toml:",omitempty"` - } - v := simple{[]int{1, 2, 3}} - expected := "S = [1, 2, 3]\n" - encodeExpected(t, "simple with omitempty, no name, non-empty field", - v, expected, nil) -} - -func TestEncodeAnonymousStruct(t *testing.T) { - type Inner struct{ N int } - type Outer0 struct{ Inner } - type Outer1 struct { - Inner `toml:"inner"` - } - - v0 := Outer0{Inner{3}} - expected := "N = 3\n" - encodeExpected(t, "embedded anonymous untagged struct", v0, expected, nil) - - v1 := Outer1{Inner{3}} - expected = "[inner]\n N = 3\n" - encodeExpected(t, "embedded anonymous tagged struct", v1, expected, nil) -} - -func TestEncodeAnonymousStructPointerField(t *testing.T) { - type Inner struct{ N int } - type Outer0 struct{ *Inner } - type Outer1 struct { - *Inner `toml:"inner"` - } - - v0 := Outer0{} - expected := "" - encodeExpected(t, "nil anonymous untagged struct pointer field", v0, expected, nil) - - v0 = Outer0{&Inner{3}} - expected = "N = 3\n" - encodeExpected(t, "non-nil anonymous untagged struct pointer field", v0, expected, nil) - - v1 := Outer1{} - expected = "" - encodeExpected(t, "nil anonymous tagged struct pointer field", v1, expected, nil) - - v1 = Outer1{&Inner{3}} - expected = "[inner]\n N = 3\n" - encodeExpected(t, "non-nil anonymous tagged struct pointer field", v1, expected, nil) -} - -func TestEncodeNestedAnonymousStructs(t *testing.T) { - type A struct{ A string } - type B struct{ B string } - type C struct{ C string } - type BC struct { - B - C - } - type Outer struct { - A - BC - } - - v := &Outer{ - A: A{ - A: "a", - }, - BC: BC{ - B: B{ - B: "b", - }, - C: C{ - C: "c", - }, - }, - } - - expected := "A = \"a\"\nB = \"b\"\nC = \"c\"\n" - encodeExpected(t, "nested anonymous untagged structs", v, expected, nil) -} - -func TestEncodeIgnoredFields(t *testing.T) { - type simple struct { - Number int `toml:"-"` - } - value := simple{} - expected := "" - encodeExpected(t, "ignored field", value, expected, nil) -} - -func TestEncodeNaN(t *testing.T) { - s1 := struct { - Nan float64 `toml:"nan"` - Inf float64 `toml:"inf"` - }{math.NaN(), math.Inf(1)} - s2 := struct { - Nan float32 `toml:"nan"` - Inf float32 `toml:"inf"` - }{float32(math.NaN()), float32(math.Inf(-1))} - encodeExpected(t, "", s1, "nan = nan\ninf = +inf\n", nil) - encodeExpected(t, "", s2, "nan = nan\ninf = -inf\n", nil) -} - -func TestEncodePrimitive(t *testing.T) { - type MyStruct struct { - Data Primitive - DataA int - DataB string - } - - decodeAndEncode := func(toml string) string { - var s MyStruct - _, err := Decode(toml, &s) - if err != nil { - t.Fatal(err) - } - - var buf bytes.Buffer - err = NewEncoder(&buf).Encode(s) - if err != nil { - t.Fatal(err) - } - return buf.String() - } - - original := `DataA = 1 -DataB = "bbb" -Data = ["Foo", "Bar"] -` - reEncoded := decodeAndEncode(decodeAndEncode(original)) - - if reEncoded != original { - t.Errorf( - "re-encoded not the same as original\noriginal: %q\nre-encoded: %q", - original, reEncoded) - } -} - -func TestEncodeError(t *testing.T) { - tests := []struct { - in interface{} - wantErr string - }{ - {make(chan int), "unsupported type for key '': chan"}, - {struct{ C complex128 }{0}, "unsupported type: complex128"}, - {[]complex128{0}, "unsupported type: complex128"}, - } - - for _, tt := range tests { - t.Run("", func(t *testing.T) { - err := NewEncoder(os.Stderr).Encode(tt.in) - if err == nil { - t.Fatal("err is nil") - } - if !errorContains(err, tt.wantErr) { - t.Errorf("wrong error\nhave: %q\nwant: %q", err, tt.wantErr) - } - }) - } -} - -type ( - sound struct{ S string } - food struct{ F []string } - fun func() - cplx complex128 -) - -// This is intentionally wrong (pointer receiver) -func (s *sound) MarshalText() ([]byte, error) { return []byte(s.S), nil } -func (f food) MarshalText() ([]byte, error) { return []byte(strings.Join(f.F, ", ")), nil } -func (f fun) MarshalText() ([]byte, error) { return []byte("why would you do this?"), nil } -func (c cplx) MarshalText() ([]byte, error) { - cplx := complex128(c) - return []byte(fmt.Sprintf("(%f+%fi)", real(cplx), imag(cplx))), nil -} - -func TestEncodeTextMarshaler(t *testing.T) { - x := struct { - Name string - Labels map[string]string - Sound sound - Sound2 *sound - Food food - Food2 *food - Complex cplx - Fun fun - }{ - Name: "Goblok", - Sound: sound{"miauw"}, - Sound2: &sound{"miauw"}, - Labels: map[string]string{ - "type": "cat", - "color": "black", - }, - Food: food{[]string{"chicken", "fish"}}, - Food2: &food{[]string{"chicken", "fish"}}, - Complex: complex(42, 666), - Fun: func() { panic("x") }, - } - - var buf bytes.Buffer - if err := NewEncoder(&buf).Encode(x); err != nil { - t.Fatal(err) - } - - want := `Name = "Goblok" -Sound2 = "miauw" -Food = "chicken, fish" -Food2 = "chicken, fish" -Complex = "(42.000000+666.000000i)" -Fun = "why would you do this?" - -[Labels] - color = "black" - type = "cat" - -[Sound] - S = "miauw" -` - - if buf.String() != want { - t.Error("\n" + buf.String()) - } -} - -func encodeExpected(t *testing.T, label string, val interface{}, want string, wantErr error) { - t.Helper() - - t.Run(label, func(t *testing.T) { - var buf bytes.Buffer - err := NewEncoder(&buf).Encode(val) - if err != wantErr { - if wantErr != nil { - if wantErr == errAnything && err != nil { - return - } - t.Errorf("want Encode error %v, got %v", wantErr, err) - } else { - t.Errorf("Encode failed: %s", err) - } - } - if err != nil { - return - } - - have := strings.TrimSpace(buf.String()) - want = strings.TrimSpace(want) - if want != have { - t.Errorf("\nhave: %s\nwant: %s\n", have, want) - // v, _ := json.MarshalIndent(val, "", " ") - // t.Log(string(v)) - } - }) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/example_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/example_test.go deleted file mode 100644 index 390d14627..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/example_test.go +++ /dev/null @@ -1,516 +0,0 @@ -package toml_test - -import ( - "bytes" - "fmt" - "log" - "time" - - "github.com/BurntSushi/toml" -) - -func ExampleEncoder_Encode() { - date, _ := time.Parse(time.RFC822, "14 Mar 10 18:00 UTC") - var config = map[string]interface{}{ - "date": date, - "counts": []int{1, 1, 2, 3, 5, 8}, - "hash": map[string]string{ - "key1": "val1", - "key2": "val2", - }, - } - buf := new(bytes.Buffer) - if err := toml.NewEncoder(buf).Encode(config); err != nil { - log.Fatal(err) - } - fmt.Println(buf.String()) - - // Output: - // counts = [1, 1, 2, 3, 5, 8] - // date = 2010-03-14T18:00:00Z - // - // [hash] - // key1 = "val1" - // key2 = "val2" -} - -func ExampleMetaData_PrimitiveDecode() { - var md toml.MetaData - var err error - - var tomlBlob = ` -ranking = ["Springsteen", "J Geils"] - -[bands.Springsteen] -started = 1973 -albums = ["Greetings", "WIESS", "Born to Run", "Darkness"] - -[bands."J Geils"] -started = 1970 -albums = ["The J. Geils Band", "Full House", "Blow Your Face Out"] -` - - type band struct { - Started int - Albums []string - } - type classics struct { - Ranking []string - Bands map[string]toml.Primitive - } - - // Do the initial decode. Reflection is delayed on Primitive values. - var music classics - if md, err = toml.Decode(tomlBlob, &music); err != nil { - log.Fatal(err) - } - - // MetaData still includes information on Primitive values. - fmt.Printf("Is `bands.Springsteen` defined? %v\n", - md.IsDefined("bands", "Springsteen")) - - // Decode primitive data into Go values. - for _, artist := range music.Ranking { - // A band is a primitive value, so we need to decode it to get a - // real `band` value. - primValue := music.Bands[artist] - - var aBand band - if err = md.PrimitiveDecode(primValue, &aBand); err != nil { - log.Fatal(err) - } - fmt.Printf("%s started in %d.\n", artist, aBand.Started) - } - // Check to see if there were any fields left undecoded. - // Note that this won't be empty before decoding the Primitive value! - fmt.Printf("Undecoded: %q\n", md.Undecoded()) - - // Output: - // Is `bands.Springsteen` defined? true - // Springsteen started in 1973. - // J Geils started in 1970. - // Undecoded: [] -} - -func ExampleDecode() { - var tomlBlob = ` -# Some comments. -[alpha] -ip = "10.0.0.1" - - [alpha.config] - Ports = [ 8001, 8002 ] - Location = "Toronto" - Created = 1987-07-05T05:45:00Z - -[beta] -ip = "10.0.0.2" - - [beta.config] - Ports = [ 9001, 9002 ] - Location = "New Jersey" - Created = 1887-01-05T05:55:00Z -` - - type serverConfig struct { - Ports []int - Location string - Created time.Time - } - - type server struct { - IP string `toml:"ip,omitempty"` - Config serverConfig `toml:"config"` - } - - type servers map[string]server - - var config servers - if _, err := toml.Decode(tomlBlob, &config); err != nil { - log.Fatal(err) - } - - for _, name := range []string{"alpha", "beta"} { - s := config[name] - fmt.Printf("Server: %s (ip: %s) in %s created on %s\n", - name, s.IP, s.Config.Location, - s.Config.Created.Format("2006-01-02")) - fmt.Printf("Ports: %v\n", s.Config.Ports) - } - - // Output: - // Server: alpha (ip: 10.0.0.1) in Toronto created on 1987-07-05 - // Ports: [8001 8002] - // Server: beta (ip: 10.0.0.2) in New Jersey created on 1887-01-05 - // Ports: [9001 9002] -} - -type duration struct { - time.Duration -} - -func (d *duration) UnmarshalText(text []byte) error { - var err error - d.Duration, err = time.ParseDuration(string(text)) - return err -} - -// Example Unmarshaler shows how to decode TOML strings into your own -// custom data type. -func Example_unmarshaler() { - blob := ` -[[song]] -name = "Thunder Road" -duration = "4m49s" - -[[song]] -name = "Stairway to Heaven" -duration = "8m03s" -` - type song struct { - Name string - Duration duration - } - type songs struct { - Song []song - } - var favorites songs - if _, err := toml.Decode(blob, &favorites); err != nil { - log.Fatal(err) - } - - // Code to implement the TextUnmarshaler interface for `duration`: - // - // type duration struct { - // time.Duration - // } - // - // func (d *duration) UnmarshalText(text []byte) error { - // var err error - // d.Duration, err = time.ParseDuration(string(text)) - // return err - // } - - for _, s := range favorites.Song { - fmt.Printf("%s (%s)\n", s.Name, s.Duration) - } - // Output: - // Thunder Road (4m49s) - // Stairway to Heaven (8m3s) -} - -// Example StrictDecoding shows how to detect whether there are keys in the -// TOML document that weren't decoded into the value given. This is useful -// for returning an error to the user if they've included extraneous fields -// in their configuration. -func Example_strictDecoding() { - var blob = ` -key1 = "value1" -key2 = "value2" -key3 = "value3" -` - type config struct { - Key1 string - Key3 string - } - - var conf config - md, err := toml.Decode(blob, &conf) - if err != nil { - log.Fatal(err) - } - fmt.Printf("Undecoded keys: %q\n", md.Undecoded()) - // Output: - // Undecoded keys: ["key2"] -} - -type order struct { - // NOTE `order.parts` is a private slice of type `part` which is an - // interface and may only be loaded from toml using the UnmarshalTOML() - // method of the Umarshaler interface. - parts parts -} - -type parts []part - -type part interface { - Name() string -} - -type valve struct { - Type string - ID string - Size float32 - Rating int -} - -func (v *valve) Name() string { - return fmt.Sprintf("VALVE: %s", v.ID) -} - -type pipe struct { - Type string - ID string - Length float32 - Diameter int -} - -func (p *pipe) Name() string { - return fmt.Sprintf("PIPE: %s", p.ID) -} - -type cable struct { - Type string - ID string - Length int - Rating float32 -} - -func (c *cable) Name() string { - return fmt.Sprintf("CABLE: %s", c.ID) -} - -func (o *order) UnmarshalTOML(data interface{}) error { - - // NOTE the example below contains detailed type casting to show how - // the 'data' is retrieved. In operational use, a type cast wrapper - // may be preferred e.g. - // - // func AsMap(v interface{}) (map[string]interface{}, error) { - // return v.(map[string]interface{}) - // } - // - // resulting in: - // d, _ := AsMap(data) - // - - d, _ := data.(map[string]interface{}) - parts, _ := d["parts"].([]map[string]interface{}) - - for _, p := range parts { - - typ, _ := p["type"].(string) - id, _ := p["id"].(string) - - // detect the type of part and handle each case - switch p["type"] { - case "valve": - - size := float32(p["size"].(float64)) - rating := int(p["rating"].(int64)) - - valve := &valve{ - Type: typ, - ID: id, - Size: size, - Rating: rating, - } - - o.parts = append(o.parts, valve) - - case "pipe": - - length := float32(p["length"].(float64)) - diameter := int(p["diameter"].(int64)) - - pipe := &pipe{ - Type: typ, - ID: id, - Length: length, - Diameter: diameter, - } - - o.parts = append(o.parts, pipe) - - case "cable": - - length := int(p["length"].(int64)) - rating := float32(p["rating"].(float64)) - - cable := &cable{ - Type: typ, - ID: id, - Length: length, - Rating: rating, - } - - o.parts = append(o.parts, cable) - - } - } - - return nil -} - -// Example UnmarshalTOML shows how to implement a struct type that knows how to -// unmarshal itself. The struct must take full responsibility for mapping the -// values passed into the struct. The method may be used with interfaces in a -// struct in cases where the actual type is not known until the data is -// examined. -func Example_unmarshalTOML() { - - var blob = ` -[[parts]] -type = "valve" -id = "valve-1" -size = 1.2 -rating = 4 - -[[parts]] -type = "valve" -id = "valve-2" -size = 2.1 -rating = 5 - -[[parts]] -type = "pipe" -id = "pipe-1" -length = 2.1 -diameter = 12 - -[[parts]] -type = "cable" -id = "cable-1" -length = 12 -rating = 3.1 -` - o := &order{} - err := toml.Unmarshal([]byte(blob), o) - if err != nil { - log.Fatal(err) - } - - fmt.Println(len(o.parts)) - - for _, part := range o.parts { - fmt.Println(part.Name()) - } - - // Code to implement UmarshalJSON. - - // type order struct { - // // NOTE `order.parts` is a private slice of type `part` which is an - // // interface and may only be loaded from toml using the - // // UnmarshalTOML() method of the Umarshaler interface. - // parts parts - // } - - // func (o *order) UnmarshalTOML(data interface{}) error { - - // // NOTE the example below contains detailed type casting to show how - // // the 'data' is retrieved. In operational use, a type cast wrapper - // // may be preferred e.g. - // // - // // func AsMap(v interface{}) (map[string]interface{}, error) { - // // return v.(map[string]interface{}) - // // } - // // - // // resulting in: - // // d, _ := AsMap(data) - // // - - // d, _ := data.(map[string]interface{}) - // parts, _ := d["parts"].([]map[string]interface{}) - - // for _, p := range parts { - - // typ, _ := p["type"].(string) - // id, _ := p["id"].(string) - - // // detect the type of part and handle each case - // switch p["type"] { - // case "valve": - - // size := float32(p["size"].(float64)) - // rating := int(p["rating"].(int64)) - - // valve := &valve{ - // Type: typ, - // ID: id, - // Size: size, - // Rating: rating, - // } - - // o.parts = append(o.parts, valve) - - // case "pipe": - - // length := float32(p["length"].(float64)) - // diameter := int(p["diameter"].(int64)) - - // pipe := &pipe{ - // Type: typ, - // ID: id, - // Length: length, - // Diameter: diameter, - // } - - // o.parts = append(o.parts, pipe) - - // case "cable": - - // length := int(p["length"].(int64)) - // rating := float32(p["rating"].(float64)) - - // cable := &cable{ - // Type: typ, - // ID: id, - // Length: length, - // Rating: rating, - // } - - // o.parts = append(o.parts, cable) - - // } - // } - - // return nil - // } - - // type parts []part - - // type part interface { - // Name() string - // } - - // type valve struct { - // Type string - // ID string - // Size float32 - // Rating int - // } - - // func (v *valve) Name() string { - // return fmt.Sprintf("VALVE: %s", v.ID) - // } - - // type pipe struct { - // Type string - // ID string - // Length float32 - // Diameter int - // } - - // func (p *pipe) Name() string { - // return fmt.Sprintf("PIPE: %s", p.ID) - // } - - // type cable struct { - // Type string - // ID string - // Length int - // Rating float32 - // } - - // func (c *cable) Name() string { - // return fmt.Sprintf("CABLE: %s", c.ID) - // } - - // Output: - // 4 - // VALVE: valve-1 - // VALVE: valve-2 - // PIPE: pipe-1 - // CABLE: cable-1 - -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/fuzz_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/fuzz_test.go deleted file mode 100644 index e37b30f46..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/fuzz_test.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build gofuzzbeta - -package toml - -import ( - "bytes" - "testing" -) - -func FuzzDecode(f *testing.F) { - buf := make([]byte, 0, 2048) - - f.Add(` -# This is a TOML document - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -dob = 1979-05-27T07:32:00-08:00 - -[database] -enabled = true -ports = [ 8000, 8001, 8002 ] -data = [ ["delta", "phi"], [3.14] ] -temp_targets = { cpu = 79.5, case = 72.0 } - -[servers] - -[servers.alpha] -ip = "10.0.0.1" -role = "frontend" - -[servers.beta] -ip = "10.0.0.2" -role = "backend" -`) - f.Fuzz(func(t *testing.T, file string) { - var m map[string]interface{} - _, err := Decode(file, &m) - if err != nil { - t.Skip() - } - - NewEncoder(bytes.NewBuffer(buf)).Encode(m) - - // TODO: should check if the output is equal to the input, too, but some - // information is lost when encoding. - }) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/go.mod b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/go.mod deleted file mode 100644 index 82989481d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/BurntSushi/toml - -go 1.16 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/go.sum b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/go.sum deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tag/add.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tag/add.go deleted file mode 100644 index 88f695038..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tag/add.go +++ /dev/null @@ -1,76 +0,0 @@ -package tag - -import ( - "fmt" - "math" - "time" - - "github.com/BurntSushi/toml/internal" -) - -// Add JSON tags to a data structure as expected by toml-test. -func Add(key string, tomlData interface{}) interface{} { - // Switch on the data type. - switch orig := tomlData.(type) { - default: - panic(fmt.Sprintf("Unknown type: %T", tomlData)) - - // A table: we don't need to add any tags, just recurse for every table - // entry. - case map[string]interface{}: - typed := make(map[string]interface{}, len(orig)) - for k, v := range orig { - typed[k] = Add(k, v) - } - return typed - - // An array: we don't need to add any tags, just recurse for every table - // entry. - case []map[string]interface{}: - typed := make([]map[string]interface{}, len(orig)) - for i, v := range orig { - typed[i] = Add("", v).(map[string]interface{}) - } - return typed - case []interface{}: - typed := make([]interface{}, len(orig)) - for i, v := range orig { - typed[i] = Add("", v) - } - return typed - - // Datetime: tag as datetime. - case time.Time: - switch orig.Location() { - default: - return tag("datetime", orig.Format("2006-01-02T15:04:05.999999999Z07:00")) - case internal.LocalDatetime: - return tag("datetime-local", orig.Format("2006-01-02T15:04:05.999999999")) - case internal.LocalDate: - return tag("date-local", orig.Format("2006-01-02")) - case internal.LocalTime: - return tag("time-local", orig.Format("15:04:05.999999999")) - } - - // Tag primitive values: bool, string, int, and float64. - case bool: - return tag("bool", fmt.Sprintf("%v", orig)) - case string: - return tag("string", orig) - case int64: - return tag("integer", fmt.Sprintf("%d", orig)) - case float64: - // Special case for nan since NaN == NaN is false. - if math.IsNaN(orig) { - return tag("float", "nan") - } - return tag("float", fmt.Sprintf("%v", orig)) - } -} - -func tag(typeName string, data interface{}) map[string]interface{} { - return map[string]interface{}{ - "type": typeName, - "value": data, - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tag/rm.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tag/rm.go deleted file mode 100644 index 884cda154..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tag/rm.go +++ /dev/null @@ -1,101 +0,0 @@ -package tag - -import ( - "log" - "strconv" - "time" - - "github.com/BurntSushi/toml/internal" -) - -// Rempve JSON tags to a data structure as returned by toml-test. -func Remove(typedJson interface{}) interface{} { - // Switch on the data type. - switch v := typedJson.(type) { - - // Object: this can either be a TOML table or a primitive with tags. - case map[string]interface{}: - // This value represents a primitive: remove the tags and return just - // the primitive value. - if len(v) == 2 && in("type", v) && in("value", v) { - return untag(v) - } - - // Table: remove tags on all children. - m := make(map[string]interface{}, len(v)) - for k, v2 := range v { - m[k] = Remove(v2) - } - return m - - // Array: remove tags from all itenm. - case []interface{}: - a := make([]interface{}, len(v)) - for i := range v { - a[i] = Remove(v[i]) - } - return a - } - - // The top level must be an object or array. - log.Fatalf("Unrecognized JSON format '%T'.", typedJson) - panic("unreachable") -} - -// Check if key is in the table m. -func in(key string, m map[string]interface{}) bool { - _, ok := m[key] - return ok -} - -// Return a primitive: read the "type" and convert the "value" to that. -func untag(typed map[string]interface{}) interface{} { - t := typed["type"].(string) - v := typed["value"].(string) - switch t { - case "string": - return v - case "integer": - n, err := strconv.Atoi(v) - if err != nil { - log.Fatalf("Could not parse '%s' as integer: %s", v, err) - } - return n - case "float": - f, err := strconv.ParseFloat(v, 64) - if err != nil { - log.Fatalf("Could not parse '%s' as float64: %s", v, err) - } - return f - case "datetime": - return parseTime(v, "2006-01-02T15:04:05.999999999Z07:00", nil) - case "datetime-local": - return parseTime(v, "2006-01-02T15:04:05.999999999", internal.LocalDatetime) - case "date-local": - return parseTime(v, "2006-01-02", internal.LocalDate) - case "time-local": - return parseTime(v, "15:04:05.999999999", internal.LocalTime) - case "bool": - switch v { - case "true": - return true - case "false": - return false - } - log.Fatalf("Could not parse '%s' as a boolean.", v) - } - - log.Fatalf("Unrecognized tag type '%s'.", t) - panic("unreachable") -} - -func parseTime(v, format string, l *time.Location) time.Time { - t, err := time.Parse(format, v) - if err != nil { - log.Fatalf("Could not parse '%s' as a datetime: %s", v, err) - } - if l != nil { - t = t.In(l) - } - return t -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/.gitignore b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/.gitignore deleted file mode 100644 index d8b7327b6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/dist -/toml-test diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/.gogo-release b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/.gogo-release deleted file mode 100644 index d454f1b91..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/.gogo-release +++ /dev/null @@ -1 +0,0 @@ -build_flags="$build_flags ./cmd/toml-test" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/COPYING b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/COPYING deleted file mode 100644 index 93b22020a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 TOML authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/README.md b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/README.md deleted file mode 100644 index 5da06f785..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/README.md +++ /dev/null @@ -1,258 +0,0 @@ -`toml-test` is a language-agnostic test suite to verify the correctness of -[TOML][t] parsers and writers. - -Tests are divided into two groups: "invalid" and "valid". Decoders or encoders -that reject "invalid" tests pass the tests, and decoders that accept "valid" -tests and output precisely what is expected pass the tests. The output format is -JSON, described below. - -Both encoders and decoders share valid tests, except an encoder accepts JSON and -outputs TOML rather than the reverse. The TOML representations are read with a -blessed decoder and is compared. Encoders have their own set of invalid tests in -the invalid-encoder directory. The JSON given to a TOML encoder is in the same -format as the JSON that a TOML decoder should output. - -Compatible with TOML version [v1.0.0][v1]. - -[t]: https://toml.io -[v1]: https://toml.io/en/v1.0.0 - -Installation ------------- -There are binaries on the [release page][r]; these are statically compiled and -should run in most environments. It's recommended you use a binary, or a tagged -release if you build from source especially in CI environments. This prevents -your tests from breaking on changes to tests in this tool. - -To compile from source you will need Go 1.16 or newer (older versions will *not* -work): - - $ git clone https://github.com/BurntSushi/toml-test.git - $ cd toml-test - $ go build ./cmd/toml-test - -This will build a `./toml-test` binary. - -[r]: https://github.com/BurntSushi/toml-test/releases - -Usage ------ -`toml-test` accepts an encoder or decoder as the first positional argument, for -example: - - $ toml-test my-toml-decoder - $ toml-test my-toml-encoder -encoder - -The `-encoder` flag is used to signal that this is an encoder rather than a -decoder. - -For example, to run the tests against the Go TOML library: - - # Install my parser - $ go install github.com/BurntSushi/toml/cmd/toml-test-decoder@master - $ go install github.com/BurntSushi/toml/cmd/toml-test-encoder@master - - $ toml-test toml-test-decoder - toml-test [toml-test-decoder]: using embeded tests: 278 passed - - $ toml-test -encoder toml-test-encoder - toml-test [toml-test-encoder]: using embeded tests: 94 passed, 0 failed - -The default is to use the tests compiled in the binary; you can use `-testdir` -to load tests from the filesystem. You can use `-run [name]` or `-skip [name]` -to run or skip specific tests. Both flags can be given more than once and accept -glob patterns: `-run 'valid/string/*'`. - -See `toml-test -help` for detailed usage. - -### Implementing a decoder -For your decoder to be compatible with `toml-test` it **must** satisfy the -expected interface: - -- Your decoder **must** accept TOML data on `stdin` until EOF. -- If the TOML data is invalid, your decoder **must** return with a non-zero - exit, code indicating an error. -- If the TOML data is valid, your decoder **must** output a JSON encoding of - that data on `stdout` and return with a zero exit code indicating success. - -An example in pseudocode: - - toml_data = read_stdin() - - parsed_toml = decode_toml(toml_data) - - if error_parsing_toml(): - print_error_to_stderr() - exit(1) - - print_as_tagged_json(parsed_toml) - exit(0) - -Details on the tagged JSON is explained below in "JSON encoding". - -### Implementing an encoder -For your encoder to be compatible with `toml-test`, it **must** satisfy the -expected interface: - -- Your encoder **must** accept JSON data on `stdin` until EOF. -- If the JSON data cannot be converted to a valid TOML representation, your - encoder **must** return with a non-zero exit code indicating an error. -- If the JSON data can be converted to a valid TOML representation, your encoder - **must** output a TOML encoding of that data on `stdout` and return with a - zero exit code indicating success. - -An example in pseudocode: - - json_data = read_stdin() - - parsed_json_with_tags = decode_json(json_data) - - if error_parsing_json(): - print_error_to_stderr() - exit(1) - - print_as_toml(parsed_json_with_tags) - exit(0) - -JSON encoding -------------- -The following JSON encoding applies equally to both encoders and decoders: - -- TOML tables correspond to JSON objects. -- TOML table arrays correspond to JSON arrays. -- TOML values correspond to a special JSON object of the form: - `{"type": "{TTYPE}", "value": {TVALUE}}` - -In the above, `TTYPE` may be one of: - -- string -- integer -- float -- bool -- datetime -- datetime-local -- date-local -- time-local - -`TVALUE` is always a JSON string. - -Empty hashes correspond to empty JSON objects (`{}`) and empty arrays correspond -to empty JSON arrays (`[]`). - -Offset datetimes should be encoded in RFC 3339; Local datetimes should be -encoded following RFC 3339 without the offset part. Local dates should be -encoded as the date part of RFC 3339 and Local times as the time part. - -Examples: - - TOML JSON - - a = 42 {"type": "integer": "value": "42} - ---- - - [tbl] {"tbl": { - a = 42 "a": {"type": "integer": "value": "42} - }} - ---- - - a = ["a", 2] {"a": [ - {"type": "string", "value": "1"}, - {"type: "integer": "value": "2"} - ]} - -Or a more complex example: - -```toml -best-day-ever = 1987-07-05T17:45:00Z - -[numtheory] -boring = false -perfection = [6, 28, 496] -``` - -And the JSON encoding expected by `toml-test` is: - -```json -{ - "best-day-ever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}, - "numtheory": { - "boring": {"type": "bool", "value": "false"}, - "perfection": [ - {"type": "integer", "value": "6"}, - {"type": "integer", "value": "28"}, - {"type": "integer", "value": "496"} - ] - } -} -``` - -Note that the only JSON values ever used are objects, arrays and strings. - -An example implementation can be found in the BurnSushi/toml: - -- [Add tags](https://github.com/BurntSushi/toml/blob/master/internal/tag/add.go) -- [Remove tags](https://github.com/BurntSushi/toml/blob/master/internal/tag/rm.go) - -Assumptions of Truth --------------------- -The following are taken as ground truths by `toml-test`: - -- All tests classified as `invalid` **are** invalid. -- All tests classified as `valid` **are** valid. -- All expected outputs in `valid/test-name.json` are exactly correct. -- The Go standard library package `encoding/json` decodes JSON correctly. -- When testing encoders, the TOML decoder at - [BurntSushi/toml](https://github.com/BurntSushi/toml) is assumed to be - correct. (Note that this assumption is not made when testing decoders!) - -Of particular note is that **no TOML decoder** is taken as ground truth when -testing decoders. This means that most changes to the spec will only require an -update of the tests in `toml-test`. (Bigger changes may require an adjustment of -how two things are considered equal. Particularly if a new type of data is -added.) Obviously, this advantage does not apply to testing TOML encoders since -there must exist a TOML decoder that conforms to the specification in order to -read the output of a TOML encoder. - -Adding tests ------------- -`toml-test` was designed so that tests can be easily added and removed. As -mentioned above, tests are split into two groups: invalid and valid tests. - -Invalid tests **only check if a decoder rejects invalid TOML data**. Or, in the -case of testing encoders, invalid tests **only check if an encoder rejects an -invalid representation of TOML** (e.g., a hetergeneous array). Therefore, all -invalid tests should try to **test one thing and one thing only**. Invalid tests -should be named after the fault it is trying to expose. Invalid tests for -decoders are in the `tests/invalid` directory while invalid tests for encoders -are in the `tests/invalid-encoder` directory. - -Valid tests check that a decoder accepts valid TOML data **and** that the parser -has the correct representation of the TOML data. Therefore, valid tests need a -JSON encoding in addition to the TOML data. The tests should be small enough -that writing the JSON encoding by hand will not give you brain damage. The exact -reverse is true when testing encoders. - -A valid test without either a `.json` or `.toml` file will automatically fail. - -If you have tests that you'd like to add, please submit a pull request. - -Why JSON? ---------- -In order for a language agnostic test suite to work, we need some kind of data -exchange format. TOML cannot be used, as it would imply that a particular parser -has a blessing of correctness. - -My decision to use JSON was not a careful one. It was based on expediency. The -Go standard library has an excellent `encoding/json` package built in, which -made it easy to compare JSON data. - -The problem with JSON is that the types in TOML are not in one-to-one -correspondence with JSON. This is why every TOML value represented in JSON is -tagged with a type annotation, as described above. - -YAML may be closer in correspondence with TOML, but I don't believe we should -rely on that correspondence. Making things explicit with JSON means that writing -tests is a little more cumbersome, but it also reduces the number of assumptions -we need to make. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/gen-multi.py b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/gen-multi.py deleted file mode 100644 index 4728ab79c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/gen-multi.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import glob -import os.path - -for f in glob.glob('tests/invalid/*/*.multi'): - base = os.path.dirname(f[:-6]) - for l in open(f, 'rb').readlines(): - name = l.split(b'=')[0].strip().decode() - if name == '' or name[0] == '#': - continue - path = base + "/" + name + '.toml' - with open(path, 'wb+') as fp: - fp.write(l) diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/json.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/json.go deleted file mode 100644 index bb46425ca..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/json.go +++ /dev/null @@ -1,265 +0,0 @@ -// +build go1.16 - -package tomltest - -import ( - "strconv" - "strings" - "time" -) - -// cmpJSON consumes the recursive structure of both want and have -// simultaneously. If anything is unequal, the result has failed and comparison -// stops. -// -// reflect.DeepEqual could work here, but it won't tell us how the two -// structures are different. -func (r Test) cmpJSON(want, have interface{}) Test { - switch w := want.(type) { - case map[string]interface{}: - return r.cmpJSONMaps(w, have) - case []interface{}: - return r.cmpJSONArrays(w, have) - default: - return r.fail( - "Key '%s' in expected output should be a map or a list of maps, but it's a %T", - r.Key, want) - } -} - -func (r Test) cmpJSONMaps(want map[string]interface{}, have interface{}) Test { - haveMap, ok := have.(map[string]interface{}) - if !ok { - return r.mismatch("table", want, haveMap) - } - - // Check to make sure both or neither are values. - if isValue(want) && !isValue(haveMap) { - return r.fail( - "Key '%s' is supposed to be a value, but the parser reports it as a table", - r.Key) - } - if !isValue(want) && isValue(haveMap) { - return r.fail( - "Key '%s' is supposed to be a table, but the parser reports it as a value", - r.Key) - } - if isValue(want) && isValue(haveMap) { - return r.cmpJSONValues(want, haveMap) - } - - // Check that the keys of each map are equivalent. - for k := range want { - if _, ok := haveMap[k]; !ok { - bunk := r.kjoin(k) - return bunk.fail("Could not find key '%s' in parser output.", - bunk.Key) - } - } - for k := range haveMap { - if _, ok := want[k]; !ok { - bunk := r.kjoin(k) - return bunk.fail("Could not find key '%s' in expected output.", - bunk.Key) - } - } - - // Okay, now make sure that each value is equivalent. - for k := range want { - if sub := r.kjoin(k).cmpJSON(want[k], haveMap[k]); sub.Failed() { - return sub - } - } - return r -} - -func (r Test) cmpJSONArrays(want, have interface{}) Test { - wantSlice, ok := want.([]interface{}) - if !ok { - return r.bug("'value' should be a JSON array when 'type=array', but it is a %T", want) - } - - haveSlice, ok := have.([]interface{}) - if !ok { - return r.fail( - "Malformed output from your encoder: 'value' is not a JSON array: %T", have) - } - - if len(wantSlice) != len(haveSlice) { - return r.fail("Array lengths differ for key '%s':\n"+ - " Expected: %d\n"+ - " Your encoder: %d", - r.Key, len(wantSlice), len(haveSlice)) - } - for i := 0; i < len(wantSlice); i++ { - if sub := r.cmpJSON(wantSlice[i], haveSlice[i]); sub.Failed() { - return sub - } - } - return r -} - -func (r Test) cmpJSONValues(want, have map[string]interface{}) Test { - wantType, ok := want["type"].(string) - if !ok { - return r.bug("'type' should be a string, but it is a %T", want["type"]) - } - - haveType, ok := have["type"].(string) - if !ok { - return r.fail("Malformed output from your encoder: 'type' is not a string: %T", have["type"]) - } - - if wantType != haveType { - return r.valMismatch(wantType, haveType, want, have) - } - - // If this is an array, then we've got to do some work to check equality. - if wantType == "array" { - return r.cmpJSONArrays(want, have) - } - - // Atomic values are always strings - wantVal, ok := want["value"].(string) - if !ok { - return r.bug("'value' %v should be a string, but it is a %[1]T", want["value"]) - } - - haveVal, ok := have["value"].(string) - if !ok { - return r.fail("Malformed output from your encoder: %T is not a string", have["value"]) - } - - // Excepting floats and datetimes, other values can be compared as strings. - switch wantType { - case "float": - return r.cmpFloats(wantVal, haveVal) - case "datetime", "datetime-local", "date-local", "time-local": - return r.cmpAsDatetimes(wantType, wantVal, haveVal) - default: - return r.cmpAsStrings(wantVal, haveVal) - } -} - -func (r Test) cmpAsStrings(want, have string) Test { - if want != have { - return r.fail("Values for key '%s' don't match:\n"+ - " Expected: %s\n"+ - " Your encoder: %s", - r.Key, want, have) - } - return r -} - -func (r Test) cmpFloats(want, have string) Test { - // Special case for NaN, since NaN != NaN. - if strings.HasSuffix(want, "nan") || strings.HasSuffix(have, "nan") { - if want != have { - return r.fail("Values for key '%s' don't match:\n"+ - " Expected: %v\n"+ - " Your encoder: %v", - r.Key, want, have) - } - return r - } - - wantF, err := strconv.ParseFloat(want, 64) - if err != nil { - return r.bug("Could not read '%s' as a float value for key '%s'", want, r.Key) - } - - haveF, err := strconv.ParseFloat(have, 64) - if err != nil { - return r.fail("Malformed output from your encoder: key '%s' is not a float: '%s'", r.Key, have) - } - - if wantF != haveF { - return r.fail("Values for key '%s' don't match:\n"+ - " Expected: %v\n"+ - " Your encoder: %v", - r.Key, wantF, haveF) - } - return r -} - -var datetimeRepl = strings.NewReplacer( - " ", "T", - "t", "T", - "z", "Z") - -var layouts = map[string]string{ - "datetime": time.RFC3339Nano, - "datetime-local": "2006-01-02T15:04:05.999999999", - "date-local": "2006-01-02", - "time-local": "15:04:05", -} - -func (r Test) cmpAsDatetimes(kind, want, have string) Test { - layout, ok := layouts[kind] - if !ok { - panic("should never happen") - } - - wantT, err := time.Parse(layout, datetimeRepl.Replace(want)) - if err != nil { - return r.bug("Could not read '%s' as a datetime value for key '%s'", want, r.Key) - } - - haveT, err := time.Parse(layout, datetimeRepl.Replace(want)) - if err != nil { - return r.fail("Malformed output from your encoder: key '%s' is not a datetime: '%s'", r.Key, have) - } - if !wantT.Equal(haveT) { - return r.fail("Values for key '%s' don't match:\n"+ - " Expected: %v\n"+ - " Your encoder: %v", - r.Key, wantT, haveT) - } - return r -} - -func (r Test) cmpAsDatetimesLocal(want, have string) Test { - if datetimeRepl.Replace(want) != datetimeRepl.Replace(have) { - return r.fail("Values for key '%s' don't match:\n"+ - " Expected: %v\n"+ - " Your encoder: %v", - r.Key, want, have) - } - return r -} - -func (r Test) kjoin(key string) Test { - if len(r.Key) == 0 { - r.Key = key - } else { - r.Key += "." + key - } - return r -} - -func isValue(m map[string]interface{}) bool { - if len(m) != 2 { - return false - } - if _, ok := m["type"]; !ok { - return false - } - if _, ok := m["value"]; !ok { - return false - } - return true -} - -func (r Test) mismatch(wantType string, want, have interface{}) Test { - return r.fail("Key '%s' is not an %s but %[4]T:\n"+ - " Expected: %#[3]v\n"+ - " Your encoder: %#[4]v", - r.Key, wantType, want, have) -} - -func (r Test) valMismatch(wantType, haveType string, want, have interface{}) Test { - return r.fail("Key '%s' is not an %s but %s:\n"+ - " Expected: %#[3]v\n"+ - " Your encoder: %#[4]v", - r.Key, wantType, want, have) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/runner.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/runner.go deleted file mode 100644 index d3044a5c4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/runner.go +++ /dev/null @@ -1,393 +0,0 @@ -// +build go1.16 - -//go:generate ./gen-multi.py - -package tomltest - -import ( - "bytes" - "embed" - "encoding/json" - "errors" - "fmt" - "io/fs" - "os" - "os/exec" - "path/filepath" - "strings" - - "github.com/BurntSushi/toml" -) - -type testType uint8 - -const ( - TypeValid testType = iota - TypeInvalid -) - -//go:embed tests/* -var embeddedTests embed.FS - -// EmbeddedTests are the tests embedded in toml-test, rooted to the "test/" -// directory. -func EmbeddedTests() fs.FS { - f, err := fs.Sub(embeddedTests, "tests") - if err != nil { - panic(err) - } - return f -} - -// Runner runs a set of tests. -// -// The validity of the parameters is not checked extensively; the caller should -// verify this if need be. See ./cmd/toml-test for an example. -type Runner struct { - Files fs.FS // Test files. - Encoder bool // Are we testing an encoder? - RunTests []string // Tests to run; run all if blank. - SkipTests []string // Tests to skip. - Parser Parser // Send data to a parser. -} - -// A Parser instance is used to call the TOML parser we test. -// -// By default this is done through an external command. -type Parser interface { - // Encode a JSON string to TOML. - // - // The output is the TOML string; if outputIsError is true then it's assumed - // that an encoding error occurred. - // - // An error return should only be used in case an unrecoverable error - // occurred; failing to encode to TOML is not an error, but the encoder - // unexpectedly panicking is. - Encode(jsonInput string) (output string, outputIsError bool, err error) - - // Decode a TOML string to JSON. The same semantics as Encode apply. - Decode(tomlInput string) (output string, outputIsError bool, err error) -} - -// CommandParser calls an external command. -type CommandParser struct { - fsys fs.FS - cmd []string -} - -// Tests are tests to run. -type Tests struct { - Tests []Test - - // Set when test are run. - - Skipped, Passed, Failed int -} - -// Result is the result of a single test. -type Test struct { - Path string // Path of test, e.g. "valid/string-test" - - // Set when a test is run. - - Skipped bool // Skipped this test? - Failure string // Failure message. - Key string // TOML key the failure occured on; may be blank. - Encoder bool // Encoder test? - Input string // The test case that we sent to the external program. - Output string // Output from the external program. - Want string // The output we want. - OutputFromStderr bool // The Output came from stderr, not stdout. -} - -// List all tests in Files. -func (r Runner) List() ([]string, error) { - ls := make([]string, 0, 256) - if err := r.findTOML("valid", &ls); err != nil { - return nil, fmt.Errorf("reading 'valid/' dir: %w", err) - } - - d := "invalid" + map[bool]string{true: "-encoder", false: ""}[r.Encoder] - if err := r.findTOML(d, &ls); err != nil { - return nil, fmt.Errorf("reading %q dir: %w", d, err) - } - return ls, nil -} - -// Run all tests listed in t.RunTests. -// -// TODO: give option to: -// - Run all tests with \n replaced with \r\n -// - Run all tests with '# comment' appended to every line. -func (r Runner) Run() (Tests, error) { - skipped, err := r.findTests() - if err != nil { - return Tests{}, fmt.Errorf("tomltest.Runner.Run: %w", err) - } - - tests := Tests{Tests: make([]Test, 0, len(r.RunTests)), Skipped: skipped} - for _, p := range r.RunTests { - if r.hasSkip(p) { - tests.Skipped++ - tests.Tests = append(tests.Tests, Test{Path: p, Skipped: true, Encoder: r.Encoder}) - continue - } - - t := Test{Path: p, Encoder: r.Encoder}.Run(r.Parser, r.Files) - tests.Tests = append(tests.Tests, t) - - if t.Failed() { - tests.Failed++ - } else { - tests.Passed++ - } - } - - return tests, nil -} - -// find all TOML files in 'path' relative to the test directory. -func (r Runner) findTOML(path string, appendTo *[]string) error { - err := fs.WalkDir(r.Files, path, func(path string, d fs.DirEntry, err error) error { - if err != nil { - return err - } - if d.IsDir() || !strings.HasSuffix(path, ".toml") { - return nil - } - - *appendTo = append(*appendTo, strings.TrimSuffix(path, ".toml")) - return nil - }) - - // It's okay if the directory doesn't exist. - var pErr *os.PathError - if errors.As(err, &pErr) && pErr.Op == "open" && pErr.Path == path { - return nil - } - return err -} - -// Expand RunTest glob patterns, or return all tests if RunTests if empty. -func (r *Runner) findTests() (int, error) { - ls, err := r.List() - if err != nil { - return 0, err - } - - var skip int - - if len(r.RunTests) == 0 { - r.RunTests = ls - } else { - run := make([]string, 0, len(r.RunTests)) - for _, l := range ls { - for _, r := range r.RunTests { - if m, _ := filepath.Match(r, l); m { - run = append(run, l) - break - } - } - } - r.RunTests, skip = run, len(ls)-len(run) - } - - // Expand invalid tests ending in ".multi.toml" - expanded := make([]string, 0, len(r.RunTests)) - for _, path := range r.RunTests { - if !strings.HasSuffix(path, ".multi") { - expanded = append(expanded, path) - continue - } - - d, err := fs.ReadFile(r.Files, path+".toml") - if err != nil { - return 0, err - } - - fmt.Println(string(d)) - } - r.RunTests = expanded - - return skip, nil -} - -func (r Runner) hasSkip(path string) bool { - for _, s := range r.SkipTests { - if m, _ := filepath.Match(s, path); m { - return true - } - } - return false -} - -func (c CommandParser) Encode(input string) (output string, outputIsError bool, err error) { - stdout, stderr := new(bytes.Buffer), new(bytes.Buffer) - cmd := exec.Command(c.cmd[0]) - cmd.Args = c.cmd - cmd.Stdin, cmd.Stdout, cmd.Stderr = strings.NewReader(input), stdout, stderr - - err = cmd.Run() - if err != nil { - eErr := &exec.ExitError{} - if errors.As(err, &eErr) { - fmt.Fprintf(stderr, "\nExit %d\n", eErr.ProcessState.ExitCode()) - err = nil - } - } - - if stderr.Len() > 0 { - return strings.TrimSpace(stderr.String()) + "\n", true, err - } - return strings.TrimSpace(stdout.String()) + "\n", false, err -} -func NewCommandParser(fsys fs.FS, cmd []string) CommandParser { return CommandParser{fsys, cmd} } -func (c CommandParser) Decode(input string) (string, bool, error) { return c.Encode(input) } - -// Run this test. -func (t Test) Run(p Parser, fsys fs.FS) Test { - if t.Type() == TypeInvalid { - return t.runInvalid(p, fsys) - } - return t.runValid(p, fsys) -} - -func (t Test) runInvalid(p Parser, fsys fs.FS) Test { - var err error - _, t.Input, err = t.ReadInput(fsys) - if err != nil { - return t.bug(err.Error()) - } - - if t.Encoder { - t.Output, t.OutputFromStderr, err = p.Encode(t.Input) - } else { - t.Output, t.OutputFromStderr, err = p.Decode(t.Input) - } - if err != nil { - return t.fail(err.Error()) - } - if !t.OutputFromStderr { - return t.fail("Expected an error, but no error was reported.") - } - return t -} - -func (t Test) runValid(p Parser, fsys fs.FS) Test { - var err error - _, t.Input, err = t.ReadInput(fsys) - if err != nil { - return t.bug(err.Error()) - } - - if t.Encoder { - t.Output, t.OutputFromStderr, err = p.Encode(t.Input) - } else { - t.Output, t.OutputFromStderr, err = p.Decode(t.Input) - } - if err != nil { - return t.fail(err.Error()) - } - if t.OutputFromStderr { - return t.fail(t.Output) - } - if t.Output == "" { - // Special case: we expect an empty output here. - if t.Path != "valid/empty-file" { - return t.fail("stdout is empty") - } - } - - // Compare for encoder test - if t.Encoder { - want, err := t.ReadWantTOML(fsys) - if err != nil { - return t.bug(err.Error()) - } - var have interface{} - if _, err := toml.Decode(t.Output, &have); err != nil { - //return t.fail("decode TOML from encoder %q:\n %s", cmd, err) - return t.fail("decode TOML from encoder:\n %s", err) - } - return t.cmpTOML(want, have) - } - - // Compare for decoder test - want, err := t.ReadWantJSON(fsys) - if err != nil { - return t.fail(err.Error()) - } - - var have interface{} - if err := json.Unmarshal([]byte(t.Output), &have); err != nil { - return t.fail("decode JSON output from parser:\n %s", err) - } - - return t.cmpJSON(want, have) -} - -// ReadInput reads the file sent to the encoder. -func (t Test) ReadInput(fsys fs.FS) (path, data string, err error) { - path = t.Path + map[bool]string{true: ".json", false: ".toml"}[t.Encoder] - d, err := fs.ReadFile(fsys, path) - if err != nil { - return path, "", err - } - return path, string(d), nil -} - -func (t Test) ReadWant(fsys fs.FS) (path, data string, err error) { - if t.Type() == TypeInvalid { - panic("testoml.Test.ReadWant: invalid tests do not have a 'correct' version") - } - - path = t.Path + map[bool]string{true: ".toml", false: ".json"}[t.Encoder] - d, err := fs.ReadFile(fsys, path) - if err != nil { - return path, "", err - } - return path, string(d), nil -} - -func (t *Test) ReadWantJSON(fsys fs.FS) (v interface{}, err error) { - var path string - path, t.Want, err = t.ReadWant(fsys) - if err != nil { - return nil, err - } - - if err := json.Unmarshal([]byte(t.Want), &v); err != nil { - return nil, fmt.Errorf("decode JSON file %q:\n %s", path, err) - } - return v, nil -} -func (t *Test) ReadWantTOML(fsys fs.FS) (v interface{}, err error) { - var path string - path, t.Want, err = t.ReadWant(fsys) - if err != nil { - return nil, err - } - _, err = toml.Decode(t.Want, &v) - if err != nil { - return nil, fmt.Errorf("Could not decode TOML file %q:\n %s", path, err) - } - return v, nil -} - -// Test type: "valid", "invalid" -func (t Test) Type() testType { - if strings.HasPrefix(t.Path, "invalid") { - return TypeInvalid - } - return TypeValid -} - -func (t Test) fail(format string, v ...interface{}) Test { - t.Failure = fmt.Sprintf(format, v...) - return t -} -func (t Test) bug(format string, v ...interface{}) Test { - return t.fail("BUG IN TEST CASE: "+format, v...) -} - -func (t Test) Failed() bool { return t.Failure != "" } diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/.gitattributes b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/.gitattributes deleted file mode 100644 index 638165542..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.toml -text diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/missing-separator.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/missing-separator.toml deleted file mode 100644 index ab3791afa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/missing-separator.toml +++ /dev/null @@ -1 +0,0 @@ -wrong = [ 1 2 3 ] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-2.toml deleted file mode 100644 index 2f46123f5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-2.toml +++ /dev/null @@ -1 +0,0 @@ -x = [42 # diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-table-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-table-2.toml deleted file mode 100644 index 827c12842..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-table-2.toml +++ /dev/null @@ -1 +0,0 @@ -x = [{ key = 42 # diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-table.toml deleted file mode 100644 index 7b077beb2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close-table.toml +++ /dev/null @@ -1 +0,0 @@ -x = [{ key = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close.toml deleted file mode 100644 index 032ebcc24..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/no-close.toml +++ /dev/null @@ -1 +0,0 @@ -long_array = [ 1, 2, 3 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/tables-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/tables-1.toml deleted file mode 100644 index 01d4d1381..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/tables-1.toml +++ /dev/null @@ -1,4 +0,0 @@ -# INVALID TOML DOC -fruit = [] - -[[fruit]] # Not allowed diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/tables-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/tables-2.toml deleted file mode 100644 index a77b0e4d3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/tables-2.toml +++ /dev/null @@ -1,10 +0,0 @@ -# INVALID TOML DOC -[[fruit]] - name = "apple" - - [[fruit.variety]] - name = "red delicious" - - # This table conflicts with the previous table - [fruit.variety] - name = "granny smith" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-after-array-entries.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-after-array-entries.toml deleted file mode 100644 index 1a7289074..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-after-array-entries.toml +++ /dev/null @@ -1,4 +0,0 @@ -array = [ - "Is there life after an array separator?", No - "Entry" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-before-array-separator.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-before-array-separator.toml deleted file mode 100644 index 9b06a3924..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-before-array-separator.toml +++ /dev/null @@ -1,4 +0,0 @@ -array = [ - "Is there life before an array separator?" No, - "Entry" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-in-array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-in-array.toml deleted file mode 100644 index a6a6c4207..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/array/text-in-array.toml +++ /dev/null @@ -1,5 +0,0 @@ -array = [ - "Entry 1", - I don't belong, - "Entry 2", -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/mixed-case.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/mixed-case.toml deleted file mode 100644 index 41d995a2d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/mixed-case.toml +++ /dev/null @@ -1 +0,0 @@ -valid = False diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/wrong-case-false.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/wrong-case-false.toml deleted file mode 100644 index 398222098..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/wrong-case-false.toml +++ /dev/null @@ -1 +0,0 @@ -b = FALSE diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/wrong-case-true.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/wrong-case-true.toml deleted file mode 100644 index 85e34c5eb..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/bool/wrong-case-true.toml +++ /dev/null @@ -1 +0,0 @@ -a = TRUE diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-del.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-del.toml deleted file mode 100644 index fb904007c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-del.toml +++ /dev/null @@ -1 +0,0 @@ -comment-del = "0x7f" #  diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-lf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-lf.toml deleted file mode 100644 index f6e963e02..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-lf.toml +++ /dev/null @@ -1 +0,0 @@ -comment-lf = "ctrl-P" #  diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-null.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-null.toml deleted file mode 100644 index 2c903729b..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-null.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-us.toml deleted file mode 100644 index c685b798f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/comment-us.toml +++ /dev/null @@ -1 +0,0 @@ -comment-us = "ctrl-_" #  diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/control.multi b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/control.multi deleted file mode 100644 index 08c0e25b3..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/control.multi and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-del.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-del.toml deleted file mode 100644 index 6629ae3b0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-del.toml +++ /dev/null @@ -1 +0,0 @@ -multi-del = """null""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-lf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-lf.toml deleted file mode 100644 index f207d33f1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-lf.toml +++ /dev/null @@ -1 +0,0 @@ -multi-lf = """null""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-null.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-null.toml deleted file mode 100644 index ac6cb46c0..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-null.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-us.toml deleted file mode 100644 index b923ca9e6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/multi-us.toml +++ /dev/null @@ -1 +0,0 @@ -multi-us = """null""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-del.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-del.toml deleted file mode 100644 index 17cde0778..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-del.toml +++ /dev/null @@ -1 +0,0 @@ -rawmulti-del = '''null''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-lf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-lf.toml deleted file mode 100644 index 360d48987..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-lf.toml +++ /dev/null @@ -1 +0,0 @@ -rawmulti-lf = '''null''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-null.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-null.toml deleted file mode 100644 index 1b5bd092c..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-null.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-us.toml deleted file mode 100644 index 025142071..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawmulti-us.toml +++ /dev/null @@ -1 +0,0 @@ -rawmulti-us = '''null''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-del.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-del.toml deleted file mode 100644 index 8d83ba8e4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-del.toml +++ /dev/null @@ -1 +0,0 @@ -rawstring-del = 'null' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-lf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-lf.toml deleted file mode 100644 index 237470ae6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-lf.toml +++ /dev/null @@ -1 +0,0 @@ -rawstring-lf = 'null' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-null.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-null.toml deleted file mode 100644 index 2d8d0b4cb..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-null.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-us.toml deleted file mode 100644 index 76cb08c0b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/rawstring-us.toml +++ /dev/null @@ -1 +0,0 @@ -rawstring-us = 'null' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-bs.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-bs.toml deleted file mode 100644 index 0061c4854..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-bs.toml +++ /dev/null @@ -1 +0,0 @@ -string-bs = "backspace" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-del.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-del.toml deleted file mode 100644 index bc0ec7fb8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-del.toml +++ /dev/null @@ -1 +0,0 @@ -string-del = "null" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-lf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-lf.toml deleted file mode 100644 index 0cf9218d7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-lf.toml +++ /dev/null @@ -1 +0,0 @@ -string-lf = "null" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-null.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-null.toml deleted file mode 100644 index 821c72c32..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-null.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-us.toml deleted file mode 100644 index af31f57b9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/control/string-us.toml +++ /dev/null @@ -1 +0,0 @@ -string-us = "null" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/impossible-date.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/impossible-date.toml deleted file mode 100644 index 78b55a39a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/impossible-date.toml +++ /dev/null @@ -1 +0,0 @@ -d = 2006-01-50T00:00:00Z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-leads-with-milli.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-leads-with-milli.toml deleted file mode 100644 index eef792f34..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-leads-with-milli.toml +++ /dev/null @@ -1 +0,0 @@ -with-milli = 1987-07-5T17:45:00.12Z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-leads.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-leads.toml deleted file mode 100644 index 123f173be..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-leads.toml +++ /dev/null @@ -1 +0,0 @@ -no-leads = 1987-7-05T17:45:00Z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-secs.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-secs.toml deleted file mode 100644 index ba9390076..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-secs.toml +++ /dev/null @@ -1 +0,0 @@ -no-secs = 1987-07-05T17:45Z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-t.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-t.toml deleted file mode 100644 index 617e3c56d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/no-t.toml +++ /dev/null @@ -1 +0,0 @@ -no-t = 1987-07-0517:45:00Z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/trailing-t.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/trailing-t.toml deleted file mode 100644 index 9b731ff01..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/datetime/trailing-t.toml +++ /dev/null @@ -1 +0,0 @@ -d = 2006-01-30T diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-at-end.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-at-end.toml deleted file mode 100644 index df5f0b066..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-at-end.toml +++ /dev/null @@ -1,5 +0,0 @@ -# There is a 0xda at after the quotes, and no EOL at the end of the file. -# -# This is a bit of an edge case: This indicates there should be two bytes -# (0b1101_1010) but there is no byte to follow because it's the end of the file. -x = """""" \ No newline at end of file diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-in-comment.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-in-comment.toml deleted file mode 100644 index 816fa4698..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-in-comment.toml +++ /dev/null @@ -1 +0,0 @@ -# diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-in-string.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-in-string.toml deleted file mode 100644 index 6d376fb17..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bad-utf8-in-string.toml +++ /dev/null @@ -1,2 +0,0 @@ -# The following line contains an invalid UTF-8 sequence. -bad = "" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bom-not-at-start-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bom-not-at-start-1.toml deleted file mode 100644 index effe1f235..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bom-not-at-start-1.toml +++ /dev/null @@ -1 +0,0 @@ -bom-not-at-start diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bom-not-at-start-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bom-not-at-start-2.toml deleted file mode 100644 index 71e52b41e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/bom-not-at-start-2.toml +++ /dev/null @@ -1 +0,0 @@ -bom-not-at-start= diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/utf16-bom.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/utf16-bom.toml deleted file mode 100644 index 95b5f9608..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/utf16-bom.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/utf16.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/utf16.toml deleted file mode 100644 index de3cbb2cb..000000000 Binary files a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/encoding/utf16.toml and /dev/null differ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/double-point-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/double-point-1.toml deleted file mode 100644 index 2105fa9be..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/double-point-1.toml +++ /dev/null @@ -1 +0,0 @@ -double-point-1 = 0..1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/double-point-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/double-point-2.toml deleted file mode 100644 index 1ef3d0b73..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/double-point-2.toml +++ /dev/null @@ -1 +0,0 @@ -double-point-2 = 0.1.2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-e-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-e-1.toml deleted file mode 100644 index ee568ce86..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-e-1.toml +++ /dev/null @@ -1 +0,0 @@ -exp-double-e-1 = 1ee2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-e-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-e-2.toml deleted file mode 100644 index 8fb015854..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-e-2.toml +++ /dev/null @@ -1 +0,0 @@ -exp-double-e-2 = 1e2e3 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-us.toml deleted file mode 100644 index 63f94e6c5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-double-us.toml +++ /dev/null @@ -1 +0,0 @@ -exp-double-us = 1e__23 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-leading-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-leading-us.toml deleted file mode 100644 index 1426f36af..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-leading-us.toml +++ /dev/null @@ -1 +0,0 @@ -exp-leading-us = 1e_23 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-point-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-point-1.toml deleted file mode 100644 index 569590bb8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-point-1.toml +++ /dev/null @@ -1 +0,0 @@ -exp-point-1 = 1e2.3 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-point-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-point-2.toml deleted file mode 100644 index 4a5e1d4dd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-point-2.toml +++ /dev/null @@ -1 +0,0 @@ -exp-point-2 = 1.e2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-trailing-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-trailing-us.toml deleted file mode 100644 index 07c06413c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/exp-trailing-us.toml +++ /dev/null @@ -1 +0,0 @@ -exp-trailing-us = 1e_23_ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/float.multi b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/float.multi deleted file mode 100644 index 070819540..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/float.multi +++ /dev/null @@ -1,40 +0,0 @@ -leading-zero = 03.14 -leading-zero-neg = -03.14 -leading-zero-plus = +03.14 - -leading-point = .12345 -leading-point-neg = -.12345 -leading-point-plus = +.12345 - -trailing-point = 1. -trailing-point-min = -1. -trailing-point-plus = +1. - -trailing-us = 1.2_ -leading-us = _1.2 -us-before-point = 1_.2 -us-after-point = 1._2 - -double-point-1 = 0..1 -double-point-2 = 0.1.2 - -exp-point-1 = 1e2.3 -exp-point-2 = 1.e2 - -exp-double-e-1 = 1ee2 -exp-double-e-2 = 1e2e3 - -exp-leading-us = 1e_23 -exp-trailing-us = 1e_23_ -exp-double-us = 1e__23 - -inf-incomplete-1 = in -inf-incomplete-2 = +in -inf-incomplete-3 = -in - -nan-incomplete-1 = na -nan-incomplete-2 = +na -nan-incomplete-3 = -na - -nan_underscore = na_n -inf_underscore = in_f diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-1.toml deleted file mode 100644 index 2c9ef598e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-1.toml +++ /dev/null @@ -1 +0,0 @@ -inf-incomplete-1 = in diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-2.toml deleted file mode 100644 index afda7123d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-2.toml +++ /dev/null @@ -1 +0,0 @@ -inf-incomplete-2 = +in diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-3.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-3.toml deleted file mode 100644 index bd8273866..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf-incomplete-3.toml +++ /dev/null @@ -1 +0,0 @@ -inf-incomplete-3 = -in diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf_underscore.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf_underscore.toml deleted file mode 100644 index 8e6ab1709..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/inf_underscore.toml +++ /dev/null @@ -1 +0,0 @@ -inf_underscore = in_f diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point-neg.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point-neg.toml deleted file mode 100644 index 74c526fc2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point-neg.toml +++ /dev/null @@ -1 +0,0 @@ -leading-point-neg = -.12345 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point-plus.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point-plus.toml deleted file mode 100644 index 85e23a282..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point-plus.toml +++ /dev/null @@ -1 +0,0 @@ -leading-point-plus = +.12345 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point.toml deleted file mode 100644 index a3c29b972..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-point.toml +++ /dev/null @@ -1 +0,0 @@ -leading-point = .12345 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-us.toml deleted file mode 100644 index fa94fd0f5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-us.toml +++ /dev/null @@ -1 +0,0 @@ -leading-us = _1.2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero-neg.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero-neg.toml deleted file mode 100644 index 94a4e70aa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero-neg.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero-neg = -03.14 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero-plus.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero-plus.toml deleted file mode 100644 index 12bfd6003..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero-plus.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero-plus = +03.14 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero.toml deleted file mode 100644 index 551fb2551..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/leading-zero.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero = 03.14 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-1.toml deleted file mode 100644 index df2e26135..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-1.toml +++ /dev/null @@ -1 +0,0 @@ -nan-incomplete-1 = na diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-2.toml deleted file mode 100644 index 6d2e8fb76..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-2.toml +++ /dev/null @@ -1 +0,0 @@ -nan-incomplete-2 = +na diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-3.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-3.toml deleted file mode 100644 index 9d365acf9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan-incomplete-3.toml +++ /dev/null @@ -1 +0,0 @@ -nan-incomplete-3 = -na diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan_underscore.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan_underscore.toml deleted file mode 100644 index 44c8bf16f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/nan_underscore.toml +++ /dev/null @@ -1 +0,0 @@ -nan_underscore = na_n diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point-min.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point-min.toml deleted file mode 100644 index 48741e3b1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point-min.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-point-min = -1. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point-plus.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point-plus.toml deleted file mode 100644 index 99260390f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point-plus.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-point-plus = +1. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point.toml deleted file mode 100644 index 76c95d916..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-point.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-point = 1. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-us.toml deleted file mode 100644 index ddfb7ba00..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/trailing-us.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-us = 1.2_ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/us-after-point.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/us-after-point.toml deleted file mode 100644 index 7f15f5709..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/us-after-point.toml +++ /dev/null @@ -1 +0,0 @@ -us-after-point = 1._2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/us-before-point.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/us-before-point.toml deleted file mode 100644 index c8edcbf0c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/float/us-before-point.toml +++ /dev/null @@ -1 +0,0 @@ -us-before-point = 1_.2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/double-comma.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/double-comma.toml deleted file mode 100644 index 2d2913a39..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/double-comma.toml +++ /dev/null @@ -1 +0,0 @@ -t = {x=3,,y=4} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/empty.toml deleted file mode 100644 index ebbb06664..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/empty.toml +++ /dev/null @@ -1 +0,0 @@ -t = {,} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-1.toml deleted file mode 100644 index 0ae44b63c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-1.toml +++ /dev/null @@ -1,4 +0,0 @@ -# No newlines are allowed between the curly braces unless they are valid within -# a value. -simple = { a = 1 -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-2.toml deleted file mode 100644 index 5ea4eaf5f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-2.toml +++ /dev/null @@ -1,2 +0,0 @@ -t = {a=1, -b=2} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-3.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-3.toml deleted file mode 100644 index 7f6e89249..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-3.toml +++ /dev/null @@ -1,2 +0,0 @@ -t = {a=1 -,b=2} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-4.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-4.toml deleted file mode 100644 index 3f34e15c0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/linebreak-4.toml +++ /dev/null @@ -1,4 +0,0 @@ -json_like = { - first = "Tom", - last = "Preston-Werner" -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/no-comma.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/no-comma.toml deleted file mode 100644 index 0a4083de5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/no-comma.toml +++ /dev/null @@ -1 +0,0 @@ -t = {x = 3 y = 4} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/trailing-comma.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/trailing-comma.toml deleted file mode 100644 index 6b67e0209..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/inline-table/trailing-comma.toml +++ /dev/null @@ -1,3 +0,0 @@ -# A terminating comma (also called trailing comma) is not permitted after the -# last key/value pair in an inline table -abc = { abc = 123, } diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-bin.toml deleted file mode 100644 index bea4e5e27..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-bin.toml +++ /dev/null @@ -1 +0,0 @@ -capital-bin = 0B0 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-hex.toml deleted file mode 100644 index bc064bb63..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-hex.toml +++ /dev/null @@ -1 +0,0 @@ -capital-hex = 0X1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-oct.toml deleted file mode 100644 index ea08a4da9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/capital-oct.toml +++ /dev/null @@ -1 +0,0 @@ -capital-oct = 0O0 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-sign-nex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-sign-nex.toml deleted file mode 100644 index ff014cf05..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-sign-nex.toml +++ /dev/null @@ -1 +0,0 @@ -double-sign-nex = --99 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-sign-plus.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-sign-plus.toml deleted file mode 100644 index 845ebb599..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-sign-plus.toml +++ /dev/null @@ -1 +0,0 @@ -double-sign-plus = ++99 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-us.toml deleted file mode 100644 index cd00561f6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/double-us.toml +++ /dev/null @@ -1 +0,0 @@ -double-us = 1__23 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/integer.multi b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/integer.multi deleted file mode 100644 index eaf4b082d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/integer.multi +++ /dev/null @@ -1,39 +0,0 @@ -leading-zero-1 = 01 -leading-zero-2 = 00 -leading-zero-sign-1 = -01 -leading-zero-sign-2 = +01 - -double-sign-plus = ++99 -double-sign-nex = --99 - -negative-hex = -0xff -negative-bin = -0b11010110 -negative-oct = -0o99 - -positive-hex = +0xff -positive-bin = +0b11010110 -positive-oct = +0o99 - -trailing-us = 123_ -leading-us = _123 -double-us = 1__23 - -us-after-hex = 0x_1 -us-after-oct = 0o_1 -us-after-bin = 0b_1 - -trailing-us-hex = 0x1_ -trailing-us-oct = 0o1_ -trailing-us-bin = 0b1_ - -leading-us-hex = _0o1 -leading-us-oct = _0o1 -leading-us-bin = _0o1 - -invalid-hex = 0xaafz -invalid-oct = 0o778 -invalid-bin = 0b0012 - -capital-hex = 0X1 -capital-oct = 0O0 -capital-bin = 0B0 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-bin.toml deleted file mode 100644 index d0182581b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-bin.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-bin = 0b0012 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-hex.toml deleted file mode 100644 index 7cc0e855e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-hex.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-hex = 0xaafz diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-oct.toml deleted file mode 100644 index 03181b1a4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/invalid-oct.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-oct = 0o778 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-bin.toml deleted file mode 100644 index 8885c031a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-bin.toml +++ /dev/null @@ -1 +0,0 @@ -leading-us-bin = _0o1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-hex.toml deleted file mode 100644 index 9f193f80e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-hex.toml +++ /dev/null @@ -1 +0,0 @@ -leading-us-hex = _0o1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-oct.toml deleted file mode 100644 index a717f1c81..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us-oct.toml +++ /dev/null @@ -1 +0,0 @@ -leading-us-oct = _0o1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us.toml deleted file mode 100644 index d059f50a8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-us.toml +++ /dev/null @@ -1 +0,0 @@ -leading-us = _123 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-1.toml deleted file mode 100644 index eba6bda31..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-1.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero-1 = 01 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-2.toml deleted file mode 100644 index 436af5652..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-2.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero-2 = 00 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-sign-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-sign-1.toml deleted file mode 100644 index 1f15a9da5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-sign-1.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero-sign-1 = -01 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-sign-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-sign-2.toml deleted file mode 100644 index fa259c3cd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/leading-zero-sign-2.toml +++ /dev/null @@ -1 +0,0 @@ -leading-zero-sign-2 = +01 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-bin.toml deleted file mode 100644 index 948b23678..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-bin.toml +++ /dev/null @@ -1 +0,0 @@ -negative-bin = -0b11010110 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-hex.toml deleted file mode 100644 index 67c31ea43..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-hex.toml +++ /dev/null @@ -1 +0,0 @@ -negative-hex = -0xff diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-oct.toml deleted file mode 100644 index b0c5ab0da..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/negative-oct.toml +++ /dev/null @@ -1 +0,0 @@ -negative-oct = -0o99 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-bin.toml deleted file mode 100644 index 7d6de6517..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-bin.toml +++ /dev/null @@ -1 +0,0 @@ -positive-bin = +0b11010110 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-hex.toml deleted file mode 100644 index bd503aad4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-hex.toml +++ /dev/null @@ -1 +0,0 @@ -positive-hex = +0xff diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-oct.toml deleted file mode 100644 index d77aa5213..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/positive-oct.toml +++ /dev/null @@ -1 +0,0 @@ -positive-oct = +0o99 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/text-after-integer.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/text-after-integer.toml deleted file mode 100644 index 42de7aff4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/text-after-integer.toml +++ /dev/null @@ -1 +0,0 @@ -answer = 42 the ultimate answer? diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-bin.toml deleted file mode 100644 index 9a0b57419..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-bin.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-us-bin = 0b1_ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-hex.toml deleted file mode 100644 index 2a9645509..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-hex.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-us-hex = 0x1_ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-oct.toml deleted file mode 100644 index d28e8bca9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us-oct.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-us-oct = 0o1_ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us.toml deleted file mode 100644 index e11e8ff6b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/trailing-us.toml +++ /dev/null @@ -1 +0,0 @@ -trailing-us = 123_ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-bin.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-bin.toml deleted file mode 100644 index 61dd895de..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-bin.toml +++ /dev/null @@ -1 +0,0 @@ -us-after-bin = 0b_1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-hex.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-hex.toml deleted file mode 100644 index 200220ad9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-hex.toml +++ /dev/null @@ -1 +0,0 @@ -us-after-hex = 0x_1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-oct.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-oct.toml deleted file mode 100644 index 23f530030..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/integer/us-after-oct.toml +++ /dev/null @@ -1 +0,0 @@ -us-after-oct = 0o_1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-array.toml deleted file mode 100644 index 5c1a1b0a9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-array.toml +++ /dev/null @@ -1 +0,0 @@ -[[agencies]] owner = "S Cjelli" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-table.toml deleted file mode 100644 index 68867842c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-table.toml +++ /dev/null @@ -1 +0,0 @@ -[error] this = "should not be here" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-value.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-value.toml deleted file mode 100644 index e05c47c23..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/after-value.toml +++ /dev/null @@ -1 +0,0 @@ -first = "Tom" last = "Preston-Werner" # INVALID diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/bare-invalid-character.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/bare-invalid-character.toml deleted file mode 100644 index e50dbe388..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/bare-invalid-character.toml +++ /dev/null @@ -1 +0,0 @@ -bare!key = 123 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/dotted-redefine-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/dotted-redefine-table.toml deleted file mode 100644 index 55e25ac08..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/dotted-redefine-table.toml +++ /dev/null @@ -1,4 +0,0 @@ -# Defined a.b as int -a.b = 1 -# Tries to access it as table: error -a.b.c = 2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/duplicate-keys.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/duplicate-keys.toml deleted file mode 100644 index 9b5aee0e5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/duplicate-keys.toml +++ /dev/null @@ -1,2 +0,0 @@ -dupe = false -dupe = true diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/duplicate.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/duplicate.toml deleted file mode 100644 index 7847bd401..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/duplicate.toml +++ /dev/null @@ -1,3 +0,0 @@ -# DO NOT DO THIS -name = "Tom" -name = "Pradyun" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/empty.toml deleted file mode 100644 index 09f998f41..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/empty.toml +++ /dev/null @@ -1 +0,0 @@ - = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/escape.toml deleted file mode 100644 index cdb8f4d68..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/escape.toml +++ /dev/null @@ -1 +0,0 @@ -\u00c0 = "latin capital letter A with grave" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/hash.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/hash.toml deleted file mode 100644 index e321b1fbd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/hash.toml +++ /dev/null @@ -1 +0,0 @@ -a# = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/multiline.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/multiline.toml deleted file mode 100644 index 31ff67e42..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/multiline.toml +++ /dev/null @@ -1,2 +0,0 @@ -"""long -key""" = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/newline.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/newline.toml deleted file mode 100644 index 24acaa1b1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/newline.toml +++ /dev/null @@ -1,2 +0,0 @@ -barekey - = 123 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/no-eol.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/no-eol.toml deleted file mode 100644 index 3c58eee18..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/no-eol.toml +++ /dev/null @@ -1 +0,0 @@ -a = 1 b = 2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/open-bracket.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/open-bracket.toml deleted file mode 100644 index f0aeb16e5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/open-bracket.toml +++ /dev/null @@ -1 +0,0 @@ -[abc = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/partial-quoted.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/partial-quoted.toml deleted file mode 100644 index e491a2f11..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/partial-quoted.toml +++ /dev/null @@ -1 +0,0 @@ -partial"quoted" = 5 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/single-open-bracket.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/single-open-bracket.toml deleted file mode 100644 index 558ed37d9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/single-open-bracket.toml +++ /dev/null @@ -1 +0,0 @@ -[ diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/space.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/space.toml deleted file mode 100644 index 7c22703e8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/space.toml +++ /dev/null @@ -1 +0,0 @@ -a b = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/special-character.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/special-character.toml deleted file mode 100644 index bc181a5cc..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/special-character.toml +++ /dev/null @@ -1 +0,0 @@ -μ = "greek small letter mu" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/start-bracket.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/start-bracket.toml deleted file mode 100644 index e0597ae1c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/start-bracket.toml +++ /dev/null @@ -1,3 +0,0 @@ -[a] -[xyz = 5 -[b] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals.toml deleted file mode 100644 index 25a037894..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals.toml +++ /dev/null @@ -1 +0,0 @@ -key= = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals2.toml deleted file mode 100644 index c5f2de8b6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals2.toml +++ /dev/null @@ -1 +0,0 @@ -a==1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals3.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals3.toml deleted file mode 100644 index eb203729a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/two-equals3.toml +++ /dev/null @@ -1 +0,0 @@ -a=b=1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/without-value-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/without-value-1.toml deleted file mode 100644 index 06bfde493..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/without-value-1.toml +++ /dev/null @@ -1 +0,0 @@ -key diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/without-value-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/without-value-2.toml deleted file mode 100644 index ca6d7eba6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/key/without-value-2.toml +++ /dev/null @@ -1 +0,0 @@ -key = diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-byte-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-byte-escape.toml deleted file mode 100644 index 4c7be59f4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-byte-escape.toml +++ /dev/null @@ -1 +0,0 @@ -naughty = "\xAg" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-codepoint.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-codepoint.toml deleted file mode 100644 index 592db75bb..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-codepoint.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-codepoint = "This string contains a non scalar unicode codepoint \uD801" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-concat.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-concat.toml deleted file mode 100644 index fc6d3c9cf..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-concat.toml +++ /dev/null @@ -1 +0,0 @@ -no_concat = "first" "second" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-escape.toml deleted file mode 100644 index 60acb0ccc..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-escape.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-escape = "This string has a bad \a escape character." diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-multiline.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-multiline.toml deleted file mode 100644 index 786046b55..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-multiline.toml +++ /dev/null @@ -1,2 +0,0 @@ -multi = "first line -second line" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-slash-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-slash-escape.toml deleted file mode 100644 index 154abadd5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-slash-escape.toml +++ /dev/null @@ -1 +0,0 @@ -invalid-escape = "This string has a bad \/ escape character." diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-uni-esc.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-uni-esc.toml deleted file mode 100644 index 9eae4ab96..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/bad-uni-esc.toml +++ /dev/null @@ -1 +0,0 @@ -str = "val\ue" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-byte-escapes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-byte-escapes.toml deleted file mode 100644 index e94452a8d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-byte-escapes.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "\x33" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml deleted file mode 100644 index b27e203c7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml +++ /dev/null @@ -1 +0,0 @@ -a = """\UFFFFFFFF""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml deleted file mode 100644 index 17a9361b3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml +++ /dev/null @@ -1 +0,0 @@ -a = """\U00D80000""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-quotes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-quotes.toml deleted file mode 100644 index 02ebf13a0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-quotes.toml +++ /dev/null @@ -1 +0,0 @@ -str5 = """Here are three quotation marks: """.""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-unknown-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-unknown-escape.toml deleted file mode 100644 index 35c5cc5ea..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-multiline-unknown-escape.toml +++ /dev/null @@ -1 +0,0 @@ -a = """\@""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-out-of-range-unicode-escape-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-out-of-range-unicode-escape-1.toml deleted file mode 100644 index ada1f557f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-out-of-range-unicode-escape-1.toml +++ /dev/null @@ -1 +0,0 @@ -a = "\UFFFFFFFF" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-out-of-range-unicode-escape-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-out-of-range-unicode-escape-2.toml deleted file mode 100644 index d4833b3db..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-out-of-range-unicode-escape-2.toml +++ /dev/null @@ -1 +0,0 @@ -a = "\U00D80000" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-unknown-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-unknown-escape.toml deleted file mode 100644 index 381dd858c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/basic-unknown-escape.toml +++ /dev/null @@ -1 +0,0 @@ -a = "\@" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/literal-multiline-quotes-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/literal-multiline-quotes-1.toml deleted file mode 100644 index 9cfb76356..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/literal-multiline-quotes-1.toml +++ /dev/null @@ -1,2 +0,0 @@ -a = '''6 apostrophes: '''''' - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/literal-multiline-quotes-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/literal-multiline-quotes-2.toml deleted file mode 100644 index 9924236e9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/literal-multiline-quotes-2.toml +++ /dev/null @@ -1 +0,0 @@ -a = '''15 apostrophes: '''''''''''''''''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/missing-quotes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/missing-quotes.toml deleted file mode 100644 index 22927931a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/missing-quotes.toml +++ /dev/null @@ -1 +0,0 @@ -name = value diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-escape-space.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-escape-space.toml deleted file mode 100644 index 13570d3b6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-escape-space.toml +++ /dev/null @@ -1,3 +0,0 @@ -a = """ - foo \ \n - bar""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-no-close-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-no-close-2.toml deleted file mode 100644 index f46940206..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-no-close-2.toml +++ /dev/null @@ -1 +0,0 @@ -x=""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-no-close.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-no-close.toml deleted file mode 100644 index 4ca959715..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-no-close.toml +++ /dev/null @@ -1,2 +0,0 @@ -invalid = """ - this will fail diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-quotes-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-quotes-1.toml deleted file mode 100644 index 9f7a42b77..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-quotes-1.toml +++ /dev/null @@ -1 +0,0 @@ -a = """6 quotes: """""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-quotes-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-quotes-2.toml deleted file mode 100644 index 9f7a42b77..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/multiline-quotes-2.toml +++ /dev/null @@ -1 +0,0 @@ -a = """6 quotes: """""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/no-close.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/no-close.toml deleted file mode 100644 index 0c292fcab..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/no-close.toml +++ /dev/null @@ -1 +0,0 @@ -no-ending-quote = "One time, at band camp diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/text-after-string.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/text-after-string.toml deleted file mode 100644 index c92a6f11d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/text-after-string.toml +++ /dev/null @@ -1 +0,0 @@ -string = "Is there life after strings?" No. diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/wrong-close.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/wrong-close.toml deleted file mode 100644 index 0f5c8011e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/string/wrong-close.toml +++ /dev/null @@ -1 +0,0 @@ -bad-ending-quote = "double and single' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-empty.toml deleted file mode 100644 index a470ca332..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-empty.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[]] -name = "Born to Run" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-implicit.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-implicit.toml deleted file mode 100644 index 05f2507ec..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-implicit.toml +++ /dev/null @@ -1,14 +0,0 @@ -# This test is a bit tricky. It should fail because the first use of -# `[[albums.songs]]` without first declaring `albums` implies that `albums` -# must be a table. The alternative would be quite weird. Namely, it wouldn't -# comply with the TOML spec: "Each double-bracketed sub-table will belong to -# the most *recently* defined table element *above* it." -# -# This is in contrast to the *valid* test, table-array-implicit where -# `[[albums.songs]]` works by itself, so long as `[[albums]]` isn't declared -# later. (Although, `[albums]` could be.) -[[albums.songs]] -name = "Glory Days" - -[[albums]] -name = "Born in the USA" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-missing-bracket.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-missing-bracket.toml deleted file mode 100644 index 39c73b05c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/array-missing-bracket.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[albums] -name = "Born to Run" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-key-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-key-table.toml deleted file mode 100644 index cedf05fc5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-key-table.toml +++ /dev/null @@ -1,5 +0,0 @@ -[fruit] -type = "apple" - -[fruit.type] -apple = "yes" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-table-array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-table-array.toml deleted file mode 100644 index a1d87059e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-table-array.toml +++ /dev/null @@ -1,2 +0,0 @@ -[tbl] -[[tbl]] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-table-array2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-table-array2.toml deleted file mode 100644 index 72eacbd10..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate-table-array2.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[tbl]] -[tbl] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate.toml deleted file mode 100644 index 73ef1cc7c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/duplicate.toml +++ /dev/null @@ -1,5 +0,0 @@ -[a] -b = 1 - -[a] -c = 2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/empty-implicit-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/empty-implicit-table.toml deleted file mode 100644 index 0cc36d0d2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/empty-implicit-table.toml +++ /dev/null @@ -1 +0,0 @@ -[naughty..naughty] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/empty.toml deleted file mode 100644 index fe51488c7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/empty.toml +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/equals-sign.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/equals-sign.toml deleted file mode 100644 index eb5e742f7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/equals-sign.toml +++ /dev/null @@ -1 +0,0 @@ -[name=bad] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/llbrace.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/llbrace.toml deleted file mode 100644 index 047978e5b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/llbrace.toml +++ /dev/null @@ -1 +0,0 @@ -[ [table]] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/nested-brackets-close.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/nested-brackets-close.toml deleted file mode 100644 index c8b5a6785..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/nested-brackets-close.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a]b] -zyx = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/nested-brackets-open.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/nested-brackets-open.toml deleted file mode 100644 index 246d7e91f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/nested-brackets-open.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a[b] -zyx = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/quoted-no-close.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/quoted-no-close.toml deleted file mode 100644 index 6e7c1a1ed..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/quoted-no-close.toml +++ /dev/null @@ -1,2 +0,0 @@ -["where will it end] -name = value diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/redefine.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/redefine.toml deleted file mode 100644 index fc23bf7d6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/redefine.toml +++ /dev/null @@ -1,6 +0,0 @@ -# Define b as int, and try to use it as a table: error -[a] -b = 1 - -[a.b] -c = 2 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/rrbrace.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/rrbrace.toml deleted file mode 100644 index 3a4dee471..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/rrbrace.toml +++ /dev/null @@ -1 +0,0 @@ -[[table] ] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/text-after-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/text-after-table.toml deleted file mode 100644 index 87da9db26..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/text-after-table.toml +++ /dev/null @@ -1 +0,0 @@ -[error] this shouldn't be here diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/whitespace.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/whitespace.toml deleted file mode 100644 index 0a6a6a697..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/whitespace.toml +++ /dev/null @@ -1 +0,0 @@ -[invalid key] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/with-pound.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/with-pound.toml deleted file mode 100644 index e7b777ecf..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/invalid/table/with-pound.toml +++ /dev/null @@ -1,2 +0,0 @@ -[key#group] -answer = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/array.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/array.json deleted file mode 100644 index 4e9d45b86..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/array.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "comments": [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - } - ], - "dates": [ - { - "type": "datetime", - "value": "1987-07-05T17:45:00Z" - }, - { - "type": "datetime", - "value": "1979-05-27T07:32:00Z" - }, - { - "type": "datetime", - "value": "2006-06-01T11:00:00Z" - } - ], - "floats": [ - { - "type": "float", - "value": "1.1" - }, - { - "type": "float", - "value": "2.1" - }, - { - "type": "float", - "value": "3.1" - } - ], - "ints": [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - }, - { - "type": "integer", - "value": "3" - } - ], - "strings": [ - { - "type": "string", - "value": "a" - }, - { - "type": "string", - "value": "b" - }, - { - "type": "string", - "value": "c" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/array.toml deleted file mode 100644 index ab884652b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/array.toml +++ /dev/null @@ -1,12 +0,0 @@ -ints = [1, 2, 3, ] -floats = [1.1, 2.1, 3.1] -strings = ["a", "b", "c"] -dates = [ - 1987-07-05T17:45:00Z, - 1979-05-27T07:32:00Z, - 2006-06-01T11:00:00Z, -] -comments = [ - 1, - 2, #this is ok -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/bool.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/bool.json deleted file mode 100644 index 7cede3fc5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/bool.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "a": [ - { - "type": "bool", - "value": "true" - }, - { - "type": "bool", - "value": "false" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/bool.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/bool.toml deleted file mode 100644 index d2010c587..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/bool.toml +++ /dev/null @@ -1 +0,0 @@ -a = [true, false] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/empty.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/empty.json deleted file mode 100644 index 7b1ca0cfa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/empty.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "thevoid": [ - [ - [ - [ - [] - ] - ] - ] - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/empty.toml deleted file mode 100644 index fa58dc63d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/empty.toml +++ /dev/null @@ -1 +0,0 @@ -thevoid = [[[[[]]]]] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/hetergeneous.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/hetergeneous.json deleted file mode 100644 index 751b6244b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/hetergeneous.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "mixed": [ - [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - } - ], - [ - { - "type": "string", - "value": "a" - }, - { - "type": "string", - "value": "b" - } - ], - [ - { - "type": "float", - "value": "1.1" - }, - { - "type": "float", - "value": "2.1" - } - ] - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/hetergeneous.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/hetergeneous.toml deleted file mode 100644 index a246fcf1d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/hetergeneous.toml +++ /dev/null @@ -1 +0,0 @@ -mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-array.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-array.json deleted file mode 100644 index 2f3ac5ee6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-array.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "arrays-and-ints": [ - { - "type": "integer", - "value": "1" - }, - [ - { - "type": "string", - "value": "Arrays are not integers." - } - ] - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-array.toml deleted file mode 100644 index 051ec7313..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-array.toml +++ /dev/null @@ -1 +0,0 @@ -arrays-and-ints = [1, ["Arrays are not integers."]] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-float.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-float.json deleted file mode 100644 index e73059b80..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-float.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ints-and-floats": [ - { - "type": "integer", - "value": "1" - }, - { - "type": "float", - "value": "1.1" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-float.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-float.toml deleted file mode 100644 index a5aa9b7a0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-float.toml +++ /dev/null @@ -1 +0,0 @@ -ints-and-floats = [1, 1.1] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-string.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-string.json deleted file mode 100644 index c6acc7633..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "strings-and-ints": [ - { - "type": "string", - "value": "hi" - }, - { - "type": "integer", - "value": "42" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-string.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-string.toml deleted file mode 100644 index f34830805..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-int-string.toml +++ /dev/null @@ -1 +0,0 @@ -strings-and-ints = ["hi", 42] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-string-table.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-string-table.json deleted file mode 100644 index 6185aa956..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-string-table.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "contributors": [ - { - "type": "string", - "value": "Foo Bar \u003cfoo@example.com\u003e" - }, - { - "email": { - "type": "string", - "value": "bazqux@example.com" - }, - "name": { - "type": "string", - "value": "Baz Qux" - }, - "url": { - "type": "string", - "value": "https://example.com/bazqux" - } - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-string-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-string-table.toml deleted file mode 100644 index bd7ada8da..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/mixed-string-table.toml +++ /dev/null @@ -1,4 +0,0 @@ -contributors = [ - "Foo Bar ", - { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-double.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-double.json deleted file mode 100644 index c89a8c9b7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-double.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "nest": [ - [ - [ - { - "type": "string", - "value": "a" - } - ], - [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - }, - [ - { - "type": "integer", - "value": "3" - } - ] - ] - ] - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-double.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-double.toml deleted file mode 100644 index c1de7477f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-double.toml +++ /dev/null @@ -1,6 +0,0 @@ -nest = [ - [ - ["a"], - [1, 2, [3]] - ] -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-inline-table.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-inline-table.json deleted file mode 100644 index 2ae5fa70c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-inline-table.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "a": [ - { - "b": {} - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-inline-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-inline-table.toml deleted file mode 100644 index e1e24f6c3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested-inline-table.toml +++ /dev/null @@ -1 +0,0 @@ -a = [ { b = {} } ] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested.json deleted file mode 100644 index 72c75897f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "nest": [ - [ - { - "type": "string", - "value": "a" - } - ], - [ - { - "type": "string", - "value": "b" - } - ] - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested.toml deleted file mode 100644 index ce3302249..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nested.toml +++ /dev/null @@ -1 +0,0 @@ -nest = [["a"], ["b"]] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nospaces.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nospaces.json deleted file mode 100644 index 6c89fced1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nospaces.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ints": [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - }, - { - "type": "integer", - "value": "3" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nospaces.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nospaces.toml deleted file mode 100644 index 66189367f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/nospaces.toml +++ /dev/null @@ -1 +0,0 @@ -ints = [1,2,3] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma-2.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma-2.json deleted file mode 100644 index 7cd54063a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma-2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "title": [ - { - "type": "string", - "value": " \", " - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma-2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma-2.toml deleted file mode 100644 index 4758ddcad..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma-2.toml +++ /dev/null @@ -1 +0,0 @@ -title = [ " \", ",] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma.json deleted file mode 100644 index b78db423e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": [ - { - "type": "string", - "value": "Client: \"XXXX\", Job: XXXX" - }, - { - "type": "string", - "value": "Code: XXXX" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma.toml deleted file mode 100644 index 6b458e1e8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-quote-comma.toml +++ /dev/null @@ -1,4 +0,0 @@ -title = [ -"Client: \"XXXX\", Job: XXXX", -"Code: XXXX" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-with-comma.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-with-comma.json deleted file mode 100644 index 42b77ef72..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-with-comma.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": [ - { - "type": "string", - "value": "Client: XXXX, Job: XXXX" - }, - { - "type": "string", - "value": "Code: XXXX" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-with-comma.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-with-comma.toml deleted file mode 100644 index 655c40e27..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/string-with-comma.toml +++ /dev/null @@ -1,4 +0,0 @@ -title = [ -"Client: XXXX, Job: XXXX", -"Code: XXXX" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/strings.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/strings.json deleted file mode 100644 index 27617b4d0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/strings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string_array": [ - { - "type": "string", - "value": "all" - }, - { - "type": "string", - "value": "strings" - }, - { - "type": "string", - "value": "are the same" - }, - { - "type": "string", - "value": "type" - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/strings.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/strings.toml deleted file mode 100644 index 51894ce10..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/strings.toml +++ /dev/null @@ -1 +0,0 @@ -string_array = [ "all", 'strings', """are the same""", '''type'''] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/table-array-string-backslash.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/table-array-string-backslash.json deleted file mode 100644 index 2c0feb13d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/table-array-string-backslash.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": [ - { - "bar": { - "type": "string", - "value": "\"{{baz}}\"" - } - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/table-array-string-backslash.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/table-array-string-backslash.toml deleted file mode 100644 index f0de81e0d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/array/table-array-string-backslash.toml +++ /dev/null @@ -1 +0,0 @@ -foo = [ { bar="\"{{baz}}\""} ] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/bool/bool.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/bool/bool.json deleted file mode 100644 index be47d6d04..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/bool/bool.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "f": { - "type": "bool", - "value": "false" - }, - "t": { - "type": "bool", - "value": "true" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/bool/bool.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/bool/bool.toml deleted file mode 100644 index a8a829b34..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/bool/bool.toml +++ /dev/null @@ -1,2 +0,0 @@ -t = true -f = false diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof.json deleted file mode 100644 index af3154ab4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "key": { - "type": "string", - "value": "value" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof.toml deleted file mode 100644 index 090b47483..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof.toml +++ /dev/null @@ -1,2 +0,0 @@ -# This is a full-line comment -key = "value" # This is a comment at the end of a line diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof2.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof2.json deleted file mode 100644 index af3154ab4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "key": { - "type": "string", - "value": "value" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof2.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof2.toml deleted file mode 100644 index 090b47483..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/at-eof2.toml +++ /dev/null @@ -1,2 +0,0 @@ -# This is a full-line comment -key = "value" # This is a comment at the end of a line diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/everywhere.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/everywhere.json deleted file mode 100644 index c3dd422de..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/everywhere.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "group": { - "answer": { - "type": "integer", - "value": "42" - }, - "d": { - "type": "datetime", - "value": "1979-05-27T07:32:12-07:00" - }, - "more": [ - { - "type": "integer", - "value": "42" - }, - { - "type": "integer", - "value": "42" - } - ] - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/everywhere.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/everywhere.toml deleted file mode 100644 index aa9ebdc7e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/everywhere.toml +++ /dev/null @@ -1,27 +0,0 @@ -# Top comment. - # Top comment. -# Top comment. - -# [no-extraneous-groups-please] - -[group] # Comment -answer = 42 # Comment -# no-extraneous-keys-please = 999 -# Inbetween comment. -more = [ # Comment - # What about multiple # comments? - # Can you handle it? - # - # Evil. -# Evil. - 42, 42, # Comments within arrays are fun. - # What about multiple # comments? - # Can you handle it? - # - # Evil. -# Evil. -# ] Did I fool you? -] # Hopefully not. - -# Make sure the space between the datetime and "#" isn't lexed. -d = 1979-05-27T07:32:12-07:00 # c diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/tricky.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/tricky.json deleted file mode 100644 index 09948647c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/tricky.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "hash#tag": { - "#!": { - "type": "string", - "value": "hash bang" - }, - "arr3": [ - { - "type": "string", - "value": "#" - }, - { - "type": "string", - "value": "#" - }, - { - "type": "string", - "value": "###" - } - ], - "arr4": [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - }, - { - "type": "integer", - "value": "3" - }, - { - "type": "integer", - "value": "4" - } - ], - "arr5": [ - [ - [ - [ - [ - { - "type": "string", - "value": "#" - } - ] - ] - ] - ] - ], - "tbl1": { - "#": { - "type": "string", - "value": "}#" - } - } - }, - "section": { - "8": { - "type": "string", - "value": "eight" - }, - "eleven": { - "type": "float", - "value": "11.1" - }, - "five": { - "type": "float", - "value": "5.5" - }, - "four": { - "type": "string", - "value": "# no comment\n# nor this\n#also not comment" - }, - "one": { - "type": "string", - "value": "11" - }, - "six": { - "type": "integer", - "value": "6" - }, - "ten": { - "type": "float", - "value": "1000.0" - }, - "three": { - "type": "string", - "value": "#" - }, - "two": { - "type": "string", - "value": "22#" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/tricky.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/tricky.toml deleted file mode 100644 index c95f94d0d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/comment/tricky.toml +++ /dev/null @@ -1,31 +0,0 @@ -[section]#attached comment -#[notsection] -one = "11"#cmt -two = "22#" -three = '#' - -four = """# no comment -# nor this -#also not comment"""#is_comment - -five = 5.5#66 -six = 6#7 -8 = "eight" -#nine = 99 -ten = 10e2#1 -eleven = 1.11e1#23 - -["hash#tag"] -"#!" = "hash bang" -arr3 = [ "#", '#', """###""" ] -arr4 = [ 1,# 9, 9, -2#,9 -,#9 -3#] -,4] -arr5 = [[[[#["#"], -["#"]]]]#] -] -tbl1 = { "#" = '}#'}#}} - - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/datetime.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/datetime.json deleted file mode 100644 index 514633596..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/datetime.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "lower": { - "type": "datetime", - "value": "1987-07-05T17:45:00Z" - }, - "space": { - "type": "datetime", - "value": "1987-07-05T17:45:00Z" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/datetime.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/datetime.toml deleted file mode 100644 index 653d521fd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/datetime.toml +++ /dev/null @@ -1,2 +0,0 @@ -space = 1987-07-05 17:45:00Z -lower = 1987-07-05t17:45:00z diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-date.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-date.json deleted file mode 100644 index 8fea2fe06..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-date.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "bestdayever": { - "type": "date-local", - "value": "1987-07-05" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-date.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-date.toml deleted file mode 100644 index 1be4a5f8e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-date.toml +++ /dev/null @@ -1 +0,0 @@ -bestdayever = 1987-07-05 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-time.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-time.json deleted file mode 100644 index 5e527e97b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-time.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "besttimeever": { - "type": "time-local", - "value": "17:45:00" - }, - "milliseconds": { - "type": "time-local", - "value": "10:32:00.555" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-time.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-time.toml deleted file mode 100644 index 6b07f6ffe..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local-time.toml +++ /dev/null @@ -1,2 +0,0 @@ -besttimeever = 17:45:00 -milliseconds = 10:32:00.555 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local.json deleted file mode 100644 index 12f8df5d5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "local": { - "type": "datetime-local", - "value": "1987-07-05T17:45:00" - }, - "milli": { - "type": "datetime-local", - "value": "1977-12-21T10:32:00.555" - }, - "space": { - "type": "datetime-local", - "value": "1987-07-05T17:45:00" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local.toml deleted file mode 100644 index ab425ecac..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/local.toml +++ /dev/null @@ -1,3 +0,0 @@ -local = 1987-07-05T17:45:00 -milli = 1977-12-21T10:32:00.555 -space = 1987-07-05 17:45:00 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/milliseconds.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/milliseconds.json deleted file mode 100644 index bb896af46..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/milliseconds.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "utc1": { - "type": "datetime", - "value": "1987-07-05T17:45:56.123456Z" - }, - "utc2": { - "type": "datetime", - "value": "1987-07-05T17:45:56.600000Z" - }, - "wita1": { - "type": "datetime", - "value": "1987-07-05T17:45:56.123456+08:00" - }, - "wita2": { - "type": "datetime", - "value": "1987-07-05T17:45:56.600000+08:00" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/milliseconds.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/milliseconds.toml deleted file mode 100644 index a6c05903a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/milliseconds.toml +++ /dev/null @@ -1,4 +0,0 @@ -utc1 = 1987-07-05T17:45:56.123456Z -utc2 = 1987-07-05T17:45:56.6Z -wita1 = 1987-07-05T17:45:56.123456+08:00 -wita2 = 1987-07-05T17:45:56.6+08:00 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/timezone.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/timezone.json deleted file mode 100644 index 8dc83281b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/timezone.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "nzdt": { - "type": "datetime", - "value": "1987-07-05T17:45:56+13:00" - }, - "nzst": { - "type": "datetime", - "value": "1987-07-05T17:45:56+12:00" - }, - "pdt": { - "type": "datetime", - "value": "1987-07-05T17:45:56-05:00" - }, - "utc": { - "type": "datetime", - "value": "1987-07-05T17:45:56Z" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/timezone.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/timezone.toml deleted file mode 100644 index 20f3835b7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/datetime/timezone.toml +++ /dev/null @@ -1,4 +0,0 @@ -utc = 1987-07-05T17:45:56Z -pdt = 1987-07-05T17:45:56-05:00 -nzst = 1987-07-05T17:45:56+12:00 -nzdt = 1987-07-05T17:45:56+13:00 # DST diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/empty-file.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/empty-file.json deleted file mode 100644 index 0967ef424..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/empty-file.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/empty-file.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/empty-file.toml deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/example.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/example.json deleted file mode 100644 index 2ea95a20d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/example.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "best-day-ever": { - "type": "datetime", - "value": "1987-07-05T17:45:00Z" - }, - "numtheory": { - "boring": { - "type": "bool", - "value": "false" - }, - "perfection": [ - { - "type": "integer", - "value": "6" - }, - { - "type": "integer", - "value": "28" - }, - { - "type": "integer", - "value": "496" - } - ] - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/example.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/example.toml deleted file mode 100644 index 8cb02e01b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/example.toml +++ /dev/null @@ -1,5 +0,0 @@ -best-day-ever = 1987-07-05T17:45:00Z - -[numtheory] -boring = false -perfection = [6, 28, 496] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/exponent.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/exponent.json deleted file mode 100644 index e79a6e13d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/exponent.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "lower": { - "type": "float", - "value": "300.0" - }, - "minustenth": { - "type": "float", - "value": "-0.1" - }, - "neg": { - "type": "float", - "value": "0.03" - }, - "pointlower": { - "type": "float", - "value": "310.0" - }, - "pointupper": { - "type": "float", - "value": "310.0" - }, - "pos": { - "type": "float", - "value": "300.0" - }, - "upper": { - "type": "float", - "value": "300.0" - }, - "zero": { - "type": "float", - "value": "3.0" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/exponent.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/exponent.toml deleted file mode 100644 index 573e0a85a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/exponent.toml +++ /dev/null @@ -1,8 +0,0 @@ -lower = 3e2 -upper = 3E2 -neg = 3e-2 -pos = 3E+2 -zero = 3e0 -pointlower = 3.1e2 -pointupper = 3.1E2 -minustenth = -1E-1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/float.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/float.json deleted file mode 100644 index f92d8d879..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/float.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "negpi": { - "type": "float", - "value": "-3.14" - }, - "pi": { - "type": "float", - "value": "3.14" - }, - "pospi": { - "type": "float", - "value": "3.14" - }, - "zero-intpart": { - "type": "float", - "value": "0.123" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/float.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/float.toml deleted file mode 100644 index 5f0232294..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/float.toml +++ /dev/null @@ -1,4 +0,0 @@ -pi = 3.14 -pospi = +3.14 -negpi = -3.14 -zero-intpart = 0.123 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/inf-and-nan.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/inf-and-nan.json deleted file mode 100644 index e3f1ba3c7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/inf-and-nan.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "infinity": { - "type": "float", - "value": "inf" - }, - "infinity_neg": { - "type": "float", - "value": "-inf" - }, - "infinity_plus": { - "type": "float", - "value": "+inf" - }, - "nan": { - "type": "float", - "value": "nan" - }, - "nan_neg": { - "type": "float", - "value": "nan" - }, - "nan_plus": { - "type": "float", - "value": "nan" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/inf-and-nan.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/inf-and-nan.toml deleted file mode 100644 index c8f8459c6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/inf-and-nan.toml +++ /dev/null @@ -1,8 +0,0 @@ -# We don't encode +nan and -nan back with the signs; many languages don't -# support a sign on NaN (it doesn't really make much sense). -nan = nan -nan_neg = -nan -nan_plus = +nan -infinity = inf -infinity_neg = -inf -infinity_plus = +inf diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/long.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/long.json deleted file mode 100644 index 73d750527..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/long.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "longpi": { - "type": "float", - "value": "3.141592653589793" - }, - "neglongpi": { - "type": "float", - "value": "-3.141592653589793" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/long.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/long.toml deleted file mode 100644 index 9558ae47c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/long.toml +++ /dev/null @@ -1,2 +0,0 @@ -longpi = 3.141592653589793 -neglongpi = -3.141592653589793 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/underscore.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/underscore.json deleted file mode 100644 index f54f7b502..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/underscore.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "after": { - "type": "float", - "value": "3141.5927" - }, - "before": { - "type": "float", - "value": "3141.5927" - }, - "exponent": { - "type": "float", - "value": "3.0e14" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/underscore.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/underscore.toml deleted file mode 100644 index 343353a89..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/underscore.toml +++ /dev/null @@ -1,3 +0,0 @@ -before = 3_141.5927 -after = 3141.592_7 -exponent = 3e1_4 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/zero.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/zero.json deleted file mode 100644 index 43381dd90..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/zero.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "f1": { - "type": "float", - "value": "0" - }, - "f2": { - "type": "float", - "value": "0" - }, - "f3": { - "type": "float", - "value": "0" - }, - "f4": { - "type": "float", - "value": "0" - }, - "f5": { - "type": "float", - "value": "0" - }, - "f6": { - "type": "float", - "value": "0" - }, - "f7": { - "type": "float", - "value": "0" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/zero.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/zero.toml deleted file mode 100644 index 5f2a8ffa4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/float/zero.toml +++ /dev/null @@ -1,7 +0,0 @@ -f1 = 0.0 -f2 = +0.0 -f3 = -0.0 -f4 = 0e0 -f5 = 0e00 -f6 = +0e0 -f7 = -0e0 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-after.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-after.json deleted file mode 100644 index 663a34e8e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-after.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "a": { - "b": { - "c": { - "answer": { - "type": "integer", - "value": "42" - } - } - }, - "better": { - "type": "integer", - "value": "43" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-after.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-after.toml deleted file mode 100644 index c0e8865b3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-after.toml +++ /dev/null @@ -1,5 +0,0 @@ -[a.b.c] -answer = 42 - -[a] -better = 43 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-before.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-before.json deleted file mode 100644 index 663a34e8e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-before.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "a": { - "b": { - "c": { - "answer": { - "type": "integer", - "value": "42" - } - } - }, - "better": { - "type": "integer", - "value": "43" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-before.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-before.toml deleted file mode 100644 index eee68ff51..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-and-explicit-before.toml +++ /dev/null @@ -1,5 +0,0 @@ -[a] -better = 43 - -[a.b.c] -answer = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-groups.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-groups.json deleted file mode 100644 index 347c693cf..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-groups.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "a": { - "b": { - "c": { - "answer": { - "type": "integer", - "value": "42" - } - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-groups.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-groups.toml deleted file mode 100644 index b6333e49d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/implicit-groups.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a.b.c] -answer = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/array.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/array.json deleted file mode 100644 index fe78bf6b5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/array.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "people": [ - { - "first_name": { - "type": "string", - "value": "Bruce" - }, - "last_name": { - "type": "string", - "value": "Springsteen" - } - }, - { - "first_name": { - "type": "string", - "value": "Eric" - }, - "last_name": { - "type": "string", - "value": "Clapton" - } - }, - { - "first_name": { - "type": "string", - "value": "Bob" - }, - "last_name": { - "type": "string", - "value": "Seger" - } - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/array.toml deleted file mode 100644 index 3fa60d669..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/array.toml +++ /dev/null @@ -1,3 +0,0 @@ -people = [{first_name = "Bruce", last_name = "Springsteen"}, - {first_name = "Eric", last_name = "Clapton"}, - {first_name = "Bob", last_name = "Seger"}] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/bool.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/bool.json deleted file mode 100644 index 717952fab..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/bool.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "a": { - "a": { - "type": "bool", - "value": "true" - }, - "b": { - "type": "bool", - "value": "false" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/bool.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/bool.toml deleted file mode 100644 index d228fc264..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/bool.toml +++ /dev/null @@ -1 +0,0 @@ -a = {a = true, b = false} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/empty.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/empty.json deleted file mode 100644 index 28beacf88..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/empty.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "empty1": {}, - "empty2": {}, - "empty_in_array": [ - { - "not_empty": { - "type": "integer", - "value": "1" - } - }, - {} - ], - "empty_in_array2": [ - {}, - { - "not_empty": { - "type": "integer", - "value": "1" - } - } - ], - "many_empty": [ - {}, - {}, - {} - ], - "nested_empty": { - "empty": {} - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/empty.toml deleted file mode 100644 index 910d458f1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/empty.toml +++ /dev/null @@ -1,6 +0,0 @@ -empty1 = {} -empty2 = { } -empty_in_array = [ { not_empty = 1 }, {} ] -empty_in_array2 = [{},{not_empty=1}] -many_empty = [{},{},{}] -nested_empty = {"empty"={}} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/end-in-bool.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/end-in-bool.json deleted file mode 100644 index 90e700aba..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/end-in-bool.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "black": { - "allow_prereleases": { - "type": "bool", - "value": "true" - }, - "python": { - "type": "string", - "value": "\u003e3.6" - }, - "version": { - "type": "string", - "value": "\u003e=18.9b0" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/end-in-bool.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/end-in-bool.toml deleted file mode 100644 index 94e5651d5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/end-in-bool.toml +++ /dev/null @@ -1 +0,0 @@ -black = { python=">3.6", version=">=18.9b0", allow_prereleases=true } diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/inline-table.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/inline-table.json deleted file mode 100644 index 2468f62c0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/inline-table.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": { - "first": { - "type": "string", - "value": "Tom" - }, - "last": { - "type": "string", - "value": "Preston-Werner" - } - }, - "point": { - "x": { - "type": "integer", - "value": "1" - }, - "y": { - "type": "integer", - "value": "2" - } - }, - "simple": { - "a": { - "type": "integer", - "value": "1" - } - }, - "str-key": { - "a": { - "type": "integer", - "value": "1" - } - }, - "table-array": [ - { - "a": { - "type": "integer", - "value": "1" - } - }, - { - "b": { - "type": "integer", - "value": "2" - } - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/inline-table.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/inline-table.toml deleted file mode 100644 index 257047eeb..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/inline-table.toml +++ /dev/null @@ -1,5 +0,0 @@ -name = { first = "Tom", last = "Preston-Werner" } -point = { x = 1, y = 2 } -simple = { a = 1 } -str-key = { "a" = 1 } -table-array = [{ "a" = 1 }, { "b" = 2 }] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/key-dotted.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/key-dotted.json deleted file mode 100644 index 38868032a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/key-dotted.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "a": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - }, - "arr": [ - { - "T": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - }, - "t": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - } - }, - { - "T": { - "a": { - "b": { - "type": "integer", - "value": "2" - } - } - }, - "t": { - "a": { - "b": { - "type": "integer", - "value": "2" - } - } - } - } - ], - "b": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - }, - "c": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - }, - "d": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - }, - "e": { - "a": { - "b": { - "type": "integer", - "value": "1" - } - } - }, - "inline": { - "a": { - "b": { - "type": "integer", - "value": "42" - } - } - }, - "many": { - "dots": { - "here": { - "dot": { - "dot": { - "dot": { - "a": { - "b": { - "c": { - "type": "integer", - "value": "1" - }, - "d": { - "type": "integer", - "value": "2" - } - } - } - } - } - } - } - } - }, - "tbl": { - "a": { - "b": { - "c": { - "d": { - "e": { - "type": "integer", - "value": "1" - } - } - } - } - }, - "x": { - "a": { - "b": { - "c": { - "d": { - "e": { - "type": "integer", - "value": "1" - } - } - } - } - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/key-dotted.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/key-dotted.toml deleted file mode 100644 index e812943a9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/key-dotted.toml +++ /dev/null @@ -1,23 +0,0 @@ -inline = {a.b = 42} - -many.dots.here.dot.dot.dot = {a.b.c = 1, a.b.d = 2} - -a = { a.b = 1 } -b = { "a"."b" = 1 } -c = { a . b = 1 } -d = { 'a' . "b" = 1 } -e = {a.b=1} - -[tbl] -a.b.c = {d.e=1} - -[tbl.x] -a.b.c = {d.e=1} - -[[arr]] -t = {a.b=1} -T = {a.b=1} - -[[arr]] -t = {a.b=2} -T = {a.b=2} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/multiline.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/multiline.json deleted file mode 100644 index f946d819e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/multiline.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "tbl_multiline": { - "a": { - "type": "integer", - "value": "1" - }, - "b": { - "type": "string", - "value": "multiline\n" - }, - "c": { - "type": "string", - "value": "and yet\nanother line" - }, - "d": { - "type": "integer", - "value": "4" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/multiline.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/multiline.toml deleted file mode 100644 index a653b18f4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/multiline.toml +++ /dev/null @@ -1,4 +0,0 @@ -tbl_multiline = { a = 1, b = """ -multiline -""", c = """and yet -another line""", d = 4 } diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/nest.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/nest.json deleted file mode 100644 index 70aebb3f9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/nest.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "arr_arr_tbl_empty": [ - [ - {} - ] - ], - "arr_arr_tbl_val": [ - [ - { - "one": { - "type": "integer", - "value": "1" - } - } - ] - ], - "arr_arr_tbls": [ - [ - { - "one": { - "type": "integer", - "value": "1" - } - }, - { - "two": { - "type": "integer", - "value": "2" - } - } - ] - ], - "arr_tbl_tbl": [ - { - "tbl": { - "one": { - "type": "integer", - "value": "1" - } - } - } - ], - "tbl_arr_tbl": { - "arr_tbl": [ - { - "one": { - "type": "integer", - "value": "1" - } - } - ] - }, - "tbl_tbl_empty": { - "tbl_0": {} - }, - "tbl_tbl_val": { - "tbl_1": { - "one": { - "type": "integer", - "value": "1" - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/nest.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/nest.toml deleted file mode 100644 index 2624c1d54..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/inline-table/nest.toml +++ /dev/null @@ -1,10 +0,0 @@ -tbl_tbl_empty = { tbl_0 = {} } -tbl_tbl_val = { tbl_1 = { one = 1 } } -tbl_arr_tbl = { arr_tbl = [ { one = 1 } ] } -arr_tbl_tbl = [ { tbl = { one = 1 } } ] - -# Array-of-array-of-table is interesting because it can only -# be represented in inline form. -arr_arr_tbl_empty = [ [ {} ] ] -arr_arr_tbl_val = [ [ { one = 1 } ] ] -arr_arr_tbls = [ [ { one = 1 }, { two = 2 } ] ] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/integer.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/integer.json deleted file mode 100644 index eee975806..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/integer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "answer": { - "type": "integer", - "value": "42" - }, - "neganswer": { - "type": "integer", - "value": "-42" - }, - "posanswer": { - "type": "integer", - "value": "42" - }, - "zero": { - "type": "integer", - "value": "0" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/integer.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/integer.toml deleted file mode 100644 index b62de30ae..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/integer.toml +++ /dev/null @@ -1,4 +0,0 @@ -answer = 42 -posanswer = +42 -neganswer = -42 -zero = 0 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/literals.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/literals.json deleted file mode 100644 index 1a8555bdd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/literals.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "bin1": { - "type": "integer", - "value": "214" - }, - "bin2": { - "type": "integer", - "value": "5" - }, - "hex1": { - "type": "integer", - "value": "3735928559" - }, - "hex2": { - "type": "integer", - "value": "3735928559" - }, - "hex3": { - "type": "integer", - "value": "3735928559" - }, - "hex4": { - "type": "integer", - "value": "2439" - }, - "oct1": { - "type": "integer", - "value": "342391" - }, - "oct2": { - "type": "integer", - "value": "493" - }, - "oct3": { - "type": "integer", - "value": "501" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/literals.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/literals.toml deleted file mode 100644 index a07859047..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/literals.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin1 = 0b11010110 -bin2 = 0b1_0_1 - -oct1 = 0o01234567 -oct2 = 0o755 -oct3 = 0o7_6_5 - -hex1 = 0xDEADBEEF -hex2 = 0xdeadbeef -hex3 = 0xdead_beef -hex4 = 0x00987 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/long.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/long.json deleted file mode 100644 index 6f4f0a7cb..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/long.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "int64-max": { - "type": "integer", - "value": "9223372036854775807" - }, - "int64-max-neg": { - "type": "integer", - "value": "-9223372036854775808" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/long.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/long.toml deleted file mode 100644 index 5db5ed79e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/long.toml +++ /dev/null @@ -1,2 +0,0 @@ -int64-max = 9223372036854775807 -int64-max-neg = -9223372036854775808 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/underscore.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/underscore.json deleted file mode 100644 index 10b9b591d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/underscore.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "kilo": { - "type": "integer", - "value": "1000" - }, - "x": { - "type": "integer", - "value": "1111" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/underscore.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/underscore.toml deleted file mode 100644 index 7c2da5fec..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/underscore.toml +++ /dev/null @@ -1,2 +0,0 @@ -kilo = 1_000 -x = 1_1_1_1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/zero.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/zero.json deleted file mode 100644 index 9d5c70771..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/zero.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "a2": { - "type": "integer", - "value": "0" - }, - "a3": { - "type": "integer", - "value": "0" - }, - "b1": { - "type": "integer", - "value": "0" - }, - "b2": { - "type": "integer", - "value": "0" - }, - "b3": { - "type": "integer", - "value": "0" - }, - "d1": { - "type": "integer", - "value": "0" - }, - "d2": { - "type": "integer", - "value": "0" - }, - "d3": { - "type": "integer", - "value": "0" - }, - "h1": { - "type": "integer", - "value": "0" - }, - "h2": { - "type": "integer", - "value": "0" - }, - "h3": { - "type": "integer", - "value": "0" - }, - "o1": { - "type": "integer", - "value": "0" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/zero.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/zero.toml deleted file mode 100644 index 4687c2810..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/integer/zero.toml +++ /dev/null @@ -1,15 +0,0 @@ -d1 = 0 -d2 = +0 -d3 = -0 - -h1 = 0x0 -h2 = 0x00 -h3 = 0x00000 - -o1 = 0o0 -a2 = 0o00 -a3 = 0o00000 - -b1 = 0b0 -b2 = 0b00 -b3 = 0b00000 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/alphanum.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/alphanum.json deleted file mode 100644 index a54e1d351..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/alphanum.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "000111": { - "type": "string", - "value": "leading" - }, - "10e3": { - "type": "string", - "value": "false float" - }, - "123": { - "type": "string", - "value": "num" - }, - "2018_10": { - "001": { - "type": "integer", - "value": "1" - } - }, - "34-11": { - "type": "integer", - "value": "23" - }, - "a-a-a": { - "_": { - "type": "bool", - "value": "false" - } - }, - "alpha": { - "type": "string", - "value": "a" - }, - "one1two2": { - "type": "string", - "value": "mixed" - }, - "under_score": { - "type": "string", - "value": "___" - }, - "with-dash": { - "type": "string", - "value": "dashed" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/alphanum.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/alphanum.toml deleted file mode 100644 index 0632e9ccd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/alphanum.toml +++ /dev/null @@ -1,14 +0,0 @@ -alpha = "a" -123 = "num" -000111 = "leading" -10e3 = "false float" -one1two2 = "mixed" -with-dash = "dashed" -under_score = "___" -34-11 = 23 - -[2018_10] -001 = 1 - -[a-a-a] -_ = false diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/case-sensitive.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/case-sensitive.json deleted file mode 100644 index 1f205d20c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/case-sensitive.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "Section": { - "M": { - "type": "string", - "value": "latin letter M" - }, - "name": { - "type": "string", - "value": "different section!!" - }, - "Μ": { - "type": "string", - "value": "greek capital letter MU" - }, - "μ": { - "type": "string", - "value": "greek small letter mu" - } - }, - "sectioN": { - "type": "string", - "value": "NN" - }, - "section": { - "NAME": { - "type": "string", - "value": "upper" - }, - "Name": { - "type": "string", - "value": "capitalized" - }, - "name": { - "type": "string", - "value": "lower" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/case-sensitive.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/case-sensitive.toml deleted file mode 100644 index e02b3a51a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/case-sensitive.toml +++ /dev/null @@ -1,13 +0,0 @@ -sectioN = "NN" - -[section] -name = "lower" -NAME = "upper" -Name = "capitalized" - -[Section] -name = "different section!!" -"μ" = "greek small letter mu" -"Μ" = "greek capital letter MU" -M = "latin letter M" - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/dotted.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/dotted.json deleted file mode 100644 index a527a72c2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/dotted.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "a": { - "few": { - "dots": { - "polka": { - "dance-with": { - "type": "string", - "value": "Dot" - }, - "dot": { - "type": "string", - "value": "again?" - } - } - } - } - }, - "arr": [ - { - "a": { - "b": { - "c": { - "type": "integer", - "value": "1" - }, - "d": { - "type": "integer", - "value": "2" - } - } - } - }, - { - "a": { - "b": { - "c": { - "type": "integer", - "value": "3" - }, - "d": { - "type": "integer", - "value": "4" - } - } - } - } - ], - "count": { - "a": { - "type": "integer", - "value": "1" - }, - "b": { - "type": "integer", - "value": "2" - }, - "c": { - "type": "integer", - "value": "3" - }, - "d": { - "type": "integer", - "value": "4" - }, - "e": { - "type": "integer", - "value": "5" - }, - "f": { - "type": "integer", - "value": "6" - }, - "g": { - "type": "integer", - "value": "7" - }, - "h": { - "type": "integer", - "value": "8" - }, - "i": { - "type": "integer", - "value": "9" - }, - "j": { - "type": "integer", - "value": "10" - }, - "k": { - "type": "integer", - "value": "11" - }, - "l": { - "type": "integer", - "value": "12" - } - }, - "many": { - "dots": { - "here": { - "dot": { - "dot": { - "dot": { - "type": "integer", - "value": "42" - } - } - } - } - } - }, - "name": { - "first": { - "type": "string", - "value": "Arthur" - }, - "last": { - "type": "string", - "value": "Dent" - } - }, - "tbl": { - "a": { - "b": { - "c": { - "type": "float", - "value": "42.666" - } - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/dotted.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/dotted.toml deleted file mode 100644 index 52d62d72f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/dotted.toml +++ /dev/null @@ -1,35 +0,0 @@ -# Note: this file contains literal tab characters. - -name.first = "Arthur" -"name".'last' = "Dent" - -many.dots.here.dot.dot.dot = 42 - -# Space are ignored, and key parts can be quoted. -count.a = 1 -count . b = 2 -"count"."c" = 3 -"count" . "d" = 4 -'count'.'e' = 5 -'count' . 'f' = 6 -"count".'g' = 7 -"count" . 'h' = 8 -count.'i' = 9 -count . 'j' = 10 -"count".k = 11 -"count" . l = 12 - -[tbl] -a.b.c = 42.666 - -[a.few.dots] -polka.dot = "again?" -polka.dance-with = "Dot" - -[[arr]] -a.b.c=1 -a.b.d=2 - -[[arr]] -a.b.c=3 -a.b.d=4 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/empty.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/empty.json deleted file mode 100644 index 44948a9e7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/empty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "": { - "type": "string", - "value": "blank" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/empty.toml deleted file mode 100644 index 0a1640dc2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/empty.toml +++ /dev/null @@ -1 +0,0 @@ -"" = "blank" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/equals-nospace.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/equals-nospace.json deleted file mode 100644 index 9394e562b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/equals-nospace.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "answer": { - "type": "integer", - "value": "42" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/equals-nospace.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/equals-nospace.toml deleted file mode 100644 index 560901c5a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/equals-nospace.toml +++ /dev/null @@ -1 +0,0 @@ -answer=42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/escapes.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/escapes.json deleted file mode 100644 index e62b3a14e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/escapes.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "\n": { - "type": "string", - "value": "newline" - }, - "\"": { - "type": "string", - "value": "just a quote" - }, - "\"quoted\"": { - "quote": { - "type": "bool", - "value": "true" - } - }, - "a.b": { - "À": {} - }, - "backsp\u0008\u0008": {}, - "À": { - "type": "string", - "value": "latin capital letter A with grave" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/escapes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/escapes.toml deleted file mode 100644 index aac3c0a51..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/escapes.toml +++ /dev/null @@ -1,10 +0,0 @@ -"\n" = "newline" -"\u00c0" = "latin capital letter A with grave" -"\"" = "just a quote" - -["backsp\b\b"] - -["\"quoted\""] -quote = true - -["a.b"."\u00c0"] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric-dotted.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric-dotted.json deleted file mode 100644 index 43dd4d1f2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric-dotted.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "1": { - "2": { - "type": "integer", - "value": "3" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric-dotted.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric-dotted.toml deleted file mode 100644 index 538204c68..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric-dotted.toml +++ /dev/null @@ -1 +0,0 @@ -1.2 = 3 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric.json deleted file mode 100644 index eddb88be1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "1": { - "type": "integer", - "value": "1" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric.toml deleted file mode 100644 index 532356f49..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/numeric.toml +++ /dev/null @@ -1 +0,0 @@ -1 = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/quoted-dots.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/quoted-dots.json deleted file mode 100644 index 1582c5b88..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/quoted-dots.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "plain": { - "type": "integer", - "value": "1" - }, - "plain_table": { - "plain": { - "type": "integer", - "value": "3" - }, - "with.dot": { - "type": "integer", - "value": "4" - } - }, - "table": { - "withdot": { - "key.with.dots": { - "type": "integer", - "value": "6" - }, - "plain": { - "type": "integer", - "value": "5" - } - } - }, - "with.dot": { - "type": "integer", - "value": "2" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/quoted-dots.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/quoted-dots.toml deleted file mode 100644 index 65fcddf96..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/quoted-dots.toml +++ /dev/null @@ -1,10 +0,0 @@ -plain = 1 -"with.dot" = 2 - -[plain_table] -plain = 3 -"with.dot" = 4 - -[table.withdot] -plain = 5 -"key.with.dots" = 6 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/space.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/space.json deleted file mode 100644 index 6d95f1ad4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/space.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "a b": { - "type": "integer", - "value": "1" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/space.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/space.toml deleted file mode 100644 index f4f36c4f6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/space.toml +++ /dev/null @@ -1 +0,0 @@ -"a b" = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-chars.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-chars.json deleted file mode 100644 index 608404751..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-chars.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "~!@$^\u0026*()_+-`1234567890[]|/?\u003e\u003c.,;:'": { - "type": "integer", - "value": "1" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-chars.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-chars.toml deleted file mode 100644 index cc572befd..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-chars.toml +++ /dev/null @@ -1 +0,0 @@ -"~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-word.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-word.json deleted file mode 100644 index 59ce693a6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-word.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "false": { - "type": "bool", - "value": "false" - }, - "inf": { - "type": "integer", - "value": "100000000" - }, - "nan": { - "type": "string", - "value": "ceci n'est pas un nombre" - }, - "true": { - "type": "integer", - "value": "1" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-word.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-word.toml deleted file mode 100644 index 0b836f17d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/key/special-word.toml +++ /dev/null @@ -1,5 +0,0 @@ -false = false -true = 1 -inf = 100000000 -nan = "ceci n'est pas un nombre" - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-crlf.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-crlf.json deleted file mode 100644 index acf617e32..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-crlf.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "newline": { - "type": "string", - "value": "crlf" - }, - "os": { - "type": "string", - "value": "DOS" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-crlf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-crlf.toml deleted file mode 100644 index 003002442..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-crlf.toml +++ /dev/null @@ -1,2 +0,0 @@ -os = "DOS" -newline = "crlf" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-lf.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-lf.json deleted file mode 100644 index 66cf871f3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-lf.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "newline": { - "type": "string", - "value": "lf" - }, - "os": { - "type": "string", - "value": "unix" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-lf.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-lf.toml deleted file mode 100644 index 0f3377cd9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/newline-lf.toml +++ /dev/null @@ -1,2 +0,0 @@ -os = "unix" -newline = "lf" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1-compact.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1-compact.json deleted file mode 100644 index 9f4078aa7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1-compact.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "clients": { - "data": [ - [ - { - "type": "string", - "value": "gamma" - }, - { - "type": "string", - "value": "delta" - } - ], - [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - } - ] - ], - "hosts": [ - { - "type": "string", - "value": "alpha" - }, - { - "type": "string", - "value": "omega" - } - ] - }, - "database": { - "connection_max": { - "type": "integer", - "value": "5000" - }, - "enabled": { - "type": "bool", - "value": "true" - }, - "ports": [ - { - "type": "integer", - "value": "8001" - }, - { - "type": "integer", - "value": "8001" - }, - { - "type": "integer", - "value": "8002" - } - ], - "server": { - "type": "string", - "value": "192.168.1.1" - } - }, - "owner": { - "dob": { - "type": "datetime", - "value": "1979-05-27T07:32:00-08:00" - }, - "name": { - "type": "string", - "value": "Lance Uppercut" - } - }, - "servers": { - "alpha": { - "dc": { - "type": "string", - "value": "eqdc10" - }, - "ip": { - "type": "string", - "value": "10.0.0.1" - } - }, - "beta": { - "dc": { - "type": "string", - "value": "eqdc10" - }, - "ip": { - "type": "string", - "value": "10.0.0.2" - } - } - }, - "title": { - "type": "string", - "value": "TOML Example" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1-compact.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1-compact.toml deleted file mode 100644 index 15e2b84b8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1-compact.toml +++ /dev/null @@ -1,23 +0,0 @@ -#Useless spaces eliminated. -title="TOML Example" -[owner] -name="Lance Uppercut" -dob=1979-05-27T07:32:00-08:00#First class dates -[database] -server="192.168.1.1" -ports=[8001,8001,8002] -connection_max=5000 -enabled=true -[servers] -[servers.alpha] -ip="10.0.0.1" -dc="eqdc10" -[servers.beta] -ip="10.0.0.2" -dc="eqdc10" -[clients] -data=[["gamma","delta"],[1,2]] -hosts=[ -"alpha", -"omega" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1.json deleted file mode 100644 index 9f4078aa7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "clients": { - "data": [ - [ - { - "type": "string", - "value": "gamma" - }, - { - "type": "string", - "value": "delta" - } - ], - [ - { - "type": "integer", - "value": "1" - }, - { - "type": "integer", - "value": "2" - } - ] - ], - "hosts": [ - { - "type": "string", - "value": "alpha" - }, - { - "type": "string", - "value": "omega" - } - ] - }, - "database": { - "connection_max": { - "type": "integer", - "value": "5000" - }, - "enabled": { - "type": "bool", - "value": "true" - }, - "ports": [ - { - "type": "integer", - "value": "8001" - }, - { - "type": "integer", - "value": "8001" - }, - { - "type": "integer", - "value": "8002" - } - ], - "server": { - "type": "string", - "value": "192.168.1.1" - } - }, - "owner": { - "dob": { - "type": "datetime", - "value": "1979-05-27T07:32:00-08:00" - }, - "name": { - "type": "string", - "value": "Lance Uppercut" - } - }, - "servers": { - "alpha": { - "dc": { - "type": "string", - "value": "eqdc10" - }, - "ip": { - "type": "string", - "value": "10.0.0.1" - } - }, - "beta": { - "dc": { - "type": "string", - "value": "eqdc10" - }, - "ip": { - "type": "string", - "value": "10.0.0.2" - } - } - }, - "title": { - "type": "string", - "value": "TOML Example" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1.toml deleted file mode 100644 index 52fd1e89c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/spec-example-1.toml +++ /dev/null @@ -1,33 +0,0 @@ -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Lance Uppercut" -dob = 1979-05-27T07:32:00-08:00 # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] - -# Line breaks are OK when inside arrays -hosts = [ - "alpha", - "omega" -] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/double-quote-escape.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/double-quote-escape.json deleted file mode 100644 index 0c4ac37e0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/double-quote-escape.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "test": { - "type": "string", - "value": "\"one\"" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/double-quote-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/double-quote-escape.toml deleted file mode 100644 index 78e7e7292..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/double-quote-escape.toml +++ /dev/null @@ -1 +0,0 @@ -test = "\"one\"" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/empty.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/empty.json deleted file mode 100644 index efe96c363..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/empty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "answer": { - "type": "string", - "value": "" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/empty.toml deleted file mode 100644 index e37e6815b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/empty.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escape-tricky.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escape-tricky.json deleted file mode 100644 index 572e0a569..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escape-tricky.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "end_esc": { - "type": "string", - "value": "String does not end here\" but ends here\\" - }, - "lit_end_esc": { - "type": "string", - "value": "String ends here\\" - }, - "lit_multiline_end": { - "type": "string", - "value": "There is no escape\\" - }, - "lit_multiline_not_unicode": { - "type": "string", - "value": "\\u007f" - }, - "multiline_end_esc": { - "type": "string", - "value": "When will it end? \"\"\"...\"\"\" should be here\"" - }, - "multiline_not_unicode": { - "type": "string", - "value": "\\u0041" - }, - "multiline_unicode": { - "type": "string", - "value": " " - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escape-tricky.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escape-tricky.toml deleted file mode 100644 index dc204cb3f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escape-tricky.toml +++ /dev/null @@ -1,15 +0,0 @@ -end_esc = "String does not end here\" but ends here\\" -lit_end_esc = 'String ends here\' - -multiline_unicode = """ -\u00a0""" - -multiline_not_unicode = """ -\\u0041""" - -multiline_end_esc = """When will it end? \"""...""\" should be here\"""" - -lit_multiline_not_unicode = ''' -\u007f''' - -lit_multiline_end = '''There is no escape\''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escaped-escape.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escaped-escape.json deleted file mode 100644 index 112c0c977..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escaped-escape.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "answer": { - "type": "string", - "value": "\\x64" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escaped-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escaped-escape.toml deleted file mode 100644 index d57587614..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escaped-escape.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "\\x64" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escapes.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escapes.json deleted file mode 100644 index d849574ac..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escapes.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "backslash": { - "type": "string", - "value": "This string has a \\ backslash character." - }, - "backspace": { - "type": "string", - "value": "This string has a \u0008 backspace character." - }, - "carriage": { - "type": "string", - "value": "This string has a \r carriage return character." - }, - "delete": { - "type": "string", - "value": "This string has a  delete control code." - }, - "formfeed": { - "type": "string", - "value": "This string has a \u000c form feed character." - }, - "newline": { - "type": "string", - "value": "This string has a \n new line character." - }, - "notunicode1": { - "type": "string", - "value": "This string does not have a unicode \\u escape." - }, - "notunicode2": { - "type": "string", - "value": "This string does not have a unicode \\u escape." - }, - "notunicode3": { - "type": "string", - "value": "This string does not have a unicode \\u0075 escape." - }, - "notunicode4": { - "type": "string", - "value": "This string does not have a unicode \\u escape." - }, - "quote": { - "type": "string", - "value": "This string has a \" quote character." - }, - "tab": { - "type": "string", - "value": "This string has a \t tab character." - }, - "unitseparator": { - "type": "string", - "value": "This string has a \u001f unit separator control code." - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escapes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escapes.toml deleted file mode 100644 index 78f7ebdf4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/escapes.toml +++ /dev/null @@ -1,13 +0,0 @@ -backspace = "This string has a \b backspace character." -tab = "This string has a \t tab character." -newline = "This string has a \n new line character." -formfeed = "This string has a \f form feed character." -carriage = "This string has a \r carriage return character." -quote = "This string has a \" quote character." -backslash = "This string has a \\ backslash character." -notunicode1 = "This string does not have a unicode \\u escape." -notunicode2 = "This string does not have a unicode \u005Cu escape." -notunicode3 = "This string does not have a unicode \\u0075 escape." -notunicode4 = "This string does not have a unicode \\\u0075 escape." -delete = "This string has a \u007F delete control code." -unitseparator = "This string has a \u001F unit separator control code." diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-json deleted file mode 100644 index 66e572bd4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "equivalent_one": { - "type": "string", - "value": "The quick brown fox jumps over the lazy dog." - }, - "equivalent_three": { - "type": "string", - "value": "The quick brown fox jumps over the lazy dog." - }, - "equivalent_two": { - "type": "string", - "value": "The quick brown fox jumps over the lazy dog." - }, - "escape-bs-1": { - "type": "string", - "value": "a \\\nb" - }, - "escape-bs-2": { - "type": "string", - "value": "a \\b" - }, - "escape-bs-3": { - "type": "string", - "value": "a \\\\\n b" - }, - "keep-ws-before": { - "type": "string", - "value": "a \tb" - }, - "multiline_empty_four": { - "type": "string", - "value": "" - }, - "multiline_empty_one": { - "type": "string", - "value": "" - }, - "multiline_empty_three": { - "type": "string", - "value": "" - }, - "multiline_empty_two": { - "type": "string", - "value": "" - }, - "no-space": { - "type": "string", - "value": "ab" - }, - "whitespace-after-bs": { - "type": "string", - "value": "The quick brown fox jumps over the lazy dog." - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-quotes.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-quotes.json deleted file mode 100644 index c134f6714..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-quotes.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "lit_one": { - "type": "string", - "value": "'one quote'" - }, - "lit_one_space": { - "type": "string", - "value": " 'one quote' " - }, - "lit_two": { - "type": "string", - "value": "''two quotes''" - }, - "lit_two_space": { - "type": "string", - "value": " ''two quotes'' " - }, - "mismatch1": { - "type": "string", - "value": "aaa'''bbb" - }, - "mismatch2": { - "type": "string", - "value": "aaa\"\"\"bbb" - }, - "one": { - "type": "string", - "value": "\"one quote\"" - }, - "one_space": { - "type": "string", - "value": " \"one quote\" " - }, - "two": { - "type": "string", - "value": "\"\"two quotes\"\"" - }, - "two_space": { - "type": "string", - "value": " \"\"two quotes\"\" " - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-quotes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-quotes.toml deleted file mode 100644 index e138e2fa0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-quotes.toml +++ /dev/null @@ -1,15 +0,0 @@ -# Make sure that quotes inside multiline strings are allowed, including right -# after the opening '''/""" and before the closing '''/""" - -lit_one = ''''one quote'''' -lit_two = '''''two quotes''''' -lit_one_space = ''' 'one quote' ''' -lit_two_space = ''' ''two quotes'' ''' - -one = """"one quote"""" -two = """""two quotes""""" -one_space = """ "one quote" """ -two_space = """ ""two quotes"" """ - -mismatch1 = """aaa'''bbb""" -mismatch2 = '''aaa"""bbb''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-toml deleted file mode 100644 index 070484833..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/multiline-toml +++ /dev/null @@ -1,46 +0,0 @@ -# NOTE: this file includes some literal tab characters. - -multiline_empty_one = """""" -multiline_empty_two = """ -""" -multiline_empty_three = """\ - """ -multiline_empty_four = """\ - \ - \ - """ - -equivalent_one = "The quick brown fox jumps over the lazy dog." -equivalent_two = """ -The quick brown \ - - - fox jumps over \ - the lazy dog.""" - -equivalent_three = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ - -whitespace-after-bs = """\ - The quick brown \ - fox jumps over \ - the lazy dog.\ - """ - -no-space = """a\ - b""" - -keep-ws-before = """a \ - b""" - -escape-bs-1 = """a \\ -b""" - -escape-bs-2 = """a \\\ -b""" - -escape-bs-3 = """a \\\\ - b""" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/nl.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/nl.json deleted file mode 100644 index 8eae09a02..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/nl.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "lit_nl_end": { - "type": "string", - "value": "value\\n" - }, - "lit_nl_mid": { - "type": "string", - "value": "val\\nue" - }, - "lit_nl_uni": { - "type": "string", - "value": "val\\ue" - }, - "nl_end": { - "type": "string", - "value": "value\n" - }, - "nl_mid": { - "type": "string", - "value": "val\nue" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/nl.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/nl.toml deleted file mode 100644 index 1e09a8bf7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/nl.toml +++ /dev/null @@ -1,6 +0,0 @@ -nl_mid = "val\nue" -nl_end = """value\n""" - -lit_nl_end = '''value\n''' -lit_nl_mid = 'val\nue' -lit_nl_uni = 'val\ue' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw-multiline.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw-multiline.json deleted file mode 100644 index 4d195ec50..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw-multiline.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "firstnl": { - "type": "string", - "value": "This string has a ' quote character." - }, - "multiline": { - "type": "string", - "value": "This string\nhas ' a quote character\nand more than\none newline\nin it." - }, - "oneline": { - "type": "string", - "value": "This string has a ' quote character." - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw-multiline.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw-multiline.toml deleted file mode 100644 index 8094c03e3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw-multiline.toml +++ /dev/null @@ -1,9 +0,0 @@ -oneline = '''This string has a ' quote character.''' -firstnl = ''' -This string has a ' quote character.''' -multiline = ''' -This string -has ' a quote character -and more than -one newline -in it.''' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw.json deleted file mode 100644 index 6b753a35b..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "backslash": { - "type": "string", - "value": "This string has a \\\\ backslash character." - }, - "backspace": { - "type": "string", - "value": "This string has a \\b backspace character." - }, - "carriage": { - "type": "string", - "value": "This string has a \\r carriage return character." - }, - "formfeed": { - "type": "string", - "value": "This string has a \\f form feed character." - }, - "newline": { - "type": "string", - "value": "This string has a \\n new line character." - }, - "slash": { - "type": "string", - "value": "This string has a \\/ slash character." - }, - "tab": { - "type": "string", - "value": "This string has a \\t tab character." - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw.toml deleted file mode 100644 index 92acd2557..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/raw.toml +++ /dev/null @@ -1,7 +0,0 @@ -backspace = 'This string has a \b backspace character.' -tab = 'This string has a \t tab character.' -newline = 'This string has a \n new line character.' -formfeed = 'This string has a \f form feed character.' -carriage = 'This string has a \r carriage return character.' -slash = 'This string has a \/ slash character.' -backslash = 'This string has a \\ backslash character.' diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/simple.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/simple.json deleted file mode 100644 index 2561cda38..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/simple.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "answer": { - "type": "string", - "value": "You are not drinking enough whisky." - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/simple.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/simple.toml deleted file mode 100644 index e17ade623..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/simple.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "You are not drinking enough whisky." diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-escape.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-escape.json deleted file mode 100644 index 9ae728bad..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-escape.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "answer4": { - "type": "string", - "value": "δ" - }, - "answer8": { - "type": "string", - "value": "δ" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-escape.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-escape.toml deleted file mode 100644 index 82faecbfa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-escape.toml +++ /dev/null @@ -1,2 +0,0 @@ -answer4 = "\u03B4" -answer8 = "\U000003B4" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-literal.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-literal.json deleted file mode 100644 index 7f15df422..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-literal.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "answer": { - "type": "string", - "value": "δ" - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-literal.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-literal.toml deleted file mode 100644 index c65723ca1..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/unicode-literal.toml +++ /dev/null @@ -1 +0,0 @@ -answer = "δ" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/with-pound.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/with-pound.json deleted file mode 100644 index 2cb8beb90..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/with-pound.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "pound": { - "type": "string", - "value": "We see no # comments here." - }, - "poundcomment": { - "type": "string", - "value": "But there are # some comments here." - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/with-pound.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/with-pound.toml deleted file mode 100644 index 5fd87466d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/string/with-pound.toml +++ /dev/null @@ -1,2 +0,0 @@ -pound = "We see no # comments here." -poundcomment = "But there are # some comments here." # Did I # mess you up? diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-implicit.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-implicit.json deleted file mode 100644 index ee164c5f3..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-implicit.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "albums": { - "songs": [ - { - "name": { - "type": "string", - "value": "Glory Days" - } - } - ] - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-implicit.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-implicit.toml deleted file mode 100644 index 3157ac981..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-implicit.toml +++ /dev/null @@ -1,2 +0,0 @@ -[[albums.songs]] -name = "Glory Days" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-many.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-many.json deleted file mode 100644 index fe78bf6b5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-many.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "people": [ - { - "first_name": { - "type": "string", - "value": "Bruce" - }, - "last_name": { - "type": "string", - "value": "Springsteen" - } - }, - { - "first_name": { - "type": "string", - "value": "Eric" - }, - "last_name": { - "type": "string", - "value": "Clapton" - } - }, - { - "first_name": { - "type": "string", - "value": "Bob" - }, - "last_name": { - "type": "string", - "value": "Seger" - } - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-many.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-many.toml deleted file mode 100644 index 46062beb8..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-many.toml +++ /dev/null @@ -1,11 +0,0 @@ -[[people]] -first_name = "Bruce" -last_name = "Springsteen" - -[[people]] -first_name = "Eric" -last_name = "Clapton" - -[[people]] -first_name = "Bob" -last_name = "Seger" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-nest.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-nest.json deleted file mode 100644 index 97f55c81e..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-nest.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "albums": [ - { - "name": { - "type": "string", - "value": "Born to Run" - }, - "songs": [ - { - "name": { - "type": "string", - "value": "Jungleland" - } - }, - { - "name": { - "type": "string", - "value": "Meeting Across the River" - } - } - ] - }, - { - "name": { - "type": "string", - "value": "Born in the USA" - }, - "songs": [ - { - "name": { - "type": "string", - "value": "Glory Days" - } - }, - { - "name": { - "type": "string", - "value": "Dancing in the Dark" - } - } - ] - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-nest.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-nest.toml deleted file mode 100644 index d659a3d94..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-nest.toml +++ /dev/null @@ -1,17 +0,0 @@ -[[albums]] -name = "Born to Run" - - [[albums.songs]] - name = "Jungleland" - - [[albums.songs]] - name = "Meeting Across the River" - -[[albums]] -name = "Born in the USA" - - [[albums.songs]] - name = "Glory Days" - - [[albums.songs]] - name = "Dancing in the Dark" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-one.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-one.json deleted file mode 100644 index 5cd67de1f..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-one.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "people": [ - { - "first_name": { - "type": "string", - "value": "Bruce" - }, - "last_name": { - "type": "string", - "value": "Springsteen" - } - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-one.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-one.toml deleted file mode 100644 index cd7e1b690..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-one.toml +++ /dev/null @@ -1,3 +0,0 @@ -[[people]] -first_name = "Bruce" -last_name = "Springsteen" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-table-array.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-table-array.json deleted file mode 100644 index 5c3d6495d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-table-array.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "a": [ - { - "b": [ - { - "c": { - "d": { - "type": "string", - "value": "val0" - } - } - }, - { - "c": { - "d": { - "type": "string", - "value": "val1" - } - } - } - ] - } - ] -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-table-array.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-table-array.toml deleted file mode 100644 index a07b0c7fe..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/array-table-array.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[a]] - [[a.b]] - [a.b.c] - d = "val0" - [[a.b]] - [a.b.c] - d = "val1" diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/empty.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/empty.json deleted file mode 100644 index 3e82cdad5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/empty.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "a": {} -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/empty.toml deleted file mode 100644 index 8bb6a0aa0..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/empty.toml +++ /dev/null @@ -1 +0,0 @@ -[a] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/keyword.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/keyword.json deleted file mode 100644 index a15dfae0a..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/keyword.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "true": {}, - "false": {}, - "inf": {}, - "nan": {} -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/keyword.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/keyword.toml deleted file mode 100644 index bc3d52a7d..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/keyword.toml +++ /dev/null @@ -1,9 +0,0 @@ -[true] - -[false] - -[inf] - -[nan] - - diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/names.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/names.json deleted file mode 100644 index 66d8ea5b7..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/names.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "a": { - " x ": {}, - "b": { - "c": {} - }, - "b.c": {}, - "d.e": {} - }, - "d": { - "e": { - "f": {} - } - }, - "g": { - "h": { - "i": {} - } - }, - "j": { - "ʞ": { - "l": {} - } - }, - "x": { - "1": { - "2": {} - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/names.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/names.toml deleted file mode 100644 index 092da2ff9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/names.toml +++ /dev/null @@ -1,9 +0,0 @@ -[a.b.c] -[a."b.c"] -[a.'d.e'] -[a.' x '] -[ d.e.f ] -[ g . h . i ] -[ j . "ʞ" . 'l' ] - -[x.1.2] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/no-eol.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/no-eol.json deleted file mode 100644 index b6e7fb502..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/no-eol.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "table": {} -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/no-eol.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/no-eol.toml deleted file mode 100644 index f1098fdac..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/no-eol.toml +++ /dev/null @@ -1 +0,0 @@ -[table] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/sub-empty.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/sub-empty.json deleted file mode 100644 index ed10cd236..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/sub-empty.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "a": { - "b": {} - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/sub-empty.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/sub-empty.toml deleted file mode 100644 index 70b7fe11c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/sub-empty.toml +++ /dev/null @@ -1,2 +0,0 @@ -[a] -[a.b] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/whitespace.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/whitespace.json deleted file mode 100644 index c77047030..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/whitespace.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "valid key": {} -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/whitespace.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/whitespace.toml deleted file mode 100644 index daf881d13..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/whitespace.toml +++ /dev/null @@ -1 +0,0 @@ -["valid key"] diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-literal-string.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-literal-string.json deleted file mode 100644 index 7784695c9..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-literal-string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "a": { - "\"b\"": { - "c": { - "answer": { - "type": "integer", - "value": "42" - } - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-literal-string.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-literal-string.toml deleted file mode 100644 index b81643daa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-literal-string.toml +++ /dev/null @@ -1,4 +0,0 @@ -['a'] -[a.'"b"'] -[a.'"b"'.c] -answer = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-pound.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-pound.json deleted file mode 100644 index f32d2f2eb..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-pound.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "key#group": { - "answer": { - "type": "integer", - "value": "42" - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-pound.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-pound.toml deleted file mode 100644 index 33f2c4fd6..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-pound.toml +++ /dev/null @@ -1,2 +0,0 @@ -["key#group"] -answer = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-single-quotes.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-single-quotes.json deleted file mode 100644 index 347c693cf..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-single-quotes.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "a": { - "b": { - "c": { - "answer": { - "type": "integer", - "value": "42" - } - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-single-quotes.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-single-quotes.toml deleted file mode 100644 index 56e52cc99..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/with-single-quotes.toml +++ /dev/null @@ -1,4 +0,0 @@ -['a'] -[a.'b'] -[a.'b'.c] -answer = 42 diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/without-super.json b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/without-super.json deleted file mode 100644 index 3c390c682..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/without-super.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "x": { - "y": { - "z": { - "w": {} - } - } - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/without-super.toml b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/without-super.toml deleted file mode 100644 index 73ed68b2c..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/tests/valid/table/without-super.toml +++ /dev/null @@ -1,5 +0,0 @@ -# [x] you -# [x.y] don't -# [x.y.z] need these -[x.y.z.w] # for this to work -[x] # defining a super-table afterwards is ok diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/toml.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/toml.go deleted file mode 100644 index 78e8de2ba..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/toml-test/toml.go +++ /dev/null @@ -1,133 +0,0 @@ -// +build go1.16 - -package tomltest - -import ( - "math" - "reflect" -) - -// cmpTOML consumes the recursive structure of both want and have -// simultaneously. If anything is unequal the result has failed and comparison -// stops. -// -// reflect.DeepEqual could work here, but it won't tell us how the two -// structures are different. -func (r Test) cmpTOML(want, have interface{}) Test { - if isTomlValue(want) { - if !isTomlValue(have) { - return r.fail("Type for key '%s' differs:\n"+ - " Expected: %[2]v (%[2]T)\n"+ - " Your encoder: %[3]v (%[3]T)", - r.Key, want, have) - } - - if !deepEqual(want, have) { - return r.fail("Values for key '%s' differ:\n"+ - " Expected: %[2]v (%[2]T)\n"+ - " Your encoder: %[3]v (%[3]T)", - r.Key, want, have) - } - return r - } - - switch w := want.(type) { - case map[string]interface{}: - return r.cmpTOMLMap(w, have) - case []interface{}: - return r.cmpTOMLArrays(w, have) - default: - return r.fail("Unrecognized TOML structure: %T", want) - } -} - -func (r Test) cmpTOMLMap(want map[string]interface{}, have interface{}) Test { - haveMap, ok := have.(map[string]interface{}) - if !ok { - return r.mismatch("table", want, haveMap) - } - - // Check that the keys of each map are equivalent. - for k := range want { - if _, ok := haveMap[k]; !ok { - bunk := r.kjoin(k) - return bunk.fail("Could not find key '%s' in encoder output", bunk.Key) - } - } - for k := range haveMap { - if _, ok := want[k]; !ok { - bunk := r.kjoin(k) - return bunk.fail("Could not find key '%s' in expected output", bunk.Key) - } - } - - // Okay, now make sure that each value is equivalent. - for k := range want { - if sub := r.kjoin(k).cmpTOML(want[k], haveMap[k]); sub.Failed() { - return sub - } - } - return r -} - -func (r Test) cmpTOMLArrays(want []interface{}, have interface{}) Test { - // Slice can be decoded to []interface{} for an array of primitives, or - // []map[string]interface{} for an array of tables. - // - // TODO: it would be nicer if it could always decode to []interface{}? - haveSlice, ok := have.([]interface{}) - if !ok { - tblArray, ok := have.([]map[string]interface{}) - if !ok { - return r.mismatch("array", want, have) - } - - haveSlice = make([]interface{}, len(tblArray)) - for i := range tblArray { - haveSlice[i] = tblArray[i] - } - } - - if len(want) != len(haveSlice) { - return r.fail("Array lengths differ for key '%s'"+ - " Expected: %[2]v (len=%[4]d)\n"+ - " Your encoder: %[3]v (len=%[5]d)", - r.Key, want, haveSlice, len(want), len(haveSlice)) - } - for i := 0; i < len(want); i++ { - if sub := r.cmpTOML(want[i], haveSlice[i]); sub.Failed() { - return sub - } - } - return r -} - -// reflect.DeepEqual() that deals with NaN != NaN -func deepEqual(want, have interface{}) bool { - var wantF, haveF float64 - switch f := want.(type) { - case float32: - wantF = float64(f) - case float64: - wantF = f - } - switch f := have.(type) { - case float32: - haveF = float64(f) - case float64: - haveF = f - } - if math.IsNaN(wantF) && math.IsNaN(haveF) { - return true - } - - return reflect.DeepEqual(want, have) -} - -func isTomlValue(v interface{}) bool { - switch v.(type) { - case map[string]interface{}, []interface{}: - return false - } - return true -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tz.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tz.go deleted file mode 100644 index 022f15bc2..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/internal/tz.go +++ /dev/null @@ -1,36 +0,0 @@ -package internal - -import "time" - -// Timezones used for local datetime, date, and time TOML types. -// -// The exact way times and dates without a timezone should be interpreted is not -// well-defined in the TOML specification and left to the implementation. These -// defaults to current local timezone offset of the computer, but this can be -// changed by changing these variables before decoding. -// -// TODO: -// Ideally we'd like to offer people the ability to configure the used timezone -// by setting Decoder.Timezone and Encoder.Timezone; however, this is a bit -// tricky: the reason we use three different variables for this is to support -// round-tripping – without these specific TZ names we wouldn't know which -// format to use. -// -// There isn't a good way to encode this right now though, and passing this sort -// of information also ties in to various related issues such as string format -// encoding, encoding of comments, etc. -// -// So, for the time being, just put this in internal until we can write a good -// comprehensive API for doing all of this. -// -// The reason they're exported is because they're referred from in e.g. -// internal/tag. -// -// Note that this behaviour is valid according to the TOML spec as the exact -// behaviour is left up to implementations. -var ( - localOffset = func() int { _, o := time.Now().Zone(); return o }() - LocalDatetime = time.FixedZone("datetime-local", localOffset) - LocalDate = time.FixedZone("date-local", localOffset) - LocalTime = time.FixedZone("time-local", localOffset) -) diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/lex.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/lex.go deleted file mode 100644 index adc4eb5d5..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/lex.go +++ /dev/null @@ -1,1225 +0,0 @@ -package toml - -import ( - "fmt" - "reflect" - "runtime" - "strings" - "unicode" - "unicode/utf8" -) - -type itemType int - -const ( - itemError itemType = iota - itemNIL // used in the parser to indicate no type - itemEOF - itemText - itemString - itemRawString - itemMultilineString - itemRawMultilineString - itemBool - itemInteger - itemFloat - itemDatetime - itemArray // the start of an array - itemArrayEnd - itemTableStart - itemTableEnd - itemArrayTableStart - itemArrayTableEnd - itemKeyStart - itemKeyEnd - itemCommentStart - itemInlineTableStart - itemInlineTableEnd -) - -const ( - eof = 0 - comma = ',' - tableStart = '[' - tableEnd = ']' - arrayTableStart = '[' - arrayTableEnd = ']' - tableSep = '.' - keySep = '=' - arrayStart = '[' - arrayEnd = ']' - commentStart = '#' - stringStart = '"' - stringEnd = '"' - rawStringStart = '\'' - rawStringEnd = '\'' - inlineTableStart = '{' - inlineTableEnd = '}' -) - -type stateFn func(lx *lexer) stateFn - -type lexer struct { - input string - start int - pos int - line int - state stateFn - items chan item - - // Allow for backing up up to four runes. - // This is necessary because TOML contains 3-rune tokens (""" and '''). - prevWidths [4]int - nprev int // how many of prevWidths are in use - // If we emit an eof, we can still back up, but it is not OK to call - // next again. - atEOF bool - - // A stack of state functions used to maintain context. - // The idea is to reuse parts of the state machine in various places. - // For example, values can appear at the top level or within arbitrarily - // nested arrays. The last state on the stack is used after a value has - // been lexed. Similarly for comments. - stack []stateFn -} - -type item struct { - typ itemType - val string - line int -} - -func (lx *lexer) nextItem() item { - for { - select { - case item := <-lx.items: - return item - default: - lx.state = lx.state(lx) - //fmt.Printf(" STATE %-24s current: %-10q stack: %s\n", lx.state, lx.current(), lx.stack) - } - } -} - -func lex(input string) *lexer { - lx := &lexer{ - input: input, - state: lexTop, - line: 1, - items: make(chan item, 10), - stack: make([]stateFn, 0, 10), - } - return lx -} - -func (lx *lexer) push(state stateFn) { - lx.stack = append(lx.stack, state) -} - -func (lx *lexer) pop() stateFn { - if len(lx.stack) == 0 { - return lx.errorf("BUG in lexer: no states to pop") - } - last := lx.stack[len(lx.stack)-1] - lx.stack = lx.stack[0 : len(lx.stack)-1] - return last -} - -func (lx *lexer) current() string { - return lx.input[lx.start:lx.pos] -} - -func (lx *lexer) emit(typ itemType) { - lx.items <- item{typ, lx.current(), lx.line} - lx.start = lx.pos -} - -func (lx *lexer) emitTrim(typ itemType) { - lx.items <- item{typ, strings.TrimSpace(lx.current()), lx.line} - lx.start = lx.pos -} - -func (lx *lexer) next() (r rune) { - if lx.atEOF { - panic("BUG in lexer: next called after EOF") - } - if lx.pos >= len(lx.input) { - lx.atEOF = true - return eof - } - - if lx.input[lx.pos] == '\n' { - lx.line++ - } - lx.prevWidths[3] = lx.prevWidths[2] - lx.prevWidths[2] = lx.prevWidths[1] - lx.prevWidths[1] = lx.prevWidths[0] - if lx.nprev < 4 { - lx.nprev++ - } - - r, w := utf8.DecodeRuneInString(lx.input[lx.pos:]) - if r == utf8.RuneError { - lx.errorf("invalid UTF-8 byte at position %d (line %d): 0x%02x", lx.pos, lx.line, lx.input[lx.pos]) - return utf8.RuneError - } - - lx.prevWidths[0] = w - lx.pos += w - return r -} - -// ignore skips over the pending input before this point. -func (lx *lexer) ignore() { - lx.start = lx.pos -} - -// backup steps back one rune. Can be called 4 times between calls to next. -func (lx *lexer) backup() { - if lx.atEOF { - lx.atEOF = false - return - } - if lx.nprev < 1 { - panic("BUG in lexer: backed up too far") - } - w := lx.prevWidths[0] - lx.prevWidths[0] = lx.prevWidths[1] - lx.prevWidths[1] = lx.prevWidths[2] - lx.prevWidths[2] = lx.prevWidths[3] - lx.nprev-- - lx.pos -= w - if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' { - lx.line-- - } -} - -// accept consumes the next rune if it's equal to `valid`. -func (lx *lexer) accept(valid rune) bool { - if lx.next() == valid { - return true - } - lx.backup() - return false -} - -// peek returns but does not consume the next rune in the input. -func (lx *lexer) peek() rune { - r := lx.next() - lx.backup() - return r -} - -// skip ignores all input that matches the given predicate. -func (lx *lexer) skip(pred func(rune) bool) { - for { - r := lx.next() - if pred(r) { - continue - } - lx.backup() - lx.ignore() - return - } -} - -// errorf stops all lexing by emitting an error and returning `nil`. -// Note that any value that is a character is escaped if it's a special -// character (newlines, tabs, etc.). -func (lx *lexer) errorf(format string, values ...interface{}) stateFn { - lx.items <- item{ - itemError, - fmt.Sprintf(format, values...), - lx.line, - } - return nil -} - -// lexTop consumes elements at the top level of TOML data. -func lexTop(lx *lexer) stateFn { - r := lx.next() - if isWhitespace(r) || isNL(r) { - return lexSkip(lx, lexTop) - } - switch r { - case commentStart: - lx.push(lexTop) - return lexCommentStart - case tableStart: - return lexTableStart - case eof: - if lx.pos > lx.start { - return lx.errorf("unexpected EOF") - } - lx.emit(itemEOF) - return nil - } - - // At this point, the only valid item can be a key, so we back up - // and let the key lexer do the rest. - lx.backup() - lx.push(lexTopEnd) - return lexKeyStart -} - -// lexTopEnd is entered whenever a top-level item has been consumed. (A value -// or a table.) It must see only whitespace, and will turn back to lexTop -// upon a newline. If it sees EOF, it will quit the lexer successfully. -func lexTopEnd(lx *lexer) stateFn { - r := lx.next() - switch { - case r == commentStart: - // a comment will read to a newline for us. - lx.push(lexTop) - return lexCommentStart - case isWhitespace(r): - return lexTopEnd - case isNL(r): - lx.ignore() - return lexTop - case r == eof: - lx.emit(itemEOF) - return nil - } - return lx.errorf( - "expected a top-level item to end with a newline, comment, or EOF, but got %q instead", - r) -} - -// lexTable lexes the beginning of a table. Namely, it makes sure that -// it starts with a character other than '.' and ']'. -// It assumes that '[' has already been consumed. -// It also handles the case that this is an item in an array of tables. -// e.g., '[[name]]'. -func lexTableStart(lx *lexer) stateFn { - if lx.peek() == arrayTableStart { - lx.next() - lx.emit(itemArrayTableStart) - lx.push(lexArrayTableEnd) - } else { - lx.emit(itemTableStart) - lx.push(lexTableEnd) - } - return lexTableNameStart -} - -func lexTableEnd(lx *lexer) stateFn { - lx.emit(itemTableEnd) - return lexTopEnd -} - -func lexArrayTableEnd(lx *lexer) stateFn { - if r := lx.next(); r != arrayTableEnd { - return lx.errorf( - "expected end of table array name delimiter %q, but got %q instead", - arrayTableEnd, r) - } - lx.emit(itemArrayTableEnd) - return lexTopEnd -} - -func lexTableNameStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == tableEnd || r == eof: - return lx.errorf("unexpected end of table name (table names cannot be empty)") - case r == tableSep: - return lx.errorf("unexpected table separator (table names cannot be empty)") - case r == stringStart || r == rawStringStart: - lx.ignore() - lx.push(lexTableNameEnd) - return lexQuotedName - default: - lx.push(lexTableNameEnd) - return lexBareName - } -} - -// lexTableNameEnd reads the end of a piece of a table name, optionally -// consuming whitespace. -func lexTableNameEnd(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.next(); { - case isWhitespace(r): - return lexTableNameEnd - case r == tableSep: - lx.ignore() - return lexTableNameStart - case r == tableEnd: - return lx.pop() - default: - return lx.errorf("expected '.' or ']' to end table name, but got %q instead", r) - } -} - -// lexBareName lexes one part of a key or table. -// -// It assumes that at least one valid character for the table has already been -// read. -// -// Lexes only one part, e.g. only 'a' inside 'a.b'. -func lexBareName(lx *lexer) stateFn { - r := lx.next() - if isBareKeyChar(r) { - return lexBareName - } - lx.backup() - lx.emit(itemText) - return lx.pop() -} - -// lexBareName lexes one part of a key or table. -// -// It assumes that at least one valid character for the table has already been -// read. -// -// Lexes only one part, e.g. only '"a"' inside '"a".b'. -func lexQuotedName(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexValue) - case r == stringStart: - lx.ignore() // ignore the '"' - return lexString - case r == rawStringStart: - lx.ignore() // ignore the "'" - return lexRawString - case r == eof: - return lx.errorf("unexpected EOF; expected value") - default: - return lx.errorf("expected value but found %q instead", r) - } -} - -// lexKeyStart consumes all key parts until a '='. -func lexKeyStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == '=' || r == eof: - return lx.errorf("unexpected '=': key name appears blank") - case r == '.': - return lx.errorf("unexpected '.': keys cannot start with a '.'") - case r == stringStart || r == rawStringStart: - lx.ignore() - fallthrough - default: // Bare key - lx.emit(itemKeyStart) - return lexKeyNameStart - } -} - -func lexKeyNameStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == '=' || r == eof: - return lx.errorf("unexpected '='") - case r == '.': - return lx.errorf("unexpected '.'") - case r == stringStart || r == rawStringStart: - lx.ignore() - lx.push(lexKeyEnd) - return lexQuotedName - default: - lx.push(lexKeyEnd) - return lexBareName - } -} - -// lexKeyEnd consumes the end of a key and trims whitespace (up to the key -// separator). -func lexKeyEnd(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.next(); { - case isWhitespace(r): - return lexSkip(lx, lexKeyEnd) - case r == eof: - return lx.errorf("unexpected EOF; expected key separator %q", keySep) - case r == '.': - lx.ignore() - return lexKeyNameStart - case r == '=': - lx.emit(itemKeyEnd) - return lexSkip(lx, lexValue) - default: - return lx.errorf("expected '.' or '=', but got %q instead", r) - } -} - -// lexValue starts the consumption of a value anywhere a value is expected. -// lexValue will ignore whitespace. -// After a value is lexed, the last state on the next is popped and returned. -func lexValue(lx *lexer) stateFn { - // We allow whitespace to precede a value, but NOT newlines. - // In array syntax, the array states are responsible for ignoring newlines. - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexValue) - case isDigit(r): - lx.backup() // avoid an extra state and use the same as above - return lexNumberOrDateStart - } - switch r { - case arrayStart: - lx.ignore() - lx.emit(itemArray) - return lexArrayValue - case inlineTableStart: - lx.ignore() - lx.emit(itemInlineTableStart) - return lexInlineTableValue - case stringStart: - if lx.accept(stringStart) { - if lx.accept(stringStart) { - lx.ignore() // Ignore """ - return lexMultilineString - } - lx.backup() - } - lx.ignore() // ignore the '"' - return lexString - case rawStringStart: - if lx.accept(rawStringStart) { - if lx.accept(rawStringStart) { - lx.ignore() // Ignore """ - return lexMultilineRawString - } - lx.backup() - } - lx.ignore() // ignore the "'" - return lexRawString - case '.': // special error case, be kind to users - return lx.errorf("floats must start with a digit, not '.'") - case 'i', 'n': - if (lx.accept('n') && lx.accept('f')) || (lx.accept('a') && lx.accept('n')) { - lx.emit(itemFloat) - return lx.pop() - } - case '-', '+': - return lexDecimalNumberStart - } - if unicode.IsLetter(r) { - // Be permissive here; lexBool will give a nice error if the - // user wrote something like - // x = foo - // (i.e. not 'true' or 'false' but is something else word-like.) - lx.backup() - return lexBool - } - if r == eof { - return lx.errorf("unexpected EOF; expected value") - } - return lx.errorf("expected value but found %q instead", r) -} - -// lexArrayValue consumes one value in an array. It assumes that '[' or ',' -// have already been consumed. All whitespace and newlines are ignored. -func lexArrayValue(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r) || isNL(r): - return lexSkip(lx, lexArrayValue) - case r == commentStart: - lx.push(lexArrayValue) - return lexCommentStart - case r == comma: - return lx.errorf("unexpected comma") - case r == arrayEnd: - // NOTE(caleb): The spec isn't clear about whether you can have - // a trailing comma or not, so we'll allow it. - return lexArrayEnd - } - - lx.backup() - lx.push(lexArrayValueEnd) - return lexValue -} - -// lexArrayValueEnd consumes everything between the end of an array value and -// the next value (or the end of the array): it ignores whitespace and newlines -// and expects either a ',' or a ']'. -func lexArrayValueEnd(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r) || isNL(r): - return lexSkip(lx, lexArrayValueEnd) - case r == commentStart: - lx.push(lexArrayValueEnd) - return lexCommentStart - case r == comma: - lx.ignore() - return lexArrayValue // move on to the next value - case r == arrayEnd: - return lexArrayEnd - } - return lx.errorf( - "expected a comma or array terminator %q, but got %s instead", - arrayEnd, runeOrEOF(r)) -} - -// lexArrayEnd finishes the lexing of an array. -// It assumes that a ']' has just been consumed. -func lexArrayEnd(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemArrayEnd) - return lx.pop() -} - -// lexInlineTableValue consumes one key/value pair in an inline table. -// It assumes that '{' or ',' have already been consumed. Whitespace is ignored. -func lexInlineTableValue(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexInlineTableValue) - case isNL(r): - return lx.errorf("newlines not allowed within inline tables") - case r == commentStart: - lx.push(lexInlineTableValue) - return lexCommentStart - case r == comma: - return lx.errorf("unexpected comma") - case r == inlineTableEnd: - return lexInlineTableEnd - } - lx.backup() - lx.push(lexInlineTableValueEnd) - return lexKeyStart -} - -// lexInlineTableValueEnd consumes everything between the end of an inline table -// key/value pair and the next pair (or the end of the table): -// it ignores whitespace and expects either a ',' or a '}'. -func lexInlineTableValueEnd(lx *lexer) stateFn { - switch r := lx.next(); { - case isWhitespace(r): - return lexSkip(lx, lexInlineTableValueEnd) - case isNL(r): - return lx.errorf("newlines not allowed within inline tables") - case r == commentStart: - lx.push(lexInlineTableValueEnd) - return lexCommentStart - case r == comma: - lx.ignore() - lx.skip(isWhitespace) - if lx.peek() == '}' { - return lx.errorf("trailing comma not allowed in inline tables") - } - return lexInlineTableValue - case r == inlineTableEnd: - return lexInlineTableEnd - default: - return lx.errorf( - "expected a comma or an inline table terminator %q, but got %s instead", - inlineTableEnd, runeOrEOF(r)) - } -} - -func runeOrEOF(r rune) string { - if r == eof { - return "end of file" - } - return "'" + string(r) + "'" -} - -// lexInlineTableEnd finishes the lexing of an inline table. -// It assumes that a '}' has just been consumed. -func lexInlineTableEnd(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemInlineTableEnd) - return lx.pop() -} - -// lexString consumes the inner contents of a string. It assumes that the -// beginning '"' has already been consumed and ignored. -func lexString(lx *lexer) stateFn { - r := lx.next() - switch { - case r == eof: - return lx.errorf(`unexpected EOF; expected '"'`) - case isControl(r) || r == '\r': - return lx.errorf("control characters are not allowed inside strings: '0x%02x'", r) - case isNL(r): - return lx.errorf("strings cannot contain newlines") - case r == '\\': - lx.push(lexString) - return lexStringEscape - case r == stringEnd: - lx.backup() - lx.emit(itemString) - lx.next() - lx.ignore() - return lx.pop() - } - return lexString -} - -// lexMultilineString consumes the inner contents of a string. It assumes that -// the beginning '"""' has already been consumed and ignored. -func lexMultilineString(lx *lexer) stateFn { - r := lx.next() - switch r { - case eof: - return lx.errorf(`unexpected EOF; expected '"""'`) - case '\r': - if lx.peek() != '\n' { - return lx.errorf("control characters are not allowed inside strings: '0x%02x'", r) - } - return lexMultilineString - case '\\': - return lexMultilineStringEscape - case stringEnd: - /// Found " → try to read two more "". - if lx.accept(stringEnd) { - if lx.accept(stringEnd) { - /// Peek ahead: the string can contain " and "", including at the - /// end: """str""""" - /// 6 or more at the end, however, is an error. - if lx.peek() == stringEnd { - /// Check if we already lexed 5 's; if so we have 6 now, and - /// that's just too many man! - if strings.HasSuffix(lx.current(), `"""""`) { - return lx.errorf(`unexpected '""""""'`) - } - lx.backup() - lx.backup() - return lexMultilineString - } - - lx.backup() /// backup: don't include the """ in the item. - lx.backup() - lx.backup() - lx.emit(itemMultilineString) - lx.next() /// Read over ''' again and discard it. - lx.next() - lx.next() - lx.ignore() - return lx.pop() - } - lx.backup() - } - } - - if isControl(r) { - return lx.errorf("control characters are not allowed inside strings: '0x%02x'", r) - } - return lexMultilineString -} - -// lexRawString consumes a raw string. Nothing can be escaped in such a string. -// It assumes that the beginning "'" has already been consumed and ignored. -func lexRawString(lx *lexer) stateFn { - r := lx.next() - switch { - case r == eof: - return lx.errorf(`unexpected EOF; expected "'"`) - case isControl(r) || r == '\r': - return lx.errorf("control characters are not allowed inside strings: '0x%02x'", r) - case isNL(r): - return lx.errorf("strings cannot contain newlines") - case r == rawStringEnd: - lx.backup() - lx.emit(itemRawString) - lx.next() - lx.ignore() - return lx.pop() - } - return lexRawString -} - -// lexMultilineRawString consumes a raw string. Nothing can be escaped in such -// a string. It assumes that the beginning "'''" has already been consumed and -// ignored. -func lexMultilineRawString(lx *lexer) stateFn { - r := lx.next() - switch r { - case eof: - return lx.errorf(`unexpected EOF; expected "'''"`) - case '\r': - if lx.peek() != '\n' { - return lx.errorf("control characters are not allowed inside strings: '0x%02x'", r) - } - return lexMultilineRawString - case rawStringEnd: - /// Found ' → try to read two more ''. - if lx.accept(rawStringEnd) { - if lx.accept(rawStringEnd) { - /// Peek ahead: the string can contain ' and '', including at the - /// end: '''str''''' - /// 6 or more at the end, however, is an error. - if lx.peek() == rawStringEnd { - /// Check if we already lexed 5 's; if so we have 6 now, and - /// that's just too many man! - if strings.HasSuffix(lx.current(), "'''''") { - return lx.errorf(`unexpected "''''''"`) - } - lx.backup() - lx.backup() - return lexMultilineRawString - } - - lx.backup() /// backup: don't include the ''' in the item. - lx.backup() - lx.backup() - lx.emit(itemRawMultilineString) - lx.next() /// Read over ''' again and discard it. - lx.next() - lx.next() - lx.ignore() - return lx.pop() - } - lx.backup() - } - } - - if isControl(r) { - return lx.errorf("control characters are not allowed inside strings: '0x%02x'", r) - } - return lexMultilineRawString -} - -// lexMultilineStringEscape consumes an escaped character. It assumes that the -// preceding '\\' has already been consumed. -func lexMultilineStringEscape(lx *lexer) stateFn { - // Handle the special case first: - if isNL(lx.next()) { - return lexMultilineString - } - lx.backup() - lx.push(lexMultilineString) - return lexStringEscape(lx) -} - -func lexStringEscape(lx *lexer) stateFn { - r := lx.next() - switch r { - case 'b': - fallthrough - case 't': - fallthrough - case 'n': - fallthrough - case 'f': - fallthrough - case 'r': - fallthrough - case '"': - fallthrough - case ' ', '\t': - // Inside """ .. """ strings you can use \ to escape newlines, and any - // amount of whitespace can be between the \ and \n. - fallthrough - case '\\': - return lx.pop() - case 'u': - return lexShortUnicodeEscape - case 'U': - return lexLongUnicodeEscape - } - return lx.errorf("invalid escape character %q; only the following escape characters are allowed: "+ - `\b, \t, \n, \f, \r, \", \\, \uXXXX, and \UXXXXXXXX`, r) -} - -func lexShortUnicodeEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 4; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf( - `expected four hexadecimal digits after '\u', but got %q instead`, - lx.current()) - } - } - return lx.pop() -} - -func lexLongUnicodeEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 8; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf( - `expected eight hexadecimal digits after '\U', but got %q instead`, - lx.current()) - } - } - return lx.pop() -} - -// lexNumberOrDateStart processes the first character of a value which begins -// with a digit. It exists to catch values starting with '0', so that -// lexBaseNumberOrDate can differentiate base prefixed integers from other -// types. -func lexNumberOrDateStart(lx *lexer) stateFn { - r := lx.next() - switch r { - case '0': - return lexBaseNumberOrDate - } - - if !isDigit(r) { - // The only way to reach this state is if the value starts - // with a digit, so specifically treat anything else as an - // error. - return lx.errorf("expected a digit but got %q", r) - } - - return lexNumberOrDate -} - -// lexNumberOrDate consumes either an integer, float or datetime. -func lexNumberOrDate(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexNumberOrDate - } - switch r { - case '-', ':': - return lexDatetime - case '_': - return lexDecimalNumber - case '.', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDatetime consumes a Datetime, to a first approximation. -// The parser validates that it matches one of the accepted formats. -func lexDatetime(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexDatetime - } - switch r { - case '-', ':', 'T', 't', ' ', '.', 'Z', 'z', '+': - return lexDatetime - } - - lx.backup() - lx.emitTrim(itemDatetime) - return lx.pop() -} - -// lexHexInteger consumes a hexadecimal integer after seeing the '0x' prefix. -func lexHexInteger(lx *lexer) stateFn { - r := lx.next() - if isHexadecimal(r) { - return lexHexInteger - } - switch r { - case '_': - return lexHexInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexOctalInteger consumes an octal integer after seeing the '0o' prefix. -func lexOctalInteger(lx *lexer) stateFn { - r := lx.next() - if isOctal(r) { - return lexOctalInteger - } - switch r { - case '_': - return lexOctalInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexBinaryInteger consumes a binary integer after seeing the '0b' prefix. -func lexBinaryInteger(lx *lexer) stateFn { - r := lx.next() - if isBinary(r) { - return lexBinaryInteger - } - switch r { - case '_': - return lexBinaryInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDecimalNumber consumes a decimal float or integer. -func lexDecimalNumber(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexDecimalNumber - } - switch r { - case '.', 'e', 'E': - return lexFloat - case '_': - return lexDecimalNumber - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDecimalNumber consumes the first digit of a number beginning with a sign. -// It assumes the sign has already been consumed. Values which start with a sign -// are only allowed to be decimal integers or floats. -// -// The special "nan" and "inf" values are also recognized. -func lexDecimalNumberStart(lx *lexer) stateFn { - r := lx.next() - - // Special error cases to give users better error messages - switch r { - case 'i': - if !lx.accept('n') || !lx.accept('f') { - return lx.errorf("invalid float: '%s'", lx.current()) - } - lx.emit(itemFloat) - return lx.pop() - case 'n': - if !lx.accept('a') || !lx.accept('n') { - return lx.errorf("invalid float: '%s'", lx.current()) - } - lx.emit(itemFloat) - return lx.pop() - case '0': - p := lx.peek() - switch p { - case 'b', 'o', 'x': - return lx.errorf("cannot use sign with non-decimal numbers: '%s%c'", lx.current(), p) - } - case '.': - return lx.errorf("floats must start with a digit, not '.'") - } - - if isDigit(r) { - return lexDecimalNumber - } - - return lx.errorf("expected a digit but got %q", r) -} - -// lexBaseNumberOrDate differentiates between the possible values which -// start with '0'. It assumes that before reaching this state, the initial '0' -// has been consumed. -func lexBaseNumberOrDate(lx *lexer) stateFn { - r := lx.next() - // Note: All datetimes start with at least two digits, so we don't - // handle date characters (':', '-', etc.) here. - if isDigit(r) { - return lexNumberOrDate - } - switch r { - case '_': - // Can only be decimal, because there can't be an underscore - // between the '0' and the base designator, and dates can't - // contain underscores. - return lexDecimalNumber - case '.', 'e', 'E': - return lexFloat - case 'b': - r = lx.peek() - if !isBinary(r) { - lx.errorf("not a binary number: '%s%c'", lx.current(), r) - } - return lexBinaryInteger - case 'o': - r = lx.peek() - if !isOctal(r) { - lx.errorf("not an octal number: '%s%c'", lx.current(), r) - } - return lexOctalInteger - case 'x': - r = lx.peek() - if !isHexadecimal(r) { - lx.errorf("not a hexidecimal number: '%s%c'", lx.current(), r) - } - return lexHexInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexFloat consumes the elements of a float. It allows any sequence of -// float-like characters, so floats emitted by the lexer are only a first -// approximation and must be validated by the parser. -func lexFloat(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexFloat - } - switch r { - case '_', '.', '-', '+', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemFloat) - return lx.pop() -} - -// lexBool consumes a bool string: 'true' or 'false. -func lexBool(lx *lexer) stateFn { - var rs []rune - for { - r := lx.next() - if !unicode.IsLetter(r) { - lx.backup() - break - } - rs = append(rs, r) - } - s := string(rs) - switch s { - case "true", "false": - lx.emit(itemBool) - return lx.pop() - } - return lx.errorf("expected value but found %q instead", s) -} - -// lexCommentStart begins the lexing of a comment. It will emit -// itemCommentStart and consume no characters, passing control to lexComment. -func lexCommentStart(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemCommentStart) - return lexComment -} - -// lexComment lexes an entire comment. It assumes that '#' has been consumed. -// It will consume *up to* the first newline character, and pass control -// back to the last state on the stack. -func lexComment(lx *lexer) stateFn { - switch r := lx.next(); { - case isNL(r) || r == eof: - lx.backup() - lx.emit(itemText) - return lx.pop() - case isControl(r): - return lx.errorf("control characters are not allowed inside comments: '0x%02x'", r) - default: - return lexComment - } -} - -// lexSkip ignores all slurped input and moves on to the next state. -func lexSkip(lx *lexer, nextState stateFn) stateFn { - lx.ignore() - return nextState -} - -// isWhitespace returns true if `r` is a whitespace character according -// to the spec. -func isWhitespace(r rune) bool { - return r == '\t' || r == ' ' -} - -func isNL(r rune) bool { - return r == '\n' || r == '\r' -} - -// Control characters except \n, \t -func isControl(r rune) bool { - switch r { - case '\t', '\r', '\n': - return false - default: - return (r >= 0x00 && r <= 0x1f) || r == 0x7f - } -} - -func isDigit(r rune) bool { - return r >= '0' && r <= '9' -} - -func isHexadecimal(r rune) bool { - return (r >= '0' && r <= '9') || - (r >= 'a' && r <= 'f') || - (r >= 'A' && r <= 'F') -} - -func isOctal(r rune) bool { - return r >= '0' && r <= '7' -} - -func isBinary(r rune) bool { - return r == '0' || r == '1' -} - -func isBareKeyChar(r rune) bool { - return (r >= 'A' && r <= 'Z') || - (r >= 'a' && r <= 'z') || - (r >= '0' && r <= '9') || - r == '_' || - r == '-' -} - -func (s stateFn) String() string { - name := runtime.FuncForPC(reflect.ValueOf(s).Pointer()).Name() - if i := strings.LastIndexByte(name, '.'); i > -1 { - name = name[i+1:] - } - if s == nil { - name = "" - } - return name + "()" -} - -func (itype itemType) String() string { - switch itype { - case itemError: - return "Error" - case itemNIL: - return "NIL" - case itemEOF: - return "EOF" - case itemText: - return "Text" - case itemString, itemRawString, itemMultilineString, itemRawMultilineString: - return "String" - case itemBool: - return "Bool" - case itemInteger: - return "Integer" - case itemFloat: - return "Float" - case itemDatetime: - return "DateTime" - case itemTableStart: - return "TableStart" - case itemTableEnd: - return "TableEnd" - case itemKeyStart: - return "KeyStart" - case itemKeyEnd: - return "KeyEnd" - case itemArray: - return "Array" - case itemArrayEnd: - return "ArrayEnd" - case itemCommentStart: - return "CommentStart" - case itemInlineTableStart: - return "InlineTableStart" - case itemInlineTableEnd: - return "InlineTableEnd" - } - panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype))) -} - -func (item item) String() string { - return fmt.Sprintf("(%s, %s)", item.typ.String(), item.val) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/move_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/move_test.go deleted file mode 100644 index d7e0123b4..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/move_test.go +++ /dev/null @@ -1,374 +0,0 @@ -package toml - -import ( - "fmt" - "testing" - "time" -) - -func TestEncode(t *testing.T) { - type Embedded struct { - Int int `toml:"_int"` - } - type NonStruct int - - date := time.Date(2014, 5, 11, 19, 30, 40, 0, time.UTC) - dateStr := "2014-05-11T19:30:40Z" - - tests := map[string]struct { - input interface{} - wantOutput string - wantError error - }{ - "bool field": { - input: struct { - BoolTrue bool - BoolFalse bool - }{true, false}, - wantOutput: "BoolTrue = true\nBoolFalse = false\n", - }, - "int fields": { - input: struct { - Int int - Int8 int8 - Int16 int16 - Int32 int32 - Int64 int64 - }{1, 2, 3, 4, 5}, - wantOutput: "Int = 1\nInt8 = 2\nInt16 = 3\nInt32 = 4\nInt64 = 5\n", - }, - "uint fields": { - input: struct { - Uint uint - Uint8 uint8 - Uint16 uint16 - Uint32 uint32 - Uint64 uint64 - }{1, 2, 3, 4, 5}, - wantOutput: "Uint = 1\nUint8 = 2\nUint16 = 3\nUint32 = 4" + - "\nUint64 = 5\n", - }, - "float fields": { - input: struct { - Float32 float32 - Float64 float64 - }{1.5, 2.5}, - wantOutput: "Float32 = 1.5\nFloat64 = 2.5\n", - }, - "string field": { - input: struct{ String string }{"foo"}, - wantOutput: "String = \"foo\"\n", - }, - "string field with \\n escape": { - input: struct{ String string }{"foo\n"}, - wantOutput: "String = \"foo\\n\"\n", - }, - "string field and unexported field": { - input: struct { - String string - unexported int - }{"foo", 0}, - wantOutput: "String = \"foo\"\n", - }, - "datetime field in UTC": { - input: struct{ Date time.Time }{date}, - wantOutput: fmt.Sprintf("Date = %s\n", dateStr), - }, - "datetime field as primitive": { - // Using a map here to fail if isStructOrMap() returns true for - // time.Time. - input: map[string]interface{}{ - "Date": date, - "Int": 1, - }, - wantOutput: fmt.Sprintf("Date = %s\nInt = 1\n", dateStr), - }, - "array fields": { - input: struct { - IntArray0 [0]int - IntArray3 [3]int - }{[0]int{}, [3]int{1, 2, 3}}, - wantOutput: "IntArray0 = []\nIntArray3 = [1, 2, 3]\n", - }, - "slice fields": { - input: struct{ IntSliceNil, IntSlice0, IntSlice3 []int }{ - nil, []int{}, []int{1, 2, 3}, - }, - wantOutput: "IntSlice0 = []\nIntSlice3 = [1, 2, 3]\n", - }, - "datetime slices": { - input: struct{ DatetimeSlice []time.Time }{ - []time.Time{date, date}, - }, - wantOutput: fmt.Sprintf("DatetimeSlice = [%s, %s]\n", - dateStr, dateStr), - }, - "nested arrays and slices": { - input: struct { - SliceOfArrays [][2]int - ArrayOfSlices [2][]int - SliceOfArraysOfSlices [][2][]int - ArrayOfSlicesOfArrays [2][][2]int - SliceOfMixedArrays [][2]interface{} - ArrayOfMixedSlices [2][]interface{} - }{ - [][2]int{{1, 2}, {3, 4}}, - [2][]int{{1, 2}, {3, 4}}, - [][2][]int{ - { - {1, 2}, {3, 4}, - }, - { - {5, 6}, {7, 8}, - }, - }, - [2][][2]int{ - { - {1, 2}, {3, 4}, - }, - { - {5, 6}, {7, 8}, - }, - }, - [][2]interface{}{ - {1, 2}, {"a", "b"}, - }, - [2][]interface{}{ - {1, 2}, {"a", "b"}, - }, - }, - wantOutput: `SliceOfArrays = [[1, 2], [3, 4]] -ArrayOfSlices = [[1, 2], [3, 4]] -SliceOfArraysOfSlices = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] -ArrayOfSlicesOfArrays = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] -SliceOfMixedArrays = [[1, 2], ["a", "b"]] -ArrayOfMixedSlices = [[1, 2], ["a", "b"]] -`, - }, - "empty slice": { - input: struct{ Empty []interface{} }{[]interface{}{}}, - wantOutput: "Empty = []\n", - }, - "(error) slice with element type mismatch (string and integer)": { - input: struct{ Mixed []interface{} }{[]interface{}{1, "a"}}, - wantOutput: "Mixed = [1, \"a\"]\n", - }, - "(error) slice with element type mismatch (integer and float)": { - input: struct{ Mixed []interface{} }{[]interface{}{1, 2.5}}, - wantOutput: "Mixed = [1, 2.5]\n", - }, - "slice with elems of differing Go types, same TOML types": { - input: struct { - MixedInts []interface{} - MixedFloats []interface{} - }{ - []interface{}{ - int(1), int8(2), int16(3), int32(4), int64(5), - uint(1), uint8(2), uint16(3), uint32(4), uint64(5), - }, - []interface{}{float32(1.5), float64(2.5)}, - }, - wantOutput: "MixedInts = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]\n" + - "MixedFloats = [1.5, 2.5]\n", - }, - "(error) slice w/ element type mismatch (one is nested array)": { - input: struct{ Mixed []interface{} }{ - []interface{}{1, []interface{}{2}}, - }, - wantOutput: "Mixed = [1, [2]]\n", - }, - "(error) slice with 1 nil element": { - input: struct{ NilElement1 []interface{} }{[]interface{}{nil}}, - wantError: errArrayNilElement, - }, - "(error) slice with 1 nil element (and other non-nil elements)": { - input: struct{ NilElement []interface{} }{ - []interface{}{1, nil}, - }, - wantError: errArrayNilElement, - }, - "simple map": { - input: map[string]int{"a": 1, "b": 2}, - wantOutput: "a = 1\nb = 2\n", - }, - "map with interface{} value type": { - input: map[string]interface{}{"a": 1, "b": "c"}, - wantOutput: "a = 1\nb = \"c\"\n", - }, - "map with interface{} value type, some of which are structs": { - input: map[string]interface{}{ - "a": struct{ Int int }{2}, - "b": 1, - }, - wantOutput: "b = 1\n\n[a]\n Int = 2\n", - }, - "nested map": { - input: map[string]map[string]int{ - "a": {"b": 1}, - "c": {"d": 2}, - }, - wantOutput: "[a]\n b = 1\n\n[c]\n d = 2\n", - }, - "nested struct": { - input: struct{ Struct struct{ Int int } }{ - struct{ Int int }{1}, - }, - wantOutput: "[Struct]\n Int = 1\n", - }, - "nested struct and non-struct field": { - input: struct { - Struct struct{ Int int } - Bool bool - }{struct{ Int int }{1}, true}, - wantOutput: "Bool = true\n\n[Struct]\n Int = 1\n", - }, - "2 nested structs": { - input: struct{ Struct1, Struct2 struct{ Int int } }{ - struct{ Int int }{1}, struct{ Int int }{2}, - }, - wantOutput: "[Struct1]\n Int = 1\n\n[Struct2]\n Int = 2\n", - }, - "deeply nested structs": { - input: struct { - Struct1, Struct2 struct{ Struct3 *struct{ Int int } } - }{ - struct{ Struct3 *struct{ Int int } }{&struct{ Int int }{1}}, - struct{ Struct3 *struct{ Int int } }{nil}, - }, - wantOutput: "[Struct1]\n [Struct1.Struct3]\n Int = 1" + - "\n\n[Struct2]\n", - }, - "nested struct with nil struct elem": { - input: struct { - Struct struct{ Inner *struct{ Int int } } - }{ - struct{ Inner *struct{ Int int } }{nil}, - }, - wantOutput: "[Struct]\n", - }, - "nested struct with no fields": { - input: struct { - Struct struct{ Inner struct{} } - }{ - struct{ Inner struct{} }{struct{}{}}, - }, - wantOutput: "[Struct]\n [Struct.Inner]\n", - }, - "struct with tags": { - input: struct { - Struct struct { - Int int `toml:"_int"` - } `toml:"_struct"` - Bool bool `toml:"_bool"` - }{ - struct { - Int int `toml:"_int"` - }{1}, true, - }, - wantOutput: "_bool = true\n\n[_struct]\n _int = 1\n", - }, - "embedded struct": { - input: struct{ Embedded }{Embedded{1}}, - wantOutput: "_int = 1\n", - }, - "embedded *struct": { - input: struct{ *Embedded }{&Embedded{1}}, - wantOutput: "_int = 1\n", - }, - "nested embedded struct": { - input: struct { - Struct struct{ Embedded } `toml:"_struct"` - }{struct{ Embedded }{Embedded{1}}}, - wantOutput: "[_struct]\n _int = 1\n", - }, - "nested embedded *struct": { - input: struct { - Struct struct{ *Embedded } `toml:"_struct"` - }{struct{ *Embedded }{&Embedded{1}}}, - wantOutput: "[_struct]\n _int = 1\n", - }, - "embedded non-struct": { - input: struct{ NonStruct }{5}, - wantOutput: "NonStruct = 5\n", - }, - "array of tables": { - input: struct { - Structs []*struct{ Int int } `toml:"struct"` - }{ - []*struct{ Int int }{{1}, {3}}, - }, - wantOutput: "[[struct]]\n Int = 1\n\n[[struct]]\n Int = 3\n", - }, - "array of tables order": { - input: map[string]interface{}{ - "map": map[string]interface{}{ - "zero": 5, - "arr": []map[string]int{ - { - "friend": 5, - }, - }, - }, - }, - wantOutput: "[map]\n zero = 5\n\n [[map.arr]]\n friend = 5\n", - }, - "empty key name": { - input: map[string]int{"": 1}, - wantOutput: `"" = 1` + "\n", - }, - "key with \\n escape": { - input: map[string]string{"\n": "\n"}, - wantOutput: `"\n" = "\n"` + "\n", - }, - - "empty map name": { - input: map[string]interface{}{ - "": map[string]int{"v": 1}, - }, - wantOutput: "[\"\"]\n v = 1\n", - }, - "(error) top-level slice": { - input: []struct{ Int int }{{1}, {2}, {3}}, - wantError: errNoKey, - }, - "(error) map no string key": { - input: map[int]string{1: ""}, - wantError: errNonString, - }, - - "tbl-in-arr-struct": { - input: struct { - Arr [][]struct{ A, B, C int } - }{[][]struct{ A, B, C int }{{{1, 2, 3}, {4, 5, 6}}}}, - wantOutput: "Arr = [[{A = 1, B = 2, C = 3}, {A = 4, B = 5, C = 6}]]", - }, - - "tbl-in-arr-map": { - input: map[string]interface{}{ - "arr": []interface{}{[]interface{}{ - map[string]interface{}{ - "a": []interface{}{"hello", "world"}, - "b": []interface{}{1.12, 4.1}, - "c": 1, - "d": map[string]interface{}{"e": "E"}, - "f": struct{ A, B int }{1, 2}, - "g": []struct{ A, B int }{{3, 4}, {5, 6}}, - }, - }}, - }, - wantOutput: `arr = [[{a = ["hello", "world"], b = [1.12, 4.1], c = 1, d = {e = "E"}, f = {A = 1, B = 2}, g = [{A = 3, B = 4}, {A = 5, B = 6}]}]]`, - }, - - "slice of slice": { - input: struct { - Slices [][]struct{ Int int } - }{ - [][]struct{ Int int }{{{1}}, {{2}}, {{3}}}, - }, - wantOutput: "Slices = [[{Int = 1}], [{Int = 2}], [{Int = 3}]]", - }, - } - for label, test := range tests { - encodeExpected(t, label, test.input, test.wantOutput, test.wantError) - } -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/parse.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/parse.go deleted file mode 100644 index d9ae5db94..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/parse.go +++ /dev/null @@ -1,739 +0,0 @@ -package toml - -import ( - "errors" - "fmt" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/BurntSushi/toml/internal" -) - -type parser struct { - mapping map[string]interface{} - types map[string]tomlType - lx *lexer - - ordered []Key // List of keys in the order that they appear in the TOML data. - context Key // Full key for the current hash in scope. - currentKey string // Base key name for everything except hashes. - approxLine int // Rough approximation of line number - implicits map[string]bool // Record implied keys (e.g. 'key.group.names'). -} - -// ParseError is used when a file can't be parsed: for example invalid integer -// literals, duplicate keys, etc. -type ParseError struct { - Message string - Line int - LastKey string -} - -func (pe ParseError) Error() string { - return fmt.Sprintf("Near line %d (last key parsed '%s'): %s", - pe.Line, pe.LastKey, pe.Message) -} - -func parse(data string) (p *parser, err error) { - defer func() { - if r := recover(); r != nil { - var ok bool - if err, ok = r.(ParseError); ok { - return - } - panic(r) - } - }() - - // Read over BOM; do this here as the lexer calls utf8.DecodeRuneInString() - // which mangles stuff. - if strings.HasPrefix(data, "\xff\xfe") || strings.HasPrefix(data, "\xfe\xff") { - data = data[2:] - } - - // Examine first few bytes for NULL bytes; this probably means it's a UTF-16 - // file (second byte in surrogate pair being NULL). Again, do this here to - // avoid having to deal with UTF-8/16 stuff in the lexer. - ex := 6 - if len(data) < 6 { - ex = len(data) - } - if strings.ContainsRune(data[:ex], 0) { - return nil, errors.New("files cannot contain NULL bytes; probably using UTF-16; TOML files must be UTF-8") - } - - p = &parser{ - mapping: make(map[string]interface{}), - types: make(map[string]tomlType), - lx: lex(data), - ordered: make([]Key, 0), - implicits: make(map[string]bool), - } - for { - item := p.next() - if item.typ == itemEOF { - break - } - p.topLevel(item) - } - - return p, nil -} - -func (p *parser) panicf(format string, v ...interface{}) { - msg := fmt.Sprintf(format, v...) - panic(ParseError{ - Message: msg, - Line: p.approxLine, - LastKey: p.current(), - }) -} - -func (p *parser) next() item { - it := p.lx.nextItem() - //fmt.Printf("ITEM %-18s line %-3d │ %q\n", it.typ, it.line, it.val) - if it.typ == itemError { - p.panicf("%s", it.val) - } - return it -} - -func (p *parser) bug(format string, v ...interface{}) { - panic(fmt.Sprintf("BUG: "+format+"\n\n", v...)) -} - -func (p *parser) expect(typ itemType) item { - it := p.next() - p.assertEqual(typ, it.typ) - return it -} - -func (p *parser) assertEqual(expected, got itemType) { - if expected != got { - p.bug("Expected '%s' but got '%s'.", expected, got) - } -} - -func (p *parser) topLevel(item item) { - switch item.typ { - case itemCommentStart: // # .. - p.approxLine = item.line - p.expect(itemText) - case itemTableStart: // [ .. ] - name := p.next() - p.approxLine = name.line - - var key Key - for ; name.typ != itemTableEnd && name.typ != itemEOF; name = p.next() { - key = append(key, p.keyString(name)) - } - p.assertEqual(itemTableEnd, name.typ) - - p.addContext(key, false) - p.setType("", tomlHash) - p.ordered = append(p.ordered, key) - case itemArrayTableStart: // [[ .. ]] - name := p.next() - p.approxLine = name.line - - var key Key - for ; name.typ != itemArrayTableEnd && name.typ != itemEOF; name = p.next() { - key = append(key, p.keyString(name)) - } - p.assertEqual(itemArrayTableEnd, name.typ) - - p.addContext(key, true) - p.setType("", tomlArrayHash) - p.ordered = append(p.ordered, key) - case itemKeyStart: // key = .. - outerContext := p.context - /// Read all the key parts (e.g. 'a' and 'b' in 'a.b') - k := p.next() - p.approxLine = k.line - var key Key - for ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() { - key = append(key, p.keyString(k)) - } - p.assertEqual(itemKeyEnd, k.typ) - - /// The current key is the last part. - p.currentKey = key[len(key)-1] - - /// All the other parts (if any) are the context; need to set each part - /// as implicit. - context := key[:len(key)-1] - for i := range context { - p.addImplicitContext(append(p.context, context[i:i+1]...)) - } - - /// Set value. - val, typ := p.value(p.next(), false) - p.set(p.currentKey, val, typ) - p.ordered = append(p.ordered, p.context.add(p.currentKey)) - - /// Remove the context we added (preserving any context from [tbl] lines). - p.context = outerContext - p.currentKey = "" - default: - p.bug("Unexpected type at top level: %s", item.typ) - } -} - -// Gets a string for a key (or part of a key in a table name). -func (p *parser) keyString(it item) string { - switch it.typ { - case itemText: - return it.val - case itemString, itemMultilineString, - itemRawString, itemRawMultilineString: - s, _ := p.value(it, false) - return s.(string) - default: - p.bug("Unexpected key type: %s", it.typ) - } - panic("unreachable") -} - -var datetimeRepl = strings.NewReplacer( - "z", "Z", - "t", "T", - " ", "T") - -// value translates an expected value from the lexer into a Go value wrapped -// as an empty interface. -func (p *parser) value(it item, parentIsArray bool) (interface{}, tomlType) { - switch it.typ { - case itemString: - return p.replaceEscapes(it.val), p.typeOfPrimitive(it) - case itemMultilineString: - return p.replaceEscapes(stripFirstNewline(stripEscapedNewlines(it.val))), p.typeOfPrimitive(it) - case itemRawString: - return it.val, p.typeOfPrimitive(it) - case itemRawMultilineString: - return stripFirstNewline(it.val), p.typeOfPrimitive(it) - case itemInteger: - return p.valueInteger(it) - case itemFloat: - return p.valueFloat(it) - case itemBool: - switch it.val { - case "true": - return true, p.typeOfPrimitive(it) - case "false": - return false, p.typeOfPrimitive(it) - default: - p.bug("Expected boolean value, but got '%s'.", it.val) - } - case itemDatetime: - return p.valueDatetime(it) - case itemArray: - return p.valueArray(it) - case itemInlineTableStart: - return p.valueInlineTable(it, parentIsArray) - default: - p.bug("Unexpected value type: %s", it.typ) - } - panic("unreachable") -} - -func (p *parser) valueInteger(it item) (interface{}, tomlType) { - if !numUnderscoresOK(it.val) { - p.panicf("Invalid integer %q: underscores must be surrounded by digits", it.val) - } - if numHasLeadingZero(it.val) { - p.panicf("Invalid integer %q: cannot have leading zeroes", it.val) - } - - num, err := strconv.ParseInt(it.val, 0, 64) - if err != nil { - // Distinguish integer values. Normally, it'd be a bug if the lexer - // provides an invalid integer, but it's possible that the number is - // out of range of valid values (which the lexer cannot determine). - // So mark the former as a bug but the latter as a legitimate user - // error. - if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { - p.panicf("Integer '%s' is out of the range of 64-bit signed integers.", it.val) - } else { - p.bug("Expected integer value, but got '%s'.", it.val) - } - } - return num, p.typeOfPrimitive(it) -} - -func (p *parser) valueFloat(it item) (interface{}, tomlType) { - parts := strings.FieldsFunc(it.val, func(r rune) bool { - switch r { - case '.', 'e', 'E': - return true - } - return false - }) - for _, part := range parts { - if !numUnderscoresOK(part) { - p.panicf("Invalid float %q: underscores must be surrounded by digits", it.val) - } - } - if len(parts) > 0 && numHasLeadingZero(parts[0]) { - p.panicf("Invalid float %q: cannot have leading zeroes", it.val) - } - if !numPeriodsOK(it.val) { - // As a special case, numbers like '123.' or '1.e2', - // which are valid as far as Go/strconv are concerned, - // must be rejected because TOML says that a fractional - // part consists of '.' followed by 1+ digits. - p.panicf("Invalid float %q: '.' must be followed by one or more digits", it.val) - } - val := strings.Replace(it.val, "_", "", -1) - if val == "+nan" || val == "-nan" { // Go doesn't support this, but TOML spec does. - val = "nan" - } - num, err := strconv.ParseFloat(val, 64) - if err != nil { - if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { - p.panicf("Float '%s' is out of the range of 64-bit IEEE-754 floating-point numbers.", it.val) - } else { - p.panicf("Invalid float value: %q", it.val) - } - } - return num, p.typeOfPrimitive(it) -} - -var dtTypes = []struct { - fmt string - zone *time.Location -}{ - {time.RFC3339Nano, time.Local}, - {"2006-01-02T15:04:05.999999999", internal.LocalDatetime}, - {"2006-01-02", internal.LocalDate}, - {"15:04:05.999999999", internal.LocalTime}, -} - -func (p *parser) valueDatetime(it item) (interface{}, tomlType) { - it.val = datetimeRepl.Replace(it.val) - var ( - t time.Time - ok bool - err error - ) - for _, dt := range dtTypes { - t, err = time.ParseInLocation(dt.fmt, it.val, dt.zone) - if err == nil { - ok = true - break - } - } - if !ok { - p.panicf("Invalid TOML Datetime: %q.", it.val) - } - return t, p.typeOfPrimitive(it) -} - -func (p *parser) valueArray(it item) (interface{}, tomlType) { - p.setType(p.currentKey, tomlArray) - - // p.setType(p.currentKey, typ) - var ( - array []interface{} - types []tomlType - ) - for it = p.next(); it.typ != itemArrayEnd; it = p.next() { - if it.typ == itemCommentStart { - p.expect(itemText) - continue - } - - val, typ := p.value(it, true) - array = append(array, val) - types = append(types, typ) - } - return array, tomlArray -} - -func (p *parser) valueInlineTable(it item, parentIsArray bool) (interface{}, tomlType) { - var ( - hash = make(map[string]interface{}) - outerContext = p.context - outerKey = p.currentKey - ) - - p.context = append(p.context, p.currentKey) - prevContext := p.context - p.currentKey = "" - - p.addImplicit(p.context) - p.addContext(p.context, parentIsArray) - - /// Loop over all table key/value pairs. - for it := p.next(); it.typ != itemInlineTableEnd; it = p.next() { - if it.typ == itemCommentStart { - p.expect(itemText) - continue - } - - /// Read all key parts. - k := p.next() - p.approxLine = k.line - var key Key - for ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() { - key = append(key, p.keyString(k)) - } - p.assertEqual(itemKeyEnd, k.typ) - - /// The current key is the last part. - p.currentKey = key[len(key)-1] - - /// All the other parts (if any) are the context; need to set each part - /// as implicit. - context := key[:len(key)-1] - for i := range context { - p.addImplicitContext(append(p.context, context[i:i+1]...)) - } - - /// Set the value. - val, typ := p.value(p.next(), false) - p.set(p.currentKey, val, typ) - p.ordered = append(p.ordered, p.context.add(p.currentKey)) - hash[p.currentKey] = val - - /// Restore context. - p.context = prevContext - } - p.context = outerContext - p.currentKey = outerKey - return hash, tomlHash -} - -// numHasLeadingZero checks if this number has leading zeroes, allowing for '0', -// +/- signs, and base prefixes. -func numHasLeadingZero(s string) bool { - if len(s) > 1 && s[0] == '0' && isDigit(rune(s[1])) { // >1 to allow "0" and isDigit to allow 0x - return true - } - if len(s) > 2 && (s[0] == '-' || s[0] == '+') && s[1] == '0' { - return true - } - return false -} - -// numUnderscoresOK checks whether each underscore in s is surrounded by -// characters that are not underscores. -func numUnderscoresOK(s string) bool { - switch s { - case "nan", "+nan", "-nan", "inf", "-inf", "+inf": - return true - } - accept := false - for _, r := range s { - if r == '_' { - if !accept { - return false - } - } - - // isHexadecimal is a superset of all the permissable characters - // surrounding an underscore. - accept = isHexadecimal(r) - } - return accept -} - -// numPeriodsOK checks whether every period in s is followed by a digit. -func numPeriodsOK(s string) bool { - period := false - for _, r := range s { - if period && !isDigit(r) { - return false - } - period = r == '.' - } - return !period -} - -// Set the current context of the parser, where the context is either a hash or -// an array of hashes, depending on the value of the `array` parameter. -// -// Establishing the context also makes sure that the key isn't a duplicate, and -// will create implicit hashes automatically. -func (p *parser) addContext(key Key, array bool) { - var ok bool - - // Always start at the top level and drill down for our context. - hashContext := p.mapping - keyContext := make(Key, 0) - - // We only need implicit hashes for key[0:-1] - for _, k := range key[0 : len(key)-1] { - _, ok = hashContext[k] - keyContext = append(keyContext, k) - - // No key? Make an implicit hash and move on. - if !ok { - p.addImplicit(keyContext) - hashContext[k] = make(map[string]interface{}) - } - - // If the hash context is actually an array of tables, then set - // the hash context to the last element in that array. - // - // Otherwise, it better be a table, since this MUST be a key group (by - // virtue of it not being the last element in a key). - switch t := hashContext[k].(type) { - case []map[string]interface{}: - hashContext = t[len(t)-1] - case map[string]interface{}: - hashContext = t - default: - p.panicf("Key '%s' was already created as a hash.", keyContext) - } - } - - p.context = keyContext - if array { - // If this is the first element for this array, then allocate a new - // list of tables for it. - k := key[len(key)-1] - if _, ok := hashContext[k]; !ok { - hashContext[k] = make([]map[string]interface{}, 0, 4) - } - - // Add a new table. But make sure the key hasn't already been used - // for something else. - if hash, ok := hashContext[k].([]map[string]interface{}); ok { - hashContext[k] = append(hash, make(map[string]interface{})) - } else { - p.panicf("Key '%s' was already created and cannot be used as an array.", keyContext) - } - } else { - p.setValue(key[len(key)-1], make(map[string]interface{})) - } - p.context = append(p.context, key[len(key)-1]) -} - -// set calls setValue and setType. -func (p *parser) set(key string, val interface{}, typ tomlType) { - p.setValue(p.currentKey, val) - p.setType(p.currentKey, typ) -} - -// setValue sets the given key to the given value in the current context. -// It will make sure that the key hasn't already been defined, account for -// implicit key groups. -func (p *parser) setValue(key string, value interface{}) { - var ( - tmpHash interface{} - ok bool - hash = p.mapping - keyContext Key - ) - for _, k := range p.context { - keyContext = append(keyContext, k) - if tmpHash, ok = hash[k]; !ok { - p.bug("Context for key '%s' has not been established.", keyContext) - } - switch t := tmpHash.(type) { - case []map[string]interface{}: - // The context is a table of hashes. Pick the most recent table - // defined as the current hash. - hash = t[len(t)-1] - case map[string]interface{}: - hash = t - default: - p.panicf("Key '%s' has already been defined.", keyContext) - } - } - keyContext = append(keyContext, key) - - if _, ok := hash[key]; ok { - // Normally redefining keys isn't allowed, but the key could have been - // defined implicitly and it's allowed to be redefined concretely. (See - // the `valid/implicit-and-explicit-after.toml` in toml-test) - // - // But we have to make sure to stop marking it as an implicit. (So that - // another redefinition provokes an error.) - // - // Note that since it has already been defined (as a hash), we don't - // want to overwrite it. So our business is done. - if p.isArray(keyContext) { - p.removeImplicit(keyContext) - hash[key] = value - return - } - if p.isImplicit(keyContext) { - p.removeImplicit(keyContext) - return - } - - // Otherwise, we have a concrete key trying to override a previous - // key, which is *always* wrong. - p.panicf("Key '%s' has already been defined.", keyContext) - } - - hash[key] = value -} - -// setType sets the type of a particular value at a given key. -// It should be called immediately AFTER setValue. -// -// Note that if `key` is empty, then the type given will be applied to the -// current context (which is either a table or an array of tables). -func (p *parser) setType(key string, typ tomlType) { - keyContext := make(Key, 0, len(p.context)+1) - for _, k := range p.context { - keyContext = append(keyContext, k) - } - if len(key) > 0 { // allow type setting for hashes - keyContext = append(keyContext, key) - } - p.types[keyContext.String()] = typ -} - -// Implicit keys need to be created when tables are implied in "a.b.c.d = 1" and -// "[a.b.c]" (the "a", "b", and "c" hashes are never created explicitly). -func (p *parser) addImplicit(key Key) { p.implicits[key.String()] = true } -func (p *parser) removeImplicit(key Key) { p.implicits[key.String()] = false } -func (p *parser) isImplicit(key Key) bool { return p.implicits[key.String()] } -func (p *parser) isArray(key Key) bool { return p.types[key.String()] == tomlArray } -func (p *parser) addImplicitContext(key Key) { - p.addImplicit(key) - p.addContext(key, false) -} - -// current returns the full key name of the current context. -func (p *parser) current() string { - if len(p.currentKey) == 0 { - return p.context.String() - } - if len(p.context) == 0 { - return p.currentKey - } - return fmt.Sprintf("%s.%s", p.context, p.currentKey) -} - -func stripFirstNewline(s string) string { - if len(s) > 0 && s[0] == '\n' { - return s[1:] - } - if len(s) > 1 && s[0] == '\r' && s[1] == '\n' { - return s[2:] - } - return s -} - -// Remove newlines inside triple-quoted strings if a line ends with "\". -func stripEscapedNewlines(s string) string { - split := strings.Split(s, "\n") - if len(split) < 1 { - return s - } - - escNL := false // Keep track of the last non-blank line was escaped. - for i, line := range split { - line = strings.TrimRight(line, " \t\r") - - if len(line) == 0 || line[len(line)-1] != '\\' { - split[i] = strings.TrimRight(split[i], "\r") - if !escNL && i != len(split)-1 { - split[i] += "\n" - } - continue - } - - escBS := true - for j := len(line) - 1; j >= 0 && line[j] == '\\'; j-- { - escBS = !escBS - } - if escNL { - line = strings.TrimLeft(line, " \t\r") - } - escNL = !escBS - - if escBS { - split[i] += "\n" - continue - } - - split[i] = line[:len(line)-1] // Remove \ - if len(split)-1 > i { - split[i+1] = strings.TrimLeft(split[i+1], " \t\r") - } - } - return strings.Join(split, "") -} - -func (p *parser) replaceEscapes(str string) string { - var replaced []rune - s := []byte(str) - r := 0 - for r < len(s) { - if s[r] != '\\' { - c, size := utf8.DecodeRune(s[r:]) - r += size - replaced = append(replaced, c) - continue - } - r += 1 - if r >= len(s) { - p.bug("Escape sequence at end of string.") - return "" - } - switch s[r] { - default: - p.bug("Expected valid escape code after \\, but got %q.", s[r]) - return "" - case ' ', '\t': - p.panicf("invalid escape: '\\%c'", s[r]) - return "" - case 'b': - replaced = append(replaced, rune(0x0008)) - r += 1 - case 't': - replaced = append(replaced, rune(0x0009)) - r += 1 - case 'n': - replaced = append(replaced, rune(0x000A)) - r += 1 - case 'f': - replaced = append(replaced, rune(0x000C)) - r += 1 - case 'r': - replaced = append(replaced, rune(0x000D)) - r += 1 - case '"': - replaced = append(replaced, rune(0x0022)) - r += 1 - case '\\': - replaced = append(replaced, rune(0x005C)) - r += 1 - case 'u': - // At this point, we know we have a Unicode escape of the form - // `uXXXX` at [r, r+5). (Because the lexer guarantees this - // for us.) - escaped := p.asciiEscapeToUnicode(s[r+1 : r+5]) - replaced = append(replaced, escaped) - r += 5 - case 'U': - // At this point, we know we have a Unicode escape of the form - // `uXXXX` at [r, r+9). (Because the lexer guarantees this - // for us.) - escaped := p.asciiEscapeToUnicode(s[r+1 : r+9]) - replaced = append(replaced, escaped) - r += 9 - } - } - return string(replaced) -} - -func (p *parser) asciiEscapeToUnicode(bs []byte) rune { - s := string(bs) - hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32) - if err != nil { - p.bug("Could not parse '%s' as a hexadecimal number, but the "+ - "lexer claims it's OK: %s", s, err) - } - if !utf8.ValidRune(rune(hex)) { - p.panicf("Escaped character '\\u%s' is not valid UTF-8.", s) - } - return rune(hex) -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/toml_test.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/toml_test.go deleted file mode 100644 index 374aeb964..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/toml_test.go +++ /dev/null @@ -1,191 +0,0 @@ -// +build go1.16 - -package toml_test - -import ( - "bytes" - "encoding/json" - "fmt" - "path/filepath" - "strings" - "testing" - - "github.com/BurntSushi/toml" - "github.com/BurntSushi/toml/internal/tag" - tomltest "github.com/BurntSushi/toml/internal/toml-test" -) - -// Test if the error message matches what we want for invalid tests. Every slice -// entry is tested with strings.Contains. -// -// Filepaths are glob'd -var errorTests = map[string][]string{ - "encoding-bad-utf8*": {"invalid UTF-8 byte"}, - "encoding-utf16*": {"files cannot contain NULL bytes; probably using UTF-16"}, - "string-multiline-escape-space": {`invalid escape: '\ '`}, -} - -// Test metadata; all keys listed as "keyname: type". -var metaTests = map[string]string{ - // TODO: this probably should have albums as a Hash as well? - "table-array-implicit": ` - albums.songs: ArrayHash - albums.songs.name: String - `, -} - -func TestToml(t *testing.T) { - for k := range errorTests { // Make sure patterns are valid. - _, err := filepath.Match(k, "") - if err != nil { - t.Fatal(err) - } - } - - run := func(t *testing.T, enc bool) { - r := tomltest.Runner{ - Files: tomltest.EmbeddedTests(), - Encoder: enc, - Parser: parser{}, - SkipTests: []string{ - // This one is annoying to fix, and such an obscure edge case - // it's okay to leave it like this for now. - "invalid/encoding/bad-utf8-at-end", - }, - } - - tests, err := r.Run() - if err != nil { - t.Fatal(err) - } - - for _, test := range tests.Tests { - t.Run(test.Path, func(t *testing.T) { - if test.Failed() { - t.Fatalf("\nError:\n%s\n\nInput:\n%s\nOutput:\n%s\nWant:\n%s\n", - test.Failure, test.Input, test.Output, test.Want) - return - } - - // Test metadata - if !enc && test.Type() == tomltest.TypeValid { - testMeta(t, test) - } - - // Test error message. - if test.Type() == tomltest.TypeInvalid { - testError(t, test) - } - }) - } - t.Logf("passed: %d; failed: %d; skipped: %d", tests.Passed, tests.Failed, tests.Skipped) - } - - t.Run("decode", func(t *testing.T) { run(t, false) }) - t.Run("encode", func(t *testing.T) { run(t, true) }) -} - -func testMeta(t *testing.T, test tomltest.Test) { - want, ok := metaTests[filepath.Base(test.Path)] - if !ok { - return - } - var s interface{} - meta, err := toml.Decode(test.Input, &s) - if err != nil { - t.Fatal(err) - } - - var b strings.Builder - for _, k := range meta.Keys() { - ks := k.String() - b.WriteString(ks) - b.WriteString(": ") - b.WriteString(meta.Type(ks)) - b.WriteByte('\n') - } - have := b.String() - have = have[:len(have)-1] // Trailing \n - - want = strings.ReplaceAll(strings.TrimSpace(want), "\t", "") - if have != want { - t.Errorf("MetaData wrong\nhave:\n%s\nwant:\n%s", have, want) - } -} - -func testError(t *testing.T, test tomltest.Test) { - path := strings.TrimPrefix(test.Path, "invalid/") - - errs, ok := errorTests[path] - if !ok { - for k := range errorTests { - ok, _ = filepath.Match(k, path) - if ok { - errs = errorTests[k] - break - } - } - } - if !ok { - return - } - - for _, e := range errs { - if !strings.Contains(test.Output, e) { - t.Errorf("\nwrong error message\nhave: %s\nwant: %s", test.Output, e) - } - } -} - -type parser struct{} - -func (p parser) Encode(input string) (output string, outputIsError bool, retErr error) { - defer func() { - if r := recover(); r != nil { - switch rr := r.(type) { - case error: - retErr = rr - default: - retErr = fmt.Errorf("%s", rr) - } - } - }() - - var tmp interface{} - err := json.Unmarshal([]byte(input), &tmp) - if err != nil { - return "", false, err - } - - buf := new(bytes.Buffer) - err = toml.NewEncoder(buf).Encode(tag.Remove(tmp)) - if err != nil { - return err.Error(), true, retErr - } - - return buf.String(), false, retErr -} - -func (p parser) Decode(input string) (output string, outputIsError bool, retErr error) { - defer func() { - if r := recover(); r != nil { - switch rr := r.(type) { - case error: - retErr = rr - default: - retErr = fmt.Errorf("%s", rr) - } - } - }() - - var d interface{} - if _, err := toml.Decode(input, &d); err != nil { - return err.Error(), true, retErr - } - - j, err := json.MarshalIndent(tag.Add("", d), "", " ") - if err != nil { - return "", false, err - } - return string(j), false, retErr -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/type_check.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/type_check.go deleted file mode 100644 index d56aa80fa..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/type_check.go +++ /dev/null @@ -1,70 +0,0 @@ -package toml - -// tomlType represents any Go type that corresponds to a TOML type. -// While the first draft of the TOML spec has a simplistic type system that -// probably doesn't need this level of sophistication, we seem to be militating -// toward adding real composite types. -type tomlType interface { - typeString() string -} - -// typeEqual accepts any two types and returns true if they are equal. -func typeEqual(t1, t2 tomlType) bool { - if t1 == nil || t2 == nil { - return false - } - return t1.typeString() == t2.typeString() -} - -func typeIsHash(t tomlType) bool { - return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash) -} - -type tomlBaseType string - -func (btype tomlBaseType) typeString() string { - return string(btype) -} - -func (btype tomlBaseType) String() string { - return btype.typeString() -} - -var ( - tomlInteger tomlBaseType = "Integer" - tomlFloat tomlBaseType = "Float" - tomlDatetime tomlBaseType = "Datetime" - tomlString tomlBaseType = "String" - tomlBool tomlBaseType = "Bool" - tomlArray tomlBaseType = "Array" - tomlHash tomlBaseType = "Hash" - tomlArrayHash tomlBaseType = "ArrayHash" -) - -// typeOfPrimitive returns a tomlType of any primitive value in TOML. -// Primitive values are: Integer, Float, Datetime, String and Bool. -// -// Passing a lexer item other than the following will cause a BUG message -// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime. -func (p *parser) typeOfPrimitive(lexItem item) tomlType { - switch lexItem.typ { - case itemInteger: - return tomlInteger - case itemFloat: - return tomlFloat - case itemDatetime: - return tomlDatetime - case itemString: - return tomlString - case itemMultilineString: - return tomlString - case itemRawString: - return tomlString - case itemRawMultilineString: - return tomlString - case itemBool: - return tomlBool - } - p.bug("Cannot infer primitive type of lex item '%s'.", lexItem) - panic("unreachable") -} diff --git a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/type_fields.go b/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/type_fields.go deleted file mode 100644 index 608997c22..000000000 --- a/pkg/mod/github.com/!burnt!sushi/toml@v0.4.1/type_fields.go +++ /dev/null @@ -1,242 +0,0 @@ -package toml - -// Struct field handling is adapted from code in encoding/json: -// -// 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 Go distribution. - -import ( - "reflect" - "sort" - "sync" -) - -// A field represents a single field found in a struct. -type field struct { - name string // the name of the field (`toml` tag included) - tag bool // whether field has a `toml` tag - index []int // represents the depth of an anonymous field - typ reflect.Type // the type of the field -} - -// byName sorts field by name, breaking ties with depth, -// then breaking ties with "name came from toml tag", then -// breaking ties with index sequence. -type byName []field - -func (x byName) Len() int { return len(x) } - -func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byName) Less(i, j int) bool { - if x[i].name != x[j].name { - return x[i].name < x[j].name - } - if len(x[i].index) != len(x[j].index) { - return len(x[i].index) < len(x[j].index) - } - if x[i].tag != x[j].tag { - return x[i].tag - } - return byIndex(x).Less(i, j) -} - -// byIndex sorts field by index sequence. -type byIndex []field - -func (x byIndex) Len() int { return len(x) } - -func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byIndex) Less(i, j int) bool { - for k, xik := range x[i].index { - if k >= len(x[j].index) { - return false - } - if xik != x[j].index[k] { - return xik < x[j].index[k] - } - } - return len(x[i].index) < len(x[j].index) -} - -// typeFields returns a list of fields that TOML should recognize for the given -// type. The algorithm is breadth-first search over the set of structs to -// include - the top struct and then any reachable anonymous structs. -func typeFields(t reflect.Type) []field { - // Anonymous fields to explore at the current level and the next. - current := []field{} - next := []field{{typ: t}} - - // Count of queued names for current level and the next. - count := map[reflect.Type]int{} - nextCount := map[reflect.Type]int{} - - // Types already visited at an earlier level. - visited := map[reflect.Type]bool{} - - // Fields found. - var fields []field - - for len(next) > 0 { - current, next = next, current[:0] - count, nextCount = nextCount, map[reflect.Type]int{} - - for _, f := range current { - if visited[f.typ] { - continue - } - visited[f.typ] = true - - // Scan f.typ for fields to include. - for i := 0; i < f.typ.NumField(); i++ { - sf := f.typ.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { // unexported - continue - } - opts := getOptions(sf.Tag) - if opts.skip { - continue - } - index := make([]int, len(f.index)+1) - copy(index, f.index) - index[len(f.index)] = i - - ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { - // Follow pointer. - ft = ft.Elem() - } - - // Record found field and index sequence. - if opts.name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { - tagged := opts.name != "" - name := opts.name - if name == "" { - name = sf.Name - } - fields = append(fields, field{name, tagged, index, ft}) - if count[f.typ] > 1 { - // If there were multiple instances, add a second, - // so that the annihilation code will see a duplicate. - // It only cares about the distinction between 1 or 2, - // so don't bother generating any more copies. - fields = append(fields, fields[len(fields)-1]) - } - continue - } - - // Record new anonymous struct to explore in next round. - nextCount[ft]++ - if nextCount[ft] == 1 { - f := field{name: ft.Name(), index: index, typ: ft} - next = append(next, f) - } - } - } - } - - sort.Sort(byName(fields)) - - // Delete all fields that are hidden by the Go rules for embedded fields, - // except that fields with TOML tags are promoted. - - // The fields are sorted in primary order of name, secondary order - // of field index length. Loop over names; for each name, delete - // hidden fields by choosing the one dominant field that survives. - out := fields[:0] - for advance, i := 0, 0; i < len(fields); i += advance { - // One iteration per name. - // Find the sequence of fields with the name of this first field. - fi := fields[i] - name := fi.name - for advance = 1; i+advance < len(fields); advance++ { - fj := fields[i+advance] - if fj.name != name { - break - } - } - if advance == 1 { // Only one field with this name - out = append(out, fi) - continue - } - dominant, ok := dominantField(fields[i : i+advance]) - if ok { - out = append(out, dominant) - } - } - - fields = out - sort.Sort(byIndex(fields)) - - return fields -} - -// dominantField looks through the fields, all of which are known to -// have the same name, to find the single field that dominates the -// others using Go's embedding rules, modified by the presence of -// TOML tags. If there are multiple top-level fields, the boolean -// will be false: This condition is an error in Go and we skip all -// the fields. -func dominantField(fields []field) (field, bool) { - // The fields are sorted in increasing index-length order. The winner - // must therefore be one with the shortest index length. Drop all - // longer entries, which is easy: just truncate the slice. - length := len(fields[0].index) - tagged := -1 // Index of first tagged field. - for i, f := range fields { - if len(f.index) > length { - fields = fields[:i] - break - } - if f.tag { - if tagged >= 0 { - // Multiple tagged fields at the same level: conflict. - // Return no field. - return field{}, false - } - tagged = i - } - } - if tagged >= 0 { - return fields[tagged], true - } - // All remaining fields have the same length. If there's more than one, - // we have a conflict (two fields named "X" at the same level) and we - // return no field. - if len(fields) > 1 { - return field{}, false - } - return fields[0], true -} - -var fieldCache struct { - sync.RWMutex - m map[reflect.Type][]field -} - -// cachedTypeFields is like typeFields but uses a cache to avoid repeated work. -func cachedTypeFields(t reflect.Type) []field { - fieldCache.RLock() - f := fieldCache.m[t] - fieldCache.RUnlock() - if f != nil { - return f - } - - // Compute fields without lock. - // Might duplicate effort but won't hold other computations back. - f = typeFields(t) - if f == nil { - f = []field{} - } - - fieldCache.Lock() - if fieldCache.m == nil { - fieldCache.m = map[reflect.Type][]field{} - } - fieldCache.m[t] = f - fieldCache.Unlock() - return f -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.gitattributes b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.gitattributes deleted file mode 100644 index 0cc26ec01..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -testdata/* linguist-vendored diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/FUNDING.yml b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/FUNDING.yml deleted file mode 100644 index 9d5f997fd..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: [mna] -custom: ["https://www.buymeacoffee.com/mna"] diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/dependabot.yml b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/dependabot.yml deleted file mode 100644 index 8723fab53..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: - # Maintain dependencies for Go - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: "daily" diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/workflows/test.yml b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/workflows/test.yml deleted file mode 100644 index c6ca6e721..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.github/workflows/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: test -on: [push, pull_request] - -env: - GOPROXY: https://proxy.golang.org,direct - -jobs: - test: - strategy: - matrix: - go-version: [1.16.x, 1.17.x] - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Test - run: go test ./... -v -cover diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.gitignore b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.gitignore deleted file mode 100644 index 970381cd2..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# editor temporary files -*.sublime-* -.DS_Store -*.swp -#*.*# -tags - -# direnv config -.env* - -# test binaries -*.test - -# coverage and profilte outputs -*.out - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/LICENSE b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/LICENSE deleted file mode 100644 index 25372c2b6..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012-2021, Martin Angers & Contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/README.md b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/README.md deleted file mode 100644 index 775223401..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/README.md +++ /dev/null @@ -1,195 +0,0 @@ -# goquery - a little like that j-thing, only in Go - -[![Build Status](https://github.com/PuerkitoBio/goquery/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/PuerkitoBio/goquery/actions) -[![Go Reference](https://pkg.go.dev/badge/github.com/PuerkitoBio/goquery.svg)](https://pkg.go.dev/github.com/PuerkitoBio/goquery) -[![Sourcegraph Badge](https://sourcegraph.com/github.com/PuerkitoBio/goquery/-/badge.svg)](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge) - -goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...). - -## Table of Contents - -* [Installation](#installation) -* [Changelog](#changelog) -* [API](#api) -* [Examples](#examples) -* [Related Projects](#related-projects) -* [Support](#support) -* [License](#license) - -## Installation - -Please note that because of the net/html dependency, goquery requires Go1.1+ and is tested on Go1.7+. - - $ go get github.com/PuerkitoBio/goquery - -(optional) To run unit tests: - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test - -(optional) To run benchmarks (warning: it runs for a few minutes): - - $ cd $GOPATH/src/github.com/PuerkitoBio/goquery - $ go test -bench=".*" - -## Changelog - -**Note that goquery's API is now stable, and will not break.** - -* **2021-10-25 (v1.8.0)** : Add `Render` function to render a `Selection` to an `io.Writer` (thanks [@anthonygedeon](https://github.com/anthonygedeon)). -* **2021-07-11 (v1.7.1)** : Update go.mod dependencies and add dependabot config (thanks [@jauderho](https://github.com/jauderho)). -* **2021-06-14 (v1.7.0)** : Add `Single` and `SingleMatcher` functions to optimize first-match selection (thanks [@gdollardollar](https://github.com/gdollardollar)). -* **2021-01-11 (v1.6.1)** : Fix panic when calling `{Prepend,Append,Set}Html` on a `Selection` that contains non-Element nodes. -* **2020-10-08 (v1.6.0)** : Parse html in context of the container node for all functions that deal with html strings (`AfterHtml`, `AppendHtml`, etc.). Thanks to [@thiemok][thiemok] and [@davidjwilkins][djw] for their work on this. -* **2020-02-04 (v1.5.1)** : Update module dependencies. -* **2018-11-15 (v1.5.0)** : Go module support (thanks @Zaba505). -* **2018-06-07 (v1.4.1)** : Add `NewDocumentFromReader` examples. -* **2018-03-24 (v1.4.0)** : Deprecate `NewDocument(url)` and `NewDocumentFromResponse(response)`. -* **2018-01-28 (v1.3.0)** : Add `ToEnd` constant to `Slice` until the end of the selection (thanks to @davidjwilkins for raising the issue). -* **2018-01-11 (v1.2.0)** : Add `AddBack*` and deprecate `AndSelf` (thanks to @davidjwilkins). -* **2017-02-12 (v1.1.0)** : Add `SetHtml` and `SetText` (thanks to @glebtv). -* **2016-12-29 (v1.0.2)** : Optimize allocations for `Selection.Text` (thanks to @radovskyb). -* **2016-08-28 (v1.0.1)** : Optimize performance for large documents. -* **2016-07-27 (v1.0.0)** : Tag version 1.0.0. -* **2016-06-15** : Invalid selector strings internally compile to a `Matcher` implementation that never matches any node (instead of a panic). So for example, `doc.Find("~")` returns an empty `*Selection` object. -* **2016-02-02** : Add `NodeName` utility function similar to the DOM's `nodeName` property. It returns the tag name of the first element in a selection, and other relevant values of non-element nodes (see [doc][] for details). Add `OuterHtml` utility function similar to the DOM's `outerHTML` property (named `OuterHtml` in small caps for consistency with the existing `Html` method on the `Selection`). -* **2015-04-20** : Add `AttrOr` helper method to return the attribute's value or a default value if absent. Thanks to [piotrkowalczuk][piotr]. -* **2015-02-04** : Add more manipulation functions - Prepend* - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-28** : Add more manipulation functions - ReplaceWith*, Wrap* and Unwrap - thanks again to [Andrew Stone][thatguystone]. -* **2014-11-07** : Add manipulation functions (thanks to [Andrew Stone][thatguystone]) and `*Matcher` functions, that receive compiled cascadia selectors instead of selector strings, thus avoiding potential panics thrown by goquery via `cascadia.MustCompile` calls. This results in better performance (selectors can be compiled once and reused) and more idiomatic error handling (you can handle cascadia's compilation errors, instead of recovering from panics, which had been bugging me for a long time). Note that the actual type expected is a `Matcher` interface, that `cascadia.Selector` implements. Other matcher implementations could be used. -* **2014-11-06** : Change import paths of net/html to golang.org/x/net/html (see https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA). Make sure to update your code to use the new import path too when you call goquery with `html.Node`s. -* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader. -* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response. -* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility. -* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out). -* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method. -* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases). -* **v0.1.0** : Initial release. - -## API - -goquery exposes two structs, `Document` and `Selection`, and the `Matcher` interface. Unlike jQuery, which is loaded as part of a DOM document, and thus acts on its containing document, goquery doesn't know which HTML document to act upon. So it needs to be told, and that's what the `Document` type is for. It holds the root document node as the initial Selection value to manipulate. - -jQuery often has many variants for the same function (no argument, a selector string argument, a jQuery object argument, a DOM element argument, ...). Instead of exposing the same features in goquery as a single method with variadic empty interface arguments, statically-typed signatures are used following this naming convention: - -* When the jQuery equivalent can be called with no argument, it has the same name as jQuery for the no argument signature (e.g.: `Prev()`), and the version with a selector string argument is called `XxxFiltered()` (e.g.: `PrevFiltered()`) -* When the jQuery equivalent **requires** one argument, the same name as jQuery is used for the selector string version (e.g.: `Is()`) -* The signatures accepting a jQuery object as argument are defined in goquery as `XxxSelection()` and take a `*Selection` object as argument (e.g.: `FilterSelection()`) -* The signatures accepting a DOM element as argument in jQuery are defined in goquery as `XxxNodes()` and take a variadic argument of type `*html.Node` (e.g.: `FilterNodes()`) -* The signatures accepting a function as argument in jQuery are defined in goquery as `XxxFunction()` and take a function as argument (e.g.: `FilterFunction()`) -* The goquery methods that can be called with a selector string have a corresponding version that take a `Matcher` interface and are defined as `XxxMatcher()` (e.g.: `IsMatcher()`) - -Utility functions that are not in jQuery but are useful in Go are implemented as functions (that take a `*Selection` as parameter), to avoid a potential naming clash on the `*Selection`'s methods (reserved for jQuery-equivalent behaviour). - -The complete [package reference documentation can be found here][doc]. - -Please note that Cascadia's selectors do not necessarily match all supported selectors of jQuery (Sizzle). See the [cascadia project][cascadia] for details. Invalid selector strings compile to a `Matcher` that fails to match any node. Behaviour of the various functions that take a selector string as argument follows from that fact, e.g. (where `~` is an invalid selector string): - -* `Find("~")` returns an empty selection because the selector string doesn't match anything. -* `Add("~")` returns a new selection that holds the same nodes as the original selection, because it didn't add any node (selector string didn't match anything). -* `ParentsFiltered("~")` returns an empty selection because the selector string doesn't match anything. -* `ParentsUntil("~")` returns all parents of the selection because the selector string didn't match any element to stop before the top element. - -## Examples - -See some tips and tricks in the [wiki][]. - -Adapted from example_test.go: - -```Go -package main - -import ( - "fmt" - "log" - "net/http" - - "github.com/PuerkitoBio/goquery" -) - -func ExampleScrape() { - // Request the HTML page. - res, err := http.Get("http://metalsucks.net") - if err != nil { - log.Fatal(err) - } - defer res.Body.Close() - if res.StatusCode != 200 { - log.Fatalf("status code error: %d %s", res.StatusCode, res.Status) - } - - // Load the HTML document - doc, err := goquery.NewDocumentFromReader(res.Body) - if err != nil { - log.Fatal(err) - } - - // Find the review items - doc.Find(".left-content article .post-title").Each(func(i int, s *goquery.Selection) { - // For each item found, get the title - title := s.Find("a").Text() - fmt.Printf("Review %d: %s\n", i, title) - }) -} - -func main() { - ExampleScrape() -} -``` - -## Related Projects - -- [Goq][goq], an HTML deserialization and scraping library based on goquery and struct tags. -- [andybalholm/cascadia][cascadia], the CSS selector library used by goquery. -- [suntong/cascadia][cascadiacli], a command-line interface to the cascadia CSS selector library, useful to test selectors. -- [gocolly/colly](https://github.com/gocolly/colly), a lightning fast and elegant Scraping Framework -- [gnulnx/goperf](https://github.com/gnulnx/goperf), a website performance test tool that also fetches static assets. -- [MontFerret/ferret](https://github.com/MontFerret/ferret), declarative web scraping. -- [tacusci/berrycms](https://github.com/tacusci/berrycms), a modern simple to use CMS with easy to write plugins -- [Dataflow kit](https://github.com/slotix/dataflowkit), Web Scraping framework for Gophers. -- [Geziyor](https://github.com/geziyor/geziyor), a fast web crawling & scraping framework for Go. Supports JS rendering. -- [Pagser](https://github.com/foolin/pagser), a simple, easy, extensible, configurable HTML parser to struct based on goquery and struct tags. -- [stitcherd](https://github.com/vhodges/stitcherd), A server for doing server side includes using css selectors and DOM updates. - -## Support - -There are a number of ways you can support the project: - -* Use it, star it, build something with it, spread the word! - - If you do build something open-source or otherwise publicly-visible, let me know so I can add it to the [Related Projects](#related-projects) section! -* Raise issues to improve the project (note: doc typos and clarifications are issues too!) - - Please search existing issues before opening a new one - it may have already been adressed. -* Pull requests: please discuss new code in an issue first, unless the fix is really trivial. - - Make sure new code is tested. - - Be mindful of existing code - PRs that break existing code have a high probability of being declined, unless it fixes a serious issue. -* Sponsor the developer - - See the Github Sponsor button at the top of the repo on github - - or via BuyMeACoffee.com, below - -Buy Me A Coffee - -## License - -The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia's license is [here][caslic]. - -[jquery]: http://jquery.com/ -[go]: http://golang.org/ -[cascadia]: https://github.com/andybalholm/cascadia -[cascadiacli]: https://github.com/suntong/cascadia -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[golic]: http://golang.org/LICENSE -[caslic]: https://github.com/andybalholm/cascadia/blob/master/LICENSE -[doc]: https://pkg.go.dev/github.com/PuerkitoBio/goquery -[index]: http://api.jquery.com/index/ -[gonet]: https://github.com/golang/net/ -[html]: https://pkg.go.dev/golang.org/x/net/html -[wiki]: https://github.com/PuerkitoBio/goquery/wiki/Tips-and-tricks -[thatguystone]: https://github.com/thatguystone -[piotr]: https://github.com/piotrkowalczuk -[goq]: https://github.com/andrewstuart/goq -[thiemok]: https://github.com/thiemok -[djw]: https://github.com/davidjwilkins diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/array.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/array.go deleted file mode 100644 index 1b1f6cbe6..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/array.go +++ /dev/null @@ -1,124 +0,0 @@ -package goquery - -import ( - "golang.org/x/net/html" -) - -const ( - maxUint = ^uint(0) - maxInt = int(maxUint >> 1) - - // ToEnd is a special index value that can be used as end index in a call - // to Slice so that all elements are selected until the end of the Selection. - // It is equivalent to passing (*Selection).Length(). - ToEnd = maxInt -) - -// First reduces the set of matched elements to the first in the set. -// It returns a new Selection object, and an empty Selection object if the -// the selection is empty. -func (s *Selection) First() *Selection { - return s.Eq(0) -} - -// Last reduces the set of matched elements to the last in the set. -// It returns a new Selection object, and an empty Selection object if -// the selection is empty. -func (s *Selection) Last() *Selection { - return s.Eq(-1) -} - -// Eq reduces the set of matched elements to the one at the specified index. -// If a negative index is given, it counts backwards starting at the end of the -// set. It returns a new Selection object, and an empty Selection object if the -// index is invalid. -func (s *Selection) Eq(index int) *Selection { - if index < 0 { - index += len(s.Nodes) - } - - if index >= len(s.Nodes) || index < 0 { - return newEmptySelection(s.document) - } - - return s.Slice(index, index+1) -} - -// Slice reduces the set of matched elements to a subset specified by a range -// of indices. The start index is 0-based and indicates the index of the first -// element to select. The end index is 0-based and indicates the index at which -// the elements stop being selected (the end index is not selected). -// -// The indices may be negative, in which case they represent an offset from the -// end of the selection. -// -// The special value ToEnd may be specified as end index, in which case all elements -// until the end are selected. This works both for a positive and negative start -// index. -func (s *Selection) Slice(start, end int) *Selection { - if start < 0 { - start += len(s.Nodes) - } - if end == ToEnd { - end = len(s.Nodes) - } else if end < 0 { - end += len(s.Nodes) - } - return pushStack(s, s.Nodes[start:end]) -} - -// Get retrieves the underlying node at the specified index. -// Get without parameter is not implemented, since the node array is available -// on the Selection object. -func (s *Selection) Get(index int) *html.Node { - if index < 0 { - index += len(s.Nodes) // Negative index gets from the end - } - return s.Nodes[index] -} - -// Index returns the position of the first element within the Selection object -// relative to its sibling elements. -func (s *Selection) Index() int { - if len(s.Nodes) > 0 { - return newSingleSelection(s.Nodes[0], s.document).PrevAll().Length() - } - return -1 -} - -// IndexSelector returns the position of the first element within the -// Selection object relative to the elements matched by the selector, or -1 if -// not found. -func (s *Selection) IndexSelector(selector string) int { - if len(s.Nodes) > 0 { - sel := s.document.Find(selector) - return indexInSlice(sel.Nodes, s.Nodes[0]) - } - return -1 -} - -// IndexMatcher returns the position of the first element within the -// Selection object relative to the elements matched by the matcher, or -1 if -// not found. -func (s *Selection) IndexMatcher(m Matcher) int { - if len(s.Nodes) > 0 { - sel := s.document.FindMatcher(m) - return indexInSlice(sel.Nodes, s.Nodes[0]) - } - return -1 -} - -// IndexOfNode returns the position of the specified node within the Selection -// object, or -1 if not found. -func (s *Selection) IndexOfNode(node *html.Node) int { - return indexInSlice(s.Nodes, node) -} - -// IndexOfSelection returns the position of the first node in the specified -// Selection object within this Selection object, or -1 if not found. -func (s *Selection) IndexOfSelection(sel *Selection) int { - if sel != nil && len(sel.Nodes) > 0 { - return indexInSlice(s.Nodes, sel.Nodes[0]) - } - return -1 -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/array_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/array_test.go deleted file mode 100644 index 7857b38fb..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/array_test.go +++ /dev/null @@ -1,234 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestFirst(t *testing.T) { - sel := Doc().Find(".pvk-content").First() - assertLength(t, sel.Nodes, 1) -} - -func TestFirstEmpty(t *testing.T) { - sel := Doc().Find(".pvk-zzcontentzz").First() - assertLength(t, sel.Nodes, 0) -} - -func TestFirstInvalid(t *testing.T) { - sel := Doc().Find("").First() - assertLength(t, sel.Nodes, 0) -} - -func TestFirstRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.First().End() - assertEqual(t, sel, sel2) -} - -func TestLast(t *testing.T) { - sel := Doc().Find(".pvk-content").Last() - assertLength(t, sel.Nodes, 1) - - // Should contain Footer - foot := Doc().Find(".footer") - if !sel.Contains(foot.Nodes[0]) { - t.Error("Last .pvk-content should contain .footer.") - } -} - -func TestLastEmpty(t *testing.T) { - sel := Doc().Find(".pvk-zzcontentzz").Last() - assertLength(t, sel.Nodes, 0) -} - -func TestLastInvalid(t *testing.T) { - sel := Doc().Find("").Last() - assertLength(t, sel.Nodes, 0) -} - -func TestLastRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Last().End() - assertEqual(t, sel, sel2) -} - -func TestEq(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(1) - assertLength(t, sel.Nodes, 1) -} - -func TestEqNegative(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(-1) - assertLength(t, sel.Nodes, 1) - - // Should contain Footer - foot := Doc().Find(".footer") - if !sel.Contains(foot.Nodes[0]) { - t.Error("Index -1 of .pvk-content should contain .footer.") - } -} - -func TestEqEmpty(t *testing.T) { - sel := Doc().Find("something_random_that_does_not_exists").Eq(0) - assertLength(t, sel.Nodes, 0) -} - -func TestEqInvalid(t *testing.T) { - sel := Doc().Find("").Eq(0) - assertLength(t, sel.Nodes, 0) -} - -func TestEqInvalidPositive(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(3) - assertLength(t, sel.Nodes, 0) -} - -func TestEqInvalidNegative(t *testing.T) { - sel := Doc().Find(".pvk-content").Eq(-4) - assertLength(t, sel.Nodes, 0) -} - -func TestEqRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Eq(1).End() - assertEqual(t, sel, sel2) -} - -func TestSlice(t *testing.T) { - sel := Doc().Find(".pvk-content").Slice(0, 2) - - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#pc1", "#pc2") -} - -func TestSliceToEnd(t *testing.T) { - sel := Doc().Find(".pvk-content").Slice(1, ToEnd) - - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel.Eq(0), "#pc2") - if _, ok := sel.Eq(1).Attr("id"); ok { - t.Error("Want no attribute ID, got one") - } -} - -func TestSliceEmpty(t *testing.T) { - defer assertPanic(t) - Doc().Find("x").Slice(0, 2) -} - -func TestSliceInvalid(t *testing.T) { - defer assertPanic(t) - Doc().Find("").Slice(0, 2) -} - -func TestSliceInvalidToEnd(t *testing.T) { - defer assertPanic(t) - Doc().Find("").Slice(2, ToEnd) -} - -func TestSliceOutOfBounds(t *testing.T) { - defer assertPanic(t) - Doc().Find(".pvk-content").Slice(2, 12) -} - -func TestNegativeSliceStart(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(-2, 3) - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel.Eq(0), "#cf3") -} - -func TestNegativeSliceEnd(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(1, -1) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel.Eq(0), "#cf2") - assertSelectionIs(t, sel.Eq(1), "#cf3") -} - -func TestNegativeSliceBoth(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(-3, -1) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel.Eq(0), "#cf2") - assertSelectionIs(t, sel.Eq(1), "#cf3") -} - -func TestNegativeSliceToEnd(t *testing.T) { - sel := Doc().Find(".container-fluid").Slice(-3, ToEnd) - assertLength(t, sel.Nodes, 3) - assertSelectionIs(t, sel, "#cf2", "#cf3", "#cf4") -} - -func TestNegativeSliceOutOfBounds(t *testing.T) { - defer assertPanic(t) - Doc().Find(".container-fluid").Slice(-12, -7) -} - -func TestSliceRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Slice(0, 2).End() - assertEqual(t, sel, sel2) -} - -func TestGet(t *testing.T) { - sel := Doc().Find(".pvk-content") - node := sel.Get(1) - if sel.Nodes[1] != node { - t.Errorf("Expected node %v to be %v.", node, sel.Nodes[1]) - } -} - -func TestGetNegative(t *testing.T) { - sel := Doc().Find(".pvk-content") - node := sel.Get(-3) - if sel.Nodes[0] != node { - t.Errorf("Expected node %v to be %v.", node, sel.Nodes[0]) - } -} - -func TestGetInvalid(t *testing.T) { - defer assertPanic(t) - sel := Doc().Find(".pvk-content") - sel.Get(129) -} - -func TestIndex(t *testing.T) { - sel := Doc().Find(".pvk-content") - if i := sel.Index(); i != 1 { - t.Errorf("Expected index of 1, got %v.", i) - } -} - -func TestIndexSelector(t *testing.T) { - sel := Doc().Find(".hero-unit") - if i := sel.IndexSelector("div"); i != 4 { - t.Errorf("Expected index of 4, got %v.", i) - } -} - -func TestIndexSelectorInvalid(t *testing.T) { - sel := Doc().Find(".hero-unit") - if i := sel.IndexSelector(""); i != -1 { - t.Errorf("Expected index of -1, got %v.", i) - } -} - -func TestIndexOfNode(t *testing.T) { - sel := Doc().Find("div.pvk-gutter") - if i := sel.IndexOfNode(sel.Nodes[1]); i != 1 { - t.Errorf("Expected index of 1, got %v.", i) - } -} - -func TestIndexOfNilNode(t *testing.T) { - sel := Doc().Find("div.pvk-gutter") - if i := sel.IndexOfNode(nil); i != -1 { - t.Errorf("Expected index of -1, got %v.", i) - } -} - -func TestIndexOfSelection(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find(".hero-unit") - if i := sel.IndexOfSelection(sel2); i != 4 { - t.Errorf("Expected index of 4, got %v.", i) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.0 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.0 deleted file mode 100644 index eb5847831..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.0 +++ /dev/null @@ -1,436 +0,0 @@ -PASS -BenchmarkFirst 20000000 92.9 ns/op -BenchmarkLast 20000000 91.6 ns/op -BenchmarkEq 20000000 90.6 ns/op -BenchmarkSlice 20000000 86.7 ns/op -BenchmarkGet 1000000000 2.14 ns/op -BenchmarkIndex 500000 5308 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 50000 54962 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 11.4 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 12.1 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 5000 327144 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 50000 52945 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 205 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 203 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2639 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 50000 30182 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 34855 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 66052 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 69721 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 66077 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 80021 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 66256 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 79568 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 569441 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 230585 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 231470 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.65 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9558 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 16809 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 37.5 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18583 ns/op -BenchmarkLength 2000000000 0.80 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 666 ns/op -BenchmarkIs 50000 34328 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 50000 32423 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2707 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 66976 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 66740 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 701722 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.9 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 50000 55444 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 10000 127984 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 355944 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 355596 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 500000 5656 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 200000 9007 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 1000000 1237 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 5613 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 47026 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 51438 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 91820 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 95156 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 10000 134383 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 235456 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 235936 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 50000 32451 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 50000 30570 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 50000 30729 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 10000 106704 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 10000 115592 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 50000 54449 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 50000 58503 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 20000 77698 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 20000 85034 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 50000 56458 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 50000 60163 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 50000 47679 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 50000 51563 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 10000 213998 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 10000 140720 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 20000 90702 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 5000 456039 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 10000 167944 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 20000 82059 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 10000 150883 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 10000 146578 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 10000 148284 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 10000 154303 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 10000 149062 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 10000 150584 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -ok github.com/PuerkitoBio/goquery 188.326s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.1 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.1 deleted file mode 100644 index c0d9d06c1..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.1 +++ /dev/null @@ -1,438 +0,0 @@ -PASS -BenchmarkFirst 20000000 96.2 ns/op -BenchmarkLast 20000000 95.8 ns/op -BenchmarkEq 20000000 94.4 ns/op -BenchmarkSlice 20000000 89.9 ns/op -BenchmarkGet 1000000000 2.31 ns/op -BenchmarkIndex 1000000 1911 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 50000 56034 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 11.8 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 12.1 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 5000 336823 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 50000 54709 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 209 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 202 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2634 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 50000 31049 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 35167 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 68974 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 74760 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 68670 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 81357 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 68388 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 82108 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 582934 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 241602 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 243612 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.14 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9848 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 17569 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 37.6 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 19345 ns/op -BenchmarkLength 2000000000 0.80 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 688 ns/op -BenchmarkIs 50000 35061 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 50000 32789 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2816 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 68272 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 68107 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 709386 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 12.4 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 50000 56342 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 10000 131878 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 374240 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 374447 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 200000 9721 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 200000 12909 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 1000000 1869 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 5941 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 46223 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 51452 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 93967 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 97617 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 10000 138898 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 247817 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 246055 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 50000 33201 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 50000 31486 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 50000 31754 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 20000 94749 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 10000 103926 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 50000 33782 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 50000 37108 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 64769 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 71050 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 50000 33908 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 50000 37353 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 50000 31056 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 50000 34286 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 10000 202553 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 20000 98693 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 50000 45532 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 5000 454378 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 10000 123594 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 50000 37509 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 10000 109317 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 10000 105959 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 10000 107132 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 10000 114474 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 10000 107592 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 10000 107495 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -ok github.com/PuerkitoBio/goquery 187.652s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.1-v0.2.1-go1.1rc1.svg b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.1-v0.2.1-go1.1rc1.svg deleted file mode 100644 index 849a70b79..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.1.1-v0.2.1-go1.1rc1.svg +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - -+0.10% - -BenchmarkFirst - - --0.10% - -BenchmarkLast - - -+2.86% - -BenchmarkEq - - -+2.67% - -BenchmarkSlice - - --10.82% - -BenchmarkGet - - --44.06% - -BenchmarkIndex - - --52.26% - -BenchmarkIndexSelector - - --9.32% - -BenchmarkIndexOfNode - - --2.48% - -BenchmarkIndexOfSelection - - --34.96% - -BenchmarkMetalReviewExample - - --59.16% - -BenchmarkAdd - - -+0.00% - -BenchmarkAddSelection - - -+3.47% - -BenchmarkAddNodes - - --2.51% - -BenchmarkAndSelf - - --13.96% - -BenchmarkFilter - - --14.53% - -BenchmarkNot - - --3.81% - -BenchmarkFilterFunction - - --2.83% - -BenchmarkNotFunction - - --4.63% - -BenchmarkFilterNodes - - --2.32% - -BenchmarkNotNodes - - --4.23% - -BenchmarkFilterSelection - - --3.31% - -BenchmarkNotSelection - - --33.69% - -BenchmarkHas - - --4.53% - -BenchmarkHasNodes - - --5.30% - -BenchmarkHasSelection - - -+11.35% - -BenchmarkEnd - - --3.33% - -BenchmarkEach - - --9.16% - -BenchmarkMap - - --19.15% - -BenchmarkAttr - - --3.24% - -BenchmarkText - - --61.25% - -BenchmarkLength - - --11.92% - -BenchmarkHtml - - --16.46% - -BenchmarkIs - - --27.31% - -BenchmarkIsPositional - - --13.49% - -BenchmarkIsFunction - - --1.71% - -BenchmarkIsSelection - - --3.03% - -BenchmarkIsNodes - - --20.30% - -BenchmarkHasClass - - --11.29% - -BenchmarkContains - - --50.88% - -BenchmarkFind - - --45.28% - -BenchmarkFindWithinSelection - - -+22.95% - -BenchmarkFindSelection - - -+22.68% - -BenchmarkFindNodes - - --65.08% - -BenchmarkContents - - --59.77% - -BenchmarkContentsFiltered - - --64.31% - -BenchmarkChildren - - --39.56% - -BenchmarkChildrenFiltered - - --6.61% - -BenchmarkParent - - --10.92% - -BenchmarkParentFiltered - - --1.72% - -BenchmarkParents - - --2.37% - -BenchmarkParentsFiltered - - --47.60% - -BenchmarkParentsUntil - - --36.39% - -BenchmarkParentsUntilSelection - - --35.99% - -BenchmarkParentsUntilNodes - - --48.84% - -BenchmarkParentsFilteredUntil - - --32.75% - -BenchmarkParentsFilteredUntilSelection - - --33.12% - -BenchmarkParentsFilteredUntilNodes - - --29.78% - -BenchmarkSiblings - - --30.89% - -BenchmarkSiblingsFiltered - - --68.19% - -BenchmarkNext - - --66.59% - -BenchmarkNextFiltered - - --31.08% - -BenchmarkNextAll - - --30.03% - -BenchmarkNextAllFiltered - - --68.32% - -BenchmarkPrev - - --66.65% - -BenchmarkPrevFiltered - - --43.33% - -BenchmarkPrevAll - - --43.24% - -BenchmarkPrevAllFiltered - - --54.27% - -BenchmarkNextUntil - - --37.90% - -BenchmarkNextUntilSelection - - --43.21% - -BenchmarkNextUntilNodes - - --49.33% - -BenchmarkPrevUntil - - --37.02% - -BenchmarkPrevUntilSelection - - --44.59% - -BenchmarkPrevUntilNodes - - --57.79% - -BenchmarkNextFilteredUntil - - --36.61% - -BenchmarkNextFilteredUntilSelection - - --37.81% - -BenchmarkNextFilteredUntilNodes - - --59.21% - -BenchmarkPrevFilteredUntil - - --36.20% - -BenchmarkPrevFilteredUntilSelection - - --36.05% - -BenchmarkPrevFilteredUntilNodes - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.0 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.0 deleted file mode 100644 index 3ea8dcb19..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.0 +++ /dev/null @@ -1,459 +0,0 @@ -PASS -BenchmarkFirst 20000000 94.3 ns/op -BenchmarkLast 20000000 94.7 ns/op -BenchmarkEq 20000000 93.7 ns/op -BenchmarkSlice 20000000 89.9 ns/op -BenchmarkGet 1000000000 2.72 ns/op -BenchmarkIndex 1000000 1834 ns/op ---- BENCH: BenchmarkIndex -bench_array_test.go:73: Index=3 -bench_array_test.go:73: Index=3 -bench_array_test.go:73: Index=3 -bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 50000 53958 ns/op ---- BENCH: BenchmarkIndexSelector -bench_array_test.go:85: IndexSelector=4 -bench_array_test.go:85: IndexSelector=4 -bench_array_test.go:85: IndexSelector=4 -bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.1 ns/op ---- BENCH: BenchmarkIndexOfNode -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 10.9 ns/op ---- BENCH: BenchmarkIndexOfSelection -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 5000 326712 ns/op ---- BENCH: BenchmarkMetalReviewExample -bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 -bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 50000 51776 ns/op ---- BENCH: BenchmarkAdd -bench_expand_test.go:20: Add=43 -bench_expand_test.go:20: Add=43 -bench_expand_test.go:20: Add=43 -bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 196 ns/op ---- BENCH: BenchmarkAddSelection -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 191 ns/op ---- BENCH: BenchmarkAddNodes -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2495 ns/op ---- BENCH: BenchmarkAndSelf -bench_expand_test.go:71: AndSelf=44 -bench_expand_test.go:71: AndSelf=44 -bench_expand_test.go:71: AndSelf=44 -bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 50000 30974 ns/op ---- BENCH: BenchmarkFilter -bench_filter_test.go:20: Filter=13 -bench_filter_test.go:20: Filter=13 -bench_filter_test.go:20: Filter=13 -bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 35322 ns/op ---- BENCH: BenchmarkNot -bench_filter_test.go:36: Not=371 -bench_filter_test.go:36: Not=371 -bench_filter_test.go:36: Not=371 -bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 65644 ns/op ---- BENCH: BenchmarkFilterFunction -bench_filter_test.go:55: FilterFunction=112 -bench_filter_test.go:55: FilterFunction=112 -bench_filter_test.go:55: FilterFunction=112 -bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 69245 ns/op ---- BENCH: BenchmarkNotFunction -bench_filter_test.go:74: NotFunction=261 -bench_filter_test.go:74: NotFunction=261 -bench_filter_test.go:74: NotFunction=261 -bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 64824 ns/op ---- BENCH: BenchmarkFilterNodes -bench_filter_test.go:92: FilterNodes=2 -bench_filter_test.go:92: FilterNodes=2 -bench_filter_test.go:92: FilterNodes=2 -bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 76247 ns/op ---- BENCH: BenchmarkNotNodes -bench_filter_test.go:110: NotNodes=360 -bench_filter_test.go:110: NotNodes=360 -bench_filter_test.go:110: NotNodes=360 -bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 66154 ns/op ---- BENCH: BenchmarkFilterSelection -bench_filter_test.go:127: FilterSelection=2 -bench_filter_test.go:127: FilterSelection=2 -bench_filter_test.go:127: FilterSelection=2 -bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 76336 ns/op ---- BENCH: BenchmarkNotSelection -bench_filter_test.go:144: NotSelection=360 -bench_filter_test.go:144: NotSelection=360 -bench_filter_test.go:144: NotSelection=360 -bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 569495 ns/op ---- BENCH: BenchmarkHas -bench_filter_test.go:160: Has=13 -bench_filter_test.go:160: Has=13 -bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 227059 ns/op ---- BENCH: BenchmarkHasNodes -bench_filter_test.go:178: HasNodes=15 -bench_filter_test.go:178: HasNodes=15 -bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 227167 ns/op ---- BENCH: BenchmarkHasSelection -bench_filter_test.go:195: HasSelection=15 -bench_filter_test.go:195: HasSelection=15 -bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 3.99 ns/op ---- BENCH: BenchmarkEnd -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9354 ns/op ---- BENCH: BenchmarkEach -bench_iteration_test.go:22: Each=59 -bench_iteration_test.go:22: Each=59 -bench_iteration_test.go:22: Each=59 -bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 16557 ns/op ---- BENCH: BenchmarkMap -bench_iteration_test.go:41: Map=59 -bench_iteration_test.go:41: Map=59 -bench_iteration_test.go:41: Map=59 -bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 36.4 ns/op ---- BENCH: BenchmarkAttr -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18473 ns/op -BenchmarkLength 2000000000 0.76 ns/op ---- BENCH: BenchmarkLength -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 666 ns/op -BenchmarkIs 50000 35174 ns/op ---- BENCH: BenchmarkIs -bench_query_test.go:16: Is=true -bench_query_test.go:16: Is=true -bench_query_test.go:16: Is=true -bench_query_test.go:16: Is=true -BenchmarkIsPositional 50000 31814 ns/op ---- BENCH: BenchmarkIsPositional -bench_query_test.go:28: IsPositional=true -bench_query_test.go:28: IsPositional=true -bench_query_test.go:28: IsPositional=true -bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2754 ns/op ---- BENCH: BenchmarkIsFunction -bench_query_test.go:43: IsFunction=true -bench_query_test.go:43: IsFunction=true -bench_query_test.go:43: IsFunction=true -bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 66260 ns/op ---- BENCH: BenchmarkIsSelection -bench_query_test.go:56: IsSelection=true -bench_query_test.go:56: IsSelection=true -bench_query_test.go:56: IsSelection=true -bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 64682 ns/op ---- BENCH: BenchmarkIsNodes -bench_query_test.go:70: IsNodes=true -bench_query_test.go:70: IsNodes=true -bench_query_test.go:70: IsNodes=true -bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 672953 ns/op ---- BENCH: BenchmarkHasClass -bench_query_test.go:82: HasClass=true -bench_query_test.go:82: HasClass=true -bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.3 ns/op ---- BENCH: BenchmarkContains -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -bench_query_test.go:96: Contains=true -BenchmarkFind 50000 53780 ns/op ---- BENCH: BenchmarkFind -bench_traversal_test.go:18: Find=41 -bench_traversal_test.go:18: Find=41 -bench_traversal_test.go:18: Find=41 -bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 10000 125963 ns/op ---- BENCH: BenchmarkFindWithinSelection -bench_traversal_test.go:34: FindWithinSelection=39 -bench_traversal_test.go:34: FindWithinSelection=39 -bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 357318 ns/op ---- BENCH: BenchmarkFindSelection -bench_traversal_test.go:51: FindSelection=73 -bench_traversal_test.go:51: FindSelection=73 -bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 357587 ns/op ---- BENCH: BenchmarkFindNodes -bench_traversal_test.go:69: FindNodes=73 -bench_traversal_test.go:69: FindNodes=73 -bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 200000 9135 ns/op ---- BENCH: BenchmarkContents -bench_traversal_test.go:85: Contents=16 -bench_traversal_test.go:85: Contents=16 -bench_traversal_test.go:85: Contents=16 -bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 200000 12383 ns/op ---- BENCH: BenchmarkContentsFiltered -bench_traversal_test.go:101: ContentsFiltered=1 -bench_traversal_test.go:101: ContentsFiltered=1 -bench_traversal_test.go:101: ContentsFiltered=1 -bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 1000000 1809 ns/op ---- BENCH: BenchmarkChildren -bench_traversal_test.go:117: Children=2 -bench_traversal_test.go:117: Children=2 -bench_traversal_test.go:117: Children=2 -bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 5814 ns/op ---- BENCH: BenchmarkChildrenFiltered -bench_traversal_test.go:133: ChildrenFiltered=2 -bench_traversal_test.go:133: ChildrenFiltered=2 -bench_traversal_test.go:133: ChildrenFiltered=2 -bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 44810 ns/op ---- BENCH: BenchmarkParent -bench_traversal_test.go:149: Parent=55 -bench_traversal_test.go:149: Parent=55 -bench_traversal_test.go:149: Parent=55 -bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 48795 ns/op ---- BENCH: BenchmarkParentFiltered -bench_traversal_test.go:165: ParentFiltered=4 -bench_traversal_test.go:165: ParentFiltered=4 -bench_traversal_test.go:165: ParentFiltered=4 -bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 89102 ns/op ---- BENCH: BenchmarkParents -bench_traversal_test.go:181: Parents=73 -bench_traversal_test.go:181: Parents=73 -bench_traversal_test.go:181: Parents=73 -bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 93953 ns/op ---- BENCH: BenchmarkParentsFiltered -bench_traversal_test.go:197: ParentsFiltered=18 -bench_traversal_test.go:197: ParentsFiltered=18 -bench_traversal_test.go:197: ParentsFiltered=18 -bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 10000 130783 ns/op ---- BENCH: BenchmarkParentsUntil -bench_traversal_test.go:213: ParentsUntil=52 -bench_traversal_test.go:213: ParentsUntil=52 -bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 231797 ns/op ---- BENCH: BenchmarkParentsUntilSelection -bench_traversal_test.go:230: ParentsUntilSelection=70 -bench_traversal_test.go:230: ParentsUntilSelection=70 -bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 233761 ns/op ---- BENCH: BenchmarkParentsUntilNodes -bench_traversal_test.go:248: ParentsUntilNodes=70 -bench_traversal_test.go:248: ParentsUntilNodes=70 -bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 50000 31360 ns/op ---- BENCH: BenchmarkParentsFilteredUntil -bench_traversal_test.go:264: ParentsFilteredUntil=2 -bench_traversal_test.go:264: ParentsFilteredUntil=2 -bench_traversal_test.go:264: ParentsFilteredUntil=2 -bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 50000 30272 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 50000 30327 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 20000 89862 ns/op ---- BENCH: BenchmarkSiblings -bench_traversal_test.go:315: Siblings=293 -bench_traversal_test.go:315: Siblings=293 -bench_traversal_test.go:315: Siblings=293 -bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 20000 97948 ns/op ---- BENCH: BenchmarkSiblingsFiltered -bench_traversal_test.go:331: SiblingsFiltered=46 -bench_traversal_test.go:331: SiblingsFiltered=46 -bench_traversal_test.go:331: SiblingsFiltered=46 -bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 50000 31975 ns/op ---- BENCH: BenchmarkNext -bench_traversal_test.go:347: Next=49 -bench_traversal_test.go:347: Next=49 -bench_traversal_test.go:347: Next=49 -bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 50000 34887 ns/op ---- BENCH: BenchmarkNextFiltered -bench_traversal_test.go:363: NextFiltered=6 -bench_traversal_test.go:363: NextFiltered=6 -bench_traversal_test.go:363: NextFiltered=6 -bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 60734 ns/op ---- BENCH: BenchmarkNextAll -bench_traversal_test.go:379: NextAll=234 -bench_traversal_test.go:379: NextAll=234 -bench_traversal_test.go:379: NextAll=234 -bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 67428 ns/op ---- BENCH: BenchmarkNextAllFiltered -bench_traversal_test.go:395: NextAllFiltered=33 -bench_traversal_test.go:395: NextAllFiltered=33 -bench_traversal_test.go:395: NextAllFiltered=33 -bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 50000 32399 ns/op ---- BENCH: BenchmarkPrev -bench_traversal_test.go:411: Prev=49 -bench_traversal_test.go:411: Prev=49 -bench_traversal_test.go:411: Prev=49 -bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 50000 34944 ns/op ---- BENCH: BenchmarkPrevFiltered -bench_traversal_test.go:429: PrevFiltered=7 -bench_traversal_test.go:429: PrevFiltered=7 -bench_traversal_test.go:429: PrevFiltered=7 -bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 29360 ns/op ---- BENCH: BenchmarkPrevAll -bench_traversal_test.go:445: PrevAll=78 -bench_traversal_test.go:445: PrevAll=78 -bench_traversal_test.go:445: PrevAll=78 -bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 50000 32291 ns/op ---- BENCH: BenchmarkPrevAllFiltered -bench_traversal_test.go:461: PrevAllFiltered=6 -bench_traversal_test.go:461: PrevAllFiltered=6 -bench_traversal_test.go:461: PrevAllFiltered=6 -bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 10000 191890 ns/op ---- BENCH: BenchmarkNextUntil -bench_traversal_test.go:477: NextUntil=84 -bench_traversal_test.go:477: NextUntil=84 -bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 20000 92054 ns/op ---- BENCH: BenchmarkNextUntilSelection -bench_traversal_test.go:494: NextUntilSelection=42 -bench_traversal_test.go:494: NextUntilSelection=42 -bench_traversal_test.go:494: NextUntilSelection=42 -bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 50000 43401 ns/op ---- BENCH: BenchmarkNextUntilNodes -bench_traversal_test.go:512: NextUntilNodes=12 -bench_traversal_test.go:512: NextUntilNodes=12 -bench_traversal_test.go:512: NextUntilNodes=12 -bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 5000 433383 ns/op ---- BENCH: BenchmarkPrevUntil -bench_traversal_test.go:528: PrevUntil=238 -bench_traversal_test.go:528: PrevUntil=238 -bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 10000 116423 ns/op ---- BENCH: BenchmarkPrevUntilSelection -bench_traversal_test.go:545: PrevUntilSelection=49 -bench_traversal_test.go:545: PrevUntilSelection=49 -bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 50000 35338 ns/op ---- BENCH: BenchmarkPrevUntilNodes -bench_traversal_test.go:563: PrevUntilNodes=11 -bench_traversal_test.go:563: PrevUntilNodes=11 -bench_traversal_test.go:563: PrevUntilNodes=11 -bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 10000 104686 ns/op ---- BENCH: BenchmarkNextFilteredUntil -bench_traversal_test.go:579: NextFilteredUntil=22 -bench_traversal_test.go:579: NextFilteredUntil=22 -bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 20000 99485 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 20000 99452 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 10000 112640 ns/op ---- BENCH: BenchmarkPrevFilteredUntil -bench_traversal_test.go:630: PrevFilteredUntil=20 -bench_traversal_test.go:630: PrevFilteredUntil=20 -bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 10000 103702 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection -bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 10000 103277 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes -bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 6530 ns/op ---- BENCH: BenchmarkClosest -bench_traversal_test.go:681: Closest=2 -bench_traversal_test.go:681: Closest=2 -bench_traversal_test.go:681: Closest=2 -bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 1000000 1135 ns/op ---- BENCH: BenchmarkClosestSelection -bench_traversal_test.go:698: ClosestSelection=2 -bench_traversal_test.go:698: ClosestSelection=2 -bench_traversal_test.go:698: ClosestSelection=2 -bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 1000000 1133 ns/op ---- BENCH: BenchmarkClosestNodes -bench_traversal_test.go:715: ClosestNodes=2 -bench_traversal_test.go:715: ClosestNodes=2 -bench_traversal_test.go:715: ClosestNodes=2 -bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 192.541s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.0-v0.2.1-go1.1rc1.svg b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.0-v0.2.1-go1.1rc1.svg deleted file mode 100644 index eaabc618b..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.0-v0.2.1-go1.1rc1.svg +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - - -+2.12% - -BenchmarkFirst - - -+1.06% - -BenchmarkLast - - -+3.63% - -BenchmarkEq - - -+2.67% - -BenchmarkSlice - - --24.26% - -BenchmarkGet - - --41.71% - -BenchmarkIndex - - --50.42% - -BenchmarkIndexSelector - - -+5.94% - -BenchmarkIndexOfNode - - -+8.26% - -BenchmarkIndexOfSelection - - --32.94% - -BenchmarkMetalReviewExample - - --56.84% - -BenchmarkAdd - - -+6.63% - -BenchmarkAddSelection - - -+9.42% - -BenchmarkAddNodes - - -+2.93% - -BenchmarkAndSelf - - --13.75% - -BenchmarkFilter - - --14.90% - -BenchmarkNot - - -+1.07% - -BenchmarkFilterFunction - - -+4.91% - -BenchmarkNotFunction - - -+1.03% - -BenchmarkFilterNodes - - -+4.22% - -BenchmarkNotNodes - - --1.00% - -BenchmarkFilterSelection - - -+4.00% - -BenchmarkNotSelection - - --32.12% - -BenchmarkHas - - -+1.59% - -BenchmarkHasNodes - - -+1.56% - -BenchmarkHasSelection - - -+15.54% - -BenchmarkEnd - - -+1.77% - -BenchmarkEach - - --3.61% - -BenchmarkMap - - --16.48% - -BenchmarkAttr - - -+1.33% - -BenchmarkText - - --59.21% - -BenchmarkLength - - --9.01% - -BenchmarkHtml - - --16.73% - -BenchmarkIs - - --25.08% - -BenchmarkIsPositional - - --11.55% - -BenchmarkIsFunction - - -+1.28% - -BenchmarkIsSelection - - -+2.10% - -BenchmarkIsNodes - - --15.99% - -BenchmarkHasClass - - --2.65% - -BenchmarkContains - - --48.54% - -BenchmarkFind - - --42.71% - -BenchmarkFindWithinSelection - - -+28.77% - -BenchmarkFindSelection - - -+28.47% - -BenchmarkFindNodes - - --62.84% - -BenchmarkContents - - --58.06% - -BenchmarkContentsFiltered - - --63.13% - -BenchmarkChildren - - --38.24% - -BenchmarkChildrenFiltered - - --3.66% - -BenchmarkParent - - --6.06% - -BenchmarkParentFiltered - - -+3.64% - -BenchmarkParents - - -+1.44% - -BenchmarkParentsFiltered - - --44.35% - -BenchmarkParentsUntil - - --31.99% - -BenchmarkParentsUntilSelection - - --32.62% - -BenchmarkParentsUntilNodes - - --45.83% - -BenchmarkParentsFilteredUntil - - --30.05% - -BenchmarkParentsFilteredUntilSelection - - --29.97% - -BenchmarkParentsFilteredUntilNodes - - --25.96% - -BenchmarkSiblings - - --26.67% - -BenchmarkSiblingsFiltered - - --66.40% - -BenchmarkNext - - --64.46% - -BenchmarkNextFiltered - - --26.50% - -BenchmarkNextAll - - --26.27% - -BenchmarkNextAllFiltered - - --66.84% - -BenchmarkPrev - - --64.35% - -BenchmarkPrevFiltered - - --40.05% - -BenchmarkPrevAll - - --39.74% - -BenchmarkPrevAllFiltered - - --51.73% - -BenchmarkNextUntil - - --33.42% - -BenchmarkNextUntilSelection - - --40.42% - -BenchmarkNextUntilNodes - - --46.87% - -BenchmarkPrevUntil - - --33.14% - -BenchmarkPrevUntilSelection - - --41.19% - -BenchmarkPrevUntilNodes - - --55.92% - -BenchmarkNextFilteredUntil - - --32.49% - -BenchmarkNextFilteredUntilSelection - - --33.00% - -BenchmarkNextFilteredUntilNodes - - --58.54% - -BenchmarkPrevFilteredUntil - - --33.80% - -BenchmarkPrevFilteredUntilSelection - - --33.44% - -BenchmarkPrevFilteredUntilNodes - - --24.82% - -BenchmarkClosest - - --34.45% - -BenchmarkClosestSelection - - --35.30% - -BenchmarkClosestNodes - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.1-go1.1rc1 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.1-go1.1rc1 deleted file mode 100644 index 1f2a426d3..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.2.1-go1.1rc1 +++ /dev/null @@ -1,470 +0,0 @@ -PASS -BenchmarkFirst 20000000 96.3 ns/op -BenchmarkLast 20000000 95.7 ns/op -BenchmarkEq 20000000 97.1 ns/op -BenchmarkSlice 20000000 92.3 ns/op -BenchmarkGet 1000000000 2.06 ns/op -BenchmarkIndex 1000000 1069 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 26750 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.7 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.8 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 219078 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 22345 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 209 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 209 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2568 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 26715 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 30058 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 66346 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 72646 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 65493 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 79466 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 65494 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 79387 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 386571 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 230664 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 230705 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.61 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9520 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 15960 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkAttr 50000000 30.4 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18718 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 606 ns/op -BenchmarkIs 100000 29289 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23834 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2436 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 67106 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 66042 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 565347 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.0 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 27677 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 72162 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 460124 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 459390 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 500000 3395 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 5193 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 667 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3591 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 43168 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 45836 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 92348 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 95306 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 72782 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 157639 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 157510 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 16987 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 21174 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 21238 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 66536 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 71822 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 10745 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 12399 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 44640 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 49713 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 10743 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 12456 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 17600 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 19460 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 92630 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 61285 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 25859 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 230236 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 20000 77837 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 20784 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 46147 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 67164 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 66628 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 46697 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 68646 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 68745 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4909 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 744 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 733 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 220.793s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.0 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.0 deleted file mode 100644 index 037c9a9d2..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.0 +++ /dev/null @@ -1,476 +0,0 @@ -PASS -BenchmarkFirst 20000000 95.5 ns/op -BenchmarkLast 20000000 94.9 ns/op -BenchmarkEq 20000000 95.7 ns/op -BenchmarkSlice 20000000 91.7 ns/op -BenchmarkGet 1000000000 2.05 ns/op -BenchmarkIndex 1000000 1079 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 26972 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.8 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.7 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 213800 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 21811 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 205 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 202 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2467 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 25643 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 100000 29566 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 66894 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 72183 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 65516 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 20000 78880 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 65232 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 20000 78813 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 388834 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 228552 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 228365 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.62 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 9548 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 15900 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1650 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 30.5 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 100000 18873 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 616 ns/op -BenchmarkIs 100000 29499 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23733 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2404 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 65376 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 65322 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 558933 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.1 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 27841 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 72096 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 457349 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 459324 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 500000 3435 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 5241 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 667 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3639 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 44867 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 46476 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 92559 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 96142 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 73931 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 159820 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 158811 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 17203 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 21358 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 21338 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 66463 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 72503 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 10881 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 12588 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 45075 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 50455 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 10933 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 12579 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 17751 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 19702 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 93586 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 61155 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 25805 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 232225 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 20000 78316 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 20657 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 46567 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 67227 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 66995 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 47361 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 68802 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 68928 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4922 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 738 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 737 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 224.003s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2 deleted file mode 100644 index 0a8704c86..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2 +++ /dev/null @@ -1,478 +0,0 @@ -PASS -BenchmarkFirst 20000000 88.4 ns/op -BenchmarkLast 20000000 88.2 ns/op -BenchmarkEq 20000000 87.4 ns/op -BenchmarkSlice 20000000 84.9 ns/op -BenchmarkGet 2000000000 1.99 ns/op -BenchmarkIndex 2000000 906 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 22276 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 200000000 9.72 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 10.4 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 199277 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 18277 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 200 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 189 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2569 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 25195 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 100000 29003 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 60690 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 66008 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 59723 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 50000 72698 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 59598 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 50000 72526 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 367076 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 219710 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 219105 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.58 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 8615 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 200000 14271 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1497 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 30.9 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 200000 13729 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 537 ns/op -BenchmarkIs 100000 28904 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23556 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2195 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 60100 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 59962 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 388679 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.0 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 22779 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 62033 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 446918 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 441753 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 1000000 2807 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 4477 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 548 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3304 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 38248 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 40677 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 83043 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 85391 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 65118 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 144028 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 146713 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 15113 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 18881 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 18926 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 63221 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 69028 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 9133 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 10601 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 43089 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 47867 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 9104 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 10579 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 15185 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 17108 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 81087 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 55831 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 23130 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 204673 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 50000 70965 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 18591 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 42004 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 61953 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 62124 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 42861 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 62451 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 62631 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4684 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 622 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 617 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 218.724s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2-take2 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2-take2 deleted file mode 100644 index 02a811874..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2-take2 +++ /dev/null @@ -1,477 +0,0 @@ -PASS -BenchmarkFirst 20000000 88.3 ns/op -BenchmarkLast 20000000 88.9 ns/op -BenchmarkEq 20000000 86.7 ns/op -BenchmarkSlice 20000000 84.1 ns/op -BenchmarkGet 2000000000 1.99 ns/op -BenchmarkIndex 2000000 907 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 200000 13052 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.5 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.6 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 189556 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 200000 13714 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 200 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 186 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2532 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 25199 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 100000 29162 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 60733 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 66124 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 59489 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 50000 73623 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 60053 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 50000 73477 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 364859 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 226980 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 220471 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.64 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 8811 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 100000 15365 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1559 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 31.7 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 200000 13901 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 541 ns/op -BenchmarkIs 100000 29435 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 22938 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2185 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 60607 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 61599 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 395436 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.0 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 200000 13788 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 54253 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 438879 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 437225 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 1000000 2844 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 4528 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 552 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3345 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 39482 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 42113 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 84136 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 86041 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 65844 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 146903 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 146638 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 16413 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 20366 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 18800 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 63443 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 69250 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 9193 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 10767 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 42829 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 48174 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 9114 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 11114 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 16387 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 18322 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 83828 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 58822 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 23173 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 219407 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 20000 76033 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 19417 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 44648 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 62751 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 62035 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 43331 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 64767 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 67808 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 4870 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 656 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 663 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 218.007s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2rc1 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2rc1 deleted file mode 100644 index e1bada783..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v0.3.2-go1.2rc1 +++ /dev/null @@ -1,477 +0,0 @@ -PASS -BenchmarkFirst 20000000 91.0 ns/op -BenchmarkLast 20000000 90.5 ns/op -BenchmarkEq 20000000 90.2 ns/op -BenchmarkSlice 20000000 88.0 ns/op -BenchmarkGet 1000000000 2.04 ns/op -BenchmarkIndex 2000000 935 ns/op ---- BENCH: BenchmarkIndex - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 - bench_array_test.go:73: Index=3 -BenchmarkIndexSelector 100000 23613 ns/op ---- BENCH: BenchmarkIndexSelector - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 - bench_array_test.go:85: IndexSelector=4 -BenchmarkIndexOfNode 100000000 10.2 ns/op ---- BENCH: BenchmarkIndexOfNode - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 - bench_array_test.go:99: IndexOfNode=2 -BenchmarkIndexOfSelection 100000000 11.0 ns/op ---- BENCH: BenchmarkIndexOfSelection - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 - bench_array_test.go:111: IndexOfSelection=2 -BenchmarkMetalReviewExample 10000 213843 ns/op ---- BENCH: BenchmarkMetalReviewExample - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - - bench_example_test.go:41: MetalReviewExample=10 - bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5). - Review 1: Over Your Threshold - Facticity (6.0). - Review 2: Nuclear Death Terror - Chaos Reigns (7.5). - Review 3: Evoken - Atra Mors (9.5). - ... [output truncated] -BenchmarkAdd 100000 18671 ns/op ---- BENCH: BenchmarkAdd - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 - bench_expand_test.go:20: Add=43 -BenchmarkAddSelection 10000000 204 ns/op ---- BENCH: BenchmarkAddSelection - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 - bench_expand_test.go:37: AddSelection=43 -BenchmarkAddNodes 10000000 195 ns/op ---- BENCH: BenchmarkAddNodes - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 - bench_expand_test.go:55: AddNodes=43 -BenchmarkAndSelf 1000000 2611 ns/op ---- BENCH: BenchmarkAndSelf - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 - bench_expand_test.go:71: AndSelf=44 -BenchmarkFilter 100000 27571 ns/op ---- BENCH: BenchmarkFilter - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 - bench_filter_test.go:20: Filter=13 -BenchmarkNot 50000 32006 ns/op ---- BENCH: BenchmarkNot - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 - bench_filter_test.go:36: Not=371 -BenchmarkFilterFunction 50000 61388 ns/op ---- BENCH: BenchmarkFilterFunction - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 - bench_filter_test.go:55: FilterFunction=112 -BenchmarkNotFunction 50000 66702 ns/op ---- BENCH: BenchmarkNotFunction - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 - bench_filter_test.go:74: NotFunction=261 -BenchmarkFilterNodes 50000 59699 ns/op ---- BENCH: BenchmarkFilterNodes - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 - bench_filter_test.go:92: FilterNodes=2 -BenchmarkNotNodes 50000 73248 ns/op ---- BENCH: BenchmarkNotNodes - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 - bench_filter_test.go:110: NotNodes=360 -BenchmarkFilterSelection 50000 59242 ns/op ---- BENCH: BenchmarkFilterSelection - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 - bench_filter_test.go:127: FilterSelection=2 -BenchmarkNotSelection 50000 73211 ns/op ---- BENCH: BenchmarkNotSelection - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 - bench_filter_test.go:144: NotSelection=360 -BenchmarkHas 5000 395087 ns/op ---- BENCH: BenchmarkHas - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 - bench_filter_test.go:160: Has=13 -BenchmarkHasNodes 10000 215849 ns/op ---- BENCH: BenchmarkHasNodes - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 - bench_filter_test.go:178: HasNodes=15 -BenchmarkHasSelection 10000 215612 ns/op ---- BENCH: BenchmarkHasSelection - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 - bench_filter_test.go:195: HasSelection=15 -BenchmarkEnd 500000000 4.59 ns/op ---- BENCH: BenchmarkEnd - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 - bench_filter_test.go:211: End=373 -BenchmarkEach 200000 8588 ns/op ---- BENCH: BenchmarkEach - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 - bench_iteration_test.go:22: Each=59 -BenchmarkMap 200000 14444 ns/op ---- BENCH: BenchmarkMap - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 - bench_iteration_test.go:41: Map=59 -BenchmarkEachWithBreak 1000000 1490 ns/op ---- BENCH: BenchmarkEachWithBreak - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 - bench_iteration_test.go:61: Each=10 -BenchmarkAttr 50000000 30.9 ns/op ---- BENCH: BenchmarkAttr - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading - bench_property_test.go:16: Attr=firstHeading -BenchmarkText 200000 14017 ns/op -BenchmarkLength 2000000000 0.31 ns/op ---- BENCH: BenchmarkLength - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 - bench_property_test.go:37: Length=14 -BenchmarkHtml 5000000 577 ns/op -BenchmarkIs 50000 31936 ns/op ---- BENCH: BenchmarkIs - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true - bench_query_test.go:16: Is=true -BenchmarkIsPositional 100000 23372 ns/op ---- BENCH: BenchmarkIsPositional - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true - bench_query_test.go:28: IsPositional=true -BenchmarkIsFunction 1000000 2170 ns/op ---- BENCH: BenchmarkIsFunction - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true - bench_query_test.go:43: IsFunction=true -BenchmarkIsSelection 50000 59814 ns/op ---- BENCH: BenchmarkIsSelection - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true - bench_query_test.go:56: IsSelection=true -BenchmarkIsNodes 50000 59629 ns/op ---- BENCH: BenchmarkIsNodes - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true - bench_query_test.go:70: IsNodes=true -BenchmarkHasClass 5000 384894 ns/op ---- BENCH: BenchmarkHasClass - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true - bench_query_test.go:82: HasClass=true -BenchmarkContains 100000000 11.4 ns/op ---- BENCH: BenchmarkContains - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true - bench_query_test.go:96: Contains=true -BenchmarkFind 100000 23545 ns/op ---- BENCH: BenchmarkFind - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 - bench_traversal_test.go:18: Find=41 -BenchmarkFindWithinSelection 50000 63775 ns/op ---- BENCH: BenchmarkFindWithinSelection - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 - bench_traversal_test.go:34: FindWithinSelection=39 -BenchmarkFindSelection 5000 441958 ns/op ---- BENCH: BenchmarkFindSelection - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 - bench_traversal_test.go:51: FindSelection=73 -BenchmarkFindNodes 5000 437717 ns/op ---- BENCH: BenchmarkFindNodes - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 - bench_traversal_test.go:69: FindNodes=73 -BenchmarkContents 1000000 2799 ns/op ---- BENCH: BenchmarkContents - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 - bench_traversal_test.go:85: Contents=16 -BenchmarkContentsFiltered 500000 4489 ns/op ---- BENCH: BenchmarkContentsFiltered - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 - bench_traversal_test.go:101: ContentsFiltered=1 -BenchmarkChildren 5000000 546 ns/op ---- BENCH: BenchmarkChildren - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 - bench_traversal_test.go:117: Children=2 -BenchmarkChildrenFiltered 500000 3472 ns/op ---- BENCH: BenchmarkChildrenFiltered - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 - bench_traversal_test.go:133: ChildrenFiltered=2 -BenchmarkParent 50000 39067 ns/op ---- BENCH: BenchmarkParent - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 - bench_traversal_test.go:149: Parent=55 -BenchmarkParentFiltered 50000 41450 ns/op ---- BENCH: BenchmarkParentFiltered - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 - bench_traversal_test.go:165: ParentFiltered=4 -BenchmarkParents 20000 84864 ns/op ---- BENCH: BenchmarkParents - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 - bench_traversal_test.go:181: Parents=73 -BenchmarkParentsFiltered 20000 87823 ns/op ---- BENCH: BenchmarkParentsFiltered - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 - bench_traversal_test.go:197: ParentsFiltered=18 -BenchmarkParentsUntil 50000 65986 ns/op ---- BENCH: BenchmarkParentsUntil - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 - bench_traversal_test.go:213: ParentsUntil=52 -BenchmarkParentsUntilSelection 10000 149798 ns/op ---- BENCH: BenchmarkParentsUntilSelection - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 - bench_traversal_test.go:230: ParentsUntilSelection=70 -BenchmarkParentsUntilNodes 10000 148144 ns/op ---- BENCH: BenchmarkParentsUntilNodes - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 - bench_traversal_test.go:248: ParentsUntilNodes=70 -BenchmarkParentsFilteredUntil 100000 15579 ns/op ---- BENCH: BenchmarkParentsFilteredUntil - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 - bench_traversal_test.go:264: ParentsFilteredUntil=2 -BenchmarkParentsFilteredUntilSelection 100000 19094 ns/op ---- BENCH: BenchmarkParentsFilteredUntilSelection - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 - bench_traversal_test.go:281: ParentsFilteredUntilSelection=2 -BenchmarkParentsFilteredUntilNodes 100000 19037 ns/op ---- BENCH: BenchmarkParentsFilteredUntilNodes - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 - bench_traversal_test.go:299: ParentsFilteredUntilNodes=2 -BenchmarkSiblings 50000 63891 ns/op ---- BENCH: BenchmarkSiblings - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 - bench_traversal_test.go:315: Siblings=293 -BenchmarkSiblingsFiltered 50000 70424 ns/op ---- BENCH: BenchmarkSiblingsFiltered - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 - bench_traversal_test.go:331: SiblingsFiltered=46 -BenchmarkNext 200000 9350 ns/op ---- BENCH: BenchmarkNext - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 - bench_traversal_test.go:347: Next=49 -BenchmarkNextFiltered 200000 10929 ns/op ---- BENCH: BenchmarkNextFiltered - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 - bench_traversal_test.go:363: NextFiltered=6 -BenchmarkNextAll 50000 43398 ns/op ---- BENCH: BenchmarkNextAll - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 - bench_traversal_test.go:379: NextAll=234 -BenchmarkNextAllFiltered 50000 48519 ns/op ---- BENCH: BenchmarkNextAllFiltered - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 - bench_traversal_test.go:395: NextAllFiltered=33 -BenchmarkPrev 200000 9181 ns/op ---- BENCH: BenchmarkPrev - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 - bench_traversal_test.go:411: Prev=49 -BenchmarkPrevFiltered 200000 10811 ns/op ---- BENCH: BenchmarkPrevFiltered - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 - bench_traversal_test.go:429: PrevFiltered=7 -BenchmarkPrevAll 100000 15589 ns/op ---- BENCH: BenchmarkPrevAll - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 - bench_traversal_test.go:445: PrevAll=78 -BenchmarkPrevAllFiltered 100000 17341 ns/op ---- BENCH: BenchmarkPrevAllFiltered - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 - bench_traversal_test.go:461: PrevAllFiltered=6 -BenchmarkNextUntil 20000 80663 ns/op ---- BENCH: BenchmarkNextUntil - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 - bench_traversal_test.go:477: NextUntil=84 -BenchmarkNextUntilSelection 50000 56496 ns/op ---- BENCH: BenchmarkNextUntilSelection - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 - bench_traversal_test.go:494: NextUntilSelection=42 -BenchmarkNextUntilNodes 100000 23729 ns/op ---- BENCH: BenchmarkNextUntilNodes - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 - bench_traversal_test.go:512: NextUntilNodes=12 -BenchmarkPrevUntil 10000 208267 ns/op ---- BENCH: BenchmarkPrevUntil - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 - bench_traversal_test.go:528: PrevUntil=238 -BenchmarkPrevUntilSelection 50000 72119 ns/op ---- BENCH: BenchmarkPrevUntilSelection - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 - bench_traversal_test.go:545: PrevUntilSelection=49 -BenchmarkPrevUntilNodes 100000 18549 ns/op ---- BENCH: BenchmarkPrevUntilNodes - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 - bench_traversal_test.go:563: PrevUntilNodes=11 -BenchmarkNextFilteredUntil 50000 42339 ns/op ---- BENCH: BenchmarkNextFilteredUntil - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 - bench_traversal_test.go:579: NextFilteredUntil=22 -BenchmarkNextFilteredUntilSelection 50000 61916 ns/op ---- BENCH: BenchmarkNextFilteredUntilSelection - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 - bench_traversal_test.go:596: NextFilteredUntilSelection=22 -BenchmarkNextFilteredUntilNodes 50000 62139 ns/op ---- BENCH: BenchmarkNextFilteredUntilNodes - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 - bench_traversal_test.go:614: NextFilteredUntilNodes=22 -BenchmarkPrevFilteredUntil 50000 43409 ns/op ---- BENCH: BenchmarkPrevFilteredUntil - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 - bench_traversal_test.go:630: PrevFilteredUntil=20 -BenchmarkPrevFilteredUntilSelection 50000 63768 ns/op ---- BENCH: BenchmarkPrevFilteredUntilSelection - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 - bench_traversal_test.go:647: PrevFilteredUntilSelection=20 -BenchmarkPrevFilteredUntilNodes 50000 63543 ns/op ---- BENCH: BenchmarkPrevFilteredUntilNodes - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 - bench_traversal_test.go:665: PrevFilteredUntilNodes=20 -BenchmarkClosest 500000 5110 ns/op ---- BENCH: BenchmarkClosest - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 - bench_traversal_test.go:681: Closest=2 -BenchmarkClosestSelection 5000000 629 ns/op ---- BENCH: BenchmarkClosestSelection - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 - bench_traversal_test.go:698: ClosestSelection=2 -BenchmarkClosestNodes 5000000 627 ns/op ---- BENCH: BenchmarkClosestNodes - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 - bench_traversal_test.go:715: ClosestNodes=2 -ok github.com/PuerkitoBio/goquery 215.785s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.0-go1.7 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.0-go1.7 deleted file mode 100644 index 4bc3a1fa8..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.0-go1.7 +++ /dev/null @@ -1,85 +0,0 @@ -BenchmarkFirst-4 30000000 50.7 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 50.9 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 55.7 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.45 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.68 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 3000000 541 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 200000 10749 ns/op 2464 B/op 17 allocs/op -BenchmarkIndexOfNode-4 200000000 6.47 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.27 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 138426 ns/op 12240 B/op 319 allocs/op -BenchmarkAdd-4 200000 10192 ns/op 208 B/op 9 allocs/op -BenchmarkAddSelection-4 10000000 158 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodes-4 10000000 156 ns/op 48 B/op 1 allocs/op -BenchmarkAndSelf-4 1000000 1588 ns/op 1008 B/op 5 allocs/op -BenchmarkFilter-4 100000 20427 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 23508 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 34178 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 38173 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34001 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 40344 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33308 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 40748 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 263346 ns/op 1816 B/op 48 allocs/op -BenchmarkHasNodes-4 10000 160840 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 165410 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.01 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4664 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8286 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 21.6 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 8909 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.34 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 3000000 422 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22615 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26655 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1208 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33497 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 33572 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 232802 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.33 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 200000 10715 ns/op 2464 B/op 17 allocs/op -BenchmarkFindWithinSelection-4 50000 35878 ns/op 2176 B/op 78 allocs/op -BenchmarkFindSelection-4 10000 194356 ns/op 2672 B/op 82 allocs/op -BenchmarkFindNodes-4 10000 195510 ns/op 2672 B/op 82 allocs/op -BenchmarkContents-4 1000000 2252 ns/op 864 B/op 34 allocs/op -BenchmarkContentsFiltered-4 500000 3015 ns/op 1016 B/op 39 allocs/op -BenchmarkChildren-4 5000000 364 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 1000000 2212 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 50000 24643 ns/op 4048 B/op 381 allocs/op -BenchmarkParentFiltered-4 50000 25967 ns/op 4248 B/op 388 allocs/op -BenchmarkParents-4 30000 50000 ns/op 27776 B/op 830 allocs/op -BenchmarkParentsFiltered-4 30000 53107 ns/op 28360 B/op 838 allocs/op -BenchmarkParentsUntil-4 100000 22423 ns/op 10352 B/op 353 allocs/op -BenchmarkParentsUntilSelection-4 20000 86925 ns/op 51144 B/op 1516 allocs/op -BenchmarkParentsUntilNodes-4 20000 87597 ns/op 51144 B/op 1516 allocs/op -BenchmarkParentsFilteredUntil-4 300000 5568 ns/op 2232 B/op 86 allocs/op -BenchmarkParentsFilteredUntilSelection-4 200000 10966 ns/op 5440 B/op 190 allocs/op -BenchmarkParentsFilteredUntilNodes-4 200000 10919 ns/op 5440 B/op 190 allocs/op -BenchmarkSiblings-4 30000 46018 ns/op 15400 B/op 204 allocs/op -BenchmarkSiblingsFiltered-4 30000 50566 ns/op 16496 B/op 213 allocs/op -BenchmarkNext-4 200000 7921 ns/op 3216 B/op 112 allocs/op -BenchmarkNextFiltered-4 200000 8804 ns/op 3416 B/op 118 allocs/op -BenchmarkNextAll-4 50000 31098 ns/op 9912 B/op 138 allocs/op -BenchmarkNextAllFiltered-4 50000 34677 ns/op 11008 B/op 147 allocs/op -BenchmarkPrev-4 200000 7920 ns/op 3216 B/op 112 allocs/op -BenchmarkPrevFiltered-4 200000 8913 ns/op 3416 B/op 118 allocs/op -BenchmarkPrevAll-4 200000 10845 ns/op 4376 B/op 113 allocs/op -BenchmarkPrevAllFiltered-4 100000 12030 ns/op 4576 B/op 119 allocs/op -BenchmarkNextUntil-4 100000 19193 ns/op 5760 B/op 260 allocs/op -BenchmarkNextUntilSelection-4 50000 34829 ns/op 18480 B/op 542 allocs/op -BenchmarkNextUntilNodes-4 100000 14459 ns/op 7944 B/op 248 allocs/op -BenchmarkPrevUntil-4 20000 66296 ns/op 12856 B/op 448 allocs/op -BenchmarkPrevUntilSelection-4 30000 45037 ns/op 23432 B/op 689 allocs/op -BenchmarkPrevUntilNodes-4 200000 11525 ns/op 6152 B/op 203 allocs/op -BenchmarkNextFilteredUntil-4 100000 12940 ns/op 4512 B/op 173 allocs/op -BenchmarkNextFilteredUntilSelection-4 50000 38924 ns/op 19160 B/op 567 allocs/op -BenchmarkNextFilteredUntilNodes-4 50000 38528 ns/op 19160 B/op 567 allocs/op -BenchmarkPrevFilteredUntil-4 100000 12980 ns/op 4664 B/op 175 allocs/op -BenchmarkPrevFilteredUntilSelection-4 50000 39671 ns/op 19936 B/op 587 allocs/op -BenchmarkPrevFilteredUntilNodes-4 50000 39484 ns/op 19936 B/op 587 allocs/op -BenchmarkClosest-4 500000 3310 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 5000000 361 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 5000000 359 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 163.718s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1a-go1.7 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1a-go1.7 deleted file mode 100644 index 0831aac3a..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1a-go1.7 +++ /dev/null @@ -1,85 +0,0 @@ -BenchmarkFirst-4 30000000 50.9 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 50.0 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 50.5 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.53 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.66 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 2000000 832 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 100000 16073 ns/op 3839 B/op 21 allocs/op -BenchmarkIndexOfNode-4 200000000 6.38 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.14 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 140737 ns/op 12418 B/op 320 allocs/op -BenchmarkAdd-4 100000 13162 ns/op 974 B/op 10 allocs/op -BenchmarkAddSelection-4 500000 3160 ns/op 814 B/op 2 allocs/op -BenchmarkAddNodes-4 500000 3159 ns/op 814 B/op 2 allocs/op -BenchmarkAndSelf-4 200000 7423 ns/op 2404 B/op 9 allocs/op -BenchmarkFilter-4 100000 19671 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 22577 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 33960 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 37909 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34196 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 40446 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33091 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 40609 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 262936 ns/op 2371 B/op 50 allocs/op -BenchmarkHasNodes-4 10000 148631 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 153117 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.02 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4653 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8257 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 22.0 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 8913 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.35 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 5000000 398 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22392 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26259 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1212 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33222 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 33408 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 233208 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.57 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 100000 16121 ns/op 3839 B/op 21 allocs/op -BenchmarkFindWithinSelection-4 20000 68019 ns/op 11521 B/op 97 allocs/op -BenchmarkFindSelection-4 5000 387582 ns/op 59787 B/op 176 allocs/op -BenchmarkFindNodes-4 5000 389246 ns/op 59797 B/op 176 allocs/op -BenchmarkContents-4 200000 11475 ns/op 2878 B/op 42 allocs/op -BenchmarkContentsFiltered-4 200000 11222 ns/op 2498 B/op 46 allocs/op -BenchmarkChildren-4 2000000 650 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 500000 2568 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 2000 702513 ns/op 194478 B/op 828 allocs/op -BenchmarkParentFiltered-4 2000 690778 ns/op 194658 B/op 835 allocs/op -BenchmarkParents-4 10000 124855 ns/op 49869 B/op 868 allocs/op -BenchmarkParentsFiltered-4 10000 128535 ns/op 50456 B/op 876 allocs/op -BenchmarkParentsUntil-4 20000 72982 ns/op 23802 B/op 388 allocs/op -BenchmarkParentsUntilSelection-4 10000 156099 ns/op 72453 B/op 1549 allocs/op -BenchmarkParentsUntilNodes-4 10000 156610 ns/op 72455 B/op 1549 allocs/op -BenchmarkParentsFilteredUntil-4 100000 15549 ns/op 4068 B/op 94 allocs/op -BenchmarkParentsFilteredUntilSelection-4 100000 20564 ns/op 7276 B/op 198 allocs/op -BenchmarkParentsFilteredUntilNodes-4 100000 20635 ns/op 7276 B/op 198 allocs/op -BenchmarkSiblings-4 3000 565114 ns/op 205910 B/op 336 allocs/op -BenchmarkSiblingsFiltered-4 3000 580264 ns/op 206993 B/op 345 allocs/op -BenchmarkNext-4 20000 93177 ns/op 26810 B/op 169 allocs/op -BenchmarkNextFiltered-4 20000 94171 ns/op 27013 B/op 175 allocs/op -BenchmarkNextAll-4 5000 270320 ns/op 89289 B/op 237 allocs/op -BenchmarkNextAllFiltered-4 5000 275283 ns/op 90375 B/op 246 allocs/op -BenchmarkPrev-4 20000 92777 ns/op 26810 B/op 169 allocs/op -BenchmarkPrevFiltered-4 20000 95577 ns/op 27007 B/op 175 allocs/op -BenchmarkPrevAll-4 20000 86339 ns/op 27515 B/op 151 allocs/op -BenchmarkPrevAllFiltered-4 20000 87759 ns/op 27715 B/op 157 allocs/op -BenchmarkNextUntil-4 10000 163930 ns/op 48541 B/op 330 allocs/op -BenchmarkNextUntilSelection-4 30000 56382 ns/op 23880 B/op 556 allocs/op -BenchmarkNextUntilNodes-4 100000 18883 ns/op 8703 B/op 252 allocs/op -BenchmarkPrevUntil-4 3000 484668 ns/op 145402 B/op 611 allocs/op -BenchmarkPrevUntilSelection-4 20000 72125 ns/op 28865 B/op 705 allocs/op -BenchmarkPrevUntilNodes-4 100000 14722 ns/op 6510 B/op 205 allocs/op -BenchmarkNextFilteredUntil-4 50000 39006 ns/op 10990 B/op 192 allocs/op -BenchmarkNextFilteredUntilSelection-4 20000 66048 ns/op 25641 B/op 586 allocs/op -BenchmarkNextFilteredUntilNodes-4 20000 65314 ns/op 25640 B/op 586 allocs/op -BenchmarkPrevFilteredUntil-4 50000 33312 ns/op 9709 B/op 189 allocs/op -BenchmarkPrevFilteredUntilSelection-4 20000 64197 ns/op 24981 B/op 601 allocs/op -BenchmarkPrevFilteredUntilNodes-4 20000 64505 ns/op 24982 B/op 601 allocs/op -BenchmarkClosest-4 500000 4065 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 2000000 756 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 2000000 753 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 162.053s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1b-go1.7 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1b-go1.7 deleted file mode 100644 index e8a9e5124..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1b-go1.7 +++ /dev/null @@ -1,85 +0,0 @@ -BenchmarkFirst-4 30000000 51.8 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 50.1 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 51.4 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.52 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.65 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 2000000 787 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 100000 16952 ns/op 3839 B/op 21 allocs/op -BenchmarkIndexOfNode-4 200000000 6.42 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.12 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 141994 ns/op 12418 B/op 320 allocs/op -BenchmarkAdd-4 200000 10367 ns/op 208 B/op 9 allocs/op -BenchmarkAddSelection-4 10000000 152 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodes-4 10000000 147 ns/op 48 B/op 1 allocs/op -BenchmarkAndSelf-4 1000000 1647 ns/op 1008 B/op 5 allocs/op -BenchmarkFilter-4 100000 19522 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 22546 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 35087 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 39123 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34890 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 41145 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33735 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 41334 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 264058 ns/op 2370 B/op 50 allocs/op -BenchmarkHasNodes-4 10000 151718 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 156955 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.01 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4660 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8404 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 806 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 21.6 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 8911 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.34 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 3000000 405 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22228 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26469 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1240 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33709 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 33711 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 236005 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.47 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 100000 16075 ns/op 3839 B/op 21 allocs/op -BenchmarkFindWithinSelection-4 30000 41418 ns/op 3539 B/op 82 allocs/op -BenchmarkFindSelection-4 10000 209490 ns/op 5616 B/op 89 allocs/op -BenchmarkFindNodes-4 10000 208206 ns/op 5614 B/op 89 allocs/op -BenchmarkContents-4 300000 4751 ns/op 1420 B/op 36 allocs/op -BenchmarkContentsFiltered-4 300000 5454 ns/op 1570 B/op 41 allocs/op -BenchmarkChildren-4 3000000 527 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 1000000 2484 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 50000 34724 ns/op 6940 B/op 387 allocs/op -BenchmarkParentFiltered-4 50000 35596 ns/op 7141 B/op 394 allocs/op -BenchmarkParents-4 20000 62094 ns/op 30720 B/op 837 allocs/op -BenchmarkParentsFiltered-4 20000 63223 ns/op 31304 B/op 845 allocs/op -BenchmarkParentsUntil-4 50000 30391 ns/op 11828 B/op 358 allocs/op -BenchmarkParentsUntilSelection-4 20000 99962 ns/op 54075 B/op 1523 allocs/op -BenchmarkParentsUntilNodes-4 20000 98763 ns/op 54073 B/op 1523 allocs/op -BenchmarkParentsFilteredUntil-4 200000 7982 ns/op 2787 B/op 88 allocs/op -BenchmarkParentsFilteredUntilSelection-4 100000 13618 ns/op 5995 B/op 192 allocs/op -BenchmarkParentsFilteredUntilNodes-4 100000 13639 ns/op 5994 B/op 192 allocs/op -BenchmarkSiblings-4 20000 75287 ns/op 28453 B/op 225 allocs/op -BenchmarkSiblingsFiltered-4 20000 80139 ns/op 29543 B/op 234 allocs/op -BenchmarkNext-4 100000 14270 ns/op 4659 B/op 117 allocs/op -BenchmarkNextFiltered-4 100000 15352 ns/op 4860 B/op 123 allocs/op -BenchmarkNextAll-4 20000 60811 ns/op 22771 B/op 157 allocs/op -BenchmarkNextAllFiltered-4 20000 69079 ns/op 23871 B/op 166 allocs/op -BenchmarkPrev-4 100000 14417 ns/op 4659 B/op 117 allocs/op -BenchmarkPrevFiltered-4 100000 15443 ns/op 4859 B/op 123 allocs/op -BenchmarkPrevAll-4 100000 22008 ns/op 7346 B/op 120 allocs/op -BenchmarkPrevAllFiltered-4 100000 23212 ns/op 7544 B/op 126 allocs/op -BenchmarkNextUntil-4 50000 30589 ns/op 8767 B/op 267 allocs/op -BenchmarkNextUntilSelection-4 30000 40875 ns/op 19862 B/op 546 allocs/op -BenchmarkNextUntilNodes-4 100000 15987 ns/op 8134 B/op 249 allocs/op -BenchmarkPrevUntil-4 20000 98799 ns/op 25727 B/op 467 allocs/op -BenchmarkPrevUntilSelection-4 30000 51874 ns/op 24875 B/op 694 allocs/op -BenchmarkPrevUntilNodes-4 100000 12901 ns/op 6334 B/op 204 allocs/op -BenchmarkNextFilteredUntil-4 100000 19869 ns/op 5909 B/op 177 allocs/op -BenchmarkNextFilteredUntilSelection-4 30000 45412 ns/op 20557 B/op 571 allocs/op -BenchmarkNextFilteredUntilNodes-4 30000 45363 ns/op 20557 B/op 571 allocs/op -BenchmarkPrevFilteredUntil-4 100000 19357 ns/op 6033 B/op 179 allocs/op -BenchmarkPrevFilteredUntilSelection-4 30000 46396 ns/op 21305 B/op 591 allocs/op -BenchmarkPrevFilteredUntilNodes-4 30000 46133 ns/op 21305 B/op 591 allocs/op -BenchmarkClosest-4 500000 3448 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 3000000 528 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 3000000 523 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 162.012s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1c-go1.7 b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1c-go1.7 deleted file mode 100644 index e522e5a2d..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench/v1.0.1c-go1.7 +++ /dev/null @@ -1,86 +0,0 @@ -BenchmarkFirst-4 30000000 51.7 ns/op 48 B/op 1 allocs/op -BenchmarkLast-4 30000000 51.9 ns/op 48 B/op 1 allocs/op -BenchmarkEq-4 30000000 50.0 ns/op 48 B/op 1 allocs/op -BenchmarkSlice-4 500000000 3.47 ns/op 0 B/op 0 allocs/op -BenchmarkGet-4 2000000000 1.68 ns/op 0 B/op 0 allocs/op -BenchmarkIndex-4 2000000 804 ns/op 248 B/op 10 allocs/op -BenchmarkIndexSelector-4 100000 16285 ns/op 3839 B/op 21 allocs/op -BenchmarkIndexOfNode-4 200000000 6.50 ns/op 0 B/op 0 allocs/op -BenchmarkIndexOfSelection-4 200000000 7.02 ns/op 0 B/op 0 allocs/op -BenchmarkMetalReviewExample-4 10000 143160 ns/op 12417 B/op 320 allocs/op -BenchmarkAdd-4 200000 10326 ns/op 208 B/op 9 allocs/op -BenchmarkAddSelection-4 10000000 155 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodes-4 10000000 156 ns/op 48 B/op 1 allocs/op -BenchmarkAddNodesBig-4 20000 94439 ns/op 21847 B/op 37 allocs/op -BenchmarkAndSelf-4 1000000 1791 ns/op 1008 B/op 5 allocs/op -BenchmarkFilter-4 100000 19470 ns/op 360 B/op 8 allocs/op -BenchmarkNot-4 100000 22500 ns/op 136 B/op 5 allocs/op -BenchmarkFilterFunction-4 50000 34578 ns/op 22976 B/op 755 allocs/op -BenchmarkNotFunction-4 50000 38703 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterNodes-4 50000 34486 ns/op 20960 B/op 749 allocs/op -BenchmarkNotNodes-4 30000 41094 ns/op 29120 B/op 757 allocs/op -BenchmarkFilterSelection-4 50000 33623 ns/op 20960 B/op 749 allocs/op -BenchmarkNotSelection-4 30000 41483 ns/op 29120 B/op 757 allocs/op -BenchmarkHas-4 5000 266628 ns/op 2371 B/op 50 allocs/op -BenchmarkHasNodes-4 10000 152617 ns/op 21184 B/op 752 allocs/op -BenchmarkHasSelection-4 10000 156682 ns/op 21184 B/op 752 allocs/op -BenchmarkEnd-4 2000000000 1.00 ns/op 0 B/op 0 allocs/op -BenchmarkEach-4 300000 4712 ns/op 3304 B/op 118 allocs/op -BenchmarkMap-4 200000 8434 ns/op 5572 B/op 184 allocs/op -BenchmarkEachWithBreak-4 2000000 819 ns/op 560 B/op 20 allocs/op -BenchmarkAttr-4 100000000 21.7 ns/op 0 B/op 0 allocs/op -BenchmarkText-4 200000 9376 ns/op 7536 B/op 110 allocs/op -BenchmarkLength-4 2000000000 0.35 ns/op 0 B/op 0 allocs/op -BenchmarkHtml-4 5000000 401 ns/op 120 B/op 2 allocs/op -BenchmarkIs-4 100000 22214 ns/op 88 B/op 4 allocs/op -BenchmarkIsPositional-4 50000 26559 ns/op 1112 B/op 10 allocs/op -BenchmarkIsFunction-4 1000000 1228 ns/op 784 B/op 28 allocs/op -BenchmarkIsSelection-4 50000 33471 ns/op 20960 B/op 749 allocs/op -BenchmarkIsNodes-4 50000 34461 ns/op 20960 B/op 749 allocs/op -BenchmarkHasClass-4 10000 232429 ns/op 14944 B/op 976 allocs/op -BenchmarkContains-4 200000000 7.62 ns/op 0 B/op 0 allocs/op -BenchmarkFind-4 100000 16114 ns/op 3839 B/op 21 allocs/op -BenchmarkFindWithinSelection-4 30000 42520 ns/op 3540 B/op 82 allocs/op -BenchmarkFindSelection-4 10000 209801 ns/op 5615 B/op 89 allocs/op -BenchmarkFindNodes-4 10000 209082 ns/op 5614 B/op 89 allocs/op -BenchmarkContents-4 300000 4836 ns/op 1420 B/op 36 allocs/op -BenchmarkContentsFiltered-4 200000 5495 ns/op 1570 B/op 41 allocs/op -BenchmarkChildren-4 3000000 527 ns/op 152 B/op 7 allocs/op -BenchmarkChildrenFiltered-4 500000 2499 ns/op 352 B/op 15 allocs/op -BenchmarkParent-4 50000 34072 ns/op 6942 B/op 387 allocs/op -BenchmarkParentFiltered-4 50000 36077 ns/op 7141 B/op 394 allocs/op -BenchmarkParents-4 20000 64118 ns/op 30719 B/op 837 allocs/op -BenchmarkParentsFiltered-4 20000 63432 ns/op 31303 B/op 845 allocs/op -BenchmarkParentsUntil-4 50000 29589 ns/op 11829 B/op 358 allocs/op -BenchmarkParentsUntilSelection-4 10000 101033 ns/op 54076 B/op 1523 allocs/op -BenchmarkParentsUntilNodes-4 10000 100584 ns/op 54076 B/op 1523 allocs/op -BenchmarkParentsFilteredUntil-4 200000 8061 ns/op 2787 B/op 88 allocs/op -BenchmarkParentsFilteredUntilSelection-4 100000 13848 ns/op 5995 B/op 192 allocs/op -BenchmarkParentsFilteredUntilNodes-4 100000 13766 ns/op 5995 B/op 192 allocs/op -BenchmarkSiblings-4 20000 75135 ns/op 28453 B/op 225 allocs/op -BenchmarkSiblingsFiltered-4 20000 80532 ns/op 29544 B/op 234 allocs/op -BenchmarkNext-4 100000 14200 ns/op 4660 B/op 117 allocs/op -BenchmarkNextFiltered-4 100000 15284 ns/op 4859 B/op 123 allocs/op -BenchmarkNextAll-4 20000 60889 ns/op 22774 B/op 157 allocs/op -BenchmarkNextAllFiltered-4 20000 65125 ns/op 23869 B/op 166 allocs/op -BenchmarkPrev-4 100000 14448 ns/op 4659 B/op 117 allocs/op -BenchmarkPrevFiltered-4 100000 15444 ns/op 4859 B/op 123 allocs/op -BenchmarkPrevAll-4 100000 22019 ns/op 7344 B/op 120 allocs/op -BenchmarkPrevAllFiltered-4 100000 23307 ns/op 7545 B/op 126 allocs/op -BenchmarkNextUntil-4 50000 30287 ns/op 8766 B/op 267 allocs/op -BenchmarkNextUntilSelection-4 30000 41476 ns/op 19862 B/op 546 allocs/op -BenchmarkNextUntilNodes-4 100000 16106 ns/op 8133 B/op 249 allocs/op -BenchmarkPrevUntil-4 20000 98951 ns/op 25728 B/op 467 allocs/op -BenchmarkPrevUntilSelection-4 30000 52390 ns/op 24875 B/op 694 allocs/op -BenchmarkPrevUntilNodes-4 100000 12986 ns/op 6334 B/op 204 allocs/op -BenchmarkNextFilteredUntil-4 100000 19365 ns/op 5908 B/op 177 allocs/op -BenchmarkNextFilteredUntilSelection-4 30000 45334 ns/op 20555 B/op 571 allocs/op -BenchmarkNextFilteredUntilNodes-4 30000 45292 ns/op 20556 B/op 571 allocs/op -BenchmarkPrevFilteredUntil-4 100000 19412 ns/op 6032 B/op 179 allocs/op -BenchmarkPrevFilteredUntilSelection-4 30000 46286 ns/op 21304 B/op 591 allocs/op -BenchmarkPrevFilteredUntilNodes-4 30000 46554 ns/op 21305 B/op 591 allocs/op -BenchmarkClosest-4 500000 3480 ns/op 160 B/op 8 allocs/op -BenchmarkClosestSelection-4 2000000 722 ns/op 96 B/op 6 allocs/op -BenchmarkClosestNodes-4 2000000 719 ns/op 96 B/op 6 allocs/op -PASS -ok github.com/PuerkitoBio/goquery 160.565s diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_array_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_array_test.go deleted file mode 100644 index 29c7e205d..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_array_test.go +++ /dev/null @@ -1,120 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkFirst(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.First() - } -} - -func BenchmarkLast(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Last() - } -} - -func BenchmarkEq(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - j := 0 - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Eq(j) - if j++; j >= sel.Length() { - j = 0 - } - } -} - -func BenchmarkSlice(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - j := 0 - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Slice(j, j+4) - if j++; j >= (sel.Length() - 4) { - j = 0 - } - } -} - -func BenchmarkGet(b *testing.B) { - b.StopTimer() - sel := DocB().Find("dd") - j := 0 - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Get(j) - if j++; j >= sel.Length() { - j = 0 - } - } -} - -func BenchmarkIndex(b *testing.B) { - var j int - - b.StopTimer() - sel := DocB().Find("#Main") - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.Index() - } - if j != 3 { - b.Fatalf("want 3, got %d", j) - } -} - -func BenchmarkIndexSelector(b *testing.B) { - var j int - - b.StopTimer() - sel := DocB().Find("#manual-nav dl dd:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.IndexSelector("dd") - } - if j != 4 { - b.Fatalf("want 4, got %d", j) - } -} - -func BenchmarkIndexOfNode(b *testing.B) { - var j int - - b.StopTimer() - sel := DocB().Find("span a") - sel2 := DocB().Find("span a:nth-child(3)") - n := sel2.Get(0) - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.IndexOfNode(n) - } - if j != 2 { - b.Fatalf("want 2, got %d", j) - } -} - -func BenchmarkIndexOfSelection(b *testing.B) { - var j int - b.StopTimer() - sel := DocB().Find("span a") - sel2 := DocB().Find("span a:nth-child(3)") - b.StartTimer() - for i := 0; i < b.N; i++ { - j = sel.IndexOfSelection(sel2) - } - if j != 2 { - b.Fatalf("want 2, got %d", j) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_example_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_example_test.go deleted file mode 100644 index ba9ebe5c0..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package goquery - -import ( - "bytes" - "fmt" - "strconv" - "testing" -) - -func BenchmarkMetalReviewExample(b *testing.B) { - var n int - var buf bytes.Buffer - - b.StopTimer() - doc := loadDoc("metalreview.html") - b.StartTimer() - for i := 0; i < b.N; i++ { - doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) { - var band, title string - var score float64 - var e error - - n++ - // For each item found, get the band, title and score, and print it - band = s.Find("strong").Text() - title = s.Find("em").Text() - if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil { - // Not a valid float, ignore score - if n <= 4 { - buf.WriteString(fmt.Sprintf("Review %d: %s - %s.\n", i, band, title)) - } - } else { - // Print all, including score - if n <= 4 { - buf.WriteString(fmt.Sprintf("Review %d: %s - %s (%2.1f).\n", i, band, title, score)) - } - } - }) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_expand_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_expand_test.go deleted file mode 100644 index 61f194753..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_expand_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkAdd(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Add("h2[title]").Length() - } else { - sel.Add("h2[title]") - } - } - if n != 43 { - b.Fatalf("want 43, got %d", n) - } -} - -func BenchmarkAddSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd") - sel2 := DocB().Find("h2[title]") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AddSelection(sel2).Length() - } else { - sel.AddSelection(sel2) - } - } - if n != 43 { - b.Fatalf("want 43, got %d", n) - } -} - -func BenchmarkAddNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd") - sel2 := DocB().Find("h2[title]") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AddNodes(nodes...).Length() - } else { - sel.AddNodes(nodes...) - } - } - if n != 43 { - b.Fatalf("want 43, got %d", n) - } -} - -func BenchmarkAddNodesBig(b *testing.B) { - var n int - - doc := DocW() - sel := doc.Find("li") - // make nodes > 1000 - nodes := sel.Nodes - nodes = append(nodes, nodes...) - nodes = append(nodes, nodes...) - sel = doc.Find("xyz") - b.ResetTimer() - - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AddNodes(nodes...).Length() - } else { - sel.AddNodes(nodes...) - } - } - if n != 373 { - b.Fatalf("want 373, got %d", n) - } -} - -func BenchmarkAndSelf(b *testing.B) { - var n int - - b.StopTimer() - sel := DocB().Find("dd").Parent() - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.AndSelf().Length() - } else { - sel.AndSelf() - } - } - if n != 44 { - b.Fatalf("want 44, got %d", n) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_filter_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_filter_test.go deleted file mode 100644 index 38e39f54a..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_filter_test.go +++ /dev/null @@ -1,236 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkFilter(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Filter(".toclevel-1").Length() - } else { - sel.Filter(".toclevel-1") - } - } - if n != 13 { - b.Fatalf("want 13, got %d", n) - } -} - -func BenchmarkNot(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Not(".toclevel-2").Length() - } else { - sel.Filter(".toclevel-2") - } - } - if n != 371 { - b.Fatalf("want 371, got %d", n) - } -} - -func BenchmarkFilterFunction(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - f := func(i int, s *Selection) bool { - return len(s.Get(0).Attr) > 0 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FilterFunction(f).Length() - } else { - sel.FilterFunction(f) - } - } - if n != 112 { - b.Fatalf("want 112, got %d", n) - } -} - -func BenchmarkNotFunction(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - f := func(i int, s *Selection) bool { - return len(s.Get(0).Attr) > 0 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NotFunction(f).Length() - } else { - sel.NotFunction(f) - } - } - if n != 261 { - b.Fatalf("want 261, got %d", n) - } -} - -func BenchmarkFilterNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FilterNodes(nodes...).Length() - } else { - sel.FilterNodes(nodes...) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkNotNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-1") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NotNodes(nodes...).Length() - } else { - sel.NotNodes(nodes...) - } - } - if n != 360 { - b.Fatalf("want 360, got %d", n) - } -} - -func BenchmarkFilterSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FilterSelection(sel2).Length() - } else { - sel.FilterSelection(sel2) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkNotSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-1") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NotSelection(sel2).Length() - } else { - sel.NotSelection(sel2) - } - } - if n != 360 { - b.Fatalf("want 360, got %d", n) - } -} - -func BenchmarkHas(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Has(".editsection").Length() - } else { - sel.Has(".editsection") - } - } - if n != 13 { - b.Fatalf("want 13, got %d", n) - } -} - -func BenchmarkHasNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".tocnumber") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.HasNodes(nodes...).Length() - } else { - sel.HasNodes(nodes...) - } - } - if n != 15 { - b.Fatalf("want 15, got %d", n) - } -} - -func BenchmarkHasSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".tocnumber") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.HasSelection(sel2).Length() - } else { - sel.HasSelection(sel2) - } - } - if n != 15 { - b.Fatalf("want 15, got %d", n) - } -} - -func BenchmarkEnd(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li").Has(".tocnumber") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.End().Length() - } else { - sel.End() - } - } - if n != 373 { - b.Fatalf("want 373, got %d", n) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_iteration_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_iteration_test.go deleted file mode 100644 index 71bfd59c5..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_iteration_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package goquery - -import ( - "strconv" - "testing" -) - -func BenchmarkEach(b *testing.B) { - var tmp, n int - - b.StopTimer() - sel := DocW().Find("td") - f := func(i int, s *Selection) { - tmp++ - } - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Each(f) - if n == 0 { - n = tmp - } - } - if n != 59 { - b.Fatalf("want 59, got %d", n) - } -} - -func BenchmarkMap(b *testing.B) { - var tmp, n int - - b.StopTimer() - sel := DocW().Find("td") - f := func(i int, s *Selection) string { - tmp++ - return strconv.Itoa(tmp) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Map(f) - if n == 0 { - n = tmp - } - } - if n != 59 { - b.Fatalf("want 59, got %d", n) - } -} - -func BenchmarkEachWithBreak(b *testing.B) { - var tmp, n int - - b.StopTimer() - sel := DocW().Find("td") - f := func(i int, s *Selection) bool { - tmp++ - return tmp < 10 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - tmp = 0 - sel.EachWithBreak(f) - if n == 0 { - n = tmp - } - } - if n != 10 { - b.Fatalf("want 10, got %d", n) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_property_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_property_test.go deleted file mode 100644 index ee2d4cd02..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_property_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkAttr(b *testing.B) { - var s string - - b.StopTimer() - sel := DocW().Find("h1") - b.StartTimer() - for i := 0; i < b.N; i++ { - s, _ = sel.Attr("id") - } - if s != "firstHeading" { - b.Fatalf("want firstHeading, got %q", s) - } -} - -func BenchmarkText(b *testing.B) { - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - sel.Text() - } -} - -func BenchmarkLength(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - n = sel.Length() - } - if n != 14 { - b.Fatalf("want 14, got %d", n) - } -} - -func BenchmarkHtml(b *testing.B) { - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - _, _ = sel.Html() - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_query_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_query_test.go deleted file mode 100644 index 64fdbc4bd..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_query_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package goquery - -import ( - "testing" -) - -func BenchmarkIs(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.Is(".toclevel-2") - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsPositional(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.Is("li:nth-child(2)") - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsFunction(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find(".toclevel-1") - f := func(i int, s *Selection) bool { - return i == 8 - } - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.IsFunction(f) - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsSelection(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.IsSelection(sel2) - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkIsNodes(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("li") - sel2 := DocW().Find(".toclevel-2") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.IsNodes(nodes...) - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkHasClass(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("span") - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.HasClass("official") - } - if !y { - b.Fatal("want true") - } -} - -func BenchmarkContains(b *testing.B) { - var y bool - - b.StopTimer() - sel := DocW().Find("span.url") - sel2 := DocW().Find("a[rel=\"nofollow\"]") - node := sel2.Nodes[0] - b.StartTimer() - for i := 0; i < b.N; i++ { - y = sel.Contains(node) - } - if !y { - b.Fatal("want true") - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_traversal_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_traversal_test.go deleted file mode 100644 index 8cb673b50..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/bench_traversal_test.go +++ /dev/null @@ -1,822 +0,0 @@ -package goquery - -import ( - "testing" - - "github.com/andybalholm/cascadia" -) - -func BenchmarkFind(b *testing.B) { - var n int - - for i := 0; i < b.N; i++ { - if n == 0 { - n = DocB().Find("dd").Length() - - } else { - DocB().Find("dd") - } - } - if n != 41 { - b.Fatalf("want 41, got %d", n) - } -} - -func BenchmarkFindWithinSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Find("a[class]").Length() - } else { - sel.Find("a[class]") - } - } - if n != 39 { - b.Fatalf("want 39, got %d", n) - } -} - -func BenchmarkFindSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul") - sel2 := DocW().Find("span") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FindSelection(sel2).Length() - } else { - sel.FindSelection(sel2) - } - } - if n != 73 { - b.Fatalf("want 73, got %d", n) - } -} - -func BenchmarkFindNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul") - sel2 := DocW().Find("span") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.FindNodes(nodes...).Length() - } else { - sel.FindNodes(nodes...) - } - } - if n != 73 { - b.Fatalf("want 73, got %d", n) - } -} - -func BenchmarkContents(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Contents().Length() - } else { - sel.Contents() - } - } - if n != 16 { - b.Fatalf("want 16, got %d", n) - } -} - -func BenchmarkContentsFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ContentsFiltered("a[href=\"#Examples\"]").Length() - } else { - sel.ContentsFiltered("a[href=\"#Examples\"]") - } - } - if n != 1 { - b.Fatalf("want 1, got %d", n) - } -} - -func BenchmarkChildren(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Children().Length() - } else { - sel.Children() - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkChildrenFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h3") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ChildrenFiltered(".editsection").Length() - } else { - sel.ChildrenFiltered(".editsection") - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkParent(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Parent().Length() - } else { - sel.Parent() - } - } - if n != 55 { - b.Fatalf("want 55, got %d", n) - } -} - -func BenchmarkParentFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentFiltered("ul[id]").Length() - } else { - sel.ParentFiltered("ul[id]") - } - } - if n != 4 { - b.Fatalf("want 4, got %d", n) - } -} - -func BenchmarkParents(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Parents().Length() - } else { - sel.Parents() - } - } - if n != 73 { - b.Fatalf("want 73, got %d", n) - } -} - -func BenchmarkParentsFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFiltered("tr").Length() - } else { - sel.ParentsFiltered("tr") - } - } - if n != 18 { - b.Fatalf("want 18, got %d", n) - } -} - -func BenchmarkParentsUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsUntil("table").Length() - } else { - sel.ParentsUntil("table") - } - } - if n != 52 { - b.Fatalf("want 52, got %d", n) - } -} - -func BenchmarkParentsUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - sel2 := DocW().Find("#content") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsUntilSelection(sel2).Length() - } else { - sel.ParentsUntilSelection(sel2) - } - } - if n != 70 { - b.Fatalf("want 70, got %d", n) - } -} - -func BenchmarkParentsUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("th a") - sel2 := DocW().Find("#content") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsUntilNodes(nodes...).Length() - } else { - sel.ParentsUntilNodes(nodes...) - } - } - if n != 70 { - b.Fatalf("want 70, got %d", n) - } -} - -func BenchmarkParentsFilteredUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1 a") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFilteredUntil(":nth-child(1)", "ul").Length() - } else { - sel.ParentsFilteredUntil(":nth-child(1)", "ul") - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkParentsFilteredUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1 a") - sel2 := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2).Length() - } else { - sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkParentsFilteredUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find(".toclevel-1 a") - sel2 := DocW().Find("ul") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...).Length() - } else { - sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkSiblings(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Siblings().Length() - } else { - sel.Siblings() - } - } - if n != 293 { - b.Fatalf("want 293, got %d", n) - } -} - -func BenchmarkSiblingsFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("ul li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.SiblingsFiltered("[class]").Length() - } else { - sel.SiblingsFiltered("[class]") - } - } - if n != 46 { - b.Fatalf("want 46, got %d", n) - } -} - -func BenchmarkNext(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Next().Length() - } else { - sel.Next() - } - } - if n != 49 { - b.Fatalf("want 49, got %d", n) - } -} - -func BenchmarkNextFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(1)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFiltered("[class]").Length() - } else { - sel.NextFiltered("[class]") - } - } - if n != 6 { - b.Fatalf("want 6, got %d", n) - } -} - -func BenchmarkNextAll(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(3)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextAll().Length() - } else { - sel.NextAll() - } - } - if n != 234 { - b.Fatalf("want 234, got %d", n) - } -} - -func BenchmarkNextAllFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(3)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextAllFiltered("[class]").Length() - } else { - sel.NextAllFiltered("[class]") - } - } - if n != 33 { - b.Fatalf("want 33, got %d", n) - } -} - -func BenchmarkPrev(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:last-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Prev().Length() - } else { - sel.Prev() - } - } - if n != 49 { - b.Fatalf("want 49, got %d", n) - } -} - -func BenchmarkPrevFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:last-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFiltered("[class]").Length() - } else { - sel.PrevFiltered("[class]") - } - } - // There is one more Prev li with a class, compared to Next li with a class - // (confirmed by looking at the HTML, this is ok) - if n != 7 { - b.Fatalf("want 7, got %d", n) - } -} - -func BenchmarkPrevAll(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(4)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevAll().Length() - } else { - sel.PrevAll() - } - } - if n != 78 { - b.Fatalf("want 78, got %d", n) - } -} - -func BenchmarkPrevAllFiltered(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:nth-child(4)") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevAllFiltered("[class]").Length() - } else { - sel.PrevAllFiltered("[class]") - } - } - if n != 6 { - b.Fatalf("want 6, got %d", n) - } -} - -func BenchmarkNextUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:first-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextUntil(":nth-child(4)").Length() - } else { - sel.NextUntil(":nth-child(4)") - } - } - if n != 84 { - b.Fatalf("want 84, got %d", n) - } -} - -func BenchmarkNextUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextUntilSelection(sel2).Length() - } else { - sel.NextUntilSelection(sel2) - } - } - if n != 42 { - b.Fatalf("want 42, got %d", n) - } -} - -func BenchmarkNextUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("p") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextUntilNodes(nodes...).Length() - } else { - sel.NextUntilNodes(nodes...) - } - } - if n != 12 { - b.Fatalf("want 12, got %d", n) - } -} - -func BenchmarkPrevUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("li:last-child") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevUntil(":nth-child(4)").Length() - } else { - sel.PrevUntil(":nth-child(4)") - } - } - if n != 238 { - b.Fatalf("want 238, got %d", n) - } -} - -func BenchmarkPrevUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("ul") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevUntilSelection(sel2).Length() - } else { - sel.PrevUntilSelection(sel2) - } - } - if n != 49 { - b.Fatalf("want 49, got %d", n) - } -} - -func BenchmarkPrevUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("p") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevUntilNodes(nodes...).Length() - } else { - sel.PrevUntilNodes(nodes...) - } - } - if n != 11 { - b.Fatalf("want 11, got %d", n) - } -} - -func BenchmarkNextFilteredUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFilteredUntil("p", "div").Length() - } else { - sel.NextFilteredUntil("p", "div") - } - } - if n != 22 { - b.Fatalf("want 22, got %d", n) - } -} - -func BenchmarkNextFilteredUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFilteredUntilSelection("p", sel2).Length() - } else { - sel.NextFilteredUntilSelection("p", sel2) - } - } - if n != 22 { - b.Fatalf("want 22, got %d", n) - } -} - -func BenchmarkNextFilteredUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.NextFilteredUntilNodes("p", nodes...).Length() - } else { - sel.NextFilteredUntilNodes("p", nodes...) - } - } - if n != 22 { - b.Fatalf("want 22, got %d", n) - } -} - -func BenchmarkPrevFilteredUntil(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFilteredUntil("p", "div").Length() - } else { - sel.PrevFilteredUntil("p", "div") - } - } - if n != 20 { - b.Fatalf("want 20, got %d", n) - } -} - -func BenchmarkPrevFilteredUntilSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFilteredUntilSelection("p", sel2).Length() - } else { - sel.PrevFilteredUntilSelection("p", sel2) - } - } - if n != 20 { - b.Fatalf("want 20, got %d", n) - } -} - -func BenchmarkPrevFilteredUntilNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := DocW().Find("h2") - sel2 := DocW().Find("div") - nodes := sel2.Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.PrevFilteredUntilNodes("p", nodes...).Length() - } else { - sel.PrevFilteredUntilNodes("p", nodes...) - } - } - if n != 20 { - b.Fatalf("want 20, got %d", n) - } -} - -func BenchmarkClosest(b *testing.B) { - var n int - - b.StopTimer() - sel := Doc().Find(".container-fluid") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.Closest(".pvk-content").Length() - } else { - sel.Closest(".pvk-content") - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkClosestSelection(b *testing.B) { - var n int - - b.StopTimer() - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content") - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ClosestSelection(sel2).Length() - } else { - sel.ClosestSelection(sel2) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkClosestNodes(b *testing.B) { - var n int - - b.StopTimer() - sel := Doc().Find(".container-fluid") - nodes := Doc().Find(".pvk-content").Nodes - b.StartTimer() - for i := 0; i < b.N; i++ { - if n == 0 { - n = sel.ClosestNodes(nodes...).Length() - } else { - sel.ClosestNodes(nodes...) - } - } - if n != 2 { - b.Fatalf("want 2, got %d", n) - } -} - -func BenchmarkSingleMatcher(b *testing.B) { - doc := Doc() - multi := cascadia.MustCompile(`div`) - single := SingleMatcher(multi) - b.ResetTimer() - - b.Run("multi", func(b *testing.B) { - for i := 0; i < b.N; i++ { - _ = doc.FindMatcher(multi) - } - }) - b.Run("single", func(b *testing.B) { - for i := 0; i < b.N; i++ { - _ = doc.FindMatcher(single) - } - }) -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/doc.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/doc.go deleted file mode 100644 index 71146a780..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/doc.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2012-2016, Martin Angers & Contributors -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation and/or -// other materials provided with the distribution. -// * Neither the name of the author nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package goquery implements features similar to jQuery, including the chainable -syntax, to manipulate and query an HTML document. - -It brings a syntax and a set of features similar to jQuery to the Go language. -It is based on Go's net/html package and the CSS Selector library cascadia. -Since the net/html parser returns nodes, and not a full-featured DOM -tree, jQuery's stateful manipulation functions (like height(), css(), detach()) -have been left off. - -Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is -the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. -See the repository's wiki for various options on how to do this. - -Syntax-wise, it is as close as possible to jQuery, with the same method names when -possible, and that warm and fuzzy chainable interface. jQuery being the -ultra-popular library that it is, writing a similar HTML-manipulating -library was better to follow its API than to start anew (in the same spirit as -Go's fmt package), even though some of its methods are less than intuitive (looking -at you, index()...). - -It is hosted on GitHub, along with additional documentation in the README.md -file: https://github.com/puerkitobio/goquery - -Please note that because of the net/html dependency, goquery requires Go1.1+. - -The various methods are split into files based on the category of behavior. -The three dots (...) indicate that various "overloads" are available. - -* array.go : array-like positional manipulation of the selection. - - Eq() - - First() - - Get() - - Index...() - - Last() - - Slice() - -* expand.go : methods that expand or augment the selection's set. - - Add...() - - AndSelf() - - Union(), which is an alias for AddSelection() - -* filter.go : filtering methods, that reduce the selection's set. - - End() - - Filter...() - - Has...() - - Intersection(), which is an alias of FilterSelection() - - Not...() - -* iteration.go : methods to loop over the selection's nodes. - - Each() - - EachWithBreak() - - Map() - -* manipulation.go : methods for modifying the document - - After...() - - Append...() - - Before...() - - Clone() - - Empty() - - Prepend...() - - Remove...() - - ReplaceWith...() - - Unwrap() - - Wrap...() - - WrapAll...() - - WrapInner...() - -* property.go : methods that inspect and get the node's properties values. - - Attr*(), RemoveAttr(), SetAttr() - - AddClass(), HasClass(), RemoveClass(), ToggleClass() - - Html() - - Length() - - Size(), which is an alias for Length() - - Text() - -* query.go : methods that query, or reflect, a node's identity. - - Contains() - - Is...() - -* traversal.go : methods to traverse the HTML document tree. - - Children...() - - Contents() - - Find...() - - Next...() - - Parent[s]...() - - Prev...() - - Siblings...() - -* type.go : definition of the types exposed by goquery. - - Document - - Selection - - Matcher - -* utilities.go : definition of helper functions (and not methods on a *Selection) -that are not part of jQuery, but are useful to goquery. - - NodeName - - OuterHtml -*/ -package goquery diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/doc/tips.md b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/doc/tips.md deleted file mode 100644 index 590da122e..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/doc/tips.md +++ /dev/null @@ -1,68 +0,0 @@ -# Tips and tricks - -## Handle Non-UTF8 html Pages - -The `go.net/html` package used by `goquery` requires that the html document is UTF-8 encoded. When you know the encoding of the html page is not UTF-8, you can use the `iconv` package to convert it to UTF-8 (there are various implementation of the `iconv` API, see [godoc.org][iconv] for other options): - -```bash -$ go get -u github.com/djimenez/iconv-go -``` - -and then: - -```golang -// Load the URL -res, err := http.Get(url) -if err != nil { - // handle error -} -defer res.Body.Close() - -// Convert the designated charset HTML to utf-8 encoded HTML. -// `charset` being one of the charsets known by the iconv package. -utfBody, err := iconv.NewReader(res.Body, charset, "utf-8") -if err != nil { - // handler error -} - -// use utfBody using goquery -doc, err := goquery.NewDocumentFromReader(utfBody) -if err != nil { - // handler error -} -// use doc... -``` - -Thanks to github user @YuheiNakasaka. - -Actually, the official go.text repository covers this use case too, see its [godoc page][text] for the details. - - -## Handle Javascript-based Pages - -`goquery` is great to handle normal html pages, but when most of the page is build dynamically using javascript, there's not much it can do. There are various options when faced with this problem: - -* Use a headless browser such as [webloop][]. -* Use a Go javascript parser package, such as [otto][]. - -You can find a code example using `otto` [in this gist][exotto]. Thanks to github user @cryptix. - -## For Loop - -If all you need is a normal `for` loop over all nodes in the current selection, where `Map/Each`-style iteration is not necessary, you can use the following: - -```golang -sel := Doc().Find(".selector") -for i := range sel.Nodes { - single := sel.Eq(i) - // use `single` as a selection of 1 node -} -``` - -Thanks to github user @jmoiron. - -[webloop]: https://github.com/sourcegraph/webloop -[otto]: https://github.com/robertkrimen/otto -[exotto]: https://gist.github.com/cryptix/87127f76a94183747b53 -[iconv]: http://godoc.org/?q=iconv -[text]: https://godoc.org/golang.org/x/text/encoding diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/example_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/example_test.go deleted file mode 100644 index 924e8d1a8..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package goquery_test - -import ( - "fmt" - "log" - "net/http" - "os" - "strings" - - "github.com/PuerkitoBio/goquery" -) - -// This example scrapes the reviews shown on the home page of metalsucks.net. -func Example() { - // Request the HTML page. - res, err := http.Get("http://metalsucks.net") - if err != nil { - log.Fatal(err) - } - defer res.Body.Close() - if res.StatusCode != 200 { - log.Fatalf("status code error: %d %s", res.StatusCode, res.Status) - } - - // Load the HTML document - doc, err := goquery.NewDocumentFromReader(res.Body) - if err != nil { - log.Fatal(err) - } - - // Find the review items - doc.Find(".sidebar-reviews article .content-block").Each(func(i int, s *goquery.Selection) { - // For each item found, get the band and title - band := s.Find("a").Text() - title := s.Find("i").Text() - fmt.Printf("Review %d: %s - %s\n", i, band, title) - }) - // To see the output of the Example while running the test suite (go test), simply - // remove the leading "x" before Output on the next line. This will cause the - // example to fail (all the "real" tests should pass). - - // xOutput: voluntarily fail the Example output. -} - -// This example shows how to use NewDocumentFromReader from a file. -func ExampleNewDocumentFromReader_file() { - // create from a file - f, err := os.Open("some/file.html") - if err != nil { - log.Fatal(err) - } - defer f.Close() - doc, err := goquery.NewDocumentFromReader(f) - if err != nil { - log.Fatal(err) - } - // use the goquery document... - _ = doc.Find("h1") -} - -// This example shows how to use NewDocumentFromReader from a string. -func ExampleNewDocumentFromReader_string() { - // create from a string - data := ` - - - My document - - -

Header

- -` - - doc, err := goquery.NewDocumentFromReader(strings.NewReader(data)) - if err != nil { - log.Fatal(err) - } - header := doc.Find("h1").Text() - fmt.Println(header) - - // Output: Header -} - -func ExampleSingle() { - html := ` - - -
1
-
2
-
3
- - -` - doc, err := goquery.NewDocumentFromReader(strings.NewReader(html)) - if err != nil { - log.Fatal(err) - } - - // By default, the selector string selects all matching nodes - multiSel := doc.Find("div") - fmt.Println(multiSel.Text()) - - // Using goquery.Single, only the first match is selected - singleSel := doc.FindMatcher(goquery.Single("div")) - fmt.Println(singleSel.Text()) - - // Output: - // 123 - // 1 -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/expand.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/expand.go deleted file mode 100644 index 7caade531..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/expand.go +++ /dev/null @@ -1,70 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Add adds the selector string's matching nodes to those in the current -// selection and returns a new Selection object. -// The selector string is run in the context of the document of the current -// Selection object. -func (s *Selection) Add(selector string) *Selection { - return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, compileMatcher(selector))...) -} - -// AddMatcher adds the matcher's matching nodes to those in the current -// selection and returns a new Selection object. -// The matcher is run in the context of the document of the current -// Selection object. -func (s *Selection) AddMatcher(m Matcher) *Selection { - return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, m)...) -} - -// AddSelection adds the specified Selection object's nodes to those in the -// current selection and returns a new Selection object. -func (s *Selection) AddSelection(sel *Selection) *Selection { - if sel == nil { - return s.AddNodes() - } - return s.AddNodes(sel.Nodes...) -} - -// Union is an alias for AddSelection. -func (s *Selection) Union(sel *Selection) *Selection { - return s.AddSelection(sel) -} - -// AddNodes adds the specified nodes to those in the -// current selection and returns a new Selection object. -func (s *Selection) AddNodes(nodes ...*html.Node) *Selection { - return pushStack(s, appendWithoutDuplicates(s.Nodes, nodes, nil)) -} - -// AndSelf adds the previous set of elements on the stack to the current set. -// It returns a new Selection object containing the current Selection combined -// with the previous one. -// Deprecated: This function has been deprecated and is now an alias for AddBack(). -func (s *Selection) AndSelf() *Selection { - return s.AddBack() -} - -// AddBack adds the previous set of elements on the stack to the current set. -// It returns a new Selection object containing the current Selection combined -// with the previous one. -func (s *Selection) AddBack() *Selection { - return s.AddSelection(s.prevSel) -} - -// AddBackFiltered reduces the previous set of elements on the stack to those that -// match the selector string, and adds them to the current set. -// It returns a new Selection object containing the current Selection combined -// with the filtered previous one -func (s *Selection) AddBackFiltered(selector string) *Selection { - return s.AddSelection(s.prevSel.Filter(selector)) -} - -// AddBackMatcher reduces the previous set of elements on the stack to those that match -// the mateher, and adds them to the curernt set. -// It returns a new Selection object containing the current Selection combined -// with the filtered previous one -func (s *Selection) AddBackMatcher(m Matcher) *Selection { - return s.AddSelection(s.prevSel.FilterMatcher(m)) -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/expand_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/expand_test.go deleted file mode 100644 index c034dc62a..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/expand_test.go +++ /dev/null @@ -1,118 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestAdd(t *testing.T) { - sel := Doc().Find("div.row-fluid").Add("a") - assertLength(t, sel.Nodes, 19) -} - -func TestAddInvalid(t *testing.T) { - sel1 := Doc().Find("div.row-fluid") - sel2 := sel1.Add("") - assertLength(t, sel1.Nodes, 9) - assertLength(t, sel2.Nodes, 9) - if sel1 == sel2 { - t.Errorf("selections should not be the same") - } -} - -func TestAddRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Add("a").End() - assertEqual(t, sel, sel2) -} - -func TestAddSelection(t *testing.T) { - sel := Doc().Find("div.row-fluid") - sel2 := Doc().Find("a") - sel = sel.AddSelection(sel2) - assertLength(t, sel.Nodes, 19) -} - -func TestAddSelectionNil(t *testing.T) { - sel := Doc().Find("div.row-fluid") - assertLength(t, sel.Nodes, 9) - - sel = sel.AddSelection(nil) - assertLength(t, sel.Nodes, 9) -} - -func TestAddSelectionRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a") - sel2 = sel.AddSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestAddNodes(t *testing.T) { - sel := Doc().Find("div.pvk-gutter") - sel2 := Doc().Find(".pvk-content") - sel = sel.AddNodes(sel2.Nodes...) - assertLength(t, sel.Nodes, 9) -} - -func TestAddNodesNone(t *testing.T) { - sel := Doc().Find("div.pvk-gutter").AddNodes() - assertLength(t, sel.Nodes, 6) -} - -func TestAddNodesRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a") - sel2 = sel.AddNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestAddNodesBig(t *testing.T) { - doc := DocW() - sel := doc.Find("li") - assertLength(t, sel.Nodes, 373) - sel2 := doc.Find("xyz") - assertLength(t, sel2.Nodes, 0) - - nodes := sel.Nodes - sel2 = sel2.AddNodes(nodes...) - assertLength(t, sel2.Nodes, 373) - nodes2 := append(nodes, nodes...) - sel2 = sel2.End().AddNodes(nodes2...) - assertLength(t, sel2.Nodes, 373) - nodes3 := append(nodes2, nodes...) - sel2 = sel2.End().AddNodes(nodes3...) - assertLength(t, sel2.Nodes, 373) -} - -func TestAndSelf(t *testing.T) { - sel := Doc().Find(".span12").Last().AndSelf() - assertLength(t, sel.Nodes, 2) -} - -func TestAndSelfRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a").AndSelf().End().End() - assertEqual(t, sel, sel2) -} - -func TestAddBack(t *testing.T) { - sel := Doc().Find(".span12").Last().AddBack() - assertLength(t, sel.Nodes, 2) -} - -func TestAddBackRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Find("a").AddBack().End().End() - assertEqual(t, sel, sel2) -} - -func TestAddBackFiltered(t *testing.T) { - sel := Doc().Find(".span12, .footer").Find("h1").AddBackFiltered(".footer") - assertLength(t, sel.Nodes, 2) -} - -func TestAddBackFilteredRollback(t *testing.T) { - sel := Doc().Find(".span12, .footer") - sel2 := sel.Find("h1").AddBackFiltered(".footer").End().End() - assertEqual(t, sel, sel2) -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/filter.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/filter.go deleted file mode 100644 index 9138ffb33..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/filter.go +++ /dev/null @@ -1,163 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Filter reduces the set of matched elements to those that match the selector string. -// It returns a new Selection object for this subset of matching elements. -func (s *Selection) Filter(selector string) *Selection { - return s.FilterMatcher(compileMatcher(selector)) -} - -// FilterMatcher reduces the set of matched elements to those that match -// the given matcher. It returns a new Selection object for this subset -// of matching elements. -func (s *Selection) FilterMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, true)) -} - -// Not removes elements from the Selection that match the selector string. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) Not(selector string) *Selection { - return s.NotMatcher(compileMatcher(selector)) -} - -// NotMatcher removes elements from the Selection that match the given matcher. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, false)) -} - -// FilterFunction reduces the set of matched elements to those that pass the function's test. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection { - return pushStack(s, winnowFunction(s, f, true)) -} - -// NotFunction removes elements from the Selection that pass the function's test. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection { - return pushStack(s, winnowFunction(s, f, false)) -} - -// FilterNodes reduces the set of matched elements to those that match the specified nodes. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterNodes(nodes ...*html.Node) *Selection { - return pushStack(s, winnowNodes(s, nodes, true)) -} - -// NotNodes removes elements from the Selection that match the specified nodes. -// It returns a new Selection object with the matching elements removed. -func (s *Selection) NotNodes(nodes ...*html.Node) *Selection { - return pushStack(s, winnowNodes(s, nodes, false)) -} - -// FilterSelection reduces the set of matched elements to those that match a -// node in the specified Selection object. -// It returns a new Selection object for this subset of elements. -func (s *Selection) FilterSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, winnowNodes(s, nil, true)) - } - return pushStack(s, winnowNodes(s, sel.Nodes, true)) -} - -// NotSelection removes elements from the Selection that match a node in the specified -// Selection object. It returns a new Selection object with the matching elements removed. -func (s *Selection) NotSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, winnowNodes(s, nil, false)) - } - return pushStack(s, winnowNodes(s, sel.Nodes, false)) -} - -// Intersection is an alias for FilterSelection. -func (s *Selection) Intersection(sel *Selection) *Selection { - return s.FilterSelection(sel) -} - -// Has reduces the set of matched elements to those that have a descendant -// that matches the selector. -// It returns a new Selection object with the matching elements. -func (s *Selection) Has(selector string) *Selection { - return s.HasSelection(s.document.Find(selector)) -} - -// HasMatcher reduces the set of matched elements to those that have a descendant -// that matches the matcher. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasMatcher(m Matcher) *Selection { - return s.HasSelection(s.document.FindMatcher(m)) -} - -// HasNodes reduces the set of matched elements to those that have a -// descendant that matches one of the nodes. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasNodes(nodes ...*html.Node) *Selection { - return s.FilterFunction(func(_ int, sel *Selection) bool { - // Add all nodes that contain one of the specified nodes - for _, n := range nodes { - if sel.Contains(n) { - return true - } - } - return false - }) -} - -// HasSelection reduces the set of matched elements to those that have a -// descendant that matches one of the nodes of the specified Selection object. -// It returns a new Selection object with the matching elements. -func (s *Selection) HasSelection(sel *Selection) *Selection { - if sel == nil { - return s.HasNodes() - } - return s.HasNodes(sel.Nodes...) -} - -// End ends the most recent filtering operation in the current chain and -// returns the set of matched elements to its previous state. -func (s *Selection) End() *Selection { - if s.prevSel != nil { - return s.prevSel - } - return newEmptySelection(s.document) -} - -// Filter based on the matcher, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnow(sel *Selection, m Matcher, keep bool) []*html.Node { - // Optimize if keep is requested - if keep { - return m.Filter(sel.Nodes) - } - // Use grep - return grep(sel, func(i int, s *Selection) bool { - return !m.Match(s.Get(0)) - }) -} - -// Filter based on an array of nodes, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node { - if len(nodes)+len(sel.Nodes) < minNodesForSet { - return grep(sel, func(i int, s *Selection) bool { - return isInSlice(nodes, s.Get(0)) == keep - }) - } - - set := make(map[*html.Node]bool) - for _, n := range nodes { - set[n] = true - } - return grep(sel, func(i int, s *Selection) bool { - return set[s.Get(0)] == keep - }) -} - -// Filter based on a function test, and the indicator to keep (Filter) or -// to get rid of (Not) the matching elements. -func winnowFunction(sel *Selection, f func(int, *Selection) bool, keep bool) []*html.Node { - return grep(sel, func(i int, s *Selection) bool { - return f(i, s) == keep - }) -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/filter_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/filter_test.go deleted file mode 100644 index f663c08f6..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/filter_test.go +++ /dev/null @@ -1,206 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestFilter(t *testing.T) { - sel := Doc().Find(".span12").Filter(".alert") - assertLength(t, sel.Nodes, 1) -} - -func TestFilterNone(t *testing.T) { - sel := Doc().Find(".span12").Filter(".zzalert") - assertLength(t, sel.Nodes, 0) -} - -func TestFilterInvalid(t *testing.T) { - sel := Doc().Find(".span12").Filter("") - assertLength(t, sel.Nodes, 0) -} - -func TestFilterRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Filter(".alert").End() - assertEqual(t, sel, sel2) -} - -func TestFilterFunction(t *testing.T) { - sel := Doc().Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool { - return i > 0 - }) - assertLength(t, sel.Nodes, 2) -} - -func TestFilterFunctionRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.FilterFunction(func(i int, s *Selection) bool { - return i > 0 - }).End() - assertEqual(t, sel, sel2) -} - -func TestFilterNode(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.FilterNodes(sel.Nodes[2]) - assertLength(t, sel2.Nodes, 1) -} - -func TestFilterNodeRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.FilterNodes(sel.Nodes[2]).End() - assertEqual(t, sel, sel2) -} - -func TestFilterSelection(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel3 := sel.FilterSelection(sel2) - assertLength(t, sel3.Nodes, 1) -} - -func TestFilterSelectionRollback(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel2 = sel.FilterSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestFilterSelectionNil(t *testing.T) { - var sel2 *Selection - - sel := Doc().Find(".link") - sel3 := sel.FilterSelection(sel2) - assertLength(t, sel3.Nodes, 0) -} - -func TestNot(t *testing.T) { - sel := Doc().Find(".span12").Not(".alert") - assertLength(t, sel.Nodes, 1) -} - -func TestNotInvalid(t *testing.T) { - sel := Doc().Find(".span12").Not("") - assertLength(t, sel.Nodes, 2) -} - -func TestNotRollback(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.Not(".alert").End() - assertEqual(t, sel, sel2) -} - -func TestNotNone(t *testing.T) { - sel := Doc().Find(".span12").Not(".zzalert") - assertLength(t, sel.Nodes, 2) -} - -func TestNotFunction(t *testing.T) { - sel := Doc().Find(".pvk-content").NotFunction(func(i int, s *Selection) bool { - return i > 0 - }) - assertLength(t, sel.Nodes, 1) -} - -func TestNotFunctionRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.NotFunction(func(i int, s *Selection) bool { - return i > 0 - }).End() - assertEqual(t, sel, sel2) -} - -func TestNotNode(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.NotNodes(sel.Nodes[2]) - assertLength(t, sel2.Nodes, 2) -} - -func TestNotNodeRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.NotNodes(sel.Nodes[2]).End() - assertEqual(t, sel, sel2) -} - -func TestNotSelection(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel3 := sel.NotSelection(sel2) - assertLength(t, sel3.Nodes, 6) -} - -func TestNotSelectionRollback(t *testing.T) { - sel := Doc().Find(".link") - sel2 := Doc().Find("a[ng-click]") - sel2 = sel.NotSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestIntersection(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := Doc().Find("div").Intersection(sel) - assertLength(t, sel2.Nodes, 6) -} - -func TestIntersectionRollback(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := Doc().Find("div") - sel2 = sel.Intersection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestHas(t *testing.T) { - sel := Doc().Find(".container-fluid").Has(".center-content") - assertLength(t, sel.Nodes, 2) - // Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content -} - -func TestHasInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").Has("") - assertLength(t, sel.Nodes, 0) -} - -func TestHasRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Has(".center-content").End() - assertEqual(t, sel, sel2) -} - -func TestHasNodes(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".center-content") - sel = sel.HasNodes(sel2.Nodes...) - assertLength(t, sel.Nodes, 2) - // Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content -} - -func TestHasNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".center-content") - sel2 = sel.HasNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestHasSelection(t *testing.T) { - sel := Doc().Find("p") - sel2 := Doc().Find("small") - sel = sel.HasSelection(sel2) - assertLength(t, sel.Nodes, 1) -} - -func TestHasSelectionRollback(t *testing.T) { - sel := Doc().Find("p") - sel2 := Doc().Find("small") - sel2 = sel.HasSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestEnd(t *testing.T) { - sel := Doc().Find("p").Has("small").End() - assertLength(t, sel.Nodes, 4) -} - -func TestEndToTop(t *testing.T) { - sel := Doc().Find("p").Has("small").End().End().End() - assertLength(t, sel.Nodes, 0) -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/go.mod b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/go.mod deleted file mode 100644 index 4b5a30963..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/PuerkitoBio/goquery - -require ( - github.com/andybalholm/cascadia v1.3.1 - golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 -) - -go 1.13 diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/go.sum b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/go.sum deleted file mode 100644 index 167f12d2d..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/go.sum +++ /dev/null @@ -1,9 +0,0 @@ -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= -github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/iteration.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/iteration.go deleted file mode 100644 index e246f2e0e..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/iteration.go +++ /dev/null @@ -1,39 +0,0 @@ -package goquery - -// Each iterates over a Selection object, executing a function for each -// matched element. It returns the current Selection object. The function -// f is called for each element in the selection with the index of the -// element in that selection starting at 0, and a *Selection that contains -// only that element. -func (s *Selection) Each(f func(int, *Selection)) *Selection { - for i, n := range s.Nodes { - f(i, newSingleSelection(n, s.document)) - } - return s -} - -// EachWithBreak iterates over a Selection object, executing a function for each -// matched element. It is identical to Each except that it is possible to break -// out of the loop by returning false in the callback function. It returns the -// current Selection object. -func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection { - for i, n := range s.Nodes { - if !f(i, newSingleSelection(n, s.document)) { - return s - } - } - return s -} - -// Map passes each element in the current matched set through a function, -// producing a slice of string holding the returned values. The function -// f is called for each element in the selection with the index of the -// element in that selection starting at 0, and a *Selection that contains -// only that element. -func (s *Selection) Map(f func(int, *Selection) string) (result []string) { - for i, n := range s.Nodes { - result = append(result, f(i, newSingleSelection(n, s.document))) - } - - return result -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/iteration_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/iteration_test.go deleted file mode 100644 index 9b6aafb7b..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/iteration_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package goquery - -import ( - "testing" - - "golang.org/x/net/html" -) - -func TestEach(t *testing.T) { - var cnt int - - sel := Doc().Find(".hero-unit .row-fluid").Each(func(i int, n *Selection) { - cnt++ - t.Logf("At index %v, node %v", i, n.Nodes[0].Data) - }).Find("a") - - if cnt != 4 { - t.Errorf("Expected Each() to call function 4 times, got %v times.", cnt) - } - assertLength(t, sel.Nodes, 6) -} - -func TestEachWithBreak(t *testing.T) { - var cnt int - - sel := Doc().Find(".hero-unit .row-fluid").EachWithBreak(func(i int, n *Selection) bool { - cnt++ - t.Logf("At index %v, node %v", i, n.Nodes[0].Data) - return false - }).Find("a") - - if cnt != 1 { - t.Errorf("Expected Each() to call function 1 time, got %v times.", cnt) - } - assertLength(t, sel.Nodes, 6) -} - -func TestEachEmptySelection(t *testing.T) { - var cnt int - - sel := Doc().Find("zzzz") - sel.Each(func(i int, n *Selection) { - cnt++ - }) - if cnt > 0 { - t.Error("Expected Each() to not be called on empty Selection.") - } - sel2 := sel.Find("div") - assertLength(t, sel2.Nodes, 0) -} - -func TestMap(t *testing.T) { - sel := Doc().Find(".pvk-content") - vals := sel.Map(func(i int, s *Selection) string { - n := s.Get(0) - if n.Type == html.ElementNode { - return n.Data - } - return "" - }) - for _, v := range vals { - if v != "div" { - t.Error("Expected Map array result to be all 'div's.") - } - } - if len(vals) != 3 { - t.Errorf("Expected Map array result to have a length of 3, found %v.", len(vals)) - } -} - -func TestForRange(t *testing.T) { - sel := Doc().Find(".pvk-content") - initLen := sel.Length() - for i := range sel.Nodes { - single := sel.Eq(i) - //h, err := single.Html() - //if err != nil { - // t.Fatal(err) - //} - //fmt.Println(i, h) - if single.Length() != 1 { - t.Errorf("%d: expected length of 1, got %d", i, single.Length()) - } - } - if sel.Length() != initLen { - t.Errorf("expected initial selection to still have length %d, got %d", initLen, sel.Length()) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/manipulation.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/manipulation.go deleted file mode 100644 index 35febf118..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/manipulation.go +++ /dev/null @@ -1,679 +0,0 @@ -package goquery - -import ( - "strings" - - "golang.org/x/net/html" -) - -// After applies the selector from the root document and inserts the matched elements -// after the elements in the set of matched elements. -// -// If one of the matched elements in the selection is not currently in the -// document, it's impossible to insert nodes after it, so it will be ignored. -// -// This follows the same rules as Selection.Append. -func (s *Selection) After(selector string) *Selection { - return s.AfterMatcher(compileMatcher(selector)) -} - -// AfterMatcher applies the matcher from the root document and inserts the matched elements -// after the elements in the set of matched elements. -// -// If one of the matched elements in the selection is not currently in the -// document, it's impossible to insert nodes after it, so it will be ignored. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterMatcher(m Matcher) *Selection { - return s.AfterNodes(m.MatchAll(s.document.rootNode)...) -} - -// AfterSelection inserts the elements in the selection after each element in the set of matched -// elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterSelection(sel *Selection) *Selection { - return s.AfterNodes(sel.Nodes...) -} - -// AfterHtml parses the html and inserts it after the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterHtml(htmlStr string) *Selection { - return s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) { - nextSibling := node.NextSibling - for _, n := range nodes { - if node.Parent != nil { - node.Parent.InsertBefore(n, nextSibling) - } - } - }) -} - -// AfterNodes inserts the nodes after each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AfterNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) { - if sn.Parent != nil { - sn.Parent.InsertBefore(n, sn.NextSibling) - } - }) -} - -// Append appends the elements specified by the selector to the end of each element -// in the set of matched elements, following those rules: -// -// 1) The selector is applied to the root document. -// -// 2) Elements that are part of the document will be moved to the new location. -// -// 3) If there are multiple locations to append to, cloned nodes will be -// appended to all target locations except the last one, which will be moved -// as noted in (2). -func (s *Selection) Append(selector string) *Selection { - return s.AppendMatcher(compileMatcher(selector)) -} - -// AppendMatcher appends the elements specified by the matcher to the end of each element -// in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendMatcher(m Matcher) *Selection { - return s.AppendNodes(m.MatchAll(s.document.rootNode)...) -} - -// AppendSelection appends the elements in the selection to the end of each element -// in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendSelection(sel *Selection) *Selection { - return s.AppendNodes(sel.Nodes...) -} - -// AppendHtml parses the html and appends it to the set of matched elements. -func (s *Selection) AppendHtml(htmlStr string) *Selection { - return s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) { - for _, n := range nodes { - node.AppendChild(n) - } - }) -} - -// AppendNodes appends the specified nodes to each node in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) AppendNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) { - sn.AppendChild(n) - }) -} - -// Before inserts the matched elements before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) Before(selector string) *Selection { - return s.BeforeMatcher(compileMatcher(selector)) -} - -// BeforeMatcher inserts the matched elements before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeMatcher(m Matcher) *Selection { - return s.BeforeNodes(m.MatchAll(s.document.rootNode)...) -} - -// BeforeSelection inserts the elements in the selection before each element in the set of matched -// elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeSelection(sel *Selection) *Selection { - return s.BeforeNodes(sel.Nodes...) -} - -// BeforeHtml parses the html and inserts it before the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeHtml(htmlStr string) *Selection { - return s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) { - for _, n := range nodes { - if node.Parent != nil { - node.Parent.InsertBefore(n, node) - } - } - }) -} - -// BeforeNodes inserts the nodes before each element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) BeforeNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, false, func(sn *html.Node, n *html.Node) { - if sn.Parent != nil { - sn.Parent.InsertBefore(n, sn) - } - }) -} - -// Clone creates a deep copy of the set of matched nodes. The new nodes will not be -// attached to the document. -func (s *Selection) Clone() *Selection { - ns := newEmptySelection(s.document) - ns.Nodes = cloneNodes(s.Nodes) - return ns -} - -// Empty removes all children nodes from the set of matched elements. -// It returns the children nodes in a new Selection. -func (s *Selection) Empty() *Selection { - var nodes []*html.Node - - for _, n := range s.Nodes { - for c := n.FirstChild; c != nil; c = n.FirstChild { - n.RemoveChild(c) - nodes = append(nodes, c) - } - } - - return pushStack(s, nodes) -} - -// Prepend prepends the elements specified by the selector to each element in -// the set of matched elements, following the same rules as Append. -func (s *Selection) Prepend(selector string) *Selection { - return s.PrependMatcher(compileMatcher(selector)) -} - -// PrependMatcher prepends the elements specified by the matcher to each -// element in the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependMatcher(m Matcher) *Selection { - return s.PrependNodes(m.MatchAll(s.document.rootNode)...) -} - -// PrependSelection prepends the elements in the selection to each element in -// the set of matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependSelection(sel *Selection) *Selection { - return s.PrependNodes(sel.Nodes...) -} - -// PrependHtml parses the html and prepends it to the set of matched elements. -func (s *Selection) PrependHtml(htmlStr string) *Selection { - return s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) { - firstChild := node.FirstChild - for _, n := range nodes { - node.InsertBefore(n, firstChild) - } - }) -} - -// PrependNodes prepends the specified nodes to each node in the set of -// matched elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) PrependNodes(ns ...*html.Node) *Selection { - return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) { - // sn.FirstChild may be nil, in which case this functions like - // sn.AppendChild() - sn.InsertBefore(n, sn.FirstChild) - }) -} - -// Remove removes the set of matched elements from the document. -// It returns the same selection, now consisting of nodes not in the document. -func (s *Selection) Remove() *Selection { - for _, n := range s.Nodes { - if n.Parent != nil { - n.Parent.RemoveChild(n) - } - } - - return s -} - -// RemoveFiltered removes from the current set of matched elements those that -// match the selector filter. It returns the Selection of removed nodes. -// -// For example if the selection s contains "

", "

" and "

" -// and s.RemoveFiltered("h2") is called, only the "

" node is removed -// (and returned), while "

" and "

" are kept in the document. -func (s *Selection) RemoveFiltered(selector string) *Selection { - return s.RemoveMatcher(compileMatcher(selector)) -} - -// RemoveMatcher removes from the current set of matched elements those that -// match the Matcher filter. It returns the Selection of removed nodes. -// See RemoveFiltered for additional information. -func (s *Selection) RemoveMatcher(m Matcher) *Selection { - return s.FilterMatcher(m).Remove() -} - -// ReplaceWith replaces each element in the set of matched elements with the -// nodes matched by the given selector. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWith(selector string) *Selection { - return s.ReplaceWithMatcher(compileMatcher(selector)) -} - -// ReplaceWithMatcher replaces each element in the set of matched elements with -// the nodes matched by the given Matcher. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithMatcher(m Matcher) *Selection { - return s.ReplaceWithNodes(m.MatchAll(s.document.rootNode)...) -} - -// ReplaceWithSelection replaces each element in the set of matched elements with -// the nodes from the given Selection. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithSelection(sel *Selection) *Selection { - return s.ReplaceWithNodes(sel.Nodes...) -} - -// ReplaceWithHtml replaces each element in the set of matched elements with -// the parsed HTML. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithHtml(htmlStr string) *Selection { - s.eachNodeHtml(htmlStr, true, func(node *html.Node, nodes []*html.Node) { - nextSibling := node.NextSibling - for _, n := range nodes { - if node.Parent != nil { - node.Parent.InsertBefore(n, nextSibling) - } - } - }) - return s.Remove() -} - -// ReplaceWithNodes replaces each element in the set of matched elements with -// the given nodes. -// It returns the removed elements. -// -// This follows the same rules as Selection.Append. -func (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection { - s.AfterNodes(ns...) - return s.Remove() -} - -// SetHtml sets the html content of each element in the selection to -// specified html string. -func (s *Selection) SetHtml(htmlStr string) *Selection { - for _, context := range s.Nodes { - for c := context.FirstChild; c != nil; c = context.FirstChild { - context.RemoveChild(c) - } - } - return s.eachNodeHtml(htmlStr, false, func(node *html.Node, nodes []*html.Node) { - for _, n := range nodes { - node.AppendChild(n) - } - }) -} - -// SetText sets the content of each element in the selection to specified content. -// The provided text string is escaped. -func (s *Selection) SetText(text string) *Selection { - return s.SetHtml(html.EscapeString(text)) -} - -// Unwrap removes the parents of the set of matched elements, leaving the matched -// elements (and their siblings, if any) in their place. -// It returns the original selection. -func (s *Selection) Unwrap() *Selection { - s.Parent().Each(func(i int, ss *Selection) { - // For some reason, jquery allows unwrap to remove the element, so - // allowing it here too. Same for . Why it allows those elements to - // be unwrapped while not allowing body is a mystery to me. - if ss.Nodes[0].Data != "body" { - ss.ReplaceWithSelection(ss.Contents()) - } - }) - - return s -} - -// Wrap wraps each element in the set of matched elements inside the first -// element matched by the given selector. The matched child is cloned before -// being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) Wrap(selector string) *Selection { - return s.WrapMatcher(compileMatcher(selector)) -} - -// WrapMatcher wraps each element in the set of matched elements inside the -// first element matched by the given matcher. The matched child is cloned -// before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapMatcher(m Matcher) *Selection { - return s.wrapNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapSelection wraps each element in the set of matched elements inside the -// first element in the given Selection. The element is cloned before being -// inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapSelection(sel *Selection) *Selection { - return s.wrapNodes(sel.Nodes...) -} - -// WrapHtml wraps each element in the set of matched elements inside the inner- -// most child of the given HTML. -// -// It returns the original set of elements. -func (s *Selection) WrapHtml(htmlStr string) *Selection { - nodesMap := make(map[string][]*html.Node) - for _, context := range s.Nodes { - var parent *html.Node - if context.Parent != nil { - parent = context.Parent - } else { - parent = &html.Node{Type: html.ElementNode} - } - nodes, found := nodesMap[nodeName(parent)] - if !found { - nodes = parseHtmlWithContext(htmlStr, parent) - nodesMap[nodeName(parent)] = nodes - } - newSingleSelection(context, s.document).wrapAllNodes(cloneNodes(nodes)...) - } - return s -} - -// WrapNode wraps each element in the set of matched elements inside the inner- -// most child of the given node. The given node is copied before being inserted -// into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapNode(n *html.Node) *Selection { - return s.wrapNodes(n) -} - -func (s *Selection) wrapNodes(ns ...*html.Node) *Selection { - s.Each(func(i int, ss *Selection) { - ss.wrapAllNodes(ns...) - }) - - return s -} - -// WrapAll wraps a single HTML structure, matched by the given selector, around -// all elements in the set of matched elements. The matched child is cloned -// before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAll(selector string) *Selection { - return s.WrapAllMatcher(compileMatcher(selector)) -} - -// WrapAllMatcher wraps a single HTML structure, matched by the given Matcher, -// around all elements in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllMatcher(m Matcher) *Selection { - return s.wrapAllNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapAllSelection wraps a single HTML structure, the first node of the given -// Selection, around all elements in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllSelection(sel *Selection) *Selection { - return s.wrapAllNodes(sel.Nodes...) -} - -// WrapAllHtml wraps the given HTML structure around all elements in the set of -// matched elements. The matched child is cloned before being inserted into the -// document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllHtml(htmlStr string) *Selection { - var context *html.Node - var nodes []*html.Node - if len(s.Nodes) > 0 { - context = s.Nodes[0] - if context.Parent != nil { - nodes = parseHtmlWithContext(htmlStr, context) - } else { - nodes = parseHtml(htmlStr) - } - } - return s.wrapAllNodes(nodes...) -} - -func (s *Selection) wrapAllNodes(ns ...*html.Node) *Selection { - if len(ns) > 0 { - return s.WrapAllNode(ns[0]) - } - return s -} - -// WrapAllNode wraps the given node around the first element in the Selection, -// making all other nodes in the Selection children of the given node. The node -// is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapAllNode(n *html.Node) *Selection { - if s.Size() == 0 { - return s - } - - wrap := cloneNode(n) - - first := s.Nodes[0] - if first.Parent != nil { - first.Parent.InsertBefore(wrap, first) - first.Parent.RemoveChild(first) - } - - for c := getFirstChildEl(wrap); c != nil; c = getFirstChildEl(wrap) { - wrap = c - } - - newSingleSelection(wrap, s.document).AppendSelection(s) - - return s -} - -// WrapInner wraps an HTML structure, matched by the given selector, around the -// content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInner(selector string) *Selection { - return s.WrapInnerMatcher(compileMatcher(selector)) -} - -// WrapInnerMatcher wraps an HTML structure, matched by the given selector, -// around the content of element in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerMatcher(m Matcher) *Selection { - return s.wrapInnerNodes(m.MatchAll(s.document.rootNode)...) -} - -// WrapInnerSelection wraps an HTML structure, matched by the given selector, -// around the content of element in the set of matched elements. The matched -// child is cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerSelection(sel *Selection) *Selection { - return s.wrapInnerNodes(sel.Nodes...) -} - -// WrapInnerHtml wraps an HTML structure, matched by the given selector, around -// the content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerHtml(htmlStr string) *Selection { - nodesMap := make(map[string][]*html.Node) - for _, context := range s.Nodes { - nodes, found := nodesMap[nodeName(context)] - if !found { - nodes = parseHtmlWithContext(htmlStr, context) - nodesMap[nodeName(context)] = nodes - } - newSingleSelection(context, s.document).wrapInnerNodes(cloneNodes(nodes)...) - } - return s -} - -// WrapInnerNode wraps an HTML structure, matched by the given selector, around -// the content of element in the set of matched elements. The matched child is -// cloned before being inserted into the document. -// -// It returns the original set of elements. -func (s *Selection) WrapInnerNode(n *html.Node) *Selection { - return s.wrapInnerNodes(n) -} - -func (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection { - if len(ns) == 0 { - return s - } - - s.Each(func(i int, s *Selection) { - contents := s.Contents() - - if contents.Size() > 0 { - contents.wrapAllNodes(ns...) - } else { - s.AppendNodes(cloneNode(ns[0])) - } - }) - - return s -} - -func parseHtml(h string) []*html.Node { - // Errors are only returned when the io.Reader returns any error besides - // EOF, but strings.Reader never will - nodes, err := html.ParseFragment(strings.NewReader(h), &html.Node{Type: html.ElementNode}) - if err != nil { - panic("goquery: failed to parse HTML: " + err.Error()) - } - return nodes -} - -func parseHtmlWithContext(h string, context *html.Node) []*html.Node { - // Errors are only returned when the io.Reader returns any error besides - // EOF, but strings.Reader never will - nodes, err := html.ParseFragment(strings.NewReader(h), context) - if err != nil { - panic("goquery: failed to parse HTML: " + err.Error()) - } - return nodes -} - -// Get the first child that is an ElementNode -func getFirstChildEl(n *html.Node) *html.Node { - c := n.FirstChild - for c != nil && c.Type != html.ElementNode { - c = c.NextSibling - } - return c -} - -// Deep copy a slice of nodes. -func cloneNodes(ns []*html.Node) []*html.Node { - cns := make([]*html.Node, 0, len(ns)) - - for _, n := range ns { - cns = append(cns, cloneNode(n)) - } - - return cns -} - -// Deep copy a node. The new node has clones of all the original node's -// children but none of its parents or siblings. -func cloneNode(n *html.Node) *html.Node { - nn := &html.Node{ - Type: n.Type, - DataAtom: n.DataAtom, - Data: n.Data, - Attr: make([]html.Attribute, len(n.Attr)), - } - - copy(nn.Attr, n.Attr) - for c := n.FirstChild; c != nil; c = c.NextSibling { - nn.AppendChild(cloneNode(c)) - } - - return nn -} - -func (s *Selection) manipulateNodes(ns []*html.Node, reverse bool, - f func(sn *html.Node, n *html.Node)) *Selection { - - lasti := s.Size() - 1 - - // net.Html doesn't provide document fragments for insertion, so to get - // things in the correct order with After() and Prepend(), the callback - // needs to be called on the reverse of the nodes. - if reverse { - for i, j := 0, len(ns)-1; i < j; i, j = i+1, j-1 { - ns[i], ns[j] = ns[j], ns[i] - } - } - - for i, sn := range s.Nodes { - for _, n := range ns { - if i != lasti { - f(sn, cloneNode(n)) - } else { - if n.Parent != nil { - n.Parent.RemoveChild(n) - } - f(sn, n) - } - } - } - - return s -} - -// eachNodeHtml parses the given html string and inserts the resulting nodes in the dom with the mergeFn. -// The parsed nodes are inserted for each element of the selection. -// isParent can be used to indicate that the elements of the selection should be treated as the parent for the parsed html. -// A cache is used to avoid parsing the html multiple times should the elements of the selection result in the same context. -func (s *Selection) eachNodeHtml(htmlStr string, isParent bool, mergeFn func(n *html.Node, nodes []*html.Node)) *Selection { - // cache to avoid parsing the html for the same context multiple times - nodeCache := make(map[string][]*html.Node) - var context *html.Node - for _, n := range s.Nodes { - if isParent { - context = n.Parent - } else { - if n.Type != html.ElementNode { - continue - } - context = n - } - if context != nil { - nodes, found := nodeCache[nodeName(context)] - if !found { - nodes = parseHtmlWithContext(htmlStr, context) - nodeCache[nodeName(context)] = nodes - } - mergeFn(n, cloneNodes(nodes)) - } - } - return s -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/manipulation_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/manipulation_test.go deleted file mode 100644 index 111968912..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/manipulation_test.go +++ /dev/null @@ -1,739 +0,0 @@ -package goquery - -import ( - "log" - "testing" -) - -const ( - wrapHtml = "
test string

" -) - -func TestAfter(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").After("#nf6") - - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main + #nf6").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAfterMany(t *testing.T) { - doc := Doc2Clone() - doc.Find(".one").After("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 1) - assertLength(t, doc.Find("#main #nf6").Nodes, 1) - assertLength(t, doc.Find(".one + #nf6").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestAfterWithRemoved(t *testing.T) { - doc := Doc2Clone() - s := doc.Find("#main").Remove() - s.After("#nf6") - - assertLength(t, s.Find("#nf6").Nodes, 0) - assertLength(t, doc.Find("#nf6").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestAfterSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AfterSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#main #nf1, #main #nf2").Nodes, 0) - assertLength(t, doc.Find("#foot #nf1, #foot #nf2").Nodes, 0) - assertLength(t, doc.Find("#main + #nf1, #nf1 + #nf2").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestAfterHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AfterHtml("new node") - - assertLength(t, doc.Find("#main + strong").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAfterHtmlContext(t *testing.T) { - doc := loadString(t, ` - - - - - - - - - -
Before1
Before2
- - `) - doc.Find("table tr td").AfterHtml("TestAgain") - assertLength(t, doc.Find("table tr td").Nodes, 6) - assertClass(t, doc.Find("table tr td").Last(), "c2") - printSel(t, doc.Selection) -} - -func TestAppend(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").Append("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendBody(t *testing.T) { - doc := Doc2Clone() - doc.Find("body").Append("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("body > #nf6").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AppendSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#foot #nf1").Nodes, 0) - assertLength(t, doc.Find("#foot #nf2").Nodes, 0) - assertLength(t, doc.Find("#main #nf1").Nodes, 1) - assertLength(t, doc.Find("#main #nf2").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendSelectionExisting(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").AppendSelection(doc.Find("#n1, #n2")) - - assertClass(t, doc.Find("#main :nth-child(1)"), "three") - assertClass(t, doc.Find("#main :nth-child(5)"), "one") - assertClass(t, doc.Find("#main :nth-child(6)"), "two") - printSel(t, doc.Selection) -} - -func TestAppendClone(t *testing.T) { - doc := Doc2Clone() - doc.Find("#n1").AppendSelection(doc.Find("#nf1").Clone()) - - assertLength(t, doc.Find("#foot #nf1").Nodes, 1) - assertLength(t, doc.Find("#main #nf1").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestAppendHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("div").AppendHtml("new node") - - assertLength(t, doc.Find("strong").Nodes, 14) - printSel(t, doc.Selection) -} - -func TestAppendHtmlContext(t *testing.T) { - doc := loadString(t, ` - - - - - - - - - -
Before1
Before2
- - `) - doc.Find("table tr").AppendHtml("new1new2") - - assertLength(t, doc.Find("table td").Nodes, 6) - assertClass(t, doc.Find("table td").Last(), "c2") - printSel(t, doc.Selection) -} - -func TestBefore(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").Before("#nf6") - - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("body > #nf6:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestBeforeWithRemoved(t *testing.T) { - doc := Doc2Clone() - s := doc.Find("#main").Remove() - s.Before("#nf6") - - assertLength(t, s.Find("#nf6").Nodes, 0) - assertLength(t, doc.Find("#nf6").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestBeforeSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").BeforeSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#main #nf1, #main #nf2").Nodes, 0) - assertLength(t, doc.Find("#foot #nf1, #foot #nf2").Nodes, 0) - assertLength(t, doc.Find("body > #nf1:first-child, #nf1 + #nf2").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestBeforeHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").BeforeHtml("new node") - - assertLength(t, doc.Find("body > strong:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestBeforeHtmlContext(t *testing.T) { - doc := loadString(t, ` - - - - - - - - - -
Before1
Before2
- - `) - doc.Find("table tr td:first-child").BeforeHtml("new1new2") - - assertLength(t, doc.Find("table td").Nodes, 6) - assertClass(t, doc.Find("table td").First(), "c1") - printSel(t, doc.Selection) -} - -func TestEmpty(t *testing.T) { - doc := Doc2Clone() - s := doc.Find("#main").Empty() - - assertLength(t, doc.Find("#main").Children().Nodes, 0) - assertLength(t, s.Filter("div").Nodes, 6) - printSel(t, doc.Selection) -} - -func TestPrepend(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").Prepend("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependBody(t *testing.T) { - doc := Doc2Clone() - doc.Find("body").Prepend("#nf6") - - assertLength(t, doc.Find("#foot #nf6").Nodes, 0) - assertLength(t, doc.Find("#main #nf6").Nodes, 0) - assertLength(t, doc.Find("body > #nf6:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").PrependSelection(doc.Find("#nf1, #nf2")) - - assertLength(t, doc.Find("#foot #nf1").Nodes, 0) - assertLength(t, doc.Find("#foot #nf2").Nodes, 0) - assertLength(t, doc.Find("#main #nf1:first-child").Nodes, 1) - assertLength(t, doc.Find("#main #nf2:nth-child(2)").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependSelectionExisting(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main").PrependSelection(doc.Find("#n5, #n6")) - - assertClass(t, doc.Find("#main :nth-child(1)"), "five") - assertClass(t, doc.Find("#main :nth-child(2)"), "six") - assertClass(t, doc.Find("#main :nth-child(5)"), "three") - assertClass(t, doc.Find("#main :nth-child(6)"), "four") - printSel(t, doc.Selection) -} - -func TestPrependClone(t *testing.T) { - doc := Doc2Clone() - doc.Find("#n1").PrependSelection(doc.Find("#nf1").Clone()) - - assertLength(t, doc.Find("#foot #nf1:first-child").Nodes, 1) - assertLength(t, doc.Find("#main #nf1:first-child").Nodes, 1) - printSel(t, doc.Selection) -} - -func TestPrependHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("div").PrependHtml("new node") - - assertLength(t, doc.Find("strong:first-child").Nodes, 14) - printSel(t, doc.Selection) -} - -func TestPrependHtmlContext(t *testing.T) { - doc := loadString(t, ` - - - - - - - - - -
Before1
Before2
- - `) - doc.Find("table tr").PrependHtml("new nodeother new node") - - assertLength(t, doc.Find("table td").Nodes, 6) - assertClass(t, doc.Find("table tr td").First(), "c1") - printSel(t, doc.Selection) -} - -func TestRemove(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").Remove() - - assertLength(t, doc.Find("#foot #nf1").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestRemoveAll(t *testing.T) { - doc := Doc2Clone() - doc.Find("*").Remove() - - assertLength(t, doc.Find("*").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestRemoveRoot(t *testing.T) { - doc := Doc2Clone() - doc.Find("html").Remove() - - assertLength(t, doc.Find("html").Nodes, 0) - printSel(t, doc.Selection) -} - -func TestRemoveFiltered(t *testing.T) { - doc := Doc2Clone() - nf6 := doc.Find("#nf6") - s := doc.Find("div").RemoveFiltered("#nf6") - - assertLength(t, doc.Find("#nf6").Nodes, 0) - assertLength(t, s.Nodes, 1) - if nf6.Nodes[0] != s.Nodes[0] { - t.Error("Removed node does not match original") - } - printSel(t, doc.Selection) -} - -func TestReplaceWith(t *testing.T) { - doc := Doc2Clone() - - doc.Find("#nf6").ReplaceWith("#main") - assertLength(t, doc.Find("#foot #main:last-child").Nodes, 1) - printSel(t, doc.Selection) - - doc.Find("#foot").ReplaceWith("#main") - assertLength(t, doc.Find("#foot").Nodes, 0) - assertLength(t, doc.Find("#main").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestReplaceWithHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#main, #foot").ReplaceWithHtml("
") - - assertLength(t, doc.Find("#replace").Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestReplaceWithHtmlContext(t *testing.T) { - doc := loadString(t, ` - - - - - - - - - -
Before1
Before2
- - `) - doc.Find("table th").ReplaceWithHtml("TestReplace") - - assertLength(t, doc.Find("table th").Nodes, 0) - assertLength(t, doc.Find("table tr td").Nodes, 4) - assertClass(t, doc.Find("table tr td").First(), "c1") - printSel(t, doc.Selection) -} - -func TestSetHtml(t *testing.T) { - doc := Doc2Clone() - q := doc.Find("#main, #foot") - q.SetHtml(`
test
`) - - assertLength(t, doc.Find("#replace").Nodes, 2) - assertLength(t, doc.Find("#main, #foot").Nodes, 2) - - if q.Text() != "testtest" { - t.Errorf("Expected text to be %v, found %v", "testtest", q.Text()) - } - - printSel(t, doc.Selection) -} - -func TestSetHtmlNoMatch(t *testing.T) { - doc := Doc2Clone() - q := doc.Find("#notthere") - q.SetHtml(`
test
`) - - assertLength(t, doc.Find("#replace").Nodes, 0) - - printSel(t, doc.Selection) -} - -func TestSetHtmlEmpty(t *testing.T) { - doc := Doc2Clone() - q := doc.Find("#main") - q.SetHtml(``) - - assertLength(t, doc.Find("#main").Nodes, 1) - assertLength(t, doc.Find("#main").Children().Nodes, 0) - printSel(t, doc.Selection) -} - -func TestSetHtmlContext(t *testing.T) { - doc := loadString(t, ` - - - - - - - - - -
Before1
Before2
- - `) - doc.Find("table tr").SetHtml("TestAgain") - - assertLength(t, doc.Find("table th").Nodes, 0) - assertLength(t, doc.Find("table td").Nodes, 4) - assertLength(t, doc.Find("table tr").Nodes, 2) - printSel(t, doc.Selection) -} - -func TestSetText(t *testing.T) { - doc := Doc2Clone() - q := doc.Find("#main, #foot") - repl := "
test
" - q.SetText(repl) - - assertLength(t, doc.Find("#replace").Nodes, 0) - assertLength(t, doc.Find("#main, #foot").Nodes, 2) - - if q.Text() != (repl + repl) { - t.Errorf("Expected text to be %v, found %v", (repl + repl), q.Text()) - } - - h, err := q.Html() - if err != nil { - t.Errorf("Error: %v", err) - } - esc := "<div id="replace">test</div>" - if h != esc { - t.Errorf("Expected html to be %v, found %v", esc, h) - } - - printSel(t, doc.Selection) -} - -func TestReplaceWithSelection(t *testing.T) { - doc := Doc2Clone() - sel := doc.Find("#nf6").ReplaceWithSelection(doc.Find("#nf5")) - - assertSelectionIs(t, sel, "#nf6") - assertLength(t, doc.Find("#nf6").Nodes, 0) - assertLength(t, doc.Find("#nf5").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrap(t *testing.T) { - doc := Doc2Clone() - - doc.Find("#nf5").Unwrap() - assertLength(t, doc.Find("#foot").Nodes, 0) - assertLength(t, doc.Find("body > #nf1").Nodes, 1) - assertLength(t, doc.Find("body > #nf5").Nodes, 1) - - printSel(t, doc.Selection) - - doc = Doc2Clone() - - doc.Find("#nf5, #n1").Unwrap() - assertLength(t, doc.Find("#foot").Nodes, 0) - assertLength(t, doc.Find("#main").Nodes, 0) - assertLength(t, doc.Find("body > #n1").Nodes, 1) - assertLength(t, doc.Find("body > #nf5").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrapBody(t *testing.T) { - doc := Doc2Clone() - - doc.Find("#main").Unwrap() - assertLength(t, doc.Find("body").Nodes, 1) - assertLength(t, doc.Find("body > #main").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrapHead(t *testing.T) { - doc := Doc2Clone() - - doc.Find("title").Unwrap() - assertLength(t, doc.Find("head").Nodes, 0) - assertLength(t, doc.Find("head > title").Nodes, 0) - assertLength(t, doc.Find("title").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestUnwrapHtml(t *testing.T) { - doc := Doc2Clone() - - doc.Find("head").Unwrap() - assertLength(t, doc.Find("html").Nodes, 0) - assertLength(t, doc.Find("html head").Nodes, 0) - assertLength(t, doc.Find("head").Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestWrap(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").Wrap("#nf2") - nf1 := doc.Find("#foot #nf2 #nf1") - assertLength(t, nf1.Nodes, 1) - - nf2 := doc.Find("#nf2") - assertLength(t, nf2.Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapEmpty(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").Wrap("#doesnt-exist") - - origHtml, _ := Doc2().Html() - newHtml, _ := doc.Html() - - if origHtml != newHtml { - t.Error("Expected the two documents to be identical.") - } - - printSel(t, doc.Selection) -} - -func TestWrapHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find(".odd").WrapHtml(wrapHtml) - nf2 := doc.Find("#ins #nf2") - assertLength(t, nf2.Nodes, 1) - printSel(t, doc.Selection) -} - -func TestWrapSelection(t *testing.T) { - doc := Doc2Clone() - doc.Find("#nf1").WrapSelection(doc.Find("#nf2")) - nf1 := doc.Find("#foot #nf2 #nf1") - assertLength(t, nf1.Nodes, 1) - - nf2 := doc.Find("#nf2") - assertLength(t, nf2.Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapAll(t *testing.T) { - doc := Doc2Clone() - doc.Find(".odd").WrapAll("#nf1") - nf1 := doc.Find("#main #nf1") - assertLength(t, nf1.Nodes, 1) - - sel := nf1.Find("#n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6") - assertLength(t, sel.Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestWrapAllHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find(".odd").WrapAllHtml(wrapHtml) - nf1 := doc.Find("#main div#ins div p em b #n2 ~ #n4 ~ #n6 ~ #nf2 ~ #nf4 ~ #nf6") - assertLength(t, nf1.Nodes, 1) - printSel(t, doc.Selection) -} - -func TestWrapInnerNoContent(t *testing.T) { - doc := Doc2Clone() - doc.Find(".one").WrapInner(".two") - - twos := doc.Find(".two") - assertLength(t, twos.Nodes, 4) - assertLength(t, doc.Find(".one .two").Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapInnerWithContent(t *testing.T) { - doc := Doc3Clone() - doc.Find(".one").WrapInner(".two") - - twos := doc.Find(".two") - assertLength(t, twos.Nodes, 4) - assertLength(t, doc.Find(".one .two").Nodes, 2) - - printSel(t, doc.Selection) -} - -func TestWrapInnerNoWrapper(t *testing.T) { - doc := Doc2Clone() - doc.Find(".one").WrapInner(".not-exist") - - twos := doc.Find(".two") - assertLength(t, twos.Nodes, 2) - assertLength(t, doc.Find(".one").Nodes, 2) - assertLength(t, doc.Find(".one .two").Nodes, 0) - - printSel(t, doc.Selection) -} - -func TestWrapInnerHtml(t *testing.T) { - doc := Doc2Clone() - doc.Find("#foot").WrapInnerHtml(wrapHtml) - - foot := doc.Find("#foot div#ins div p em b #nf1 ~ #nf2 ~ #nf3") - assertLength(t, foot.Nodes, 1) - - printSel(t, doc.Selection) -} - -func TestParsingRespectsVaryingContext(t *testing.T) { - docA := loadString(t, ` - - - - - `) - docTable := loadString(t, ` - - -
- - `) - docBoth := loadString(t, ` - - -
- - - `) - - sA := docA.Find(".x").AppendHtml("Hello") - sTable := docTable.Find(".x").AppendHtml("Hello") - sBoth := docBoth.Find(".x").AppendHtml("Hello") - - printSel(t, docA.Selection) - printSel(t, docTable.Selection) - printSel(t, docBoth.Selection) - - oA, _ := sA.Html() - oTable, _ := sTable.Html() - - if oA == oTable { - t.Errorf("Expected inner html of and to not be equal, but got %s and %s", oA, oTable) - } - - oBothTable, _ := sBoth.First().Html() - if oBothTable != oTable { - t.Errorf("Expected inner html of
and
in doc containing both tags to be equal, but got %s and %s", - oTable, - oBothTable) - } - - oBothA, _ := sBoth.Last().Html() - if oBothA != oA { - t.Errorf("Expected inner html of and in doc containing both tags to be equal, but got %s and %s", - oA, - oBothA) - } -} - -func TestHtmlWithNonElementNode(t *testing.T) { - const data = ` - - - - -

- This is sometext. -

- - -` - - cases := map[string]func(*Selection, string) *Selection{ - "AfterHtml": (*Selection).AfterHtml, - "AppendHtml": (*Selection).AppendHtml, - "BeforeHtml": (*Selection).BeforeHtml, - "PrependHtml": (*Selection).PrependHtml, - "ReplaceWithHtml": (*Selection).ReplaceWithHtml, - "SetHtml": (*Selection).SetHtml, - } - for nm, fn := range cases { - // this test is only to make sure that the HTML parsing/manipulation - // methods do not raise panics when executed over Selections that contain - // non-Element nodes. - t.Run(nm, func(t *testing.T) { - doc := loadString(t, data) - sel := doc.Find("p").Contents() - func() { - defer func() { - if err := recover(); err != nil { - t.Fatal(err) - } - }() - fn(sel, "
") - }() - - // print the resulting document in verbose mode - h, err := OuterHtml(doc.Selection) - if err != nil { - log.Fatal(err) - } - t.Log(h) - }) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/misc/git/pre-commit b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/misc/git/pre-commit deleted file mode 100644 index 78e433146..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/misc/git/pre-commit +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -echo ">>> golint" -for dir in $(go list ./... | grep -v /vendor/) -do - golint "${dir}" -done -echo "<<< golint" -echo - -echo ">>> go vet" -go vet $(go list ./... | grep -v /vendor/) -echo "<<< go vet" -echo - -echo ">>> gosimple" -gosimple $(go list ./... | grep -v /vendor/) -echo "<<< gosimple" -echo - -# Check for gofmt problems and report if any. -gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$' | grep -v /vendor/) -[ -z "$gofiles" ] && echo "EXIT $vetres" && exit $vetres - -if [ -n "$gofiles" ]; then - unformatted=$(gofmt -l $gofiles) - - if [ -n "$unformatted" ]; then - # Some files are not gofmt'd. - echo >&2 "Go files must be formatted with gofmt. Please run:" - for fn in $unformatted; do - echo >&2 " gofmt -w $PWD/$fn" - done - fi -fi -echo - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/property.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/property.go deleted file mode 100644 index 411126db2..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/property.go +++ /dev/null @@ -1,275 +0,0 @@ -package goquery - -import ( - "bytes" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -var rxClassTrim = regexp.MustCompile("[\t\r\n]") - -// Attr gets the specified attribute's value for the first element in the -// Selection. To get the value for each element individually, use a looping -// construct such as Each or Map method. -func (s *Selection) Attr(attrName string) (val string, exists bool) { - if len(s.Nodes) == 0 { - return - } - return getAttributeValue(attrName, s.Nodes[0]) -} - -// AttrOr works like Attr but returns default value if attribute is not present. -func (s *Selection) AttrOr(attrName, defaultValue string) string { - if len(s.Nodes) == 0 { - return defaultValue - } - - val, exists := getAttributeValue(attrName, s.Nodes[0]) - if !exists { - return defaultValue - } - - return val -} - -// RemoveAttr removes the named attribute from each element in the set of matched elements. -func (s *Selection) RemoveAttr(attrName string) *Selection { - for _, n := range s.Nodes { - removeAttr(n, attrName) - } - - return s -} - -// SetAttr sets the given attribute on each element in the set of matched elements. -func (s *Selection) SetAttr(attrName, val string) *Selection { - for _, n := range s.Nodes { - attr := getAttributePtr(attrName, n) - if attr == nil { - n.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val}) - } else { - attr.Val = val - } - } - - return s -} - -// Text gets the combined text contents of each element in the set of matched -// elements, including their descendants. -func (s *Selection) Text() string { - var buf bytes.Buffer - - // Slightly optimized vs calling Each: no single selection object created - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.TextNode { - // Keep newlines and spaces, like jQuery - buf.WriteString(n.Data) - } - if n.FirstChild != nil { - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - } - for _, n := range s.Nodes { - f(n) - } - - return buf.String() -} - -// Size is an alias for Length. -func (s *Selection) Size() int { - return s.Length() -} - -// Length returns the number of elements in the Selection object. -func (s *Selection) Length() int { - return len(s.Nodes) -} - -// Html gets the HTML contents of the first element in the set of matched -// elements. It includes text and comment nodes. -func (s *Selection) Html() (ret string, e error) { - // Since there is no .innerHtml, the HTML content must be re-created from - // the nodes using html.Render. - var buf bytes.Buffer - - if len(s.Nodes) > 0 { - for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling { - e = html.Render(&buf, c) - if e != nil { - return - } - } - ret = buf.String() - } - - return -} - -// AddClass adds the given class(es) to each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -func (s *Selection) AddClass(class ...string) *Selection { - classStr := strings.TrimSpace(strings.Join(class, " ")) - - if classStr == "" { - return s - } - - tcls := getClassesSlice(classStr) - for _, n := range s.Nodes { - curClasses, attr := getClassesAndAttr(n, true) - for _, newClass := range tcls { - if !strings.Contains(curClasses, " "+newClass+" ") { - curClasses += newClass + " " - } - } - - setClasses(n, attr, curClasses) - } - - return s -} - -// HasClass determines whether any of the matched elements are assigned the -// given class. -func (s *Selection) HasClass(class string) bool { - class = " " + class + " " - for _, n := range s.Nodes { - classes, _ := getClassesAndAttr(n, false) - if strings.Contains(classes, class) { - return true - } - } - return false -} - -// RemoveClass removes the given class(es) from each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -// If no class name is provided, all classes are removed. -func (s *Selection) RemoveClass(class ...string) *Selection { - var rclasses []string - - classStr := strings.TrimSpace(strings.Join(class, " ")) - remove := classStr == "" - - if !remove { - rclasses = getClassesSlice(classStr) - } - - for _, n := range s.Nodes { - if remove { - removeAttr(n, "class") - } else { - classes, attr := getClassesAndAttr(n, true) - for _, rcl := range rclasses { - classes = strings.Replace(classes, " "+rcl+" ", " ", -1) - } - - setClasses(n, attr, classes) - } - } - - return s -} - -// ToggleClass adds or removes the given class(es) for each element in the set of matched elements. -// Multiple class names can be specified, separated by a space or via multiple arguments. -func (s *Selection) ToggleClass(class ...string) *Selection { - classStr := strings.TrimSpace(strings.Join(class, " ")) - - if classStr == "" { - return s - } - - tcls := getClassesSlice(classStr) - - for _, n := range s.Nodes { - classes, attr := getClassesAndAttr(n, true) - for _, tcl := range tcls { - if strings.Contains(classes, " "+tcl+" ") { - classes = strings.Replace(classes, " "+tcl+" ", " ", -1) - } else { - classes += tcl + " " - } - } - - setClasses(n, attr, classes) - } - - return s -} - -func getAttributePtr(attrName string, n *html.Node) *html.Attribute { - if n == nil { - return nil - } - - for i, a := range n.Attr { - if a.Key == attrName { - return &n.Attr[i] - } - } - return nil -} - -// Private function to get the specified attribute's value from a node. -func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) { - if a := getAttributePtr(attrName, n); a != nil { - val = a.Val - exists = true - } - return -} - -// Get and normalize the "class" attribute from the node. -func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) { - // Applies only to element nodes - if n.Type == html.ElementNode { - attr = getAttributePtr("class", n) - if attr == nil && create { - n.Attr = append(n.Attr, html.Attribute{ - Key: "class", - Val: "", - }) - attr = &n.Attr[len(n.Attr)-1] - } - } - - if attr == nil { - classes = " " - } else { - classes = rxClassTrim.ReplaceAllString(" "+attr.Val+" ", " ") - } - - return -} - -func getClassesSlice(classes string) []string { - return strings.Split(rxClassTrim.ReplaceAllString(" "+classes+" ", " "), " ") -} - -func removeAttr(n *html.Node, attrName string) { - for i, a := range n.Attr { - if a.Key == attrName { - n.Attr[i], n.Attr[len(n.Attr)-1], n.Attr = - n.Attr[len(n.Attr)-1], html.Attribute{}, n.Attr[:len(n.Attr)-1] - return - } - } -} - -func setClasses(n *html.Node, attr *html.Attribute, classes string) { - classes = strings.TrimSpace(classes) - if classes == "" { - removeAttr(n, "class") - return - } - - attr.Val = classes -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/property_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/property_test.go deleted file mode 100644 index 1095dcc89..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/property_test.go +++ /dev/null @@ -1,252 +0,0 @@ -package goquery - -import ( - "regexp" - "strings" - "testing" -) - -func TestAttrExists(t *testing.T) { - if val, ok := Doc().Find("a").Attr("href"); !ok { - t.Error("Expected a value for the href attribute.") - } else { - t.Logf("Href of first anchor: %v.", val) - } -} - -func TestAttrOr(t *testing.T) { - if val := Doc().Find("a").AttrOr("fake-attribute", "alternative"); val != "alternative" { - t.Error("Expected an alternative value for 'fake-attribute' attribute.") - } else { - t.Logf("Value returned for not existing attribute: %v.", val) - } - if val := Doc().Find("zz").AttrOr("fake-attribute", "alternative"); val != "alternative" { - t.Error("Expected an alternative value for 'fake-attribute' on an empty selection.") - } else { - t.Logf("Value returned for empty selection: %v.", val) - } -} - -func TestAttrNotExist(t *testing.T) { - if val, ok := Doc().Find("div.row-fluid").Attr("href"); ok { - t.Errorf("Expected no value for the href attribute, got %v.", val) - } -} - -func TestRemoveAttr(t *testing.T) { - sel := Doc2Clone().Find("div") - - sel.RemoveAttr("id") - - _, ok := sel.Attr("id") - if ok { - t.Error("Expected there to be no id attributes set") - } -} - -func TestSetAttr(t *testing.T) { - sel := Doc2Clone().Find("#main") - - sel.SetAttr("id", "not-main") - - val, ok := sel.Attr("id") - if !ok { - t.Error("Expected an id attribute on main") - } - - if val != "not-main" { - t.Errorf("Expected an attribute id to be not-main, got %s", val) - } -} - -func TestSetAttr2(t *testing.T) { - sel := Doc2Clone().Find("#main") - - sel.SetAttr("foo", "bar") - - val, ok := sel.Attr("foo") - if !ok { - t.Error("Expected an 'foo' attribute on main") - } - - if val != "bar" { - t.Errorf("Expected an attribute 'foo' to be 'bar', got '%s'", val) - } -} - -func TestText(t *testing.T) { - txt := Doc().Find("h1").Text() - if strings.Trim(txt, " \n\r\t") != "Provok.in" { - t.Errorf("Expected text to be Provok.in, found %s.", txt) - } -} - -func TestText2(t *testing.T) { - txt := Doc().Find(".hero-unit .container-fluid .row-fluid:nth-child(1)").Text() - if ok, e := regexp.MatchString(`^\s+Provok\.in\s+Prove your point.\s+$`, txt); !ok || e != nil { - t.Errorf("Expected text to be Provok.in Prove your point., found %s.", txt) - if e != nil { - t.Logf("Error: %s.", e.Error()) - } - } -} - -func TestText3(t *testing.T) { - txt := Doc().Find(".pvk-gutter").First().Text() - // There's an   character in there... - if ok, e := regexp.MatchString(`^[\s\x{00A0}]+$`, txt); !ok || e != nil { - t.Errorf("Expected spaces, found <%v>.", txt) - if e != nil { - t.Logf("Error: %s.", e.Error()) - } - } -} - -func TestHtml(t *testing.T) { - txt, e := Doc().Find("h1").Html() - if e != nil { - t.Errorf("Error: %s.", e) - } - - if ok, e := regexp.MatchString(`^\s*
Provok\.in\s*$`, txt); !ok || e != nil { - t.Errorf("Unexpected HTML content, found %s.", txt) - if e != nil { - t.Logf("Error: %s.", e.Error()) - } - } -} - -func TestNbsp(t *testing.T) { - src := `

Some text

` - d, err := NewDocumentFromReader(strings.NewReader(src)) - if err != nil { - t.Fatal(err) - } - txt := d.Find("p").Text() - ix := strings.Index(txt, "\u00a0") - if ix != 4 { - t.Errorf("Text: expected a non-breaking space at index 4, got %d", ix) - } - - h, err := d.Find("p").Html() - if err != nil { - t.Fatal(err) - } - ix = strings.Index(h, "\u00a0") - if ix != 4 { - t.Errorf("Html: expected a non-breaking space at index 4, got %d", ix) - } -} - -func TestAddClass(t *testing.T) { - sel := Doc2Clone().Find("#main") - sel.AddClass("main main main") - - // Make sure that class was only added once - if a, ok := sel.Attr("class"); !ok || a != "main" { - t.Error("Expected #main to have class main") - } -} - -func TestAddClassSimilar(t *testing.T) { - sel := Doc2Clone().Find("#nf5") - sel.AddClass("odd") - - assertClass(t, sel, "odd") - assertClass(t, sel, "odder") - printSel(t, sel.Parent()) -} - -func TestAddEmptyClass(t *testing.T) { - sel := Doc2Clone().Find("#main") - sel.AddClass("") - - // Make sure that class was only added once - if a, ok := sel.Attr("class"); ok { - t.Errorf("Expected #main to not to have a class, have: %s", a) - } -} - -func TestAddClasses(t *testing.T) { - sel := Doc2Clone().Find("#main") - sel.AddClass("a b") - - // Make sure that class was only added once - if !sel.HasClass("a") || !sel.HasClass("b") { - t.Errorf("#main does not have classes") - } -} - -func TestHasClass(t *testing.T) { - sel := Doc().Find("div") - if !sel.HasClass("span12") { - t.Error("Expected at least one div to have class span12.") - } -} - -func TestHasClassNone(t *testing.T) { - sel := Doc().Find("h2") - if sel.HasClass("toto") { - t.Error("Expected h1 to have no class.") - } -} - -func TestHasClassNotFirst(t *testing.T) { - sel := Doc().Find(".alert") - if !sel.HasClass("alert-error") { - t.Error("Expected .alert to also have class .alert-error.") - } -} - -func TestRemoveClass(t *testing.T) { - sel := Doc2Clone().Find("#nf1") - sel.RemoveClass("one row") - - if !sel.HasClass("even") || sel.HasClass("one") || sel.HasClass("row") { - classes, _ := sel.Attr("class") - t.Error("Expected #nf1 to have class even, has ", classes) - } -} - -func TestRemoveClassSimilar(t *testing.T) { - sel := Doc2Clone().Find("#nf5, #nf6") - assertLength(t, sel.Nodes, 2) - - sel.RemoveClass("odd") - assertClass(t, sel.Eq(0), "odder") - printSel(t, sel) -} - -func TestRemoveAllClasses(t *testing.T) { - sel := Doc2Clone().Find("#nf1") - sel.RemoveClass() - - if a, ok := sel.Attr("class"); ok { - t.Error("All classes were not removed, has ", a) - } - - sel = Doc2Clone().Find("#main") - sel.RemoveClass() - if a, ok := sel.Attr("class"); ok { - t.Error("All classes were not removed, has ", a) - } -} - -func TestToggleClass(t *testing.T) { - sel := Doc2Clone().Find("#nf1") - - sel.ToggleClass("one") - if sel.HasClass("one") { - t.Error("Expected #nf1 to not have class one") - } - - sel.ToggleClass("one") - if !sel.HasClass("one") { - t.Error("Expected #nf1 to have class one") - } - - sel.ToggleClass("one even row") - if a, ok := sel.Attr("class"); ok { - t.Errorf("Expected #nf1 to have no classes, have %q", a) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/query.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/query.go deleted file mode 100644 index fe86bf0bf..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/query.go +++ /dev/null @@ -1,49 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -// Is checks the current matched set of elements against a selector and -// returns true if at least one of these elements matches. -func (s *Selection) Is(selector string) bool { - return s.IsMatcher(compileMatcher(selector)) -} - -// IsMatcher checks the current matched set of elements against a matcher and -// returns true if at least one of these elements matches. -func (s *Selection) IsMatcher(m Matcher) bool { - if len(s.Nodes) > 0 { - if len(s.Nodes) == 1 { - return m.Match(s.Nodes[0]) - } - return len(m.Filter(s.Nodes)) > 0 - } - - return false -} - -// IsFunction checks the current matched set of elements against a predicate and -// returns true if at least one of these elements matches. -func (s *Selection) IsFunction(f func(int, *Selection) bool) bool { - return s.FilterFunction(f).Length() > 0 -} - -// IsSelection checks the current matched set of elements against a Selection object -// and returns true if at least one of these elements matches. -func (s *Selection) IsSelection(sel *Selection) bool { - return s.FilterSelection(sel).Length() > 0 -} - -// IsNodes checks the current matched set of elements against the specified nodes -// and returns true if at least one of these elements matches. -func (s *Selection) IsNodes(nodes ...*html.Node) bool { - return s.FilterNodes(nodes...).Length() > 0 -} - -// Contains returns true if the specified Node is within, -// at any depth, one of the nodes in the Selection object. -// It is NOT inclusive, to behave like jQuery's implementation, and -// unlike Javascript's .contains, so if the contained -// node is itself in the selection, it returns false. -func (s *Selection) Contains(n *html.Node) bool { - return sliceContains(s.Nodes, n) -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/query_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/query_test.go deleted file mode 100644 index 54b2a2e0d..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/query_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package goquery - -import ( - "testing" -) - -func TestIs(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(1)") - if !sel.Is("p") { - t.Error("Expected .footer p:nth-child(1) to be p.") - } -} - -func TestIsInvalid(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(1)") - if sel.Is("") { - t.Error("Is should not succeed with invalid selector string") - } -} - -func TestIsPositional(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(2)") - if !sel.Is("p:nth-child(2)") { - t.Error("Expected .footer p:nth-child(2) to be p:nth-child(2).") - } -} - -func TestIsPositionalNot(t *testing.T) { - sel := Doc().Find(".footer p:nth-child(1)") - if sel.Is("p:nth-child(2)") { - t.Error("Expected .footer p:nth-child(1) NOT to be p:nth-child(2).") - } -} - -func TestIsFunction(t *testing.T) { - ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool { - return s.HasClass("container-fluid") - }) - - if !ok { - t.Error("Expected some div to have a container-fluid class.") - } -} - -func TestIsFunctionRollback(t *testing.T) { - ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool { - return s.HasClass("container-fluid") - }) - - if !ok { - t.Error("Expected some div to have a container-fluid class.") - } -} - -func TestIsSelection(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find(".pvk-gutter") - - if !sel.IsSelection(sel2) { - t.Error("Expected some div to have a pvk-gutter class.") - } -} - -func TestIsSelectionNot(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find("a") - - if sel.IsSelection(sel2) { - t.Error("Expected some div NOT to be an anchor.") - } -} - -func TestIsNodes(t *testing.T) { - sel := Doc().Find("div") - sel2 := Doc().Find(".footer") - - if !sel.IsNodes(sel2.Nodes[0]) { - t.Error("Expected some div to have a footer class.") - } -} - -func TestDocContains(t *testing.T) { - sel := Doc().Find("h1") - if !Doc().Contains(sel.Nodes[0]) { - t.Error("Expected document to contain H1 tag.") - } -} - -func TestSelContains(t *testing.T) { - sel := Doc().Find(".row-fluid") - sel2 := Doc().Find("a[ng-click]") - if !sel.Contains(sel2.Nodes[0]) { - t.Error("Expected .row-fluid to contain a[ng-click] tag.") - } -} - -func TestSelNotContains(t *testing.T) { - sel := Doc().Find("a.link") - sel2 := Doc().Find("span") - if sel.Contains(sel2.Nodes[0]) { - t.Error("Expected a.link to NOT contain span tag.") - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/gotesting.html b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/gotesting.html deleted file mode 100644 index ba5348fd4..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/gotesting.html +++ /dev/null @@ -1,855 +0,0 @@ - - - - - - testing - The Go Programming Language - - - - - - - - - - - - -
- - -
-

Package testing

- - - - - - - - - - -
-
-
import "testing"
-
-
-
Overview
-
Index
- - -
Subdirectories
- -
-
- -
- -
-

Overview ▾

-

-Package testing provides support for automated testing of Go packages. -It is intended to be used in concert with the “go test” command, which automates -execution of any function of the form -

-
func TestXxx(*testing.T)
-
-

-where Xxx can be any alphanumeric string (but the first letter must not be in -[a-z]) and serves to identify the test routine. -These TestXxx routines should be declared within the package they are testing. -

-

-Functions of the form -

-
func BenchmarkXxx(*testing.B)
-
-

-are considered benchmarks, and are executed by the "go test" command when -the -test.bench flag is provided. -

-

-A sample benchmark function looks like this: -

-
func BenchmarkHello(b *testing.B) {
-    for i := 0; i < b.N; i++ {
-        fmt.Sprintf("hello")
-    }
-}
-
-

-The benchmark package will vary b.N until the benchmark function lasts -long enough to be timed reliably. The output -

-
testing.BenchmarkHello    10000000    282 ns/op
-
-

-means that the loop ran 10000000 times at a speed of 282 ns per loop. -

-

-If a benchmark needs some expensive setup before running, the timer -may be stopped: -

-
func BenchmarkBigLen(b *testing.B) {
-    b.StopTimer()
-    big := NewBig()
-    b.StartTimer()
-    for i := 0; i < b.N; i++ {
-        big.Len()
-    }
-}
-
-

-The package also runs and verifies example code. Example functions may -include a concluding comment that begins with "Output:" and is compared with -the standard output of the function when the tests are run, as in these -examples of an example: -

-
func ExampleHello() {
-        fmt.Println("hello")
-        // Output: hello
-}
-
-func ExampleSalutations() {
-        fmt.Println("hello, and")
-        fmt.Println("goodbye")
-        // Output:
-        // hello, and
-        // goodbye
-}
-
-

-Example functions without output comments are compiled but not executed. -

-

-The naming convention to declare examples for a function F, a type T and -method M on type T are: -

-
func ExampleF() { ... }
-func ExampleT() { ... }
-func ExampleT_M() { ... }
-
-

-Multiple example functions for a type/function/method may be provided by -appending a distinct suffix to the name. The suffix must start with a -lower-case letter. -

-
func ExampleF_suffix() { ... }
-func ExampleT_suffix() { ... }
-func ExampleT_M_suffix() { ... }
-
-

-The entire test file is presented as the example when it contains a single -example function, at least one other function, type, variable, or constant -declaration, and no test or benchmark functions. -

- -
-
- - -

Index

- -
-
- - - - -
func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
- - -
func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
- - -
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)
- - -
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
- - -
func Short() bool
- - - -
type B
- - - -
    func (c *B) Error(args ...interface{})
- - -
    func (c *B) Errorf(format string, args ...interface{})
- - -
    func (c *B) Fail()
- - -
    func (c *B) FailNow()
- - -
    func (c *B) Failed() bool
- - -
    func (c *B) Fatal(args ...interface{})
- - -
    func (c *B) Fatalf(format string, args ...interface{})
- - -
    func (c *B) Log(args ...interface{})
- - -
    func (c *B) Logf(format string, args ...interface{})
- - -
    func (b *B) ResetTimer()
- - -
    func (b *B) SetBytes(n int64)
- - -
    func (b *B) StartTimer()
- - -
    func (b *B) StopTimer()
- - - -
type BenchmarkResult
- - -
    func Benchmark(f func(b *B)) BenchmarkResult
- - - -
    func (r BenchmarkResult) NsPerOp() int64
- - -
    func (r BenchmarkResult) String() string
- - - -
type InternalBenchmark
- - - - -
type InternalExample
- - - - -
type InternalTest
- - - - -
type T
- - - -
    func (c *T) Error(args ...interface{})
- - -
    func (c *T) Errorf(format string, args ...interface{})
- - -
    func (c *T) Fail()
- - -
    func (c *T) FailNow()
- - -
    func (c *T) Failed() bool
- - -
    func (c *T) Fatal(args ...interface{})
- - -
    func (c *T) Fatalf(format string, args ...interface{})
- - -
    func (c *T) Log(args ...interface{})
- - -
    func (c *T) Logf(format string, args ...interface{})
- - -
    func (t *T) Parallel()
- - - -
- - - - -

Package files

-

- - - benchmark.go - - example.go - - testing.go - - -

- - - - - - - -

func Main

-
func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
-

-An internal function but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - -

func RunBenchmarks

-
func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
-

-An internal function but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - -

func RunExamples

-
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)
- - - - - -

func RunTests

-
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
- - - - - -

func Short

-
func Short() bool
-

-Short reports whether the -test.short flag is set. -

- - - - - - -

type B

-
type B struct {
-    N int
-    // contains filtered or unexported fields
-}
-

-B is a type passed to Benchmark functions to manage benchmark -timing and to specify the number of iterations to run. -

- - - - - - - - - - - - -

func (*B) Error

-
func (c *B) Error(args ...interface{})
-

-Error is equivalent to Log() followed by Fail(). -

- - - - - -

func (*B) Errorf

-
func (c *B) Errorf(format string, args ...interface{})
-

-Errorf is equivalent to Logf() followed by Fail(). -

- - - - - -

func (*B) Fail

-
func (c *B) Fail()
-

-Fail marks the function as having failed but continues execution. -

- - - - - -

func (*B) FailNow

-
func (c *B) FailNow()
-

-FailNow marks the function as having failed and stops its execution. -Execution will continue at the next test or benchmark. -

- - - - - -

func (*B) Failed

-
func (c *B) Failed() bool
-

-Failed returns whether the function has failed. -

- - - - - -

func (*B) Fatal

-
func (c *B) Fatal(args ...interface{})
-

-Fatal is equivalent to Log() followed by FailNow(). -

- - - - - -

func (*B) Fatalf

-
func (c *B) Fatalf(format string, args ...interface{})
-

-Fatalf is equivalent to Logf() followed by FailNow(). -

- - - - - -

func (*B) Log

-
func (c *B) Log(args ...interface{})
-

-Log formats its arguments using default formatting, analogous to Println(), -and records the text in the error log. -

- - - - - -

func (*B) Logf

-
func (c *B) Logf(format string, args ...interface{})
-

-Logf formats its arguments according to the format, analogous to Printf(), -and records the text in the error log. -

- - - - - -

func (*B) ResetTimer

-
func (b *B) ResetTimer()
-

-ResetTimer sets the elapsed benchmark time to zero. -It does not affect whether the timer is running. -

- - - - - -

func (*B) SetBytes

-
func (b *B) SetBytes(n int64)
-

-SetBytes records the number of bytes processed in a single operation. -If this is called, the benchmark will report ns/op and MB/s. -

- - - - - -

func (*B) StartTimer

-
func (b *B) StartTimer()
-

-StartTimer starts timing a test. This function is called automatically -before a benchmark starts, but it can also used to resume timing after -a call to StopTimer. -

- - - - - -

func (*B) StopTimer

-
func (b *B) StopTimer()
-

-StopTimer stops timing a test. This can be used to pause the timer -while performing complex initialization that you don't -want to measure. -

- - - - - - - -

type BenchmarkResult

-
type BenchmarkResult struct {
-    N     int           // The number of iterations.
-    T     time.Duration // The total time taken.
-    Bytes int64         // Bytes processed in one iteration.
-}
-

-The results of a benchmark run. -

- - - - - - - - - - -

func Benchmark

-
func Benchmark(f func(b *B)) BenchmarkResult
-

-Benchmark benchmarks a single function. Useful for creating -custom benchmarks that do not use the "go test" command. -

- - - - - - -

func (BenchmarkResult) NsPerOp

-
func (r BenchmarkResult) NsPerOp() int64
- - - - - -

func (BenchmarkResult) String

-
func (r BenchmarkResult) String() string
- - - - - - - -

type InternalBenchmark

-
type InternalBenchmark struct {
-    Name string
-    F    func(b *B)
-}
-

-An internal type but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - - - - - - - - - - -

type InternalExample

-
type InternalExample struct {
-    Name   string
-    F      func()
-    Output string
-}
- - - - - - - - - - - - - - -

type InternalTest

-
type InternalTest struct {
-    Name string
-    F    func(*T)
-}
-

-An internal type but exported because it is cross-package; part of the implementation -of the "go test" command. -

- - - - - - - - - - - - - - -

type T

-
type T struct {
-    // contains filtered or unexported fields
-}
-

-T is a type passed to Test functions to manage test state and support formatted test logs. -Logs are accumulated during execution and dumped to standard error when done. -

- - - - - - - - - - - - -

func (*T) Error

-
func (c *T) Error(args ...interface{})
-

-Error is equivalent to Log() followed by Fail(). -

- - - - - -

func (*T) Errorf

-
func (c *T) Errorf(format string, args ...interface{})
-

-Errorf is equivalent to Logf() followed by Fail(). -

- - - - - -

func (*T) Fail

-
func (c *T) Fail()
-

-Fail marks the function as having failed but continues execution. -

- - - - - -

func (*T) FailNow

-
func (c *T) FailNow()
-

-FailNow marks the function as having failed and stops its execution. -Execution will continue at the next test or benchmark. -

- - - - - -

func (*T) Failed

-
func (c *T) Failed() bool
-

-Failed returns whether the function has failed. -

- - - - - -

func (*T) Fatal

-
func (c *T) Fatal(args ...interface{})
-

-Fatal is equivalent to Log() followed by FailNow(). -

- - - - - -

func (*T) Fatalf

-
func (c *T) Fatalf(format string, args ...interface{})
-

-Fatalf is equivalent to Logf() followed by FailNow(). -

- - - - - -

func (*T) Log

-
func (c *T) Log(args ...interface{})
-

-Log formats its arguments using default formatting, analogous to Println(), -and records the text in the error log. -

- - - - - -

func (*T) Logf

-
func (c *T) Logf(format string, args ...interface{})
-

-Logf formats its arguments according to the format, analogous to Printf(), -and records the text in the error log. -

- - - - - -

func (*T) Parallel

-
func (t *T) Parallel()
-

-Parallel signals that this test is to be run in parallel with (and only with) -other parallel tests in this CPU group. -

- - - - - -
- - - - - - - - - - - - -

Subdirectories

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name    Synopsis
..
iotest    Package iotest implements Readers and Writers useful mainly for testing.
quick    Package quick implements utility functions to help with black box testing.
- - - - - - - - - - - - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/gowiki.html b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/gowiki.html deleted file mode 100644 index 2ed6bb715..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/gowiki.html +++ /dev/null @@ -1,1214 +0,0 @@ - - - -Go (programming language) - Wikipedia, the free encyclopedia - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- - - -
- - -

Go (programming language)

- - -
- -
From Wikipedia, the free encyclopedia
- - -
  (Redirected from Golang)
- - -
- Jump to: navigation, search -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Go
Golang.png
Paradigm(s)compiled, concurrent, imperative, structured
Appeared in2009
Designed byRobert Griesemer
-Rob Pike
-Ken Thompson
DeveloperGoogle Inc.
Stable releaseversion 1.0.2[1] (14 June 2012; 2 months ago (2012-06-14))
Typing disciplinestrong, static
Major implementationsgc (8g, 6g, 5g), gccgo
Influenced byC, Limbo, Modula, Newsqueak, Oberon, Pascal,[2] Python
OSLinux, Mac OS X, FreeBSD, OpenBSD, MS Windows, Plan 9[3]
LicenseBSD-style[4] + Patent grant[5]
Usual filename extensions.go
Websitegolang.org
-

Go is a compiled, garbage-collected, concurrent programming language developed by Google Inc.[6]

-

The initial design of Go was started in September 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.[2] Go was officially announced in November 2009. In May 2010, Rob Pike publicly stated that Go was being used "for real stuff" at Google.[7] Go's "gc" compiler targets the Linux, Mac OS X, FreeBSD, OpenBSD, Plan 9, and Microsoft Windows operating systems and the i386, amd64, and ARM processor architectures.[8]

- - - - -
-
-

Contents

-
- -
-

[edit] Goals

-

Go aims to provide the efficiency of a statically typed compiled language with the ease of programming of a dynamic language.[9] Other goals include:

-
    -
  • Safety: Type-safe and memory-safe.
  • -
  • Good support for concurrency and communication.
  • -
  • Efficient, latency-free garbage collection.
  • -
  • High-speed compilation.
  • -
-

[edit] Description

-

The syntax of Go is broadly similar to that of C: blocks of code are surrounded with curly braces; common control flow structures include for, switch, and if. Unlike C, line-ending semicolons are optional, variable declarations are written differently and are usually optional, type conversions must be made explicit, and new go and select control keywords have been introduced to support concurrent programming. New built-in types include maps, Unicode strings, array slices, and channels for inter-thread communication.

-

Go is designed for exceptionally fast compiling times, even on modest hardware.[10] The language requires garbage collection. Certain concurrency-related structural conventions of Go (channels and alternative channel inputs) are borrowed from Tony Hoare's CSP. Unlike previous concurrent programming languages such as occam or Limbo, Go does not provide any built-in notion of safe or verifiable concurrency.[11]

-

Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic.[2] Of these, the Go authors express an openness to generic programming, explicitly argue against assertions and pointer arithmetic, while defending the choice to omit type inheritance as giving a more useful language, encouraging heavy use of interfaces instead.[2] Initially, the language did not include exception handling, but in March 2010 a mechanism known as panic/recover was implemented to handle exceptional errors while avoiding some of the problems the Go authors find with exceptions.[12][13]

-

[edit] Type system

-

Go allows a programmer to write functions that can operate on inputs of arbitrary type, provided that the type implements the functions defined by a given interface.

-

Unlike Java, the interfaces a type supports do not need to be specified at the point at which the type is defined, and Go interfaces do not participate in a type hierarchy. A Go interface is best described as a set of methods, each identified by a name and signature. A type is considered to implement an interface if all the required methods have been defined for that type. An interface can be declared to "embed" other interfaces, meaning the declared interface includes the methods defined in the other interfaces.[11]

-

Unlike Java, the in-memory representation of an object does not contain a pointer to a virtual method table. Instead a value of interface type is implemented as a pair of a pointer to the object, and a pointer to a dictionary containing implementations of the interface methods for that type.

-

Consider the following example:

-
-
-
-type Sequence []int
- 
-func (s Sequence) Len() int {
-    return len(s)
-}
- 
-type HasLength interface {
-    Len() int
-}
- 
-func Foo (o HasLength) {
-    ...
-}
-
-
-

These four definitions could have been placed in separate files, in different parts of the program. Notably, the programmer who defined the Sequence type did not need to declare that the type implemented HasLength, and the person who implemented the Len method for Sequence did not need to specify that this method was part of HasLength.

-

[edit] Name visibility

-

Visibility of structures, structure fields, variables, constants, methods, top-level types and functions outside their defining package is defined implicitly according to the capitalization of their identifier.[14]

-

[edit] Concurrency

-

Go provides goroutines, small lightweight threads; the name alludes to coroutines. Goroutines are created with the go statement from anonymous or named functions.

-

Goroutines are executed in parallel with other goroutines, including their caller. They do not necessarily run in separate threads, but a group of goroutines are multiplexed onto multiple threads — execution control is moved between them by blocking them when sending or receiving messages over channels.

-

[edit] Implementations

-

There are currently two Go compilers:

-
    -
  • 6g/8g/5g (the compilers for AMD64, x86, and ARM respectively) with their supporting tools (collectively known as "gc") based on Ken's previous work on Plan 9's C toolchain.
  • -
  • gccgo, a GCC frontend written in C++,[15] and now officially supported as of version 4.6, albeit not part of the standard binary for gcc.[16]
  • -
-

Both compilers work on Unix-like systems, and a port to Microsoft Windows of the gc compiler and runtime have been integrated in the main distribution. Most of the standard libraries also work on Windows.

-

There is also an unmaintained "tiny" runtime environment that allows Go programs to run on bare hardware.[17]

-

[edit] Examples

-

[edit] Hello world

-

The following is a Hello world program in Go:

-
-
-
-package main
- 
-import "fmt"
- 
-func main() {
-        fmt.Println("Hello, World")
-}
-
-
-

Go's automatic semicolon insertion feature requires that opening braces not be placed on their own lines, and this is thus the preferred brace style; the examples shown comply with this style.[18]

-

[edit] Echo

-

Example illustrating how to write a program like the Unix echo command in Go:[19]

-
-
-
-package main
- 
-import (
-        "os"
-        "flag"  // command line option parser
-)
- 
-var omitNewline = flag.Bool("n", false, "don't print final newline")
- 
-const (
-        Space = " "
-        Newline = "\n"
-)
- 
-func main() {
-        flag.Parse()   // Scans the arg list and sets up flags
-        var s string
-        for i := 0; i < flag.NArg(); i++ {
-                if i > 0 {
-                        s += Space
-                }
-                s += flag.Arg(i)
-        }
-        if !*omitNewline {
-                s += Newline
-        }
-        os.Stdout.WriteString(s)
-}
-
-
-

[edit] Reception

-

Go's initial release led to much discussion.

-

Michele Simionato wrote in an article for artima.com:[20]

-
-
Here I just wanted to point out the design choices about interfaces and inheritance. Such ideas are not new and it is a shame that no popular language has followed such particular route in the design space. I hope Go will become popular; if not, I hope such ideas will finally enter in a popular language, we are already 10 or 20 years too late :-(
-
-

Dave Astels at Engine Yard wrote:[21]

-
-
Go is extremely easy to dive into. There are a minimal number of fundamental language concepts and the syntax is clean and designed to be clear and unambiguous. Go is still experimental and still a little rough around the edges.
-
-

Ars Technica interviewed Rob Pike, one of the authors of Go, and asked why a new language was needed. He replied that:[22]

-
-
It wasn't enough to just add features to existing programming languages, because sometimes you can get more in the long run by taking things away. They wanted to start from scratch and rethink everything. ... [But they did not want] to deviate too much from what developers already knew because they wanted to avoid alienating Go's target audience.
-
-

Go was in 15th place on the TIOBE Programming Community Index of programming language popularity in its first year, 2009,[citation needed] surpassing established languages like Pascal. As of March 2012, it ranked 66th in the index.[23]

-

Bruce Eckel stated:[24]

-
-
The complexity of C++ (even more complexity has been added in the new C++), and the resulting impact on productivity, is no longer justified. All the hoops that the C++ programmer had to jump through in order to use a C-compatible language make no sense anymore -- they're just a waste of time and effort. Now, Go makes much more sense for the class of problems that C++ was originally intended to solve.
-
-

[edit] Naming dispute

-

On the day of the general release of the language, Francis McCabe, developer of the Go! programming language (note the exclamation point), requested a name change of Google's language to prevent confusion with his language.[25] The issue was closed by a Google developer on 12 October 2010 with the custom status "Unfortunate", with a comment that "there are many computing products and services named Go. In the 11 months since our release, there has been minimal confusion of the two languages."[26]

-

[edit] See also

- -

[edit] References

- -
-
    -
  1. ^ "golang-announce: go1.0.2 released". https://groups.google.com/forum/#!msg/golang-announce/9-f_fnXNDzw/MiM3tk0iyjYJ. Retrieved 14 June 2012. 
  2. -
  3. ^ a b c d "Language Design FAQ". golang.org. 16 January 2010. http://golang.org/doc/go_faq.html. Retrieved 27 February 2010. 
  4. -
  5. ^ "Go Porting Efforts". Go Language Resources. cat-v. 12 January 2010. http://go-lang.cat-v.org/os-ports. Retrieved 18 January 2010. 
  6. -
  7. ^ "Text file LICENSE". http://golang.org/LICENSE. Retrieved 27 January 2011. 
  8. -
  9. ^ "Additional IP Rights Grant". http://code.google.com/p/go/source/browse/PATENTS. Retrieved 26 July 2012. 
  10. -
  11. ^ Kincaid, Jason (10 November 2009). "Google’s Go: A New Programming Language That’s Python Meets C++". TechCrunch. http://www.techcrunch.com/2009/11/10/google-go-language/. Retrieved 18 January 2010. 
  12. -
  13. ^ Metz, Cade (20 May 2010). "Google programming Frankenstein is a Go". The Register. http://www.theregister.co.uk/2010/05/20/go_in_production_at_google/. 
  14. -
  15. ^ "Installing Go". golang.org. The Go Authors. 11 June 2010. http://golang.org/doc/install.html#tmp_33. Retrieved 11 June 2010. 
  16. -
  17. ^ Pike, Rob. "The Go Programming Language". YouTube. http://www.youtube.com/watch?v=rKnDgT73v8s&feature=related. Retrieved 1 Jul 2011. 
  18. -
  19. ^ Rob Pike (10 November 2009) (flv). The Go Programming Language (Tech talk). Google. Event occurs at 8:53. http://www.youtube.com/watch?v=rKnDgT73v8s#t=8m53. 
  20. -
  21. ^ a b "The Go Memory Model". Google. http://golang.org/doc/go_mem.html. Retrieved 5 January 2011. 
  22. -
  23. ^ Release notes, 30 March 2010
  24. -
  25. ^ "Proposal for an exception-like mechanism". golang-nuts. 25 March 2010. http://groups.google.com/group/golang-nuts/browse_thread/thread/1ce5cd050bb973e4. Retrieved 25 March 2010. 
  26. -
  27. ^ "A Tutorial for the Go Programming Language". The Go Programming Language. Google. http://golang.org/doc/go_tutorial.html. Retrieved 10 March 2010. "In Go the rule about visibility of information is simple: if a name (of a top-level type, function, method, constant or variable, or of a structure field or method) is capitalized, users of the package may see it. Otherwise, the name and hence the thing being named is visible only inside the package in which it is declared." 
  28. -
  29. ^ "FAQ: Implementation". golang.org. 16 January 2010. http://golang.org/doc/go_faq.html#Implementation. Retrieved 18 January 2010. 
  30. -
  31. ^ "Installing GCC: Configuration". http://gcc.gnu.org/install/configure.html. Retrieved 3 December 2011. "Ada, Go and Objective-C++ are not default languages" 
  32. -
  33. ^ Gerrand, Andrew (1 February 2011). "release.2011-02-01". golang-nuts. Google. http://groups.google.com/group/golang-nuts/browse_thread/thread/b877e34723b543a7. Retrieved 5 February 2011. 
  34. -
  35. ^ "A Tutorial for the Go Programming Language". The Go Programming Language. Google. http://golang.org/doc/go_tutorial.html. Retrieved 10 March 2010. "The one surprise is that it's important to put the opening brace of a construct such as an if statement on the same line as the if; however, if you don't, there are situations that may not compile or may give the wrong result. The language forces the brace style to some extent." 
  36. -
  37. ^ "A Tutorial for the Go Programming Language". golang.org. 16 January 2010. http://golang.org/doc/go_tutorial.html. Retrieved 18 January 2010. 
  38. -
  39. ^ Simionato, Michele (15 November 2009). "Interfaces vs Inheritance (or, watch out for Go!)". artima. http://www.artima.com/weblogs/viewpost.jsp?thread=274019. Retrieved 15 November 2009. 
  40. -
  41. ^ Astels, Dave (9 November 2009). "Ready, Set, Go!". engineyard. http://www.engineyard.com/blog/2009/ready-set-go/. Retrieved 9 November 2009. 
  42. -
  43. ^ Paul, Ryan (10 November 2009). "Go: new open source programming language from Google". Ars Technica. http://arstechnica.com/open-source/news/2009/11/go-new-open-source-programming-language-from-google.ars. Retrieved 13 November 2009. 
  44. -
  45. ^ "TIOBE Programming Community Index for March 2012". TIOBE Software. March 2012. http://es.scribd.com/doc/89569304/TIOBE-Programming-Community-Index-for-March-2012. Retrieved 28 April 2012. 
  46. -
  47. ^ Bruce Eckel (27). "Calling Go from Python via JSON-RPC". http://www.artima.com/weblogs/viewpost.jsp?thread=333589. Retrieved 29 August 2011. 
  48. -
  49. ^ Claburn, Thomas (11 November 2009). "Google 'Go' Name Brings Accusations Of Evil'". InformationWeek. http://www.informationweek.com/news/software/web_services/showArticle.jhtml?articleID=221601351. Retrieved 18 January 2010. 
  50. -
  51. ^ "Issue 9 - go - I have already used the name for *MY* programming language". Google Code. Google Inc.. http://code.google.com/p/go/issues/detail?id=9. Retrieved 12 October 2010. 
  52. -
-
-

[edit] Further reading

- -

[edit] External links

- - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - -
- -
- - -
- - -
-
Personal tools
- -
- - -
- - -
-
Namespaces
- -
- - - - -
-

-

-
Variants
- -
- - -
-
- - -
-
Views
- -
- - - - -
-
Actions
- -
- - - - - - - -
-
- - - - - - - - - - - - - - - - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/metalreview.html b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/metalreview.html deleted file mode 100644 index fc4a38fcd..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/metalreview.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - Metal Reviews, News, Blogs, Interviews and Community | Metal Review - - - - - - - - - - -
-
- - - -
- - - - -
-
- - - - -
-
-
- -
-
-
-
- - - - - -
-

Reviews

-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
    - -
  • -

    - Serpentine Path - Serpentine Path - Serpentine Path
    - Serpentine Path
    - -

    -
  • - -
  • -

    - Hunter - Hunter's Ground
    - No God But the Wild
    - -

    -
  • - -
  • -

    - Blut Aus Nord - 777 - Cosmosophy - Blut Aus Nord
    - 777 - Cosmosophy
    - Black -

    -
  • - -
  • -

    - Ufomammut - Oro: Opus Alter - Ufomammut
    - Oro: Opus Alter
    - Doom -

    -
  • - -
  • -

    - Resurgency - False Enlightenment - Resurgency
    - False Enlightenment
    - Death -

    -
  • - -
  • -

    - Morgoth - Cursed to Live - Morgoth
    - Cursed to Live
    - DeathLive -

    -
  • - -
  • -

    - Krallice - Years Past Matter - Krallice
    - Years Past Matter
    - Black -

    -
  • - -
  • -

    - Murder Construct - Results - Murder Construct
    - Results
    - Grindcore -

    -
  • - -
  • -

    - Grave - Endless Procession of Souls - Grave
    - Endless Procession of Souls
    - Death -

    -
  • - -
  • -

    - Master - The New Elite - Master
    - The New Elite
    - Death -

    -
  • - -
-
-
-
-
-
-
- Serpentine Path - Serpentine PathHunter's Ground - No God But the WildBlut Aus Nord - 777 - CosmosophyUfomammut - Oro: Opus AlterResurgency - False EnlightenmentMorgoth - Cursed to LiveKrallice - Years Past MatterMurder Construct - ResultsGrave - Endless Procession of SoulsMaster - The New Elite -
-
-
-
- - - - - - - -
-
-
-
-
- - - - -
Goto Next Group
-
Goto Previous Group
- - - - - -
- -
- - - - - - - -
-

Lashes

-
NEW Katatonia - Dead End Kings
45 minutes ago by Chaosjunkie
-
Katatonia - Dead End Kings
1 hour ago by Harry Dick Rotten
-
Resurgency - False Enlightenment
3 hours ago by Anonymous
-
Witchcraft - The Alchemist
5 hours ago by Luke_22
-
Katatonia - Dead End Kings
9 hours ago by chaosjunkie
-
Katatonia - Dead End Kings
10 hours ago by Compeller
-
Manetheren - Time
10 hours ago by xpmule
-
Ufomammut - Oro: Opus Alter
16 hours ago by Anonymous
-
Ufomammut - Oro: Opus Alter
17 hours ago by Harry Dick Rotten
-
Katatonia - Dead End Kings
yesterday by Chaosjunkie
-
Katatonia - Dead End Kings
yesterday by Anonymous
-
Katatonia - Dead End Kings
yesterday by Anonymous
-
Katatonia - Dead End Kings
yesterday by Anonymous
-
Katatonia - Dead End Kings
yesterday by frantic
-
Blut Aus Nord - 777 - Cosmosophy
yesterday by Dimensional Bleedthrough
- -
- -
-
-
- - - -
-
- - - - - - - - - - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page.html b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page.html deleted file mode 100644 index 92ec74eef..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - Provok.in - - - - - - - - - -
-
-
-   -
-
-
-
-
-
-

- Provok.in -

-

- Prove your point. -

-
-
-
-
- Beta Version. Things may change. Or disappear. Or fail miserably. If it's the latter, please file an issue. -
-
- -
- Welcome, {{getUserName()}} ( logout ) -
-
-
-
-
-   -
-
-
-
-   -
-
-
-
-
-
- × -

- {{ title }} -

-

- {{ message }} -

-
-
-
-
-
-
-
-
-
-
-   -
-
-
-
-   -
-
- -
-
-   -
-
-
- - \ No newline at end of file diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page2.html b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page2.html deleted file mode 100644 index 4c2f92f4b..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page2.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Tests for siblings - - -
-
-
-
-
-
-
-
- - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page3.html b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page3.html deleted file mode 100644 index 17e86241f..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/testdata/page3.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Tests for siblings - - -
-
hello
-
-
-
-
-
-
- - - diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/traversal.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/traversal.go deleted file mode 100644 index 5fa5315ac..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/traversal.go +++ /dev/null @@ -1,698 +0,0 @@ -package goquery - -import "golang.org/x/net/html" - -type siblingType int - -// Sibling type, used internally when iterating over children at the same -// level (siblings) to specify which nodes are requested. -const ( - siblingPrevUntil siblingType = iota - 3 - siblingPrevAll - siblingPrev - siblingAll - siblingNext - siblingNextAll - siblingNextUntil - siblingAllIncludingNonElements -) - -// Find gets the descendants of each element in the current set of matched -// elements, filtered by a selector. It returns a new Selection object -// containing these matched elements. -func (s *Selection) Find(selector string) *Selection { - return pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector))) -} - -// FindMatcher gets the descendants of each element in the current set of matched -// elements, filtered by the matcher. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindMatcher(m Matcher) *Selection { - return pushStack(s, findWithMatcher(s.Nodes, m)) -} - -// FindSelection gets the descendants of each element in the current -// Selection, filtered by a Selection. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, nil) - } - return s.FindNodes(sel.Nodes...) -} - -// FindNodes gets the descendants of each element in the current -// Selection, filtered by some nodes. It returns a new Selection object -// containing these matched elements. -func (s *Selection) FindNodes(nodes ...*html.Node) *Selection { - return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if sliceContains(s.Nodes, n) { - return []*html.Node{n} - } - return nil - })) -} - -// Contents gets the children of each element in the Selection, -// including text and comment nodes. It returns a new Selection object -// containing these elements. -func (s *Selection) Contents() *Selection { - return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements)) -} - -// ContentsFiltered gets the children of each element in the Selection, -// filtered by the specified selector. It returns a new Selection -// object containing these elements. Since selectors only act on Element nodes, -// this function is an alias to ChildrenFiltered unless the selector is empty, -// in which case it is an alias to Contents. -func (s *Selection) ContentsFiltered(selector string) *Selection { - if selector != "" { - return s.ChildrenFiltered(selector) - } - return s.Contents() -} - -// ContentsMatcher gets the children of each element in the Selection, -// filtered by the specified matcher. It returns a new Selection -// object containing these elements. Since matchers only act on Element nodes, -// this function is an alias to ChildrenMatcher. -func (s *Selection) ContentsMatcher(m Matcher) *Selection { - return s.ChildrenMatcher(m) -} - -// Children gets the child elements of each element in the Selection. -// It returns a new Selection object containing these elements. -func (s *Selection) Children() *Selection { - return pushStack(s, getChildrenNodes(s.Nodes, siblingAll)) -} - -// ChildrenFiltered gets the child elements of each element in the Selection, -// filtered by the specified selector. It returns a new -// Selection object containing these elements. -func (s *Selection) ChildrenFiltered(selector string) *Selection { - return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector)) -} - -// ChildrenMatcher gets the child elements of each element in the Selection, -// filtered by the specified matcher. It returns a new -// Selection object containing these elements. -func (s *Selection) ChildrenMatcher(m Matcher) *Selection { - return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m) -} - -// Parent gets the parent of each element in the Selection. It returns a -// new Selection object containing the matched elements. -func (s *Selection) Parent() *Selection { - return pushStack(s, getParentNodes(s.Nodes)) -} - -// ParentFiltered gets the parent of each element in the Selection filtered by a -// selector. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentFiltered(selector string) *Selection { - return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector)) -} - -// ParentMatcher gets the parent of each element in the Selection filtered by a -// matcher. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentMatcher(m Matcher) *Selection { - return filterAndPush(s, getParentNodes(s.Nodes), m) -} - -// Closest gets the first element that matches the selector by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) Closest(selector string) *Selection { - cs := compileMatcher(selector) - return s.ClosestMatcher(cs) -} - -// ClosestMatcher gets the first element that matches the matcher by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) ClosestMatcher(m Matcher) *Selection { - return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { - // For each node in the selection, test the node itself, then each parent - // until a match is found. - for ; n != nil; n = n.Parent { - if m.Match(n) { - return []*html.Node{n} - } - } - return nil - })) -} - -// ClosestNodes gets the first element that matches one of the nodes by testing the -// element itself and traversing up through its ancestors in the DOM tree. -func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection { - set := make(map[*html.Node]bool) - for _, n := range nodes { - set[n] = true - } - return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { - // For each node in the selection, test the node itself, then each parent - // until a match is found. - for ; n != nil; n = n.Parent { - if set[n] { - return []*html.Node{n} - } - } - return nil - })) -} - -// ClosestSelection gets the first element that matches one of the nodes in the -// Selection by testing the element itself and traversing up through its ancestors -// in the DOM tree. -func (s *Selection) ClosestSelection(sel *Selection) *Selection { - if sel == nil { - return pushStack(s, nil) - } - return s.ClosestNodes(sel.Nodes...) -} - -// Parents gets the ancestors of each element in the current Selection. It -// returns a new Selection object with the matched elements. -func (s *Selection) Parents() *Selection { - return pushStack(s, getParentsNodes(s.Nodes, nil, nil)) -} - -// ParentsFiltered gets the ancestors of each element in the current -// Selection. It returns a new Selection object with the matched elements. -func (s *Selection) ParentsFiltered(selector string) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector)) -} - -// ParentsMatcher gets the ancestors of each element in the current -// Selection. It returns a new Selection object with the matched elements. -func (s *Selection) ParentsMatcher(m Matcher) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m) -} - -// ParentsUntil gets the ancestors of each element in the Selection, up to but -// not including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsUntil(selector string) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil)) -} - -// ParentsUntilMatcher gets the ancestors of each element in the Selection, up to but -// not including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, m, nil)) -} - -// ParentsUntilSelection gets the ancestors of each element in the Selection, -// up to but not including the elements in the specified Selection. It returns a -// new Selection object containing the matched elements. -func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.Parents() - } - return s.ParentsUntilNodes(sel.Nodes...) -} - -// ParentsUntilNodes gets the ancestors of each element in the Selection, -// up to but not including the specified nodes. It returns a -// new Selection object containing the matched elements. -func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getParentsNodes(s.Nodes, nil, nodes)) -} - -// ParentsFilteredUntil is like ParentsUntil, with the option to filter the -// results based on a selector string. It returns a new Selection -// object containing the matched elements. -func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// ParentsFilteredUntilMatcher is like ParentsUntilMatcher, with the option to filter the -// results based on a matcher. It returns a new Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter) -} - -// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// ParentsMatcherUntilSelection is like ParentsUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.ParentsMatcher(filter) - } - return s.ParentsMatcherUntilNodes(filter, sel.Nodes...) -} - -// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector)) -} - -// ParentsMatcherUntilNodes is like ParentsUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter) -} - -// Siblings gets the siblings of each element in the Selection. It returns -// a new Selection object containing the matched elements. -func (s *Selection) Siblings() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil)) -} - -// SiblingsFiltered gets the siblings of each element in the Selection -// filtered by a selector. It returns a new Selection object containing the -// matched elements. -func (s *Selection) SiblingsFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector)) -} - -// SiblingsMatcher gets the siblings of each element in the Selection -// filtered by a matcher. It returns a new Selection object containing the -// matched elements. -func (s *Selection) SiblingsMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m) -} - -// Next gets the immediately following sibling of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) Next() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil)) -} - -// NextFiltered gets the immediately following sibling of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector)) -} - -// NextMatcher gets the immediately following sibling of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m) -} - -// NextAll gets all the following siblings of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) NextAll() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil)) -} - -// NextAllFiltered gets all the following siblings of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextAllFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector)) -} - -// NextAllMatcher gets all the following siblings of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) NextAllMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m) -} - -// Prev gets the immediately preceding sibling of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) Prev() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil)) -} - -// PrevFiltered gets the immediately preceding sibling of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector)) -} - -// PrevMatcher gets the immediately preceding sibling of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m) -} - -// PrevAll gets all the preceding siblings of each element in the -// Selection. It returns a new Selection object containing the matched elements. -func (s *Selection) PrevAll() *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil)) -} - -// PrevAllFiltered gets all the preceding siblings of each element in the -// Selection filtered by a selector. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevAllFiltered(selector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector)) -} - -// PrevAllMatcher gets all the preceding siblings of each element in the -// Selection filtered by a matcher. It returns a new Selection object -// containing the matched elements. -func (s *Selection) PrevAllMatcher(m Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m) -} - -// NextUntil gets all following siblings of each element up to but not -// including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntil(selector string) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - compileMatcher(selector), nil)) -} - -// NextUntilMatcher gets all following siblings of each element up to but not -// including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilMatcher(m Matcher) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - m, nil)) -} - -// NextUntilSelection gets all following siblings of each element up to but not -// including the element matched by the Selection. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.NextAll() - } - return s.NextUntilNodes(sel.Nodes...) -} - -// NextUntilNodes gets all following siblings of each element up to but not -// including the element matched by the nodes. It returns a new Selection -// object containing the matched elements. -func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes)) -} - -// PrevUntil gets all preceding siblings of each element up to but not -// including the element matched by the selector. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntil(selector string) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - compileMatcher(selector), nil)) -} - -// PrevUntilMatcher gets all preceding siblings of each element up to but not -// including the element matched by the matcher. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilMatcher(m Matcher) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - m, nil)) -} - -// PrevUntilSelection gets all preceding siblings of each element up to but not -// including the element matched by the Selection. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilSelection(sel *Selection) *Selection { - if sel == nil { - return s.PrevAll() - } - return s.PrevUntilNodes(sel.Nodes...) -} - -// PrevUntilNodes gets all preceding siblings of each element up to but not -// including the element matched by the nodes. It returns a new Selection -// object containing the matched elements. -func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection { - return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes)) -} - -// NextFilteredUntil is like NextUntil, with the option to filter -// the results based on a selector string. -// It returns a new Selection object containing the matched elements. -func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// NextFilteredUntilMatcher is like NextUntilMatcher, with the option to filter -// the results based on a matcher. -// It returns a new Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - until, nil), filter) -} - -// NextFilteredUntilSelection is like NextUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.NextMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// NextMatcherUntilSelection is like NextUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.NextMatcher(filter) - } - return s.NextMatcherUntilNodes(filter, sel.Nodes...) -} - -// NextFilteredUntilNodes is like NextUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes), compileMatcher(filterSelector)) -} - -// NextMatcherUntilNodes is like NextUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) NextMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, - nil, nodes), filter) -} - -// PrevFilteredUntil is like PrevUntil, with the option to filter -// the results based on a selector string. -// It returns a new Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) -} - -// PrevFilteredUntilMatcher is like PrevUntilMatcher, with the option to filter -// the results based on a matcher. -// It returns a new Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilMatcher(filter, until Matcher) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - until, nil), filter) -} - -// PrevFilteredUntilSelection is like PrevUntilSelection, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { - return s.PrevMatcherUntilSelection(compileMatcher(filterSelector), sel) -} - -// PrevMatcherUntilSelection is like PrevUntilSelection, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { - if sel == nil { - return s.PrevMatcher(filter) - } - return s.PrevMatcherUntilNodes(filter, sel.Nodes...) -} - -// PrevFilteredUntilNodes is like PrevUntilNodes, with the -// option to filter the results based on a selector string. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes), compileMatcher(filterSelector)) -} - -// PrevMatcherUntilNodes is like PrevUntilNodes, with the -// option to filter the results based on a matcher. It returns a new -// Selection object containing the matched elements. -func (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { - return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil, - nil, nodes), filter) -} - -// Filter and push filters the nodes based on a matcher, and pushes the results -// on the stack, with the srcSel as previous selection. -func filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection { - // Create a temporary Selection with the specified nodes to filter using winnow - sel := &Selection{nodes, srcSel.document, nil} - // Filter based on matcher and push on stack - return pushStack(srcSel, winnow(sel, m, true)) -} - -// Internal implementation of Find that return raw nodes. -func findWithMatcher(nodes []*html.Node, m Matcher) []*html.Node { - // Map nodes to find the matches within the children of each node - return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { - // Go down one level, becausejQuery's Find selects only within descendants - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == html.ElementNode { - result = append(result, m.MatchAll(c)...) - } - } - return - }) -} - -// Internal implementation to get all parent nodes, stopping at the specified -// node (or nil if no stop). -func getParentsNodes(nodes []*html.Node, stopm Matcher, stopNodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { - for p := n.Parent; p != nil; p = p.Parent { - sel := newSingleSelection(p, nil) - if stopm != nil { - if sel.IsMatcher(stopm) { - break - } - } else if len(stopNodes) > 0 { - if sel.IsNodes(stopNodes...) { - break - } - } - if p.Type == html.ElementNode { - result = append(result, p) - } - } - return - }) -} - -// Internal implementation of sibling nodes that return a raw slice of matches. -func getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNodes []*html.Node) []*html.Node { - var f func(*html.Node) bool - - // If the requested siblings are ...Until, create the test function to - // determine if the until condition is reached (returns true if it is) - if st == siblingNextUntil || st == siblingPrevUntil { - f = func(n *html.Node) bool { - if untilm != nil { - // Matcher-based condition - sel := newSingleSelection(n, nil) - return sel.IsMatcher(untilm) - } else if len(untilNodes) > 0 { - // Nodes-based condition - sel := newSingleSelection(n, nil) - return sel.IsNodes(untilNodes...) - } - return false - } - } - - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - return getChildrenWithSiblingType(n.Parent, st, n, f) - }) -} - -// Gets the children nodes of each node in the specified slice of nodes, -// based on the sibling type request. -func getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - return getChildrenWithSiblingType(n, st, nil, nil) - }) -} - -// Gets the children of the specified parent, based on the requested sibling -// type, skipping a specified node if required. -func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *html.Node, - untilFunc func(*html.Node) bool) (result []*html.Node) { - - // Create the iterator function - var iter = func(cur *html.Node) (ret *html.Node) { - // Based on the sibling type requested, iterate the right way - for { - switch st { - case siblingAll, siblingAllIncludingNonElements: - if cur == nil { - // First iteration, start with first child of parent - // Skip node if required - if ret = parent.FirstChild; ret == skipNode && skipNode != nil { - ret = skipNode.NextSibling - } - } else { - // Skip node if required - if ret = cur.NextSibling; ret == skipNode && skipNode != nil { - ret = skipNode.NextSibling - } - } - case siblingPrev, siblingPrevAll, siblingPrevUntil: - if cur == nil { - // Start with previous sibling of the skip node - ret = skipNode.PrevSibling - } else { - ret = cur.PrevSibling - } - case siblingNext, siblingNextAll, siblingNextUntil: - if cur == nil { - // Start with next sibling of the skip node - ret = skipNode.NextSibling - } else { - ret = cur.NextSibling - } - default: - panic("Invalid sibling type.") - } - if ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements { - return - } - // Not a valid node, try again from this one - cur = ret - } - } - - for c := iter(nil); c != nil; c = iter(c) { - // If this is an ...Until case, test before append (returns true - // if the until condition is reached) - if st == siblingNextUntil || st == siblingPrevUntil { - if untilFunc(c) { - return - } - } - result = append(result, c) - if st == siblingNext || st == siblingPrev { - // Only one node was requested (immediate next or previous), so exit - return - } - } - return -} - -// Internal implementation of parent nodes that return a raw slice of Nodes. -func getParentNodes(nodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if n.Parent != nil && n.Parent.Type == html.ElementNode { - return []*html.Node{n.Parent} - } - return nil - }) -} - -// Internal map function used by many traversing methods. Takes the source nodes -// to iterate on and the mapping function that returns an array of nodes. -// Returns an array of nodes mapped by calling the callback function once for -// each node in the source nodes. -func mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) { - set := make(map[*html.Node]bool) - for i, n := range nodes { - if vals := f(i, n); len(vals) > 0 { - result = appendWithoutDuplicates(result, vals, set) - } - } - return result -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/traversal_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/traversal_test.go deleted file mode 100644 index 04383a413..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/traversal_test.go +++ /dev/null @@ -1,793 +0,0 @@ -package goquery - -import ( - "strings" - "testing" -) - -func TestFind(t *testing.T) { - sel := Doc().Find("div.row-fluid") - assertLength(t, sel.Nodes, 9) -} - -func TestFindRollback(t *testing.T) { - sel := Doc().Find("div.row-fluid") - sel2 := sel.Find("a").End() - assertEqual(t, sel, sel2) -} - -func TestFindNotSelf(t *testing.T) { - sel := Doc().Find("h1").Find("h1") - assertLength(t, sel.Nodes, 0) -} - -func TestFindInvalid(t *testing.T) { - sel := Doc().Find(":+ ^") - assertLength(t, sel.Nodes, 0) -} - -func TestFindBig(t *testing.T) { - doc := DocW() - sel := doc.Find("li") - assertLength(t, sel.Nodes, 373) - sel2 := doc.Find("span") - assertLength(t, sel2.Nodes, 448) - sel3 := sel.FindSelection(sel2) - assertLength(t, sel3.Nodes, 248) -} - -func TestChainedFind(t *testing.T) { - sel := Doc().Find("div.hero-unit").Find(".row-fluid") - assertLength(t, sel.Nodes, 4) -} - -func TestChainedFindInvalid(t *testing.T) { - sel := Doc().Find("div.hero-unit").Find("") - assertLength(t, sel.Nodes, 0) -} - -func TestChildren(t *testing.T) { - sel := Doc().Find(".pvk-content").Children() - assertLength(t, sel.Nodes, 5) -} - -func TestChildrenRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Children().End() - assertEqual(t, sel, sel2) -} - -func TestContents(t *testing.T) { - sel := Doc().Find(".pvk-content").Contents() - assertLength(t, sel.Nodes, 13) -} - -func TestContentsRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.Contents().End() - assertEqual(t, sel, sel2) -} - -func TestChildrenFiltered(t *testing.T) { - sel := Doc().Find(".pvk-content").ChildrenFiltered(".hero-unit") - assertLength(t, sel.Nodes, 1) -} - -func TestChildrenFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-content").ChildrenFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestChildrenFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.ChildrenFiltered(".hero-unit").End() - assertEqual(t, sel, sel2) -} - -func TestContentsFiltered(t *testing.T) { - sel := Doc().Find(".pvk-content").ContentsFiltered(".hero-unit") - assertLength(t, sel.Nodes, 1) -} - -func TestContentsFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-content").ContentsFiltered("~") - assertLength(t, sel.Nodes, 0) -} - -func TestContentsFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-content") - sel2 := sel.ContentsFiltered(".hero-unit").End() - assertEqual(t, sel, sel2) -} - -func TestChildrenFilteredNone(t *testing.T) { - sel := Doc().Find(".pvk-content").ChildrenFiltered("a.btn") - assertLength(t, sel.Nodes, 0) -} - -func TestParent(t *testing.T) { - sel := Doc().Find(".container-fluid").Parent() - assertLength(t, sel.Nodes, 3) -} - -func TestParentRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Parent().End() - assertEqual(t, sel, sel2) -} - -func TestParentBody(t *testing.T) { - sel := Doc().Find("body").Parent() - assertLength(t, sel.Nodes, 1) -} - -func TestParentFiltered(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentFiltered(".hero-unit") - assertLength(t, sel.Nodes, 1) - assertClass(t, sel, "hero-unit") -} - -func TestParentFilteredInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestParentFilteredRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentFiltered(".hero-unit").End() - assertEqual(t, sel, sel2) -} - -func TestParents(t *testing.T) { - sel := Doc().Find(".container-fluid").Parents() - assertLength(t, sel.Nodes, 8) -} - -func TestParentsOrder(t *testing.T) { - sel := Doc().Find("#cf2").Parents() - assertLength(t, sel.Nodes, 6) - assertSelectionIs(t, sel, ".hero-unit", ".pvk-content", "div.row-fluid", "#cf1", "body", "html") -} - -func TestParentsRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Parents().End() - assertEqual(t, sel, sel2) -} - -func TestParentsFiltered(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFiltered("body") - assertLength(t, sel.Nodes, 1) -} - -func TestParentsFilteredInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestParentsFilteredRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentsFiltered("body").End() - assertEqual(t, sel, sel2) -} - -func TestParentsUntil(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsUntil("body") - assertLength(t, sel.Nodes, 6) -} - -func TestParentsUntilInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsUntil("") - assertLength(t, sel.Nodes, 8) -} - -func TestParentsUntilRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentsUntil("body").End() - assertEqual(t, sel, sel2) -} - -func TestParentsUntilSelection(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content") - sel = sel.ParentsUntilSelection(sel2) - assertLength(t, sel.Nodes, 3) -} - -func TestParentsUntilSelectionRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content") - sel2 = sel.ParentsUntilSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestParentsUntilNodes(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content, .hero-unit") - sel = sel.ParentsUntilNodes(sel2.Nodes...) - assertLength(t, sel.Nodes, 2) -} - -func TestParentsUntilNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".pvk-content, .hero-unit") - sel2 = sel.ParentsUntilNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestParentsFilteredUntil(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFilteredUntil(".pvk-content", "body") - assertLength(t, sel.Nodes, 2) -} - -func TestParentsFilteredUntilInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").ParentsFilteredUntil("", "") - assertLength(t, sel.Nodes, 0) -} - -func TestParentsFilteredUntilRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ParentsFilteredUntil(".pvk-content", "body").End() - assertEqual(t, sel, sel2) -} - -func TestParentsFilteredUntilSelection(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel = sel.ParentsFilteredUntilSelection("div", sel2) - assertLength(t, sel.Nodes, 3) -} - -func TestParentsFilteredUntilSelectionRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel2 = sel.ParentsFilteredUntilSelection("div", sel2).End() - assertEqual(t, sel, sel2) -} - -func TestParentsFilteredUntilNodes(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...) - assertLength(t, sel.Nodes, 1) -} - -func TestParentsFilteredUntilNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := Doc().Find(".row-fluid") - sel2 = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestSiblings(t *testing.T) { - sel := Doc().Find("h1").Siblings() - assertLength(t, sel.Nodes, 1) -} - -func TestSiblingsRollback(t *testing.T) { - sel := Doc().Find("h1") - sel2 := sel.Siblings().End() - assertEqual(t, sel, sel2) -} - -func TestSiblings2(t *testing.T) { - sel := Doc().Find(".pvk-gutter").Siblings() - assertLength(t, sel.Nodes, 9) -} - -func TestSiblings3(t *testing.T) { - sel := Doc().Find("body>.container-fluid").Siblings() - assertLength(t, sel.Nodes, 0) -} - -func TestSiblingsFiltered(t *testing.T) { - sel := Doc().Find(".pvk-gutter").SiblingsFiltered(".pvk-content") - assertLength(t, sel.Nodes, 3) -} - -func TestSiblingsFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-gutter").SiblingsFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestSiblingsFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := sel.SiblingsFiltered(".pvk-content").End() - assertEqual(t, sel, sel2) -} - -func TestNext(t *testing.T) { - sel := Doc().Find("h1").Next() - assertLength(t, sel.Nodes, 1) -} - -func TestNextRollback(t *testing.T) { - sel := Doc().Find("h1") - sel2 := sel.Next().End() - assertEqual(t, sel, sel2) -} - -func TestNext2(t *testing.T) { - sel := Doc().Find(".close").Next() - assertLength(t, sel.Nodes, 1) -} - -func TestNextNone(t *testing.T) { - sel := Doc().Find("small").Next() - assertLength(t, sel.Nodes, 0) -} - -func TestNextFiltered(t *testing.T) { - sel := Doc().Find(".container-fluid").NextFiltered("div") - assertLength(t, sel.Nodes, 2) -} - -func TestNextFilteredInvalid(t *testing.T) { - sel := Doc().Find(".container-fluid").NextFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestNextFilteredRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.NextFiltered("div").End() - assertEqual(t, sel, sel2) -} - -func TestNextFiltered2(t *testing.T) { - sel := Doc().Find(".container-fluid").NextFiltered("[ng-view]") - assertLength(t, sel.Nodes, 1) -} - -func TestPrev(t *testing.T) { - sel := Doc().Find(".red").Prev() - assertLength(t, sel.Nodes, 1) - assertClass(t, sel, "green") -} - -func TestPrevRollback(t *testing.T) { - sel := Doc().Find(".red") - sel2 := sel.Prev().End() - assertEqual(t, sel, sel2) -} - -func TestPrev2(t *testing.T) { - sel := Doc().Find(".row-fluid").Prev() - assertLength(t, sel.Nodes, 5) -} - -func TestPrevNone(t *testing.T) { - sel := Doc().Find("h2").Prev() - assertLength(t, sel.Nodes, 0) -} - -func TestPrevFiltered(t *testing.T) { - sel := Doc().Find(".row-fluid").PrevFiltered(".row-fluid") - assertLength(t, sel.Nodes, 5) -} - -func TestPrevFilteredInvalid(t *testing.T) { - sel := Doc().Find(".row-fluid").PrevFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestPrevFilteredRollback(t *testing.T) { - sel := Doc().Find(".row-fluid") - sel2 := sel.PrevFiltered(".row-fluid").End() - assertEqual(t, sel, sel2) -} - -func TestNextAll(t *testing.T) { - sel := Doc().Find("#cf2 div:nth-child(1)").NextAll() - assertLength(t, sel.Nodes, 3) -} - -func TestNextAllRollback(t *testing.T) { - sel := Doc().Find("#cf2 div:nth-child(1)") - sel2 := sel.NextAll().End() - assertEqual(t, sel, sel2) -} - -func TestNextAll2(t *testing.T) { - sel := Doc().Find("div[ng-cloak]").NextAll() - assertLength(t, sel.Nodes, 1) -} - -func TestNextAllNone(t *testing.T) { - sel := Doc().Find(".footer").NextAll() - assertLength(t, sel.Nodes, 0) -} - -func TestNextAllFiltered(t *testing.T) { - sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("[ng-cloak]") - assertLength(t, sel.Nodes, 2) -} - -func TestNextAllFilteredInvalid(t *testing.T) { - sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestNextAllFilteredRollback(t *testing.T) { - sel := Doc().Find("#cf2 .row-fluid") - sel2 := sel.NextAllFiltered("[ng-cloak]").End() - assertEqual(t, sel, sel2) -} - -func TestNextAllFiltered2(t *testing.T) { - sel := Doc().Find(".close").NextAllFiltered("h4") - assertLength(t, sel.Nodes, 1) -} - -func TestPrevAll(t *testing.T) { - sel := Doc().Find("[ng-view]").PrevAll() - assertLength(t, sel.Nodes, 2) -} - -func TestPrevAllOrder(t *testing.T) { - sel := Doc().Find("[ng-view]").PrevAll() - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#cf4", "#cf3") -} - -func TestPrevAllRollback(t *testing.T) { - sel := Doc().Find("[ng-view]") - sel2 := sel.PrevAll().End() - assertEqual(t, sel, sel2) -} - -func TestPrevAll2(t *testing.T) { - sel := Doc().Find(".pvk-gutter").PrevAll() - assertLength(t, sel.Nodes, 6) -} - -func TestPrevAllFiltered(t *testing.T) { - sel := Doc().Find(".pvk-gutter").PrevAllFiltered(".pvk-content") - assertLength(t, sel.Nodes, 3) -} - -func TestPrevAllFilteredInvalid(t *testing.T) { - sel := Doc().Find(".pvk-gutter").PrevAllFiltered("") - assertLength(t, sel.Nodes, 0) -} - -func TestPrevAllFilteredRollback(t *testing.T) { - sel := Doc().Find(".pvk-gutter") - sel2 := sel.PrevAllFiltered(".pvk-content").End() - assertEqual(t, sel, sel2) -} - -func TestNextUntil(t *testing.T) { - sel := Doc().Find(".alert a").NextUntil("p") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "h4") -} - -func TestNextUntilInvalid(t *testing.T) { - sel := Doc().Find(".alert a").NextUntil("") - assertLength(t, sel.Nodes, 2) -} - -func TestNextUntil2(t *testing.T) { - sel := Doc().Find("#cf2-1").NextUntil("[ng-cloak]") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "#cf2-2") -} - -func TestNextUntilOrder(t *testing.T) { - sel := Doc().Find("#cf2-1").NextUntil("#cf2-4") - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#cf2-2", "#cf2-3") -} - -func TestNextUntilRollback(t *testing.T) { - sel := Doc().Find("#cf2-1") - sel2 := sel.PrevUntil("#cf2-4").End() - assertEqual(t, sel, sel2) -} - -func TestNextUntilSelection(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n4") - sel2 = sel.NextUntilSelection(sel2) - assertLength(t, sel2.Nodes, 1) - assertSelectionIs(t, sel2, "#n3") -} - -func TestNextUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n4") - sel2 = sel.NextUntilSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestNextUntilNodes(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n5") - sel2 = sel.NextUntilNodes(sel2.Nodes...) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#n3", "#n4") -} - -func TestNextUntilNodesRollback(t *testing.T) { - sel := Doc2().Find("#n2") - sel2 := Doc2().Find("#n5") - sel2 = sel.NextUntilNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestPrevUntil(t *testing.T) { - sel := Doc().Find(".alert p").PrevUntil("a") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "h4") -} - -func TestPrevUntilInvalid(t *testing.T) { - sel := Doc().Find(".alert p").PrevUntil("") - assertLength(t, sel.Nodes, 2) -} - -func TestPrevUntil2(t *testing.T) { - sel := Doc().Find("[ng-cloak]").PrevUntil(":not([ng-cloak])") - assertLength(t, sel.Nodes, 1) - assertSelectionIs(t, sel, "[ng-cloak]") -} - -func TestPrevUntilOrder(t *testing.T) { - sel := Doc().Find("#cf2-4").PrevUntil("#cf2-1") - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#cf2-3", "#cf2-2") -} - -func TestPrevUntilRollback(t *testing.T) { - sel := Doc().Find("#cf2-4") - sel2 := sel.PrevUntil("#cf2-1").End() - assertEqual(t, sel, sel2) -} - -func TestPrevUntilSelection(t *testing.T) { - sel := Doc2().Find("#n4") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilSelection(sel2) - assertLength(t, sel2.Nodes, 1) - assertSelectionIs(t, sel2, "#n3") -} - -func TestPrevUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find("#n4") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilSelection(sel2).End() - assertEqual(t, sel, sel2) -} - -func TestPrevUntilNodes(t *testing.T) { - sel := Doc2().Find("#n5") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilNodes(sel2.Nodes...) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#n4", "#n3") -} - -func TestPrevUntilNodesRollback(t *testing.T) { - sel := Doc2().Find("#n5") - sel2 := Doc2().Find("#n2") - sel2 = sel.PrevUntilNodes(sel2.Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestNextFilteredUntil(t *testing.T) { - sel := Doc2().Find(".two").NextFilteredUntil(".even", ".six") - assertLength(t, sel.Nodes, 4) - assertSelectionIs(t, sel, "#n3", "#n5", "#nf3", "#nf5") -} - -func TestNextFilteredUntilInvalid(t *testing.T) { - sel := Doc2().Find(".two").NextFilteredUntil("", "") - assertLength(t, sel.Nodes, 0) -} - -func TestNextFilteredUntilRollback(t *testing.T) { - sel := Doc2().Find(".two") - sel2 := sel.NextFilteredUntil(".even", ".six").End() - assertEqual(t, sel, sel2) -} - -func TestNextFilteredUntilSelection(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".five") - sel = sel.NextFilteredUntilSelection(".even", sel2) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#n3", "#nf3") -} - -func TestNextFilteredUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".five") - sel3 := sel.NextFilteredUntilSelection(".even", sel2).End() - assertEqual(t, sel, sel3) -} - -func TestNextFilteredUntilNodes(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel = sel.NextFilteredUntilNodes(".odd", sel2.Nodes...) - assertLength(t, sel.Nodes, 4) - assertSelectionIs(t, sel, "#n2", "#n6", "#nf2", "#nf6") -} - -func TestNextFilteredUntilNodesRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel3 := sel.NextFilteredUntilNodes(".odd", sel2.Nodes...).End() - assertEqual(t, sel, sel3) -} - -func TestPrevFilteredUntil(t *testing.T) { - sel := Doc2().Find(".five").PrevFilteredUntil(".odd", ".one") - assertLength(t, sel.Nodes, 4) - assertSelectionIs(t, sel, "#n4", "#n2", "#nf4", "#nf2") -} - -func TestPrevFilteredUntilInvalid(t *testing.T) { - sel := Doc2().Find(".five").PrevFilteredUntil("", "") - assertLength(t, sel.Nodes, 0) -} - -func TestPrevFilteredUntilRollback(t *testing.T) { - sel := Doc2().Find(".four") - sel2 := sel.PrevFilteredUntil(".odd", ".one").End() - assertEqual(t, sel, sel2) -} - -func TestPrevFilteredUntilSelection(t *testing.T) { - sel := Doc2().Find(".odd") - sel2 := Doc2().Find(".two") - sel = sel.PrevFilteredUntilSelection(".odd", sel2) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#n4", "#nf4") -} - -func TestPrevFilteredUntilSelectionRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".five") - sel3 := sel.PrevFilteredUntilSelection(".even", sel2).End() - assertEqual(t, sel, sel3) -} - -func TestPrevFilteredUntilNodes(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel = sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...) - assertLength(t, sel.Nodes, 2) - assertSelectionIs(t, sel, "#n2", "#nf2") -} - -func TestPrevFilteredUntilNodesRollback(t *testing.T) { - sel := Doc2().Find(".even") - sel2 := Doc2().Find(".four") - sel3 := sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...).End() - assertEqual(t, sel, sel3) -} - -func TestClosestItself(t *testing.T) { - sel := Doc2().Find(".three") - sel2 := sel.Closest(".row") - assertLength(t, sel2.Nodes, sel.Length()) - assertSelectionIs(t, sel2, "#n3", "#nf3") -} - -func TestClosestNoDupes(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.Closest(".pvk-content") - assertLength(t, sel2.Nodes, 1) - assertClass(t, sel2, "pvk-content") -} - -func TestClosestNone(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.Closest("a") - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestInvalid(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.Closest("") - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestMany(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Closest(".pvk-content") - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#pc1", "#pc2") -} - -func TestClosestRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.Closest(".pvk-content").End() - assertEqual(t, sel, sel2) -} - -func TestClosestSelectionItself(t *testing.T) { - sel := Doc2().Find(".three") - sel2 := sel.ClosestSelection(Doc2().Find(".row")) - assertLength(t, sel2.Nodes, sel.Length()) -} - -func TestClosestSelectionNoDupes(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")) - assertLength(t, sel2.Nodes, 1) - assertClass(t, sel2, "pvk-content") -} - -func TestClosestSelectionNone(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.ClosestSelection(Doc().Find("a")) - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestSelectionMany(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#pc1", "#pc2") -} - -func TestClosestSelectionRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")).End() - assertEqual(t, sel, sel2) -} - -func TestClosestNodesItself(t *testing.T) { - sel := Doc2().Find(".three") - sel2 := sel.ClosestNodes(Doc2().Find(".row").Nodes...) - assertLength(t, sel2.Nodes, sel.Length()) -} - -func TestClosestNodesNoDupes(t *testing.T) { - sel := Doc().Find(".span12") - sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...) - assertLength(t, sel2.Nodes, 1) - assertClass(t, sel2, "pvk-content") -} - -func TestClosestNodesNone(t *testing.T) { - sel := Doc().Find("h4") - sel2 := sel.ClosestNodes(Doc().Find("a").Nodes...) - assertLength(t, sel2.Nodes, 0) -} - -func TestClosestNodesMany(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...) - assertLength(t, sel2.Nodes, 2) - assertSelectionIs(t, sel2, "#pc1", "#pc2") -} - -func TestClosestNodesRollback(t *testing.T) { - sel := Doc().Find(".container-fluid") - sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...).End() - assertEqual(t, sel, sel2) -} - -func TestIssue26(t *testing.T) { - img1 := `150x150` - img2 := `150x150` - cases := []struct { - s string - l int - }{ - {s: img1 + img2, l: 2}, - {s: img1, l: 1}, - {s: img2, l: 1}, - } - for _, c := range cases { - doc, err := NewDocumentFromReader(strings.NewReader(c.s)) - if err != nil { - t.Fatal(err) - } - sel := doc.Find("img[src]") - assertLength(t, sel.Nodes, c.l) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/type.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/type.go deleted file mode 100644 index 6646c143b..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/type.go +++ /dev/null @@ -1,203 +0,0 @@ -package goquery - -import ( - "errors" - "io" - "net/http" - "net/url" - - "github.com/andybalholm/cascadia" - "golang.org/x/net/html" -) - -// Document represents an HTML document to be manipulated. Unlike jQuery, which -// is loaded as part of a DOM document, and thus acts upon its containing -// document, GoQuery doesn't know which HTML document to act upon. So it needs -// to be told, and that's what the Document class is for. It holds the root -// document node to manipulate, and can make selections on this document. -type Document struct { - *Selection - Url *url.URL - rootNode *html.Node -} - -// NewDocumentFromNode is a Document constructor that takes a root html Node -// as argument. -func NewDocumentFromNode(root *html.Node) *Document { - return newDocument(root, nil) -} - -// NewDocument is a Document constructor that takes a string URL as argument. -// It loads the specified document, parses it, and stores the root Document -// node, ready to be manipulated. -// -// Deprecated: Use the net/http standard library package to make the request -// and validate the response before calling goquery.NewDocumentFromReader -// with the response's body. -func NewDocument(url string) (*Document, error) { - // Load the URL - res, e := http.Get(url) - if e != nil { - return nil, e - } - return NewDocumentFromResponse(res) -} - -// NewDocumentFromReader returns a Document from an io.Reader. -// It returns an error as second value if the reader's data cannot be parsed -// as html. It does not check if the reader is also an io.Closer, the -// provided reader is never closed by this call. It is the responsibility -// of the caller to close it if required. -func NewDocumentFromReader(r io.Reader) (*Document, error) { - root, e := html.Parse(r) - if e != nil { - return nil, e - } - return newDocument(root, nil), nil -} - -// NewDocumentFromResponse is another Document constructor that takes an http response as argument. -// It loads the specified response's document, parses it, and stores the root Document -// node, ready to be manipulated. The response's body is closed on return. -// -// Deprecated: Use goquery.NewDocumentFromReader with the response's body. -func NewDocumentFromResponse(res *http.Response) (*Document, error) { - if res == nil { - return nil, errors.New("Response is nil") - } - defer res.Body.Close() - if res.Request == nil { - return nil, errors.New("Response.Request is nil") - } - - // Parse the HTML into nodes - root, e := html.Parse(res.Body) - if e != nil { - return nil, e - } - - // Create and fill the document - return newDocument(root, res.Request.URL), nil -} - -// CloneDocument creates a deep-clone of a document. -func CloneDocument(doc *Document) *Document { - return newDocument(cloneNode(doc.rootNode), doc.Url) -} - -// Private constructor, make sure all fields are correctly filled. -func newDocument(root *html.Node, url *url.URL) *Document { - // Create and fill the document - d := &Document{nil, url, root} - d.Selection = newSingleSelection(root, d) - return d -} - -// Selection represents a collection of nodes matching some criteria. The -// initial Selection can be created by using Document.Find, and then -// manipulated using the jQuery-like chainable syntax and methods. -type Selection struct { - Nodes []*html.Node - document *Document - prevSel *Selection -} - -// Helper constructor to create an empty selection -func newEmptySelection(doc *Document) *Selection { - return &Selection{nil, doc, nil} -} - -// Helper constructor to create a selection of only one node -func newSingleSelection(node *html.Node, doc *Document) *Selection { - return &Selection{[]*html.Node{node}, doc, nil} -} - -// Matcher is an interface that defines the methods to match -// HTML nodes against a compiled selector string. Cascadia's -// Selector implements this interface. -type Matcher interface { - Match(*html.Node) bool - MatchAll(*html.Node) []*html.Node - Filter([]*html.Node) []*html.Node -} - -// Single compiles a selector string to a Matcher that stops after the first -// match is found. -// -// By default, Selection.Find and other functions that accept a selector string -// to select nodes will use all matches corresponding to that selector. By -// using the Matcher returned by Single, at most the first match will be -// selected. -// -// For example, those two statements are semantically equivalent: -// -// sel1 := doc.Find("a").First() -// sel2 := doc.FindMatcher(goquery.Single("a")) -// -// The one using Single is optimized to be potentially much faster on large -// documents. -// -// Only the behaviour of the MatchAll method of the Matcher interface is -// altered compared to standard Matchers. This means that the single-selection -// property of the Matcher only applies for Selection methods where the Matcher -// is used to select nodes, not to filter or check if a node matches the -// Matcher - in those cases, the behaviour of the Matcher is unchanged (e.g. -// FilterMatcher(Single("div")) will still result in a Selection with multiple -// "div"s if there were many "div"s in the Selection to begin with). -func Single(selector string) Matcher { - return singleMatcher{compileMatcher(selector)} -} - -// SingleMatcher returns a Matcher matches the same nodes as m, but that stops -// after the first match is found. -// -// See the documentation of function Single for more details. -func SingleMatcher(m Matcher) Matcher { - if _, ok := m.(singleMatcher); ok { - // m is already a singleMatcher - return m - } - return singleMatcher{m} -} - -// compileMatcher compiles the selector string s and returns -// the corresponding Matcher. If s is an invalid selector string, -// it returns a Matcher that fails all matches. -func compileMatcher(s string) Matcher { - cs, err := cascadia.Compile(s) - if err != nil { - return invalidMatcher{} - } - return cs -} - -type singleMatcher struct { - Matcher -} - -func (m singleMatcher) MatchAll(n *html.Node) []*html.Node { - // Optimized version - stops finding at the first match (cascadia-compiled - // matchers all use this code path). - if mm, ok := m.Matcher.(interface{ MatchFirst(*html.Node) *html.Node }); ok { - node := mm.MatchFirst(n) - if node == nil { - return nil - } - return []*html.Node{node} - } - - // Fallback version, for e.g. test mocks that don't provide the MatchFirst - // method. - nodes := m.Matcher.MatchAll(n) - if len(nodes) > 0 { - return nodes[:1:1] - } - return nil -} - -// invalidMatcher is a Matcher that always fails to match. -type invalidMatcher struct{} - -func (invalidMatcher) Match(n *html.Node) bool { return false } -func (invalidMatcher) MatchAll(n *html.Node) []*html.Node { return nil } -func (invalidMatcher) Filter(ns []*html.Node) []*html.Node { return nil } diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/type_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/type_test.go deleted file mode 100644 index 84080a9c7..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/type_test.go +++ /dev/null @@ -1,255 +0,0 @@ -package goquery - -import ( - "bytes" - "fmt" - "os" - "strings" - "testing" - - "github.com/andybalholm/cascadia" - "golang.org/x/net/html" -) - -// Test helper functions and members -var doc *Document -var doc2 *Document -var doc3 *Document -var docB *Document -var docW *Document - -func Doc() *Document { - if doc == nil { - doc = loadDoc("page.html") - } - return doc -} - -func Doc2() *Document { - if doc2 == nil { - doc2 = loadDoc("page2.html") - } - return doc2 -} - -func Doc2Clone() *Document { - return CloneDocument(Doc2()) -} - -func Doc3() *Document { - if doc3 == nil { - doc3 = loadDoc("page3.html") - } - return doc3 -} - -func Doc3Clone() *Document { - return CloneDocument(Doc3()) -} - -func DocB() *Document { - if docB == nil { - docB = loadDoc("gotesting.html") - } - return docB -} - -func DocW() *Document { - if docW == nil { - docW = loadDoc("gowiki.html") - } - return docW -} - -func assertLength(t *testing.T, nodes []*html.Node, length int) { - if len(nodes) != length { - t.Errorf("Expected %d nodes, found %d.", length, len(nodes)) - for i, n := range nodes { - t.Logf("Node %d: %+v.", i, n) - } - } -} - -func assertClass(t *testing.T, sel *Selection, class string) { - if !sel.HasClass(class) { - t.Errorf("Expected node to have class %s, found %+v.", class, sel.Get(0)) - } -} - -func assertPanic(t *testing.T) { - if e := recover(); e == nil { - t.Error("Expected a panic.") - } -} - -func assertEqual(t *testing.T, s1 *Selection, s2 *Selection) { - if s1 != s2 { - t.Error("Expected selection objects to be the same.") - } -} - -func assertSelectionIs(t *testing.T, sel *Selection, is ...string) { - for i := 0; i < sel.Length(); i++ { - if !sel.Eq(i).Is(is[i]) { - t.Errorf("Expected node %d to be %s, found %+v", i, is[i], sel.Get(i)) - } - } -} - -func printSel(t *testing.T, sel *Selection) { - if testing.Verbose() { - h, err := sel.Html() - if err != nil { - t.Fatal(err) - } - t.Log(h) - } -} - -func loadDoc(page string) *Document { - var f *os.File - var e error - - if f, e = os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil { - panic(e.Error()) - } - defer f.Close() - - var node *html.Node - if node, e = html.Parse(f); e != nil { - panic(e.Error()) - } - return NewDocumentFromNode(node) -} - -func loadString(t *testing.T, doc string) *Document { - d, err := NewDocumentFromReader(strings.NewReader(doc)) - if err != nil { - t.Error("Failed to parse test document") - } - return d -} - -func TestNewDocument(t *testing.T) { - if f, e := os.Open("./testdata/page.html"); e != nil { - t.Error(e.Error()) - } else { - defer f.Close() - if node, e := html.Parse(f); e != nil { - t.Error(e.Error()) - } else { - doc = NewDocumentFromNode(node) - } - } -} - -func TestNewDocumentFromReader(t *testing.T) { - cases := []struct { - src string - err bool - sel string - cnt int - }{ - 0: { - src: ` - - -Test - -

Hi

- -`, - sel: "h1", - cnt: 1, - }, - 1: { - // Actually pretty hard to make html.Parse return an error - // based on content... - src: `>>qq>`, - }, - } - buf := bytes.NewBuffer(nil) - - for i, c := range cases { - buf.Reset() - buf.WriteString(c.src) - - d, e := NewDocumentFromReader(buf) - if (e != nil) != c.err { - if c.err { - t.Errorf("[%d] - expected error, got none", i) - } else { - t.Errorf("[%d] - expected no error, got %s", i, e) - } - } - if c.sel != "" { - s := d.Find(c.sel) - if s.Length() != c.cnt { - t.Errorf("[%d] - expected %d nodes, found %d", i, c.cnt, s.Length()) - } - } - } -} - -func TestNewDocumentFromResponseNil(t *testing.T) { - _, e := NewDocumentFromResponse(nil) - if e == nil { - t.Error("Expected error, got none") - } -} - -func TestIssue103(t *testing.T) { - d, err := NewDocumentFromReader(strings.NewReader("Scientists Stored These Images in DNA—Then Flawlessly Retrieved Them")) - if err != nil { - t.Error(err) - } - text := d.Find("title").Text() - for i, r := range text { - t.Logf("%d: %d - %q\n", i, r, string(r)) - } - t.Log(text) -} - -func TestSingle(t *testing.T) { - data := ` - - -
1
-
2
-
3
-

4

- - -` - doc, err := NewDocumentFromReader(strings.NewReader(data)) - if err != nil { - t.Fatal(err) - } - - text := doc.FindMatcher(Single("div")).Text() - if text != "1" { - t.Fatalf("want %q, got %q", "1", text) - } - - // Verify semantic equivalence - sel1 := doc.Find("div").First() - sel2 := doc.FindMatcher(Single("div")) - if sel1.Text() != sel2.Text() { - t.Fatalf("want sel1 to equal sel2") - } - - // Here, the Single has no effect as the selector is used to filter - // from the existing selection, not to find nodes in the document. - divs := doc.Find("div") - text = divs.FilterMatcher(Single(".a")).Text() - if text != "23" { - t.Fatalf("want %q, got %q", "23", text) - } - - classA := cascadia.MustCompile(".a") - classB := cascadia.MustCompile(".b") - text = doc.FindMatcher(classB).AddMatcher(SingleMatcher(classA)).Text() - if text != "142" { - t.Fatalf("want %q, got %q", "142", text) - } -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/utilities.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/utilities.go deleted file mode 100644 index 6d243cdd6..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/utilities.go +++ /dev/null @@ -1,178 +0,0 @@ -package goquery - -import ( - "bytes" - "io" - - "golang.org/x/net/html" -) - -// used to determine if a set (map[*html.Node]bool) should be used -// instead of iterating over a slice. The set uses more memory and -// is slower than slice iteration for small N. -const minNodesForSet = 1000 - -var nodeNames = []string{ - html.ErrorNode: "#error", - html.TextNode: "#text", - html.DocumentNode: "#document", - html.CommentNode: "#comment", -} - -// NodeName returns the node name of the first element in the selection. -// It tries to behave in a similar way as the DOM's nodeName property -// (https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName). -// -// Go's net/html package defines the following node types, listed with -// the corresponding returned value from this function: -// -// ErrorNode : #error -// TextNode : #text -// DocumentNode : #document -// ElementNode : the element's tag name -// CommentNode : #comment -// DoctypeNode : the name of the document type -// -func NodeName(s *Selection) string { - if s.Length() == 0 { - return "" - } - return nodeName(s.Get(0)) -} - -// nodeName returns the node name of the given html node. -// See NodeName for additional details on behaviour. -func nodeName(node *html.Node) string { - if node == nil { - return "" - } - - switch node.Type { - case html.ElementNode, html.DoctypeNode: - return node.Data - default: - if int(node.Type) < len(nodeNames) { - return nodeNames[node.Type] - } - return "" - } -} - -// Render renders the html of the first element from selector and writes it to -// the writer. It behaves the same as OuterHtml but writes to w instead of -// returning the string. -func Render(w io.Writer, s *Selection) error { - if s.Length() == 0 { - return nil - } - n := s.Get(0) - return html.Render(w, n) -} - -// OuterHtml returns the outer HTML rendering of the first item in -// the selection - that is, the HTML including the first element's -// tag and attributes. -// -// Unlike InnerHtml, this is a function and not a method on the Selection, -// because this is not a jQuery method (in javascript-land, this is -// a property provided by the DOM). -func OuterHtml(s *Selection) (string, error) { - var buf bytes.Buffer - if err := Render(&buf, s); err != nil { - return "", err - } - return buf.String(), nil -} - -// Loop through all container nodes to search for the target node. -func sliceContains(container []*html.Node, contained *html.Node) bool { - for _, n := range container { - if nodeContains(n, contained) { - return true - } - } - - return false -} - -// Checks if the contained node is within the container node. -func nodeContains(container *html.Node, contained *html.Node) bool { - // Check if the parent of the contained node is the container node, traversing - // upward until the top is reached, or the container is found. - for contained = contained.Parent; contained != nil; contained = contained.Parent { - if container == contained { - return true - } - } - return false -} - -// Checks if the target node is in the slice of nodes. -func isInSlice(slice []*html.Node, node *html.Node) bool { - return indexInSlice(slice, node) > -1 -} - -// Returns the index of the target node in the slice, or -1. -func indexInSlice(slice []*html.Node, node *html.Node) int { - if node != nil { - for i, n := range slice { - if n == node { - return i - } - } - } - return -1 -} - -// Appends the new nodes to the target slice, making sure no duplicate is added. -// There is no check to the original state of the target slice, so it may still -// contain duplicates. The target slice is returned because append() may create -// a new underlying array. If targetSet is nil, a local set is created with the -// target if len(target) + len(nodes) is greater than minNodesForSet. -func appendWithoutDuplicates(target []*html.Node, nodes []*html.Node, targetSet map[*html.Node]bool) []*html.Node { - // if there are not that many nodes, don't use the map, faster to just use nested loops - // (unless a non-nil targetSet is passed, in which case the caller knows better). - if targetSet == nil && len(target)+len(nodes) < minNodesForSet { - for _, n := range nodes { - if !isInSlice(target, n) { - target = append(target, n) - } - } - return target - } - - // if a targetSet is passed, then assume it is reliable, otherwise create one - // and initialize it with the current target contents. - if targetSet == nil { - targetSet = make(map[*html.Node]bool, len(target)) - for _, n := range target { - targetSet[n] = true - } - } - for _, n := range nodes { - if !targetSet[n] { - target = append(target, n) - targetSet[n] = true - } - } - - return target -} - -// Loop through a selection, returning only those nodes that pass the predicate -// function. -func grep(sel *Selection, predicate func(i int, s *Selection) bool) (result []*html.Node) { - for i, n := range sel.Nodes { - if predicate(i, newSingleSelection(n, sel.document)) { - result = append(result, n) - } - } - return result -} - -// Creates a new Selection object based on the specified nodes, and keeps the -// source Selection object on the stack (linked list). -func pushStack(fromSel *Selection, nodes []*html.Node) *Selection { - result := &Selection{nodes, fromSel.document, fromSel} - return result -} diff --git a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/utilities_test.go b/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/utilities_test.go deleted file mode 100644 index c8e9d5400..000000000 --- a/pkg/mod/github.com/!puerkito!bio/goquery@v1.8.0/utilities_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package goquery - -import ( - "reflect" - "sort" - "strings" - "testing" - - "golang.org/x/net/html" -) - -var allNodes = ` - - - - - -

- This is some text. -

-
-

-

- -` - -func TestNodeName(t *testing.T) { - doc, err := NewDocumentFromReader(strings.NewReader(allNodes)) - if err != nil { - t.Fatal(err) - } - - n0 := doc.Nodes[0] - nDT := n0.FirstChild - sMeta := doc.Find("meta") - nMeta := sMeta.Get(0) - sP := doc.Find("p") - nP := sP.Get(0) - nComment := nP.FirstChild - nText := nComment.NextSibling - - cases := []struct { - node *html.Node - typ html.NodeType - want string - }{ - {n0, html.DocumentNode, nodeNames[html.DocumentNode]}, - {nDT, html.DoctypeNode, "html"}, - {nMeta, html.ElementNode, "meta"}, - {nP, html.ElementNode, "p"}, - {nComment, html.CommentNode, nodeNames[html.CommentNode]}, - {nText, html.TextNode, nodeNames[html.TextNode]}, - } - for i, c := range cases { - got := NodeName(newSingleSelection(c.node, doc)) - if c.node.Type != c.typ { - t.Errorf("%d: want type %v, got %v", i, c.typ, c.node.Type) - } - if got != c.want { - t.Errorf("%d: want %q, got %q", i, c.want, got) - } - } -} - -func TestNodeNameMultiSel(t *testing.T) { - doc, err := NewDocumentFromReader(strings.NewReader(allNodes)) - if err != nil { - t.Fatal(err) - } - - in := []string{"p", "h1", "div"} - var out []string - doc.Find(strings.Join(in, ", ")).Each(func(i int, s *Selection) { - got := NodeName(s) - out = append(out, got) - }) - sort.Strings(in) - sort.Strings(out) - if !reflect.DeepEqual(in, out) { - t.Errorf("want %v, got %v", in, out) - } -} - -func TestOuterHtml(t *testing.T) { - doc, err := NewDocumentFromReader(strings.NewReader(allNodes)) - if err != nil { - t.Fatal(err) - } - - n0 := doc.Nodes[0] - nDT := n0.FirstChild - sMeta := doc.Find("meta") - sP := doc.Find("p") - nP := sP.Get(0) - nComment := nP.FirstChild - nText := nComment.NextSibling - sHeaders := doc.Find(".header") - - cases := []struct { - node *html.Node - sel *Selection - want string - }{ - {nDT, nil, ""}, // render makes DOCTYPE all caps - {nil, sMeta, ``}, // and auto-closes the meta - {nil, sP, `

- This is some text. -

`}, - {nComment, nil, ""}, - {nText, nil, ` - This is some text. - `}, - {nil, sHeaders, `

`}, - } - for i, c := range cases { - if c.sel == nil { - c.sel = newSingleSelection(c.node, doc) - } - got, err := OuterHtml(c.sel) - if err != nil { - t.Fatal(err) - } - - if got != c.want { - t.Errorf("%d: want %q, got %q", i, c.want, got) - } - } -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/.github/workflows/go.yml b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/.github/workflows/go.yml deleted file mode 100644 index dc251db92..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/.github/workflows/go.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Go - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 - - - name: Load cached dependencies - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - - - name: Download dependencies - run: go mod download - - - name: Build - run: make build - - - name: Lint - run: make lint - - - name: Test - run: make cover - - - name: Upload coverage - uses: codecov/codecov-action@v1 diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/.gitignore b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/.gitignore deleted file mode 100644 index 4119fb986..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/bin -/cover.out -/cover.html diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/CHANGELOG.md b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/CHANGELOG.md deleted file mode 100644 index e8eb435ff..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/CHANGELOG.md +++ /dev/null @@ -1,27 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [0.3.0] - 2021-03-25 -### Changed -- Renderer: Don't render links if Resolver returns an empty destination. - -[0.3.0]: https://github.com/abhinav/goldmark-wikilink/releases/tag/v0.3.0 - -## [0.2.0] - 2021-03-23 -### Added -- Node: Add `Fragment` field to track the `#` portion of a link. - -### Changed -- Parser: Pull apart `#` portion of a link into Fragment field. -- Renderer: Support links without titles. This makes wikilink references to - headers in the same document possible with `[[#Foo]]` possible. - -[0.2.0]: https://github.com/abhinav/goldmark-wikilink/releases/tag/v0.2.0 - -## [0.1.0] - 2021-03-14 -- Initial release. - -[0.1.0]: https://github.com/abhinav/goldmark-wikilink/releases/tag/v0.1.0 diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/LICENSE b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/LICENSE deleted file mode 100644 index e1c72f0b7..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Abhinav Gupta - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/Makefile b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/Makefile deleted file mode 100644 index fdf2c7bf4..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# "go install"-ed binaries will be placed here during development. -export GOBIN ?= $(shell pwd)/bin - -GO_FILES = $(shell find . \ - -path '*/.*' -prune -o \ - '(' -type f -a -name '*.go' ')' -print) - -GOLINT = $(GOBIN)/golint -STATICCHECK = $(GOBIN)/staticcheck -TOOLS = $(GOLINT) $(STATICCHECK) - -.PHONY: all -all: build lint test - -.PHONY: build -build: - go build ./... - -.PHONY: test -test: - go test -v -race ./... - -.PHONY: cover -cover: - go test -race -coverprofile=cover.out -coverpkg=./... ./... - go tool cover -html=cover.out -o cover.html - -.PHONY: lint -lint: gofmt golint staticcheck - -.PHONY: gofmt -gofmt: - $(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX)) - @gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true - @[ ! -s "$(FMT_LOG)" ] || \ - (echo "gofmt failed. Please reformat the following files:" | \ - cat - $(FMT_LOG) && false) - -.PHONY: golint -golint: $(GOLINT) - $(GOLINT) ./... - -.PHONY: staticcheck -staticcheck: $(STATICCHECK) - $(STATICCHECK) ./... - -tools: $(GOLINT) $(STATICCHECK) - -$(GOLINT): tools/go.mod - cd tools && go install golang.org/x/lint/golint - -$(STATICCHECK): tools/go.mod - cd tools && go install honnef.co/go/tools/cmd/staticcheck diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/README.md b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/README.md deleted file mode 100644 index 28d1bd375..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/README.md +++ /dev/null @@ -1,42 +0,0 @@ -[![Go Reference](https://pkg.go.dev/badge/github.com/abhinav/goldmark-wikilink.svg)](https://pkg.go.dev/github.com/abhinav/goldmark-wikilink) -[![Go](https://github.com/abhinav/goldmark-wikilink/actions/workflows/go.yml/badge.svg)](https://github.com/abhinav/goldmark-wikilink/actions/workflows/go.yml) -[![codecov](https://codecov.io/gh/abhinav/goldmark-wikilink/branch/main/graph/badge.svg?token=W98KYF8SPE)](https://codecov.io/gh/abhinav/goldmark-wikilink) - -goldmark-wikilink is an extension for the [goldmark] Markdown parser that -supports parsing `[[...]]`-style wiki links. - - [goldmark]: http://github.com/yuin/goldmark - -# Usage - -To use goldmark-wikilink, import the `wikilink` package. - -```go -import wikilink "github.com/abhinav/goldmark-wikilink" -``` - -Then include the `wiklink.Extender` in the list of extensions you build your -[`goldmark.Markdown`] with. - - [`goldmark.Markdown`]: https://pkg.go.dev/github.com/yuin/goldmark#Markdown - -```go -goldmark.New( - &wiklink.Extender{} - // ... -) -``` - -goldmark-wikilink provides control over destinations of wikilinks with the -`Resolver` type. Specify a custom `Resolver` to the `Extender` when installing -it. - -```go -goldmark.New( - &wiklink.Extender{ - Resolver: myresolver, - } - // ... -) -``` - diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/ast.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/ast.go deleted file mode 100644 index d16ebce3d..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/ast.go +++ /dev/null @@ -1,52 +0,0 @@ -package wikilink - -import ( - "github.com/yuin/goldmark/ast" -) - -// Kind is the kind of the wikilink AST node. -var Kind = ast.NewNodeKind("WikiLink") - -// Node is a Wikilink AST node. Wikilinks have two components: the target and -// the label. -// -// The target is the page to which this link points, and the label is the text -// that displays for this link. -// -// For links in the following form, the label and the target are the same. -// -// [[Foo bar]] -// -// For links in the following form, the target is the portion of the link to -// the left of the "|", and the label is the portion to the right. -// -// [[Foo bar|baz qux]] -type Node struct { - ast.BaseInline - - // Page to which this wikilink points. - // - // This may be blank for links to headers within the same document - // like [[#Foo]]. - Target []byte - - // Fragment portion of the link, if any. - // - // For links in the form, [[Foo bar#Baz qux]], this is the portion - // after the "#". - Fragment []byte -} - -var _ ast.Node = (*Node)(nil) - -// Kind reports the kind of this node. -func (n *Node) Kind() ast.NodeKind { - return Kind -} - -// Dump dumps the Node to stdout. -func (n *Node) Dump(src []byte, level int) { - ast.DumpHelper(n, src, level, map[string]string{ - "Target": string(n.Target), - }, nil) -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/ast_test.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/ast_test.go deleted file mode 100644 index 51c70ac79..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/ast_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package wikilink - -import ( - "io/ioutil" - "os" - "strings" - "testing" - - "github.com/stretchr/testify/require" - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" -) - -func TestNodeDump(t *testing.T) { - src := []byte("[[My page]]") - n := &Node{Target: src[2 : len(src)-2]} - n.AppendChild(n, ast.NewTextSegment(text.NewSegment(2, len(src)-2))) - - // Node.Dump writes to stdout and provides now ay of overriding that - // so we'll have to temporarily hijack os.Stdout. - out, err := ioutil.TempFile(t.TempDir(), "stdout") - require.NoError(t, err, "create temporary file") - defer func(out *os.File) { os.Stdout = out }(os.Stdout) - os.Stdout = out - - n.Dump(src, 0) - - require.NoError(t, out.Close(), "close stdout") - - got, err := ioutil.ReadFile(out.Name()) - require.NoError(t, err, "read stdout from %q", out.Name()) - - want := strings.Join([]string{ - "WikiLink {", - " Target: My page", - ` Text: "My page"`, - "}", - "", - }, "\n") - require.Equal(t, want, string(got), "dump output mismatch") -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/extender.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/extender.go deleted file mode 100644 index 31e08cc98..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/extender.go +++ /dev/null @@ -1,38 +0,0 @@ -package wikilink - -import ( - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/util" -) - -// Extender extends a goldmark Markdown object with support for parsing and -// rendering Wikilinks. -type Extender struct { - // Resoler specifies how to resolve destinations for linked pages. - // - // Uses DefaultResolver if unspecified. - Resolver Resolver -} - -// Extend extends the provided Markdown object with support for wikilinks. -func (e *Extender) Extend(md goldmark.Markdown) { - // The link parser is at priority 200 in goldmark so we need to be - // lower than that to ensure that the "[" trigger fires. - md.Parser().AddOptions( - parser.WithInlineParsers( - util.Prioritized(&Parser{}, 199), - ), - ) - - // The renderer priority matters less. Use the same just so that - // there's a reasonable expected value. - md.Renderer().AddOptions( - renderer.WithNodeRenderers( - util.Prioritized(&Renderer{ - Resolver: e.Resolver, - }, 199), - ), - ) -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/go.mod b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/go.mod deleted file mode 100644 index 85ed866c5..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/abhinav/goldmark-wikilink - -go 1.16 - -require ( - github.com/stretchr/testify v1.7.0 - github.com/yuin/goldmark v1.1.32 -) diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/go.sum b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/go.sum deleted file mode 100644 index abf41c88b..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/go.sum +++ /dev/null @@ -1,13 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.32 h1:5tjfNdR2ki3yYQ842+eX2sQHeiwpKJ0RnHO4IYOc4V8= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/integration_test.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/integration_test.go deleted file mode 100644 index dee41a564..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/integration_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package wikilink_test - -import ( - "bytes" - "testing" - - wikilink "github.com/abhinav/goldmark-wikilink" - "github.com/yuin/goldmark" - goldtestutil "github.com/yuin/goldmark/testutil" -) - -func TestIntegration(t *testing.T) { - t.Parallel() - - goldtestutil.DoTestCaseFile( - goldmark.New(goldmark.WithExtensions(&wikilink.Extender{ - Resolver: _resolver, - })), - "testdata/tests.txt", - t, - ) -} - -var ( - _resolver = resolver{} - - // Links with this target will return a nil destination. - _doesNotExistTarget = []byte("Does Not Exist") -) - -type resolver struct{} - -func (resolver) ResolveWikilink(n *wikilink.Node) ([]byte, error) { - if bytes.Equal(n.Target, _doesNotExistTarget) { - return nil, nil - } - - return wikilink.DefaultResolver.ResolveWikilink(n) -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/parser.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/parser.go deleted file mode 100644 index fe4c42bc0..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/parser.go +++ /dev/null @@ -1,83 +0,0 @@ -package wikilink - -import ( - "bytes" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/text" -) - -// Parser parses wikilinks. -// -// Install it on your goldmark Markdown object with Extender, or install it -// directly on your goldmark Parser by using the WithInlineParsers option. -// -// wikilinkParser := util.Prioritized(&wikilink.Parser{...}, 199) -// goldmarkParser.AddOptions(parser.WithInlineParsers(wikilinkParser)) -// -// Note that the priority for the wikilink parser must 199 or lower to take -// precednce over the plain Markdown link parser which has a priority of 200. -type Parser struct { -} - -var _ parser.InlineParser = (*Parser)(nil) - -var ( - _open = []byte("[[") - _pipe = []byte{'|'} - _hash = []byte{'#'} - _close = []byte("]]") -) - -// Trigger returns characters that trigger this parser. -func (p *Parser) Trigger() []byte { - return []byte{'['} -} - -// Parse parses a wikilink. It supports links in the following form. -// -// [[My page]] -// -// This will use "My page" as both, the target for the link as well as the -// plain text label for it. -// -// Optionally, links can specify a different label by adding a "|" after the -// target. -// -// [[My page|click here]] -// -// This will treat "My page" as the target and "click here" as the label for -// the link. -func (p *Parser) Parse(_ ast.Node, block text.Reader, _ parser.Context) ast.Node { - line, seg := block.PeekLine() - if !bytes.HasPrefix(line, _open) { - return nil - } - - stop := bytes.Index(line, _close) - if stop < 0 { - return nil // must close on the same ine - } - seg = text.NewSegment(seg.Start+2, seg.Start+stop) - - n := &Node{Target: block.Value(seg)} - if idx := bytes.Index(n.Target, _pipe); idx >= 0 { - n.Target = n.Target[:idx] // [[ ... | - seg = seg.WithStart(seg.Start + idx + 1) // | ... ]] - } - - if len(n.Target) == 0 || seg.Len() == 0 { - return nil // target and label must not be empty - } - - // Target may be Foo#Bar, so break them apart. - if idx := bytes.LastIndex(n.Target, _hash); idx >= 0 { - n.Fragment = n.Target[idx+1:] // Foo#Bar => Bar - n.Target = n.Target[:idx] // Foo#Bar => Foo - } - - n.AppendChild(n, ast.NewTextSegment(seg)) - block.Advance(stop + 2) - return n -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/parser_test.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/parser_test.go deleted file mode 100644 index 600b2ac44..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/parser_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package wikilink - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/text" -) - -func TestParser(t *testing.T) { - t.Parallel() - - tests := []struct { - desc string - give string - - wantTarget string - wantLabel string - wantFragment string - - remainder string // unconsumed portion of tt.give - }{ - { - desc: "simple", - give: "[[foo]] bar", - wantTarget: "foo", - wantLabel: "foo", - remainder: " bar", - }, - { - desc: "spaces", - give: "[[foo bar]]baz", - wantTarget: "foo bar", - wantLabel: "foo bar", - remainder: "baz", - }, - { - desc: "label", - give: "[[foo|bar]]", - wantTarget: "foo", - wantLabel: "bar", - }, - { - desc: "label with spaces", - give: "[[foo bar|baz qux]] quux", - wantTarget: "foo bar", - wantLabel: "baz qux", - remainder: " quux", - }, - { - desc: "fragment", - give: "[[foo#bar]] baz", - wantTarget: "foo", - wantLabel: "foo#bar", - wantFragment: "bar", - remainder: " baz", - }, - { - desc: "fragment with label", - give: "[[foo#bar|baz]]", - wantTarget: "foo", - wantLabel: "baz", - wantFragment: "bar", - }, - { - desc: "fragment without target", - give: "[[#foo]]", - wantTarget: "", - wantLabel: "#foo", - wantFragment: "foo", - }, - { - desc: "fragment without target with label", - give: "[[#foo|bar]]", - wantTarget: "", - wantLabel: "bar", - wantFragment: "foo", - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.desc, func(t *testing.T) { - t.Parallel() - - r := text.NewReader([]byte(tt.give)) - - var p Parser - got := p.Parse(nil /* parent */, r, parser.NewContext()) - require.NotNil(t, got, "expected Node, got nil") - - if n, ok := got.(*Node); assert.True(t, ok, "expected Node, got %T", got) { - assert.Equal(t, tt.wantTarget, string(n.Target), "target mismatch") - assert.Equal(t, tt.wantFragment, string(n.Fragment), "fragment mismatch") - } - - if assert.Equal(t, 1, got.ChildCount(), "children mismatch") { - child := got.FirstChild() - if label, ok := child.(*ast.Text); assert.True(t, ok, "expected Text, got %T", child) { - assert.Equal(t, tt.wantLabel, string(r.Value(label.Segment)), "label mismatch") - } - } - - _, pos := r.Position() - assert.Equal(t, tt.remainder, string(r.Value(pos)), - "remaining text does not match") - }) - } -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/renderer.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/renderer.go deleted file mode 100644 index 42cb2232c..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/renderer.go +++ /dev/null @@ -1,106 +0,0 @@ -package wikilink - -import ( - "fmt" - "sync" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/util" -) - -// Renderer renders wikilinks as HTML. -// -// Install it on your goldmark Markdown object with Extender, or directly on a -// goldmark Renderer by using the WithNodeRenderers option. -// -// wikilinkRenderer := util.Prioritized(&wikilink.Renderer{...}, 199) -// goldmarkRenderer.AddOptions(renderer.WithNodeRenderers(wikilinkRenderer)) -type Renderer struct { - // Resolver determines destinations for wikilink pages. - // - // If a Resolver returns an empty destination, the Renderer will skip - // the link and render just its contents. That is, instead of, - // - // bar - // - // The renderer will render just the following. - // - // bar - // - // Defaults to DefaultResolver if unspecified. - Resolver Resolver - - once sync.Once // guards init - - // hasDest records whether a node had a destination when we resolved - // it. This is needed to decide whether a closing must be added - // when exiting a Node render. - hasDest map[*Node]struct{} -} - -func (r *Renderer) init() { - r.once.Do(func() { - r.hasDest = make(map[*Node]struct{}) - if r.Resolver == nil { - r.Resolver = DefaultResolver - } - }) -} - -// RegisterFuncs registers wikilink rendering functions with the provided -// goldmark registerer. This teaches goldmark to call us when it encounters a -// wikilink in the AST. -func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - reg.Register(Kind, r.Render) -} - -// Render renders the provided Node. It must be a Wikilink node. -// -// goldmark will call this method if this renderer was registered with it -// using the WithNodeRenderers option. -func (r *Renderer) Render(w util.BufWriter, _ []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - r.init() - - n, ok := node.(*Node) - if !ok { - return ast.WalkStop, fmt.Errorf("unexpected node %T, expected *goldmarkwikilink.Node", node) - } - - if entering { - if err := r.enter(w, n); err != nil { - return ast.WalkStop, err - } - } else { - r.exit(w, n) - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) enter(w util.BufWriter, n *Node) error { - dest, err := r.Resolver.ResolveWikilink(n) - if err != nil { - return fmt.Errorf("resolve %q: %w", n.Target, err) - } - if len(dest) == 0 { - return nil - } - - r.hasDest[n] = struct{}{} - w.WriteString(``) - return nil -} - -func (r *Renderer) exit(w util.BufWriter, n *Node) { - _, ok := r.hasDest[n] - if !ok { - return - } - - w.WriteString("") - // Avoid memory leaks by cleaning up after exiting the node. - delete(r.hasDest, n) -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/renderer_test.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/renderer_test.go deleted file mode 100644 index 8af96e865..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/renderer_test.go +++ /dev/null @@ -1,119 +0,0 @@ -package wikilink - -import ( - "bufio" - "bytes" - "errors" - "io/ioutil" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/yuin/goldmark/ast" -) - -func TestRenderer(t *testing.T) { - t.Parallel() - - t.Run("default resolver", func(t *testing.T) { - t.Parallel() - - var ( - r Renderer - buff bytes.Buffer - w = bufio.NewWriter(&buff) - n = &Node{Target: []byte("foo")} - ) - - _, err := r.Render(w, nil /* source */, n, true /* entering */) - require.NoError(t, err, "should not fail") - require.NoError(t, w.Flush(), "flush") - - assert.Equal(t, ``, buff.String(), - "output mismatch") - }) - - t.Run("custom resolver", func(t *testing.T) { - t.Parallel() - - var ( - buff bytes.Buffer - w = bufio.NewWriter(&buff) - resolved bool - ) - defer func() { - assert.True(t, resolved, "custom resolver was never invoked") - }() - - n := &Node{Target: []byte("foo")} - r := Renderer{ - Resolver: resolverFunc(func(n *Node) ([]byte, error) { - assert.False(t, resolved, "resolver invoked too many times") - resolved = true - - assert.Equal(t, "foo", string(n.Target), "target mismatch") - return []byte("bar.html"), nil - }), - } - - _, err := r.Render(w, nil /* source */, n, true /* entering */) - require.NoError(t, err, "should not fail") - require.NoError(t, w.Flush(), "flush") - - assert.Equal(t, ``, buff.String(), - "output mismatch") - }) - - t.Run("no link", func(t *testing.T) { - t.Parallel() - var ( - buff bytes.Buffer - w = bufio.NewWriter(&buff) - ) - - n := &Node{Target: []byte("foo")} - r := Renderer{ - Resolver: resolverFunc(noopResolver), - } - - _, err := r.Render(w, nil /* source */, n, true /* entering */) - require.NoError(t, err, "should not fail") - - _, err = r.Render(w, nil /* source */, n, false /* entering */) - require.NoError(t, err, "should not fail") - - require.NoError(t, w.Flush(), "flush") - assert.Empty(t, buff.String(), "output should be empty") - }) -} - -func TestRenderer_IncorrectNode(t *testing.T) { - t.Parallel() - - var r Renderer - _, err := r.Render(bufio.NewWriter(ioutil.Discard), nil /* src */, ast.NewText(), true /* enter */) - require.Error(t, err, "render with incorrect node must fail") - assert.Contains(t, err.Error(), "unexpected node") -} - -func TestRenderer_ResolveError(t *testing.T) { - t.Parallel() - - r := Renderer{ - Resolver: resolverFunc(func(*Node) ([]byte, error) { - return nil, errors.New("great sadness") - }), - } - _, err := r.Render( - bufio.NewWriter(ioutil.Discard), - nil, // source - &Node{Target: []byte("foo")}, - true, // entering - ) - require.Error(t, err, "render with incorrect node must fail") - assert.Contains(t, err.Error(), "great sadness") -} - -func noopResolver(*Node) ([]byte, error) { - return nil, nil -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/resolver.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/resolver.go deleted file mode 100644 index 7fdb2fd6f..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/resolver.go +++ /dev/null @@ -1,44 +0,0 @@ -package wikilink - -// DefaultResolver is a minimal wiklink resolver that resolves to HTML pages -// relative to the source page. -// -// For example, -// -// [[Foo]] // => "Foo.html" -// [[Foo bar]] // => "Foo bar.html" -// [[foo/Bar]] // => "foo/Bar.html" -var DefaultResolver Resolver = defaultResolver{} - -// Resolver resolves pages referenced by wikilinks to their destinations. -type Resolver interface { - // ResolveWikilink returns the address of the page that the provided - // wikilink points to. The destination will be URL-escaped before - // being placed into a link. - // - // If ResolveWikilink returns a non-nil error, rendering will be - // halted. - // - // If ResolveWikilink returns a nil destination and error, the - // Renderer will omit the link and render its contents as a regular - // string. - ResolveWikilink(*Node) (destination []byte, err error) -} - -var _html = []byte(".html") - -type defaultResolver struct{} - -func (defaultResolver) ResolveWikilink(n *Node) ([]byte, error) { - dest := make([]byte, len(n.Target)+len(_html)+len(_hash)+len(n.Fragment)) - var i int - if len(n.Target) > 0 { - i += copy(dest, n.Target) - i += copy(dest[i:], _html) - } - if len(n.Fragment) > 0 { - i += copy(dest[i:], _hash) - i += copy(dest[i:], n.Fragment) - } - return dest[:i], nil -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/resolver_test.go b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/resolver_test.go deleted file mode 100644 index 01f8099e3..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/resolver_test.go +++ /dev/null @@ -1,67 +0,0 @@ -package wikilink - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type resolverFunc func(*Node) ([]byte, error) - -func (f resolverFunc) ResolveWikilink(n *Node) ([]byte, error) { - return f(n) -} - -func TestDefaultResolver(t *testing.T) { - t.Parallel() - - tests := []struct { - target string - fragment string - want string - }{ - { - target: "foo", - want: "foo.html", - }, - { - target: "foo bar", - want: "foo bar.html", - }, - { - target: "foo/bar", - want: "foo/bar.html", - }, - { - target: "foo", - fragment: "bar", - want: "foo.html#bar", - }, - { - target: "foo/bar", - fragment: "baz", - want: "foo/bar.html#baz", - }, - { - fragment: "foo", - want: "#foo", - }, - } - - for _, tt := range tests { - tt := tt - name := fmt.Sprintf("%v#%v", tt.target, tt.fragment) - t.Run(name, func(t *testing.T) { - t.Parallel() - - got, err := DefaultResolver.ResolveWikilink(&Node{ - Target: []byte(tt.target), - Fragment: []byte(tt.fragment), - }) - require.NoError(t, err, "resolve failed") - assert.Equal(t, tt.want, string(got), "result mismatch") - }) - } -} diff --git a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/testdata/tests.txt b/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/testdata/tests.txt deleted file mode 100644 index 64866912f..000000000 --- a/pkg/mod/github.com/abhinav/goldmark-wikilink@v0.3.0/testdata/tests.txt +++ /dev/null @@ -1,106 +0,0 @@ -1 -//- - - - - - - - -// -[[Simple]] link. -//- - - - - - - - -// -

Simple link.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -2 -//- - - - - - - - -// -Links [[with|label]]. -//- - - - - - - - -// -

Links label.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -3 -//- - - - - - - - -// -Links [[can have spaces]]. -//- - - - - - - - -// -

Links can have spaces.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -4 -//- - - - - - - - -// -Labels [[can have|spaces too]]. -//- - - - - - - - -// -

Labels spaces too.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -5 -//- - - - - - - - -// -Links can not [[go across -lines]] -//- - - - - - - - -// -

Links can not [[go across -lines]]

-//= = = = = = = = = = = = = = = = = = = = = = = =// -6 -//- - - - - - - - -// -Labels can not [[go across| -lines]]. -//- - - - - - - - -// -

Labels can not [[go across| -lines]].

-//= = = = = = = = = = = = = = = = = = = = = = = =// -7 -//- - - - - - - - -// -Formatting in [[links *is* _taken_ ~~verbatim~~]]. -//- - - - - - - - -// -

Formatting in links *is* _taken_ ~~verbatim~~.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -8 -//- - - - - - - - -// -Empty links are not allowed [[]]. -//- - - - - - - - -// -

Empty links are not allowed [[]].

-//= = = = = = = = = = = = = = = = = = = = = = = =// -9 -//- - - - - - - - -// -Empty links are not allowed even with labels [[|Foo]]. -//- - - - - - - - -// -

Empty links are not allowed even with labels [[|Foo]].

-//= = = = = = = = = = = = = = = = = = = = = = = =// -10 -//- - - - - - - - -// -Empty labels are not allowed [[Foo|]]. -//- - - - - - - - -// -

Empty labels are not allowed [[Foo|]].

-//= = = = = = = = = = = = = = = = = = = = = = = =// -11 -//- - - - - - - - -// -Does not mess up [regular links](dest.html). -//- - - - - - - - -// -

Does not mess up regular links.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -12 -//- - - - - - - - -// -Supports [[Fragments#In Links]]. -//- - - - - - - - -// -

Supports Fragments#In Links.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -13 -//- - - - - - - - -// -Links [[with fragments#can have|labels]]. -//- - - - - - - - -// -

Links labels.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -14 -//- - - - - - - - -// -[[#Relative]] links. -//- - - - - - - - -// -

#Relative links.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -15 -//- - - - - - - - -// -Relative [[#Links|with labels]]. -//- - - - - - - - -// -

Relative with labels.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -16 -//- - - - - - - - -// -Page that [[Does Not Exist]]. -//- - - - - - - - -// -

Page that Does Not Exist.

-//= = = = = = = = = = = = = = = = = = = = = = = =// -17 -//- - - - - - - - -// -Page that [[Does Not Exist|has a label]]. -//- - - - - - - - -// -

Page that has a label.

-//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/.travis.yml b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/.travis.yml deleted file mode 100644 index 6f227517d..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -go: - - 1.3 - - 1.4 - -install: - - go get github.com/andybalholm/cascadia - -script: - - go test -v - -notifications: - email: false diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/LICENSE b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/LICENSE deleted file mode 100644 index ee5ad35ac..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011 Andy Balholm. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/README.md b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/README.md deleted file mode 100644 index 26f4c37b3..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# cascadia - -[![](https://travis-ci.org/andybalholm/cascadia.svg)](https://travis-ci.org/andybalholm/cascadia) - -The Cascadia package implements CSS selectors for use with the parse trees produced by the html package. - -To test CSS selectors without writing Go code, check out [cascadia](https://github.com/suntong/cascadia) the command line tool, a thin wrapper around this package. - -[Refer to godoc here](https://godoc.org/github.com/andybalholm/cascadia). diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/benchmark_test.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/benchmark_test.go deleted file mode 100644 index 42bf50006..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/benchmark_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package cascadia - -import ( - "strings" - "testing" - - "golang.org/x/net/html" -) - -func MustParseHTML(doc string) *html.Node { - dom, err := html.Parse(strings.NewReader(doc)) - if err != nil { - panic(err) - } - return dom -} - -var selector = MustCompile(`div.matched`) -var doc = ` - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - -` -var dom = MustParseHTML(doc) - -func BenchmarkMatchAll(b *testing.B) { - var matches []*html.Node - for i := 0; i < b.N; i++ { - matches = selector.MatchAll(dom) - } - _ = matches -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test0 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test0 deleted file mode 100644 index 83a6561a7..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test0 +++ /dev/null @@ -1 +0,0 @@ -address \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test1 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test1 deleted file mode 100644 index f59ec20aa..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test1 +++ /dev/null @@ -1 +0,0 @@ -* \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test10 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test10 deleted file mode 100644 index 0ee70eb00..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test10 +++ /dev/null @@ -1 +0,0 @@ -p[title] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test11 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test11 deleted file mode 100644 index 66340c4af..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test11 +++ /dev/null @@ -1 +0,0 @@ -address[title="foo"] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test12 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test12 deleted file mode 100644 index 6303f0869..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test12 +++ /dev/null @@ -1 +0,0 @@ -[ title ~= foo ] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test13 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test13 deleted file mode 100644 index 45d91eb63..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test13 +++ /dev/null @@ -1 +0,0 @@ -[title~="hello world"] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test14 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test14 deleted file mode 100644 index 62e7d68a8..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test14 +++ /dev/null @@ -1 +0,0 @@ -[lang|="en"] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test15 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test15 deleted file mode 100644 index fe9ab530e..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test15 +++ /dev/null @@ -1 +0,0 @@ -[title^="foo"] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test16 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test16 deleted file mode 100644 index dbee7332c..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test16 +++ /dev/null @@ -1 +0,0 @@ -[title$="bar"] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test17 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test17 deleted file mode 100644 index e4fb4032c..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test17 +++ /dev/null @@ -1 +0,0 @@ -[title*="bar"] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test18 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test18 deleted file mode 100644 index 607501436..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test18 +++ /dev/null @@ -1 +0,0 @@ -.t1:not(.t2) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test19 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test19 deleted file mode 100644 index f04dfafd4..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test19 +++ /dev/null @@ -1 +0,0 @@ -div:not(.t1) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test2 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test2 deleted file mode 100644 index 5529b9b4c..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test2 +++ /dev/null @@ -1 +0,0 @@ -#foo \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test20 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test20 deleted file mode 100644 index a1c883497..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test20 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(odd) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test21 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test21 deleted file mode 100644 index b99fcb6ac..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test21 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(even) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test22 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test22 deleted file mode 100644 index a9ee21795..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test22 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(-n+2) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test23 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test23 deleted file mode 100644 index aad519d55..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test23 +++ /dev/null @@ -1 +0,0 @@ -li:nth-child(3n+1) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test24 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test24 deleted file mode 100644 index 436a2191c..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test24 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(odd) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test25 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test25 deleted file mode 100644 index 46f6cbc27..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test25 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(even) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test26 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test26 deleted file mode 100644 index d18bf3b45..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test26 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(-n+2) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test27 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test27 deleted file mode 100644 index d1d6eb317..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test27 +++ /dev/null @@ -1 +0,0 @@ -li:nth-last-child(3n+1) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test28 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test28 deleted file mode 100644 index 9a0c94931..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test28 +++ /dev/null @@ -1 +0,0 @@ -span:first-child \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test29 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test29 deleted file mode 100644 index 7058608ec..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test29 +++ /dev/null @@ -1 +0,0 @@ -span:last-child \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test3 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test3 deleted file mode 100644 index ee024825f..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test3 +++ /dev/null @@ -1 +0,0 @@ -li#t1 \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test30 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test30 deleted file mode 100644 index 536e6ffb3..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test30 +++ /dev/null @@ -1 +0,0 @@ -p:nth-of-type(2) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test31 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test31 deleted file mode 100644 index 61c1fc758..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test31 +++ /dev/null @@ -1 +0,0 @@ -p:nth-last-of-type(2) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test32 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test32 deleted file mode 100644 index d9a9dc54b..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test32 +++ /dev/null @@ -1 +0,0 @@ -p:last-of-type \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test33 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test33 deleted file mode 100644 index 9052c4194..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test33 +++ /dev/null @@ -1 +0,0 @@ -p:first-of-type \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test34 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test34 deleted file mode 100644 index 60bd12471..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test34 +++ /dev/null @@ -1 +0,0 @@ -p:only-child \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test35 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test35 deleted file mode 100644 index 87d9dbc65..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test35 +++ /dev/null @@ -1 +0,0 @@ -p:only-of-type \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test36 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test36 deleted file mode 100644 index 8e9295421..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test36 +++ /dev/null @@ -1 +0,0 @@ -:empty \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test37 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test37 deleted file mode 100644 index ba3455f5b..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test37 +++ /dev/null @@ -1 +0,0 @@ -div p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test38 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test38 deleted file mode 100644 index d6f24c0af..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test38 +++ /dev/null @@ -1 +0,0 @@ -div table p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test39 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test39 deleted file mode 100644 index a72a605cf..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test39 +++ /dev/null @@ -1 +0,0 @@ -div > p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test4 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test4 deleted file mode 100644 index 7b253d3ee..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test4 +++ /dev/null @@ -1 +0,0 @@ -*#t4 \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test40 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test40 deleted file mode 100644 index 407ea3c42..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test40 +++ /dev/null @@ -1 +0,0 @@ -p ~ p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test41 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test41 deleted file mode 100644 index e36e0942f..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test41 +++ /dev/null @@ -1 +0,0 @@ -p + p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test42 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test42 deleted file mode 100644 index fa59ada06..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test42 +++ /dev/null @@ -1 +0,0 @@ -li, p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test43 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test43 deleted file mode 100644 index e946ff3aa..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test43 +++ /dev/null @@ -1 +0,0 @@ -p +/*This is a comment*/ p \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test44 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test44 deleted file mode 100644 index df68954ae..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test44 +++ /dev/null @@ -1 +0,0 @@ -p:contains("that wraps") \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test45 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test45 deleted file mode 100644 index 5c479a9a1..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test45 +++ /dev/null @@ -1 +0,0 @@ -p:containsOwn("that wraps") \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test46 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test46 deleted file mode 100644 index a189d03cb..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test46 +++ /dev/null @@ -1 +0,0 @@ -:containsOwn("inner") \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test47 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test47 deleted file mode 100644 index bfba3689e..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test47 +++ /dev/null @@ -1 +0,0 @@ -p:containsOwn("block") \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test48 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test48 deleted file mode 100644 index 4a6abb3ce..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test48 +++ /dev/null @@ -1 +0,0 @@ -div:has(#p1) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test49 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test49 deleted file mode 100644 index 2048a0cd8..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test49 +++ /dev/null @@ -1 +0,0 @@ -div:has(:containsOwn("2")) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test5 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test5 deleted file mode 100644 index 702c0f1e5..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test5 +++ /dev/null @@ -1 +0,0 @@ -.t1 \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test50 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test50 deleted file mode 100644 index c062e4c1b..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test50 +++ /dev/null @@ -1 +0,0 @@ -body :has(:containsOwn("2")) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test51 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test51 deleted file mode 100644 index 151226047..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test51 +++ /dev/null @@ -1 +0,0 @@ -body :haschild(:containsOwn("2")) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test52 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test52 deleted file mode 100644 index c3dee62a8..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test52 +++ /dev/null @@ -1 +0,0 @@ -p:matches([\d]) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test53 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test53 deleted file mode 100644 index 90f71d782..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test53 +++ /dev/null @@ -1 +0,0 @@ -p:matches([a-z]) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test54 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test54 deleted file mode 100644 index 88b4c2830..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test54 +++ /dev/null @@ -1 +0,0 @@ -p:matches([a-zA-Z]) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test55 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test55 deleted file mode 100644 index 699b41ffd..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test55 +++ /dev/null @@ -1 +0,0 @@ -p:matches([^\d]) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test56 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test56 deleted file mode 100644 index 83d4c474b..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test56 +++ /dev/null @@ -1 +0,0 @@ -p:matches(^(0|a)) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test57 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test57 deleted file mode 100644 index e8507ba67..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test57 +++ /dev/null @@ -1 +0,0 @@ -p:matches(^\d+$) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test58 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test58 deleted file mode 100644 index e29dba9b3..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test58 +++ /dev/null @@ -1 +0,0 @@ -p:not(:matches(^\d+$)) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test59 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test59 deleted file mode 100644 index b5f72069a..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test59 +++ /dev/null @@ -1 +0,0 @@ -div :matchesOwn(^\d+$) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test6 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test6 deleted file mode 100644 index cf58afccd..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test6 +++ /dev/null @@ -1 +0,0 @@ -p.t1 \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test60 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test60 deleted file mode 100644 index 2154ba88b..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test60 +++ /dev/null @@ -1 +0,0 @@ -[href#=(fina)]:not([href#=(\/\/[^\/]+untrusted)]) \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test61 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test61 deleted file mode 100644 index 1c8f5258e..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test61 +++ /dev/null @@ -1 +0,0 @@ -[href#=(^https:\/\/[^\/]*\/?news)] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test7 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test7 deleted file mode 100644 index 9ad6c2093..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test7 +++ /dev/null @@ -1 +0,0 @@ -div.teST \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test8 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test8 deleted file mode 100644 index 2ed128422..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test8 +++ /dev/null @@ -1 +0,0 @@ -.t1.fail \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test9 b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test9 deleted file mode 100644 index 8c1c2a272..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/corpus/test9 +++ /dev/null @@ -1 +0,0 @@ -p.t1.t2 \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/fuzz.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/fuzz.go deleted file mode 100644 index d1a46f8cb..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/fuzz/fuzz.go +++ /dev/null @@ -1,15 +0,0 @@ -package fuzz - -import "github.com/andybalholm/cascadia" - -// Fuzz is the entrypoint used by the go-fuzz framework -func Fuzz(data []byte) int { - sel, err := cascadia.Compile(string(data)) - if err != nil { - if sel != nil { - panic("sel != nil on error") - } - return 0 - } - return 1 -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/go.mod b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/go.mod deleted file mode 100644 index ee72d3fe0..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/andybalholm/cascadia - -go 1.16 - -require golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/go.sum b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/go.sum deleted file mode 100644 index 0f4194c57..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/go.sum +++ /dev/null @@ -1,7 +0,0 @@ -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/parser.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/parser.go deleted file mode 100644 index f654c0c7a..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/parser.go +++ /dev/null @@ -1,887 +0,0 @@ -// Package cascadia is an implementation of CSS selectors. -package cascadia - -import ( - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -// a parser for CSS selectors -type parser struct { - s string // the source text - i int // the current position - - // if `false`, parsing a pseudo-element - // returns an error. - acceptPseudoElements bool -} - -// parseEscape parses a backslash escape. -func (p *parser) parseEscape() (result string, err error) { - if len(p.s) < p.i+2 || p.s[p.i] != '\\' { - return "", errors.New("invalid escape sequence") - } - - start := p.i + 1 - c := p.s[start] - switch { - case c == '\r' || c == '\n' || c == '\f': - return "", errors.New("escaped line ending outside string") - case hexDigit(c): - // unicode escape (hex) - var i int - for i = start; i < start+6 && i < len(p.s) && hexDigit(p.s[i]); i++ { - // empty - } - v, _ := strconv.ParseUint(p.s[start:i], 16, 64) - if len(p.s) > i { - switch p.s[i] { - case '\r': - i++ - if len(p.s) > i && p.s[i] == '\n' { - i++ - } - case ' ', '\t', '\n', '\f': - i++ - } - } - p.i = i - return string(rune(v)), nil - } - - // Return the literal character after the backslash. - result = p.s[start : start+1] - p.i += 2 - return result, nil -} - -// toLowerASCII returns s with all ASCII capital letters lowercased. -func toLowerASCII(s string) string { - var b []byte - for i := 0; i < len(s); i++ { - if c := s[i]; 'A' <= c && c <= 'Z' { - if b == nil { - b = make([]byte, len(s)) - copy(b, s) - } - b[i] = s[i] + ('a' - 'A') - } - } - - if b == nil { - return s - } - - return string(b) -} - -func hexDigit(c byte) bool { - return '0' <= c && c <= '9' || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F' -} - -// nameStart returns whether c can be the first character of an identifier -// (not counting an initial hyphen, or an escape sequence). -func nameStart(c byte) bool { - return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 -} - -// nameChar returns whether c can be a character within an identifier -// (not counting an escape sequence). -func nameChar(c byte) bool { - return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127 || - c == '-' || '0' <= c && c <= '9' -} - -// parseIdentifier parses an identifier. -func (p *parser) parseIdentifier() (result string, err error) { - startingDash := false - if len(p.s) > p.i && p.s[p.i] == '-' { - startingDash = true - p.i++ - } - - if len(p.s) <= p.i { - return "", errors.New("expected identifier, found EOF instead") - } - - if c := p.s[p.i]; !(nameStart(c) || c == '\\') { - return "", fmt.Errorf("expected identifier, found %c instead", c) - } - - result, err = p.parseName() - if startingDash && err == nil { - result = "-" + result - } - return -} - -// parseName parses a name (which is like an identifier, but doesn't have -// extra restrictions on the first character). -func (p *parser) parseName() (result string, err error) { - i := p.i -loop: - for i < len(p.s) { - c := p.s[i] - switch { - case nameChar(c): - start := i - for i < len(p.s) && nameChar(p.s[i]) { - i++ - } - result += p.s[start:i] - case c == '\\': - p.i = i - val, err := p.parseEscape() - if err != nil { - return "", err - } - i = p.i - result += val - default: - break loop - } - } - - if result == "" { - return "", errors.New("expected name, found EOF instead") - } - - p.i = i - return result, nil -} - -// parseString parses a single- or double-quoted string. -func (p *parser) parseString() (result string, err error) { - i := p.i - if len(p.s) < i+2 { - return "", errors.New("expected string, found EOF instead") - } - - quote := p.s[i] - i++ - -loop: - for i < len(p.s) { - switch p.s[i] { - case '\\': - if len(p.s) > i+1 { - switch c := p.s[i+1]; c { - case '\r': - if len(p.s) > i+2 && p.s[i+2] == '\n' { - i += 3 - continue loop - } - fallthrough - case '\n', '\f': - i += 2 - continue loop - } - } - p.i = i - val, err := p.parseEscape() - if err != nil { - return "", err - } - i = p.i - result += val - case quote: - break loop - case '\r', '\n', '\f': - return "", errors.New("unexpected end of line in string") - default: - start := i - for i < len(p.s) { - if c := p.s[i]; c == quote || c == '\\' || c == '\r' || c == '\n' || c == '\f' { - break - } - i++ - } - result += p.s[start:i] - } - } - - if i >= len(p.s) { - return "", errors.New("EOF in string") - } - - // Consume the final quote. - i++ - - p.i = i - return result, nil -} - -// parseRegex parses a regular expression; the end is defined by encountering an -// unmatched closing ')' or ']' which is not consumed -func (p *parser) parseRegex() (rx *regexp.Regexp, err error) { - i := p.i - if len(p.s) < i+2 { - return nil, errors.New("expected regular expression, found EOF instead") - } - - // number of open parens or brackets; - // when it becomes negative, finished parsing regex - open := 0 - -loop: - for i < len(p.s) { - switch p.s[i] { - case '(', '[': - open++ - case ')', ']': - open-- - if open < 0 { - break loop - } - } - i++ - } - - if i >= len(p.s) { - return nil, errors.New("EOF in regular expression") - } - rx, err = regexp.Compile(p.s[p.i:i]) - p.i = i - return rx, err -} - -// skipWhitespace consumes whitespace characters and comments. -// It returns true if there was actually anything to skip. -func (p *parser) skipWhitespace() bool { - i := p.i - for i < len(p.s) { - switch p.s[i] { - case ' ', '\t', '\r', '\n', '\f': - i++ - continue - case '/': - if strings.HasPrefix(p.s[i:], "/*") { - end := strings.Index(p.s[i+len("/*"):], "*/") - if end != -1 { - i += end + len("/**/") - continue - } - } - } - break - } - - if i > p.i { - p.i = i - return true - } - - return false -} - -// consumeParenthesis consumes an opening parenthesis and any following -// whitespace. It returns true if there was actually a parenthesis to skip. -func (p *parser) consumeParenthesis() bool { - if p.i < len(p.s) && p.s[p.i] == '(' { - p.i++ - p.skipWhitespace() - return true - } - return false -} - -// consumeClosingParenthesis consumes a closing parenthesis and any preceding -// whitespace. It returns true if there was actually a parenthesis to skip. -func (p *parser) consumeClosingParenthesis() bool { - i := p.i - p.skipWhitespace() - if p.i < len(p.s) && p.s[p.i] == ')' { - p.i++ - return true - } - p.i = i - return false -} - -// parseTypeSelector parses a type selector (one that matches by tag name). -func (p *parser) parseTypeSelector() (result tagSelector, err error) { - tag, err := p.parseIdentifier() - if err != nil { - return - } - return tagSelector{tag: toLowerASCII(tag)}, nil -} - -// parseIDSelector parses a selector that matches by id attribute. -func (p *parser) parseIDSelector() (idSelector, error) { - if p.i >= len(p.s) { - return idSelector{}, fmt.Errorf("expected id selector (#id), found EOF instead") - } - if p.s[p.i] != '#' { - return idSelector{}, fmt.Errorf("expected id selector (#id), found '%c' instead", p.s[p.i]) - } - - p.i++ - id, err := p.parseName() - if err != nil { - return idSelector{}, err - } - - return idSelector{id: id}, nil -} - -// parseClassSelector parses a selector that matches by class attribute. -func (p *parser) parseClassSelector() (classSelector, error) { - if p.i >= len(p.s) { - return classSelector{}, fmt.Errorf("expected class selector (.class), found EOF instead") - } - if p.s[p.i] != '.' { - return classSelector{}, fmt.Errorf("expected class selector (.class), found '%c' instead", p.s[p.i]) - } - - p.i++ - class, err := p.parseIdentifier() - if err != nil { - return classSelector{}, err - } - - return classSelector{class: class}, nil -} - -// parseAttributeSelector parses a selector that matches by attribute value. -func (p *parser) parseAttributeSelector() (attrSelector, error) { - if p.i >= len(p.s) { - return attrSelector{}, fmt.Errorf("expected attribute selector ([attribute]), found EOF instead") - } - if p.s[p.i] != '[' { - return attrSelector{}, fmt.Errorf("expected attribute selector ([attribute]), found '%c' instead", p.s[p.i]) - } - - p.i++ - p.skipWhitespace() - key, err := p.parseIdentifier() - if err != nil { - return attrSelector{}, err - } - key = toLowerASCII(key) - - p.skipWhitespace() - if p.i >= len(p.s) { - return attrSelector{}, errors.New("unexpected EOF in attribute selector") - } - - if p.s[p.i] == ']' { - p.i++ - return attrSelector{key: key, operation: ""}, nil - } - - if p.i+2 >= len(p.s) { - return attrSelector{}, errors.New("unexpected EOF in attribute selector") - } - - op := p.s[p.i : p.i+2] - if op[0] == '=' { - op = "=" - } else if op[1] != '=' { - return attrSelector{}, fmt.Errorf(`expected equality operator, found "%s" instead`, op) - } - p.i += len(op) - - p.skipWhitespace() - if p.i >= len(p.s) { - return attrSelector{}, errors.New("unexpected EOF in attribute selector") - } - var val string - var rx *regexp.Regexp - if op == "#=" { - rx, err = p.parseRegex() - } else { - switch p.s[p.i] { - case '\'', '"': - val, err = p.parseString() - default: - val, err = p.parseIdentifier() - } - } - if err != nil { - return attrSelector{}, err - } - - p.skipWhitespace() - if p.i >= len(p.s) { - return attrSelector{}, errors.New("unexpected EOF in attribute selector") - } - - // check if the attribute contains an ignore case flag - ignoreCase := false - if p.s[p.i] == 'i' || p.s[p.i] == 'I' { - ignoreCase = true - p.i++ - } - - p.skipWhitespace() - if p.i >= len(p.s) { - return attrSelector{}, errors.New("unexpected EOF in attribute selector") - } - - if p.s[p.i] != ']' { - return attrSelector{}, fmt.Errorf("expected ']', found '%c' instead", p.s[p.i]) - } - p.i++ - - switch op { - case "=", "!=", "~=", "|=", "^=", "$=", "*=", "#=": - return attrSelector{key: key, val: val, operation: op, regexp: rx, insensitive: ignoreCase}, nil - default: - return attrSelector{}, fmt.Errorf("attribute operator %q is not supported", op) - } -} - -var ( - errExpectedParenthesis = errors.New("expected '(' but didn't find it") - errExpectedClosingParenthesis = errors.New("expected ')' but didn't find it") - errUnmatchedParenthesis = errors.New("unmatched '('") -) - -// parsePseudoclassSelector parses a pseudoclass selector like :not(p) or a pseudo-element -// For backwards compatibility, both ':' and '::' prefix are allowed for pseudo-elements. -// https://drafts.csswg.org/selectors-3/#pseudo-elements -// Returning a nil `Sel` (and a nil `error`) means we found a pseudo-element. -func (p *parser) parsePseudoclassSelector() (out Sel, pseudoElement string, err error) { - if p.i >= len(p.s) { - return nil, "", fmt.Errorf("expected pseudoclass selector (:pseudoclass), found EOF instead") - } - if p.s[p.i] != ':' { - return nil, "", fmt.Errorf("expected attribute selector (:pseudoclass), found '%c' instead", p.s[p.i]) - } - - p.i++ - var mustBePseudoElement bool - if p.i >= len(p.s) { - return nil, "", fmt.Errorf("got empty pseudoclass (or pseudoelement)") - } - if p.s[p.i] == ':' { // we found a pseudo-element - mustBePseudoElement = true - p.i++ - } - - name, err := p.parseIdentifier() - if err != nil { - return - } - name = toLowerASCII(name) - if mustBePseudoElement && (name != "after" && name != "backdrop" && name != "before" && - name != "cue" && name != "first-letter" && name != "first-line" && name != "grammar-error" && - name != "marker" && name != "placeholder" && name != "selection" && name != "spelling-error") { - return out, "", fmt.Errorf("unknown pseudoelement :%s", name) - } - - switch name { - case "not", "has", "haschild": - if !p.consumeParenthesis() { - return out, "", errExpectedParenthesis - } - sel, parseErr := p.parseSelectorGroup() - if parseErr != nil { - return out, "", parseErr - } - if !p.consumeClosingParenthesis() { - return out, "", errExpectedClosingParenthesis - } - - out = relativePseudoClassSelector{name: name, match: sel} - - case "contains", "containsown": - if !p.consumeParenthesis() { - return out, "", errExpectedParenthesis - } - if p.i == len(p.s) { - return out, "", errUnmatchedParenthesis - } - var val string - switch p.s[p.i] { - case '\'', '"': - val, err = p.parseString() - default: - val, err = p.parseIdentifier() - } - if err != nil { - return out, "", err - } - val = strings.ToLower(val) - p.skipWhitespace() - if p.i >= len(p.s) { - return out, "", errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return out, "", errExpectedClosingParenthesis - } - - out = containsPseudoClassSelector{own: name == "containsown", value: val} - - case "matches", "matchesown": - if !p.consumeParenthesis() { - return out, "", errExpectedParenthesis - } - rx, err := p.parseRegex() - if err != nil { - return out, "", err - } - if p.i >= len(p.s) { - return out, "", errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return out, "", errExpectedClosingParenthesis - } - - out = regexpPseudoClassSelector{own: name == "matchesown", regexp: rx} - - case "nth-child", "nth-last-child", "nth-of-type", "nth-last-of-type": - if !p.consumeParenthesis() { - return out, "", errExpectedParenthesis - } - a, b, err := p.parseNth() - if err != nil { - return out, "", err - } - if !p.consumeClosingParenthesis() { - return out, "", errExpectedClosingParenthesis - } - last := name == "nth-last-child" || name == "nth-last-of-type" - ofType := name == "nth-of-type" || name == "nth-last-of-type" - out = nthPseudoClassSelector{a: a, b: b, last: last, ofType: ofType} - - case "first-child": - out = nthPseudoClassSelector{a: 0, b: 1, ofType: false, last: false} - case "last-child": - out = nthPseudoClassSelector{a: 0, b: 1, ofType: false, last: true} - case "first-of-type": - out = nthPseudoClassSelector{a: 0, b: 1, ofType: true, last: false} - case "last-of-type": - out = nthPseudoClassSelector{a: 0, b: 1, ofType: true, last: true} - case "only-child": - out = onlyChildPseudoClassSelector{ofType: false} - case "only-of-type": - out = onlyChildPseudoClassSelector{ofType: true} - case "input": - out = inputPseudoClassSelector{} - case "empty": - out = emptyElementPseudoClassSelector{} - case "root": - out = rootPseudoClassSelector{} - case "link": - out = linkPseudoClassSelector{} - case "lang": - if !p.consumeParenthesis() { - return out, "", errExpectedParenthesis - } - if p.i == len(p.s) { - return out, "", errUnmatchedParenthesis - } - val, err := p.parseIdentifier() - if err != nil { - return out, "", err - } - val = strings.ToLower(val) - p.skipWhitespace() - if p.i >= len(p.s) { - return out, "", errors.New("unexpected EOF in pseudo selector") - } - if !p.consumeClosingParenthesis() { - return out, "", errExpectedClosingParenthesis - } - out = langPseudoClassSelector{lang: val} - case "enabled": - out = enabledPseudoClassSelector{} - case "disabled": - out = disabledPseudoClassSelector{} - case "checked": - out = checkedPseudoClassSelector{} - case "visited", "hover", "active", "focus", "target": - // Not applicable in a static context: never match. - out = neverMatchSelector{value: ":" + name} - case "after", "backdrop", "before", "cue", "first-letter", "first-line", "grammar-error", "marker", "placeholder", "selection", "spelling-error": - return nil, name, nil - default: - return out, "", fmt.Errorf("unknown pseudoclass or pseudoelement :%s", name) - } - return -} - -// parseInteger parses a decimal integer. -func (p *parser) parseInteger() (int, error) { - i := p.i - start := i - for i < len(p.s) && '0' <= p.s[i] && p.s[i] <= '9' { - i++ - } - if i == start { - return 0, errors.New("expected integer, but didn't find it") - } - p.i = i - - val, err := strconv.Atoi(p.s[start:i]) - if err != nil { - return 0, err - } - - return val, nil -} - -// parseNth parses the argument for :nth-child (normally of the form an+b). -func (p *parser) parseNth() (a, b int, err error) { - // initial state - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '-': - p.i++ - goto negativeA - case '+': - p.i++ - goto positiveA - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - goto positiveA - case 'n', 'N': - a = 1 - p.i++ - goto readN - case 'o', 'O', 'e', 'E': - id, nameErr := p.parseName() - if nameErr != nil { - return 0, 0, nameErr - } - id = toLowerASCII(id) - if id == "odd" { - return 2, 1, nil - } - if id == "even" { - return 2, 0, nil - } - return 0, 0, fmt.Errorf("expected 'odd' or 'even', but found '%s' instead", id) - default: - goto invalid - } - -positiveA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - a, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - goto readA - case 'n', 'N': - a = 1 - p.i++ - goto readN - default: - goto invalid - } - -negativeA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - a, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - a = -a - goto readA - case 'n', 'N': - a = -1 - p.i++ - goto readN - default: - goto invalid - } - -readA: - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case 'n', 'N': - p.i++ - goto readN - default: - // The number we read as a is actually b. - return 0, a, nil - } - -readN: - p.skipWhitespace() - if p.i >= len(p.s) { - goto eof - } - switch p.s[p.i] { - case '+': - p.i++ - p.skipWhitespace() - b, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - return a, b, nil - case '-': - p.i++ - p.skipWhitespace() - b, err = p.parseInteger() - if err != nil { - return 0, 0, err - } - return a, -b, nil - default: - return a, 0, nil - } - -eof: - return 0, 0, errors.New("unexpected EOF while attempting to parse expression of form an+b") - -invalid: - return 0, 0, errors.New("unexpected character while attempting to parse expression of form an+b") -} - -// parseSimpleSelectorSequence parses a selector sequence that applies to -// a single element. -func (p *parser) parseSimpleSelectorSequence() (Sel, error) { - var selectors []Sel - - if p.i >= len(p.s) { - return nil, errors.New("expected selector, found EOF instead") - } - - switch p.s[p.i] { - case '*': - // It's the universal selector. Just skip over it, since it doesn't affect the meaning. - p.i++ - if p.i+2 < len(p.s) && p.s[p.i:p.i+2] == "|*" { // other version of universal selector - p.i += 2 - } - case '#', '.', '[', ':': - // There's no type selector. Wait to process the other till the main loop. - default: - r, err := p.parseTypeSelector() - if err != nil { - return nil, err - } - selectors = append(selectors, r) - } - - var pseudoElement string -loop: - for p.i < len(p.s) { - var ( - ns Sel - newPseudoElement string - err error - ) - switch p.s[p.i] { - case '#': - ns, err = p.parseIDSelector() - case '.': - ns, err = p.parseClassSelector() - case '[': - ns, err = p.parseAttributeSelector() - case ':': - ns, newPseudoElement, err = p.parsePseudoclassSelector() - default: - break loop - } - if err != nil { - return nil, err - } - // From https://drafts.csswg.org/selectors-3/#pseudo-elements : - // "Only one pseudo-element may appear per selector, and if present - // it must appear after the sequence of simple selectors that - // represents the subjects of the selector."" - if ns == nil { // we found a pseudo-element - if pseudoElement != "" { - return nil, fmt.Errorf("only one pseudo-element is accepted per selector, got %s and %s", pseudoElement, newPseudoElement) - } - if !p.acceptPseudoElements { - return nil, fmt.Errorf("pseudo-element %s found, but pseudo-elements support is disabled", newPseudoElement) - } - pseudoElement = newPseudoElement - } else { - if pseudoElement != "" { - return nil, fmt.Errorf("pseudo-element %s must be at the end of selector", pseudoElement) - } - selectors = append(selectors, ns) - } - - } - if len(selectors) == 1 && pseudoElement == "" { // no need wrap the selectors in compoundSelector - return selectors[0], nil - } - return compoundSelector{selectors: selectors, pseudoElement: pseudoElement}, nil -} - -// parseSelector parses a selector that may include combinators. -func (p *parser) parseSelector() (Sel, error) { - p.skipWhitespace() - result, err := p.parseSimpleSelectorSequence() - if err != nil { - return nil, err - } - - for { - var ( - combinator byte - c Sel - ) - if p.skipWhitespace() { - combinator = ' ' - } - if p.i >= len(p.s) { - return result, nil - } - - switch p.s[p.i] { - case '+', '>', '~': - combinator = p.s[p.i] - p.i++ - p.skipWhitespace() - case ',', ')': - // These characters can't begin a selector, but they can legally occur after one. - return result, nil - } - - if combinator == 0 { - return result, nil - } - - c, err = p.parseSimpleSelectorSequence() - if err != nil { - return nil, err - } - result = combinedSelector{first: result, combinator: combinator, second: c} - } -} - -// parseSelectorGroup parses a group of selectors, separated by commas. -func (p *parser) parseSelectorGroup() (SelectorGroup, error) { - current, err := p.parseSelector() - if err != nil { - return nil, err - } - result := SelectorGroup{current} - - for p.i < len(p.s) { - if p.s[p.i] != ',' { - break - } - p.i++ - c, err := p.parseSelector() - if err != nil { - return nil, err - } - result = append(result, c) - } - return result, nil -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/parser_test.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/parser_test.go deleted file mode 100644 index 0dacb79ea..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/parser_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package cascadia - -import ( - "testing" -) - -var identifierTests = map[string]string{ - "x": "x", - "96": "", - "-x": "-x", - `r\e9 sumé`: "résumé", - `r\0000e9 sumé`: "résumé", - `r\0000e9sumé`: "résumé", - `a\"b`: `a"b`, -} - -func TestParseIdentifier(t *testing.T) { - for source, want := range identifierTests { - p := &parser{s: source} - got, err := p.parseIdentifier() - if err != nil { - if want == "" { - // It was supposed to be an error. - continue - } - t.Errorf("parsing %q: got error (%s), want %q", source, err, want) - continue - } - - if want == "" { - if err == nil { - t.Errorf("parsing %q: got %q, want error", source, got) - } - continue - } - - if p.i < len(source) { - t.Errorf("parsing %q: %d bytes left over", source, len(source)-p.i) - continue - } - - if got != want { - t.Errorf("parsing %q: got %q, want %q", source, got, want) - } - } -} - -var stringTests = map[string]string{ - `"x"`: "x", - `'x'`: "x", - `'x`: "", - "'x\\\r\nx'": "xx", - `"r\e9 sumé"`: "résumé", - `"r\0000e9 sumé"`: "résumé", - `"r\0000e9sumé"`: "résumé", - `"a\"b"`: `a"b`, -} - -func TestParseString(t *testing.T) { - for source, want := range stringTests { - p := &parser{s: source} - got, err := p.parseString() - if err != nil { - if want == "" { - // It was supposed to be an error. - continue - } - t.Errorf("parsing %q: got error (%s), want %q", source, err, want) - continue - } - - if want == "" { - if err == nil { - t.Errorf("parsing %q: got %q, want error", source, got) - } - continue - } - - if p.i < len(source) { - t.Errorf("parsing %q: %d bytes left over", source, len(source)-p.i) - continue - } - - if got != want { - t.Errorf("parsing %q: got %q, want %q", source, got, want) - } - } -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/pseudo_classes.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/pseudo_classes.go deleted file mode 100644 index 3986b22cd..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/pseudo_classes.go +++ /dev/null @@ -1,474 +0,0 @@ -package cascadia - -import ( - "bytes" - "fmt" - "regexp" - "strings" - - "golang.org/x/net/html" - "golang.org/x/net/html/atom" -) - -// This file implements the pseudo classes selectors, -// which share the implementation of PseudoElement() and Specificity() - -type abstractPseudoClass struct{} - -func (s abstractPseudoClass) Specificity() Specificity { - return Specificity{0, 1, 0} -} - -func (c abstractPseudoClass) PseudoElement() string { - return "" -} - -type relativePseudoClassSelector struct { - name string // one of "not", "has", "haschild" - match SelectorGroup -} - -func (s relativePseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - switch s.name { - case "not": - // matches elements that do not match a. - return !s.match.Match(n) - case "has": - // matches elements with any descendant that matches a. - return hasDescendantMatch(n, s.match) - case "haschild": - // matches elements with a child that matches a. - return hasChildMatch(n, s.match) - default: - panic(fmt.Sprintf("unsupported relative pseudo class selector : %s", s.name)) - } -} - -// hasChildMatch returns whether n has any child that matches a. -func hasChildMatch(n *html.Node, a Matcher) bool { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if a.Match(c) { - return true - } - } - return false -} - -// hasDescendantMatch performs a depth-first search of n's descendants, -// testing whether any of them match a. It returns true as soon as a match is -// found, or false if no match is found. -func hasDescendantMatch(n *html.Node, a Matcher) bool { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if a.Match(c) || (c.Type == html.ElementNode && hasDescendantMatch(c, a)) { - return true - } - } - return false -} - -// Specificity returns the specificity of the most specific selectors -// in the pseudo-class arguments. -// See https://www.w3.org/TR/selectors/#specificity-rules -func (s relativePseudoClassSelector) Specificity() Specificity { - var max Specificity - for _, sel := range s.match { - newSpe := sel.Specificity() - if max.Less(newSpe) { - max = newSpe - } - } - return max -} - -func (c relativePseudoClassSelector) PseudoElement() string { - return "" -} - -type containsPseudoClassSelector struct { - abstractPseudoClass - value string - own bool -} - -func (s containsPseudoClassSelector) Match(n *html.Node) bool { - var text string - if s.own { - // matches nodes that directly contain the given text - text = strings.ToLower(nodeOwnText(n)) - } else { - // matches nodes that contain the given text. - text = strings.ToLower(nodeText(n)) - } - return strings.Contains(text, s.value) -} - -type regexpPseudoClassSelector struct { - abstractPseudoClass - regexp *regexp.Regexp - own bool -} - -func (s regexpPseudoClassSelector) Match(n *html.Node) bool { - var text string - if s.own { - // matches nodes whose text directly matches the specified regular expression - text = nodeOwnText(n) - } else { - // matches nodes whose text matches the specified regular expression - text = nodeText(n) - } - return s.regexp.MatchString(text) -} - -// writeNodeText writes the text contained in n and its descendants to b. -func writeNodeText(n *html.Node, b *bytes.Buffer) { - switch n.Type { - case html.TextNode: - b.WriteString(n.Data) - case html.ElementNode: - for c := n.FirstChild; c != nil; c = c.NextSibling { - writeNodeText(c, b) - } - } -} - -// nodeText returns the text contained in n and its descendants. -func nodeText(n *html.Node) string { - var b bytes.Buffer - writeNodeText(n, &b) - return b.String() -} - -// nodeOwnText returns the contents of the text nodes that are direct -// children of n. -func nodeOwnText(n *html.Node) string { - var b bytes.Buffer - for c := n.FirstChild; c != nil; c = c.NextSibling { - if c.Type == html.TextNode { - b.WriteString(c.Data) - } - } - return b.String() -} - -type nthPseudoClassSelector struct { - abstractPseudoClass - a, b int - last, ofType bool -} - -func (s nthPseudoClassSelector) Match(n *html.Node) bool { - if s.a == 0 { - if s.last { - return simpleNthLastChildMatch(s.b, s.ofType, n) - } else { - return simpleNthChildMatch(s.b, s.ofType, n) - } - } - return nthChildMatch(s.a, s.b, s.last, s.ofType, n) -} - -// nthChildMatch implements :nth-child(an+b). -// If last is true, implements :nth-last-child instead. -// If ofType is true, implements :nth-of-type instead. -func nthChildMatch(a, b int, last, ofType bool, n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - i := -1 - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - i = count - if !last { - break - } - } - } - - if i == -1 { - // This shouldn't happen, since n should always be one of its parent's children. - return false - } - - if last { - i = count - i + 1 - } - - i -= b - if a == 0 { - return i == 0 - } - - return i%a == 0 && i/a >= 0 -} - -// simpleNthChildMatch implements :nth-child(b). -// If ofType is true, implements :nth-of-type instead. -func simpleNthChildMatch(b int, ofType bool, n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - return count == b - } - if count >= b { - return false - } - } - return false -} - -// simpleNthLastChildMatch implements :nth-last-child(b). -// If ofType is true, implements :nth-last-of-type instead. -func simpleNthLastChildMatch(b int, ofType bool, n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - count := 0 - for c := parent.LastChild; c != nil; c = c.PrevSibling { - if c.Type != html.ElementNode || (ofType && c.Data != n.Data) { - continue - } - count++ - if c == n { - return count == b - } - if count >= b { - return false - } - } - return false -} - -type onlyChildPseudoClassSelector struct { - abstractPseudoClass - ofType bool -} - -// Match implements :only-child. -// If `ofType` is true, it implements :only-of-type instead. -func (s onlyChildPseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - parent := n.Parent - if parent == nil { - return false - } - - if parent.Type == html.DocumentNode { - return false - } - - count := 0 - for c := parent.FirstChild; c != nil; c = c.NextSibling { - if (c.Type != html.ElementNode) || (s.ofType && c.Data != n.Data) { - continue - } - count++ - if count > 1 { - return false - } - } - - return count == 1 -} - -type inputPseudoClassSelector struct { - abstractPseudoClass -} - -// Matches input, select, textarea and button elements. -func (s inputPseudoClassSelector) Match(n *html.Node) bool { - return n.Type == html.ElementNode && (n.Data == "input" || n.Data == "select" || n.Data == "textarea" || n.Data == "button") -} - -type emptyElementPseudoClassSelector struct { - abstractPseudoClass -} - -// Matches empty elements. -func (s emptyElementPseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - - for c := n.FirstChild; c != nil; c = c.NextSibling { - switch c.Type { - case html.ElementNode: - return false - case html.TextNode: - if strings.TrimSpace(nodeText(c)) == "" { - continue - } else { - return false - } - } - } - - return true -} - -type rootPseudoClassSelector struct { - abstractPseudoClass -} - -// Match implements :root -func (s rootPseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - if n.Parent == nil { - return false - } - return n.Parent.Type == html.DocumentNode -} - -func hasAttr(n *html.Node, attr string) bool { - return matchAttribute(n, attr, func(string) bool { return true }) -} - -type linkPseudoClassSelector struct { - abstractPseudoClass -} - -// Match implements :link -func (s linkPseudoClassSelector) Match(n *html.Node) bool { - return (n.DataAtom == atom.A || n.DataAtom == atom.Area || n.DataAtom == atom.Link) && hasAttr(n, "href") -} - -type langPseudoClassSelector struct { - abstractPseudoClass - lang string -} - -func (s langPseudoClassSelector) Match(n *html.Node) bool { - own := matchAttribute(n, "lang", func(val string) bool { - return val == s.lang || strings.HasPrefix(val, s.lang+"-") - }) - if n.Parent == nil { - return own - } - return own || s.Match(n.Parent) -} - -type enabledPseudoClassSelector struct { - abstractPseudoClass -} - -func (s enabledPseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - switch n.DataAtom { - case atom.A, atom.Area, atom.Link: - return hasAttr(n, "href") - case atom.Optgroup, atom.Menuitem, atom.Fieldset: - return !hasAttr(n, "disabled") - case atom.Button, atom.Input, atom.Select, atom.Textarea, atom.Option: - return !hasAttr(n, "disabled") && !inDisabledFieldset(n) - } - return false -} - -type disabledPseudoClassSelector struct { - abstractPseudoClass -} - -func (s disabledPseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - switch n.DataAtom { - case atom.Optgroup, atom.Menuitem, atom.Fieldset: - return hasAttr(n, "disabled") - case atom.Button, atom.Input, atom.Select, atom.Textarea, atom.Option: - return hasAttr(n, "disabled") || inDisabledFieldset(n) - } - return false -} - -func hasLegendInPreviousSiblings(n *html.Node) bool { - for s := n.PrevSibling; s != nil; s = s.PrevSibling { - if s.DataAtom == atom.Legend { - return true - } - } - return false -} - -func inDisabledFieldset(n *html.Node) bool { - if n.Parent == nil { - return false - } - if n.Parent.DataAtom == atom.Fieldset && hasAttr(n.Parent, "disabled") && - (n.DataAtom != atom.Legend || hasLegendInPreviousSiblings(n)) { - return true - } - return inDisabledFieldset(n.Parent) -} - -type checkedPseudoClassSelector struct { - abstractPseudoClass -} - -func (s checkedPseudoClassSelector) Match(n *html.Node) bool { - if n.Type != html.ElementNode { - return false - } - switch n.DataAtom { - case atom.Input, atom.Menuitem: - return hasAttr(n, "checked") && matchAttribute(n, "type", func(val string) bool { - t := toLowerASCII(val) - return t == "checkbox" || t == "radio" - }) - case atom.Option: - return hasAttr(n, "selected") - } - return false -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/selector.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/selector.go deleted file mode 100644 index 87549be23..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/selector.go +++ /dev/null @@ -1,586 +0,0 @@ -package cascadia - -import ( - "fmt" - "regexp" - "strings" - - "golang.org/x/net/html" -) - -// Matcher is the interface for basic selector functionality. -// Match returns whether a selector matches n. -type Matcher interface { - Match(n *html.Node) bool -} - -// Sel is the interface for all the functionality provided by selectors. -type Sel interface { - Matcher - Specificity() Specificity - - // Returns a CSS input compiling to this selector. - String() string - - // Returns a pseudo-element, or an empty string. - PseudoElement() string -} - -// Parse parses a selector. Use `ParseWithPseudoElement` -// if you need support for pseudo-elements. -func Parse(sel string) (Sel, error) { - p := &parser{s: sel} - compiled, err := p.parseSelector() - if err != nil { - return nil, err - } - - if p.i < len(sel) { - return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i) - } - - return compiled, nil -} - -// ParseWithPseudoElement parses a single selector, -// with support for pseudo-element. -func ParseWithPseudoElement(sel string) (Sel, error) { - p := &parser{s: sel, acceptPseudoElements: true} - compiled, err := p.parseSelector() - if err != nil { - return nil, err - } - - if p.i < len(sel) { - return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i) - } - - return compiled, nil -} - -// ParseGroup parses a selector, or a group of selectors separated by commas. -// Use `ParseGroupWithPseudoElements` -// if you need support for pseudo-elements. -func ParseGroup(sel string) (SelectorGroup, error) { - p := &parser{s: sel} - compiled, err := p.parseSelectorGroup() - if err != nil { - return nil, err - } - - if p.i < len(sel) { - return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i) - } - - return compiled, nil -} - -// ParseGroupWithPseudoElements parses a selector, or a group of selectors separated by commas. -// It supports pseudo-elements. -func ParseGroupWithPseudoElements(sel string) (SelectorGroup, error) { - p := &parser{s: sel, acceptPseudoElements: true} - compiled, err := p.parseSelectorGroup() - if err != nil { - return nil, err - } - - if p.i < len(sel) { - return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i) - } - - return compiled, nil -} - -// A Selector is a function which tells whether a node matches or not. -// -// This type is maintained for compatibility; I recommend using the newer and -// more idiomatic interfaces Sel and Matcher. -type Selector func(*html.Node) bool - -// Compile parses a selector and returns, if successful, a Selector object -// that can be used to match against html.Node objects. -func Compile(sel string) (Selector, error) { - compiled, err := ParseGroup(sel) - if err != nil { - return nil, err - } - - return Selector(compiled.Match), nil -} - -// MustCompile is like Compile, but panics instead of returning an error. -func MustCompile(sel string) Selector { - compiled, err := Compile(sel) - if err != nil { - panic(err) - } - return compiled -} - -// MatchAll returns a slice of the nodes that match the selector, -// from n and its children. -func (s Selector) MatchAll(n *html.Node) []*html.Node { - return s.matchAllInto(n, nil) -} - -func (s Selector) matchAllInto(n *html.Node, storage []*html.Node) []*html.Node { - if s(n) { - storage = append(storage, n) - } - - for child := n.FirstChild; child != nil; child = child.NextSibling { - storage = s.matchAllInto(child, storage) - } - - return storage -} - -func queryInto(n *html.Node, m Matcher, storage []*html.Node) []*html.Node { - for child := n.FirstChild; child != nil; child = child.NextSibling { - if m.Match(child) { - storage = append(storage, child) - } - storage = queryInto(child, m, storage) - } - - return storage -} - -// QueryAll returns a slice of all the nodes that match m, from the descendants -// of n. -func QueryAll(n *html.Node, m Matcher) []*html.Node { - return queryInto(n, m, nil) -} - -// Match returns true if the node matches the selector. -func (s Selector) Match(n *html.Node) bool { - return s(n) -} - -// MatchFirst returns the first node that matches s, from n and its children. -func (s Selector) MatchFirst(n *html.Node) *html.Node { - if s.Match(n) { - return n - } - - for c := n.FirstChild; c != nil; c = c.NextSibling { - m := s.MatchFirst(c) - if m != nil { - return m - } - } - return nil -} - -// Query returns the first node that matches m, from the descendants of n. -// If none matches, it returns nil. -func Query(n *html.Node, m Matcher) *html.Node { - for c := n.FirstChild; c != nil; c = c.NextSibling { - if m.Match(c) { - return c - } - if matched := Query(c, m); matched != nil { - return matched - } - } - - return nil -} - -// Filter returns the nodes in nodes that match the selector. -func (s Selector) Filter(nodes []*html.Node) (result []*html.Node) { - for _, n := range nodes { - if s(n) { - result = append(result, n) - } - } - return result -} - -// Filter returns the nodes that match m. -func Filter(nodes []*html.Node, m Matcher) (result []*html.Node) { - for _, n := range nodes { - if m.Match(n) { - result = append(result, n) - } - } - return result -} - -type tagSelector struct { - tag string -} - -// Matches elements with a given tag name. -func (t tagSelector) Match(n *html.Node) bool { - return n.Type == html.ElementNode && n.Data == t.tag -} - -func (c tagSelector) Specificity() Specificity { - return Specificity{0, 0, 1} -} - -func (c tagSelector) PseudoElement() string { - return "" -} - -type classSelector struct { - class string -} - -// Matches elements by class attribute. -func (t classSelector) Match(n *html.Node) bool { - return matchAttribute(n, "class", func(s string) bool { - return matchInclude(t.class, s, false) - }) -} - -func (c classSelector) Specificity() Specificity { - return Specificity{0, 1, 0} -} - -func (c classSelector) PseudoElement() string { - return "" -} - -type idSelector struct { - id string -} - -// Matches elements by id attribute. -func (t idSelector) Match(n *html.Node) bool { - return matchAttribute(n, "id", func(s string) bool { - return s == t.id - }) -} - -func (c idSelector) Specificity() Specificity { - return Specificity{1, 0, 0} -} - -func (c idSelector) PseudoElement() string { - return "" -} - -type attrSelector struct { - key, val, operation string - regexp *regexp.Regexp - insensitive bool -} - -// Matches elements by attribute value. -func (t attrSelector) Match(n *html.Node) bool { - switch t.operation { - case "": - return matchAttribute(n, t.key, func(string) bool { return true }) - case "=": - return matchAttribute(n, t.key, func(s string) bool { return matchInsensitiveValue(s, t.val, t.insensitive) }) - case "!=": - return attributeNotEqualMatch(t.key, t.val, n, t.insensitive) - case "~=": - // matches elements where the attribute named key is a whitespace-separated list that includes val. - return matchAttribute(n, t.key, func(s string) bool { return matchInclude(t.val, s, t.insensitive) }) - case "|=": - return attributeDashMatch(t.key, t.val, n, t.insensitive) - case "^=": - return attributePrefixMatch(t.key, t.val, n, t.insensitive) - case "$=": - return attributeSuffixMatch(t.key, t.val, n, t.insensitive) - case "*=": - return attributeSubstringMatch(t.key, t.val, n, t.insensitive) - case "#=": - return attributeRegexMatch(t.key, t.regexp, n) - default: - panic(fmt.Sprintf("unsuported operation : %s", t.operation)) - } -} - -// matches elements where we ignore (or not) the case of the attribute value -// the user attribute is the value set by the user to match elements -// the real attribute is the attribute value found in the code parsed -func matchInsensitiveValue(userAttr string, realAttr string, ignoreCase bool) bool { - if ignoreCase { - return strings.EqualFold(userAttr, realAttr) - } - return userAttr == realAttr - -} - -// matches elements where the attribute named key satisifes the function f. -func matchAttribute(n *html.Node, key string, f func(string) bool) bool { - if n.Type != html.ElementNode { - return false - } - for _, a := range n.Attr { - if a.Key == key && f(a.Val) { - return true - } - } - return false -} - -// attributeNotEqualMatch matches elements where -// the attribute named key does not have the value val. -func attributeNotEqualMatch(key, val string, n *html.Node, ignoreCase bool) bool { - if n.Type != html.ElementNode { - return false - } - for _, a := range n.Attr { - if a.Key == key && matchInsensitiveValue(a.Val, val, ignoreCase) { - return false - } - } - return true -} - -// returns true if s is a whitespace-separated list that includes val. -func matchInclude(val string, s string, ignoreCase bool) bool { - for s != "" { - i := strings.IndexAny(s, " \t\r\n\f") - if i == -1 { - return matchInsensitiveValue(s, val, ignoreCase) - } - if matchInsensitiveValue(s[:i], val, ignoreCase) { - return true - } - s = s[i+1:] - } - return false -} - -// matches elements where the attribute named key equals val or starts with val plus a hyphen. -func attributeDashMatch(key, val string, n *html.Node, ignoreCase bool) bool { - return matchAttribute(n, key, - func(s string) bool { - if matchInsensitiveValue(s, val, ignoreCase) { - return true - } - if len(s) <= len(val) { - return false - } - if matchInsensitiveValue(s[:len(val)], val, ignoreCase) && s[len(val)] == '-' { - return true - } - return false - }) -} - -// attributePrefixMatch returns a Selector that matches elements where -// the attribute named key starts with val. -func attributePrefixMatch(key, val string, n *html.Node, ignoreCase bool) bool { - return matchAttribute(n, key, - func(s string) bool { - if strings.TrimSpace(s) == "" { - return false - } - if ignoreCase { - return strings.HasPrefix(strings.ToLower(s), strings.ToLower(val)) - } - return strings.HasPrefix(s, val) - }) -} - -// attributeSuffixMatch matches elements where -// the attribute named key ends with val. -func attributeSuffixMatch(key, val string, n *html.Node, ignoreCase bool) bool { - return matchAttribute(n, key, - func(s string) bool { - if strings.TrimSpace(s) == "" { - return false - } - if ignoreCase { - return strings.HasSuffix(strings.ToLower(s), strings.ToLower(val)) - } - return strings.HasSuffix(s, val) - }) -} - -// attributeSubstringMatch matches nodes where -// the attribute named key contains val. -func attributeSubstringMatch(key, val string, n *html.Node, ignoreCase bool) bool { - return matchAttribute(n, key, - func(s string) bool { - if strings.TrimSpace(s) == "" { - return false - } - if ignoreCase { - return strings.Contains(strings.ToLower(s), strings.ToLower(val)) - } - return strings.Contains(s, val) - }) -} - -// attributeRegexMatch matches nodes where -// the attribute named key matches the regular expression rx -func attributeRegexMatch(key string, rx *regexp.Regexp, n *html.Node) bool { - return matchAttribute(n, key, - func(s string) bool { - return rx.MatchString(s) - }) -} - -func (c attrSelector) Specificity() Specificity { - return Specificity{0, 1, 0} -} - -func (c attrSelector) PseudoElement() string { - return "" -} - -// see pseudo_classes.go for pseudo classes selectors - -// on a static context, some selectors can't match anything -type neverMatchSelector struct { - value string -} - -func (s neverMatchSelector) Match(n *html.Node) bool { - return false -} - -func (s neverMatchSelector) Specificity() Specificity { - return Specificity{0, 0, 0} -} - -func (c neverMatchSelector) PseudoElement() string { - return "" -} - -type compoundSelector struct { - selectors []Sel - pseudoElement string -} - -// Matches elements if each sub-selectors matches. -func (t compoundSelector) Match(n *html.Node) bool { - if len(t.selectors) == 0 { - return n.Type == html.ElementNode - } - - for _, sel := range t.selectors { - if !sel.Match(n) { - return false - } - } - return true -} - -func (s compoundSelector) Specificity() Specificity { - var out Specificity - for _, sel := range s.selectors { - out = out.Add(sel.Specificity()) - } - if s.pseudoElement != "" { - // https://drafts.csswg.org/selectors-3/#specificity - out = out.Add(Specificity{0, 0, 1}) - } - return out -} - -func (c compoundSelector) PseudoElement() string { - return c.pseudoElement -} - -type combinedSelector struct { - first Sel - combinator byte - second Sel -} - -func (t combinedSelector) Match(n *html.Node) bool { - if t.first == nil { - return false // maybe we should panic - } - switch t.combinator { - case 0: - return t.first.Match(n) - case ' ': - return descendantMatch(t.first, t.second, n) - case '>': - return childMatch(t.first, t.second, n) - case '+': - return siblingMatch(t.first, t.second, true, n) - case '~': - return siblingMatch(t.first, t.second, false, n) - default: - panic("unknown combinator") - } -} - -// matches an element if it matches d and has an ancestor that matches a. -func descendantMatch(a, d Matcher, n *html.Node) bool { - if !d.Match(n) { - return false - } - - for p := n.Parent; p != nil; p = p.Parent { - if a.Match(p) { - return true - } - } - - return false -} - -// matches an element if it matches d and its parent matches a. -func childMatch(a, d Matcher, n *html.Node) bool { - return d.Match(n) && n.Parent != nil && a.Match(n.Parent) -} - -// matches an element if it matches s2 and is preceded by an element that matches s1. -// If adjacent is true, the sibling must be immediately before the element. -func siblingMatch(s1, s2 Matcher, adjacent bool, n *html.Node) bool { - if !s2.Match(n) { - return false - } - - if adjacent { - for n = n.PrevSibling; n != nil; n = n.PrevSibling { - if n.Type == html.TextNode || n.Type == html.CommentNode { - continue - } - return s1.Match(n) - } - return false - } - - // Walk backwards looking for element that matches s1 - for c := n.PrevSibling; c != nil; c = c.PrevSibling { - if s1.Match(c) { - return true - } - } - - return false -} - -func (s combinedSelector) Specificity() Specificity { - spec := s.first.Specificity() - if s.second != nil { - spec = spec.Add(s.second.Specificity()) - } - return spec -} - -// on combinedSelector, a pseudo-element only makes sens on the last -// selector, although others increase specificity. -func (c combinedSelector) PseudoElement() string { - if c.second == nil { - return "" - } - return c.second.PseudoElement() -} - -// A SelectorGroup is a list of selectors, which matches if any of the -// individual selectors matches. -type SelectorGroup []Sel - -// Match returns true if the node matches one of the single selectors. -func (s SelectorGroup) Match(n *html.Node) bool { - for _, sel := range s { - if sel.Match(n) { - return true - } - } - return false -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/selector_test.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/selector_test.go deleted file mode 100644 index b357a9800..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/selector_test.go +++ /dev/null @@ -1,1003 +0,0 @@ -package cascadia - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "log" - "reflect" - "strings" - "testing" - - "golang.org/x/net/html" -) - -var validSelectors []validSelector - -func init() { - c, err := ioutil.ReadFile("test_resources/valid_selectors.json") - if err != nil { - log.Fatal(err) - } - if err = json.Unmarshal(c, &validSelectors); err != nil { - log.Fatal(err) - } -} - -type selectorTest struct { - HTML, selector string - results []string -} - -func nodeString(n *html.Node) string { - buf := bytes.NewBufferString("") - if err := html.Render(buf, n); err != nil { - log.Fatal(err) - } - return buf.String() -} - -var selectorTests = []selectorTest{ - { - `
This address...
`, - "address", - []string{ - "
This address...
", - }, - }, - { - `text`, - "*", - []string{ - "text", - "", - "text", - }, - }, - { - ``, - "*", - []string{ - "", - "", - "", - }, - }, - { - `

`, - "#foo", - []string{ - `

`, - }, - }, - { - `
  • `, - "li#t1", - []string{ - `

  • `, - }, - }, - { - `
    1. `, - "*#t4", - []string{ - `
    2. `, - }, - }, - { - `
      • `, - ".t1", - []string{ - `
      • `, - }, - }, - { - `

        `, - "p.t1", - []string{ - `

        `, - }, - }, - { - `
        `, - "div.teST", - []string{}, - }, - { - `

        `, - ".t1.fail", - []string{}, - }, - { - `

        `, - "p.t1.t2", - []string{ - `

        `, - }, - }, - { - `

        `, - "p[title]", - []string{ - `

        `, - }, - }, - { - `
        `, - `div[class="red" i]`, - []string{ - `
        `, - }, - }, - { - `
        `, - `address[title="foo"]`, - []string{ - `
        `, - }, - }, - { - `
        `, - `address[title="FoOIgnoRECaSe" i]`, - []string{ - `
        `, - }, - }, - { - `
        `, - `address[title!="foo"]`, - []string{ - `
        `, - `
        `, - }, - }, - { - `
        `, - `address[title!="foo" i]`, - []string{ - `
        `, - `
        `, - }, - }, - { - `

        `, - `p[title!="FooBarUFoo" i]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[ title ~= foo ]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p[title~="FOO" i]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p[title~=toofoo i]`, - []string{}, - }, - { - `

        `, - `[title~="hello world"]`, - []string{}, - }, - { - `

        `, - `[title~="hello" i]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title~="hello" I]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[lang|="en"]`, - []string{ - `

        `, - `

        `, - }, - }, - { - `

        `, - `[lang|="EN" i]`, - []string{ - `

        `, - `

        `, - }, - }, - { - `

        `, - `[lang|="EN" i]`, - []string{ - `

        `, - `

        `, - }, - }, - { - `

        `, - `[title^="foo"]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title^="foo" i]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title$="bar"]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title$="BAR" i]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title*="bar"]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title*="BaRu" i]`, - []string{ - `

        `, - }, - }, - { - `

        `, - `[title*="BaRu" I]`, - []string{ - `

        `, - }, - }, - { - `

        This text should be green.

        This text should be green.

        `, - `p[class$=" "]`, - []string{}, - }, - { - `

        This text should be green.

        This text should be green.

        `, - `p[class$=""]`, - []string{}, - }, - { - `

        This text should be green.

        This text should be green.

        `, - `p[class^=" "]`, - []string{}, - }, - { - `

        This text should be green.

        This text should be green.

        `, - `p[class^=""]`, - []string{}, - }, - { - `

        This text should be green.

        This text should be green.

        `, - `p[class*=" "]`, - []string{}, - }, - { - `

        This text should be green.

        This text should be green.

        `, - `p[class*=""]`, - []string{}, - }, - { - ``, - `input[name=Sex][value=F]`, - []string{ - ``, - }, - }, - { - `aaa
        `, - `table[border="0"][cellpadding="0"][cellspacing="0"]`, - []string{ - `
        `, - }, - }, - { - `

        `, - ".t1:not(.t2)", - []string{}, - }, - { - `

        `, - `div:not(.t1)`, - []string{ - `
        `, - }, - }, - { - `
        `, - `div:not([class="t2"])`, - []string{ - `
        `, - `
        `, - }, - }, - { - `
        `, - `li:nth-child(odd)`, - []string{ - `
      • `, - `
      • `, - }, - }, - { - `
        `, - `li:nth-child(even)`, - []string{ - `
      • `, - }, - }, - { - `
        `, - `li:nth-child(-n+2)`, - []string{ - `
      • `, - `
      • `, - }, - }, - { - `
        `, - `li:nth-child(3n+1)`, - []string{ - `
      • `, - }, - }, - { - `
        `, - `li:nth-last-child(odd)`, - []string{ - `
      • `, - `
      • `, - }, - }, - { - `
        `, - `li:nth-last-child(even)`, - []string{ - `
      • `, - `
      • `, - }, - }, - { - `
        `, - `li:nth-last-child(-n+2)`, - []string{ - `
      • `, - `
      • `, - }, - }, - { - `
        `, - `li:nth-last-child(3n+1)`, - []string{ - `
      • `, - `
      • `, - }, - }, - { - `

        some text and a span and another

        `, - `span:first-child`, - []string{ - `and a span`, - }, - }, - { - `a span and some text`, - `span:last-child`, - []string{ - `a span`, - }, - }, - { - `

        `, - `p:nth-of-type(2)`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p:nth-last-of-type(2)`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p:last-of-type`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p:first-of-type`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p:only-child`, - []string{ - `

        `, - }, - }, - { - `

        `, - `p:only-of-type`, - []string{ - `

        `, - }, - }, - { - `

        Hello

        `, - `:empty`, - []string{ - ``, - `

        `, - ``, - }, - }, - { - `

        `, - `div p`, - []string{ - `

        `, - `

        `, - }, - }, - { - `

        `, - `div table p`, - []string{ - `

        `, - }, - }, - { - `

        `, - `div > p`, - []string{ - `

        `, - `

        `, - }, - }, - { - `

        `, - `p ~ p`, - []string{ - `

        `, - `

        `, - }, - }, - { - `

        - -

        `, - `p + p`, - []string{ - `

        `, - }, - }, - { - `

        `, - `li, p`, - []string{ - "

      • ", - "
      • ", - "

        ", - }, - }, - { - `

        `, - `p +/*This is a comment*/ p`, - []string{ - `

        `, - }, - }, - { - `

        Text block that wraps inner text and continues

        `, - `p:contains("that wraps")`, - []string{ - `

        Text block that wraps inner text and continues

        `, - }, - }, - { - `

        Text block that wraps inner text and continues

        `, - `p:containsOwn("that wraps")`, - []string{}, - }, - { - `

        Text block that wraps inner text and continues

        `, - `:containsOwn("inner")`, - []string{ - `wraps inner text`, - }, - }, - { - `

        Text block that wraps inner text and continues

        `, - `p:containsOwn("block")`, - []string{ - `

        Text block that wraps inner text and continues

        `, - }, - }, - { - `

        text content

        `, - `div:has(#p1)`, - []string{ - `

        text content

        `, - }, - }, - { - `

        contents 1

        -

        contents 2

        `, - `div:has(:containsOwn("2"))`, - []string{ - `

        contents 2

        `, - }, - }, - { - `

        contents 1

        -

        contents 2

        `, - `body :has(:containsOwn("2"))`, - []string{ - `

        contents 2

        `, - `

        contents 2

        `, - }, - }, - { - `

        contents 1

        -

        contents 2

        `, - `body :haschild(:containsOwn("2"))`, - []string{ - `

        contents 2

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:matches([\d])`, - []string{ - `

        0123456789

        `, - `

        0123ABCD

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:matches([a-z])`, - []string{ - `

        abcdef

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:matches([a-zA-Z])`, - []string{ - `

        abcdef

        `, - `

        0123ABCD

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:matches([^\d])`, - []string{ - `

        abcdef

        `, - `

        0123ABCD

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:matches(^(0|a))`, - []string{ - `

        0123456789

        `, - `

        abcdef

        `, - `

        0123ABCD

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:matches(^\d+$)`, - []string{ - `

        0123456789

        `, - }, - }, - { - `

        0123456789

        abcdef

        0123ABCD

        `, - `p:not(:matches(^\d+$))`, - []string{ - `

        abcdef

        `, - `

        0123ABCD

        `, - }, - }, - { - `

        0123456789

        `, - `div :matchesOwn(^\d+$)`, - []string{ - `

        0123456789

        `, - `567`, - }, - }, - { - ``, - `[href#=(fina)]:not([href#=(\/\/[^\/]+untrusted)])`, - []string{ - ``, - ``, - }, - }, - { - ``, - `[href#=(^https:\/\/[^\/]*\/?news)]`, - []string{ - ``, - }, - }, - { - `
        - - - - - -
        `, - `:input`, - []string{ - ``, - ``, - ``, - ``, - ``, - }, - }, - { - ``, - ":root", - []string{ - "", - }, - }, - { - ``, - "*:root", - []string{ - "", - }, - }, - { - ``, - "*:root:first-child", - []string{}, - }, - { - ``, - "*:root:nth-child(1)", - []string{}, - }, - { - ``, - "a:not(:root)", - []string{ - ``, - }, - }, - { - `

        `, - "body > *:nth-child(3n+2)", - []string{ - "
        ", - "
        ", - }, - }, - { - `
        `, - "input:disabled", - []string{ - ``, - }, - }, - { - `
        `, - ":disabled", - []string{ - `
        `, - }, - }, - { - `
        `, - ":enabled", - []string{ - `
        `, - }, - }, -} - -func setup(selector, testHTML string) (Selector, *html.Node, error) { - s, err := Compile(selector) - if err != nil { - return nil, nil, fmt.Errorf("error compiling %q: %s", selector, err) - } - - doc, err := html.Parse(strings.NewReader(testHTML)) - if err != nil { - return nil, nil, fmt.Errorf("error parsing %q: %s", testHTML, err) - } - return s, doc, nil -} - -func TestSelectors(t *testing.T) { - for _, test := range selectorTests { - s, doc, err := setup(test.selector, test.HTML) - if err != nil { - t.Error(err) - continue - } - - matches := s.MatchAll(doc) - if len(matches) != len(test.results) { - t.Errorf("selector %s wanted %d elements, got %d instead", test.selector, len(test.results), len(matches)) - continue - } - - for i, m := range matches { - got := nodeString(m) - if got != test.results[i] { - t.Errorf("selector %s wanted %s, got %s instead", test.selector, test.results[i], got) - } - } - - firstMatch := s.MatchFirst(doc) - if len(test.results) == 0 { - if firstMatch != nil { - t.Errorf("MatchFirst: selector %s want nil, got %s", test.selector, nodeString(firstMatch)) - } - } else { - got := nodeString(firstMatch) - if got != test.results[0] { - t.Errorf("MatchFirst: selector %s want %s, got %s", test.selector, test.results[0], got) - } - } - } -} - -func setupMatcher(selector, testHTML string) (Matcher, *html.Node, error) { - s, err := ParseGroup(selector) - if err != nil { - return nil, nil, fmt.Errorf("error compiling %q: %s", selector, err) - } - - doc, err := html.Parse(strings.NewReader(testHTML)) - if err != nil { - return nil, nil, fmt.Errorf("error parsing %q: %s", testHTML, err) - } - return s, doc, nil -} - -func TestMatchers(t *testing.T) { - for _, test := range selectorTests { - s, doc, err := setupMatcher(test.selector, test.HTML) - if err != nil { - t.Error(err) - continue - } - - matches := QueryAll(doc, s) - if len(matches) != len(test.results) { - t.Errorf("selector %s wanted %d elements, got %d instead", test.selector, len(test.results), len(matches)) - continue - } - - for i, m := range matches { - got := nodeString(m) - if got != test.results[i] { - t.Errorf("selector %s wanted %s, got %s instead", test.selector, test.results[i], got) - } - } - - firstMatch := Query(doc, s) - if len(test.results) == 0 { - if firstMatch != nil { - t.Errorf("Query: selector %s want nil, got %s", test.selector, nodeString(firstMatch)) - } - } else { - got := nodeString(firstMatch) - if got != test.results[0] { - t.Errorf("Query: selector %s want %s, got %s", test.selector, test.results[0], got) - } - } - - if !reflect.DeepEqual(matches, Selector(s.Match).Filter(matches)) { - t.Fatalf("inconsistent Filter result") - } - } -} - -type testPseudo struct { - HTML, selector string - spec Specificity - pseudo string -} - -var testsPseudo = []testPseudo{ - { - HTML: `
        `, - selector: "#s12:not(FOO)::before", - spec: Specificity{1, 0, 2}, - pseudo: "before", - }, - { - HTML: `
        `, - selector: "#s12::first-line", - spec: Specificity{1, 0, 1}, - pseudo: "first-line", - }, - { - HTML: `
        `, - selector: "ol > #s12:first-line", - spec: Specificity{1, 0, 2}, - pseudo: "first-line", - }, - { - HTML: `
        `, - selector: "#s12:not(FOO)::after", - spec: Specificity{1, 0, 2}, - pseudo: "after", - }, - { - HTML: `
        `, - selector: "LI.red.level:before", - spec: Specificity{0, 2, 2}, - pseudo: "before", - }, -} - -func TestPseudoElement(t *testing.T) { - for _, test := range testsPseudo { - s, err := ParseWithPseudoElement(test.selector) - if err != nil { - t.Fatalf("error compiling %q: %s", test.selector, err) - } - - if _, err = Parse(test.selector); err == nil { - t.Fatalf("selector %s with pseudo-element should not compile", test.selector) - } - - doc, err := html.Parse(strings.NewReader(test.HTML)) - if err != nil { - t.Fatalf("error parsing %q: %s", test.HTML, err) - } - - body := doc.FirstChild.LastChild - testNode := body.FirstChild.FirstChild.LastChild - if !s.Match(testNode) { - t.Errorf("%s didn't match (html tree : \n %s) \n", test.selector, nodeString(doc)) - continue - } - if s.Specificity() != test.spec { - t.Errorf("wrong specificity : expected %v got %v", test.spec, s.Specificity()) - } - if s.PseudoElement() != test.pseudo { - t.Errorf("wrong pseudo-element : expected %s got %s", test.pseudo, s.PseudoElement()) - } - } -} - -type invalidSelector struct { - Name string `json:"name,omitempty"` - Selector string `json:"selector,omitempty"` -} - -type validSelector struct { - invalidSelector - Expect []string `json:"expect,omitempty"` - Exclude []string `json:"exclude,omitempty"` - Level int `json:"level,omitempty"` - Xfail bool `json:"xfail,omitempty"` -} - -func TestShakespeare(t *testing.T) { - doc := parseReference("test_resources/shakespeare.html") - body := doc.FirstChild.NextSibling.LastChild - assertCount := func(selector string, expected int) { - sel, err := ParseGroup(selector) - if err != nil { - t.Errorf("invalid selector %s", selector) - } - if l := len(Selector(sel.Match).MatchAll(body)); l != expected { - t.Errorf("%s -> expected %d, got %d", selector, expected, l) - } - } - - // Data borrowed from https://github.com/Kozea/cssselect2 - assertCount("*", 246) - assertCount("div:only-child", 22) // ? - assertCount("div:nth-child(even)", 106) - assertCount("div:nth-child(2n)", 106) - assertCount("div:nth-child(odd)", 137) - assertCount("div:nth-child(2n+1)", 137) - assertCount("div:nth-child(n)", 243) - assertCount("div:last-child", 53) - assertCount("div:first-child", 51) - assertCount("div > div", 242) - assertCount("div + div", 190) - assertCount("div ~ div", 190) - assertCount("body", 1) - assertCount("body div", 243) - assertCount("div", 243) - assertCount("div div", 242) - assertCount("div div div", 241) - assertCount("div, div, div", 243) - assertCount("div, a, span", 243) - assertCount(".dialog", 51) - assertCount("div.dialog", 51) - assertCount("div .dialog", 51) - assertCount("div.character, div.dialog", 99) - assertCount("div.direction.dialog", 0) - assertCount("div.dialog.direction", 0) - assertCount("div.dialog.scene", 1) - assertCount("div.scene.scene", 1) - assertCount("div.scene .scene", 0) - assertCount("div.direction .dialog ", 0) - assertCount("div .dialog .direction", 4) - assertCount("div.dialog .dialog .direction", 4) - assertCount("#speech5", 1) - assertCount("div#speech5", 1) - assertCount("div #speech5", 1) - assertCount("div.scene div.dialog", 49) - assertCount("div#scene1 div.dialog div", 142) - assertCount("#scene1 #speech1", 1) - assertCount("div[class]", 103) - assertCount("div[class=dialog]", 50) - assertCount("div[class^=dia]", 51) - assertCount("div[class$=log]", 50) - assertCount("div[class*=sce]", 1) - assertCount("div[class|=dialog]", 50) - assertCount("div[class~=dialog]", 51) -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/serialize.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/serialize.go deleted file mode 100644 index 61acf04e1..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/serialize.go +++ /dev/null @@ -1,176 +0,0 @@ -package cascadia - -import ( - "fmt" - "strconv" - "strings" -) - -// implements the reverse operation Sel -> string - -var specialCharReplacer *strings.Replacer - -func init() { - var pairs []string - for _, s := range ",!\"#$%&'()*+ -./:;<=>?@[\\]^`{|}~" { - pairs = append(pairs, string(s), "\\"+string(s)) - } - specialCharReplacer = strings.NewReplacer(pairs...) -} - -// espace special CSS char -func escape(s string) string { return specialCharReplacer.Replace(s) } - -func (c tagSelector) String() string { - return c.tag -} - -func (c idSelector) String() string { - return "#" + escape(c.id) -} - -func (c classSelector) String() string { - return "." + escape(c.class) -} - -func (c attrSelector) String() string { - val := c.val - if c.operation == "#=" { - val = c.regexp.String() - } else if c.operation != "" { - val = fmt.Sprintf(`"%s"`, val) - } - - ignoreCase := "" - - if c.insensitive { - ignoreCase = " i" - } - - return fmt.Sprintf(`[%s%s%s%s]`, c.key, c.operation, val, ignoreCase) -} - -func (c relativePseudoClassSelector) String() string { - return fmt.Sprintf(":%s(%s)", c.name, c.match.String()) -} - -func (c containsPseudoClassSelector) String() string { - s := "contains" - if c.own { - s += "Own" - } - return fmt.Sprintf(`:%s("%s")`, s, c.value) -} - -func (c regexpPseudoClassSelector) String() string { - s := "matches" - if c.own { - s += "Own" - } - return fmt.Sprintf(":%s(%s)", s, c.regexp.String()) -} - -func (c nthPseudoClassSelector) String() string { - if c.a == 0 && c.b == 1 { // special cases - s := ":first-" - if c.last { - s = ":last-" - } - if c.ofType { - s += "of-type" - } else { - s += "child" - } - return s - } - var name string - switch [2]bool{c.last, c.ofType} { - case [2]bool{true, true}: - name = "nth-last-of-type" - case [2]bool{true, false}: - name = "nth-last-child" - case [2]bool{false, true}: - name = "nth-of-type" - case [2]bool{false, false}: - name = "nth-child" - } - s := fmt.Sprintf("+%d", c.b) - if c.b < 0 { // avoid +-8 invalid syntax - s = strconv.Itoa(c.b) - } - return fmt.Sprintf(":%s(%dn%s)", name, c.a, s) -} - -func (c onlyChildPseudoClassSelector) String() string { - if c.ofType { - return ":only-of-type" - } - return ":only-child" -} - -func (c inputPseudoClassSelector) String() string { - return ":input" -} - -func (c emptyElementPseudoClassSelector) String() string { - return ":empty" -} - -func (c rootPseudoClassSelector) String() string { - return ":root" -} - -func (c linkPseudoClassSelector) String() string { - return ":link" -} - -func (c langPseudoClassSelector) String() string { - return fmt.Sprintf(":lang(%s)", c.lang) -} - -func (c neverMatchSelector) String() string { - return c.value -} - -func (c enabledPseudoClassSelector) String() string { - return ":enabled" -} - -func (c disabledPseudoClassSelector) String() string { - return ":disabled" -} - -func (c checkedPseudoClassSelector) String() string { - return ":checked" -} - -func (c compoundSelector) String() string { - if len(c.selectors) == 0 && c.pseudoElement == "" { - return "*" - } - chunks := make([]string, len(c.selectors)) - for i, sel := range c.selectors { - chunks[i] = sel.String() - } - s := strings.Join(chunks, "") - if c.pseudoElement != "" { - s += "::" + c.pseudoElement - } - return s -} - -func (c combinedSelector) String() string { - start := c.first.String() - if c.second != nil { - start += fmt.Sprintf(" %s %s", string(c.combinator), c.second.String()) - } - return start -} - -func (c SelectorGroup) String() string { - ck := make([]string, len(c)) - for i, s := range c { - ck[i] = s.String() - } - return strings.Join(ck, ", ") -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/serialize_test.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/serialize_test.go deleted file mode 100644 index c2e979145..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/serialize_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package cascadia - -import ( - "reflect" - "testing" -) - -func TestSerialize(t *testing.T) { - var testSer []string - for _, test := range selectorTests { - testSer = append(testSer, test.selector) - } - for _, test := range testsPseudo { - testSer = append(testSer, test.selector) - } - for _, test := range loadValidSelectors(t) { - if test.Xfail { - continue - } - testSer = append(testSer, test.Selector) - } - - for _, test := range testSer { - s, err := ParseGroupWithPseudoElements(test) - if err != nil { - t.Fatalf("error compiling %q: %s", test, err) - } - - serialized := s.String() - s2, err := ParseGroupWithPseudoElements(serialized) - if err != nil { - t.Errorf("error compiling %q: %s %T (original : %s)", serialized, err, s, test) - } - - if !reflect.DeepEqual(s, s2) { - t.Errorf("can't retrieve selector from serialized : %s (original : %s, sel : %#v)", serialized, test, s) - } - } -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/specificity.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/specificity.go deleted file mode 100644 index 8db864f9b..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/specificity.go +++ /dev/null @@ -1,26 +0,0 @@ -package cascadia - -// Specificity is the CSS specificity as defined in -// https://www.w3.org/TR/selectors/#specificity-rules -// with the convention Specificity = [A,B,C]. -type Specificity [3]int - -// returns `true` if s < other (strictly), false otherwise -func (s Specificity) Less(other Specificity) bool { - for i := range s { - if s[i] < other[i] { - return true - } - if s[i] > other[i] { - return false - } - } - return false -} - -func (s Specificity) Add(other Specificity) Specificity { - for i, sp := range other { - s[i] += sp - } - return s -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/specificity_test.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/specificity_test.go deleted file mode 100644 index 535e545a9..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/specificity_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package cascadia - -import ( - "fmt" - "strings" - "testing" - - "golang.org/x/net/html" -) - -type testSpec struct { - // html, css selector - HTML, selector string - // correct specificity - spec Specificity -} - -var testsSpecificity = []testSpec{ - { - HTML: `
        `, - selector: ":not(em, strong#foo)", - spec: Specificity{1, 0, 1}, - }, - { - HTML: `
        `, - selector: "*", - spec: Specificity{0, 0, 0}, - }, - { - HTML: `
          `, - selector: "ul", - spec: Specificity{0, 0, 1}, - }, - { - HTML: `
          `, - selector: "ul li", - spec: Specificity{0, 0, 2}, - }, - { - HTML: `
            `, - selector: "ul ol+li", - spec: Specificity{0, 0, 3}, - }, - { - HTML: `

            `, - selector: "H1 + *[REL=up] ", - spec: Specificity{0, 1, 1}, - }, - { - HTML: `
            `, - selector: "UL OL LI.red", - spec: Specificity{0, 1, 3}, - }, - { - HTML: `
            `, - selector: "LI.red.level", - spec: Specificity{0, 2, 1}, - }, - { - HTML: `
            `, - selector: "#x34y", - spec: Specificity{1, 0, 0}, - }, - { - HTML: `
            `, - selector: "#s12:not(FOO)", - spec: Specificity{1, 0, 1}, - }, - { - HTML: `
            `, - selector: "#s12:not(FOO)", - spec: Specificity{1, 0, 1}, - }, - { - HTML: `
            `, - selector: "#s12:empty", - spec: Specificity{1, 1, 0}, - }, - { - HTML: `
            `, - selector: "#s12:only-child", - spec: Specificity{1, 1, 0}, - }, -} - -func setupSel(selector, HTML string) (Sel, *html.Node, error) { - s, err := Parse(selector) - if err != nil { - return nil, nil, fmt.Errorf("error compiling %q: %s", selector, err) - } - - doc, err := html.Parse(strings.NewReader(HTML)) - if err != nil { - return nil, nil, fmt.Errorf("error parsing %q: %s", HTML, err) - } - return s, doc, nil -} - -func TestSpecificity(t *testing.T) { - for _, test := range testsSpecificity { - s, doc, err := setupSel(test.selector, test.HTML) - if err != nil { - t.Fatal(err) - } - body := doc.FirstChild.LastChild - testNode := body.FirstChild.FirstChild.LastChild - if !s.Match(testNode) { - t.Errorf("%s didn't match (html tree : \n %s) \n", test.selector, nodeString(doc)) - continue - } - gotSpec := s.Specificity() - if gotSpec != test.spec { - t.Errorf("wrong specificity : expected %v, got %v", test.spec, gotSpec) - } - } -} - -func TestCompareSpecificity(t *testing.T) { - s1, s2 := Specificity{1, 1, 0}, Specificity{1, 0, 0} - if s1.Less(s2) { - t.Fatal() - } - - if s1.Less(s1) { - t.Fatal() - } -} diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/content.xhtml b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/content.xhtml deleted file mode 100644 index bc54adec7..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/content.xhtml +++ /dev/null @@ -1,530 +0,0 @@ - - - - - Selectors-API Test Suite: HTML with Selectors Level 2 using - TestHarness: Test Document - - - - - - - - - -
            -
            - -
            -

            - Universal selector tests inside element with - id="universal". -

            -
            -
            Some preformatted text with some embedded code
            -

            - This is a normal link: - W3C -

            -
            - Some more nested elements - code hyperlink -
            -
            - -
            -
            -
            -
            -
            -

            - -

            -
            
            -                
            -
              - - - - -
              - -
              -
              -
              -
              -
              - -
              - - - - - - - - - -
              - -
              -
              - -
              -
              -
              -
              - -
              -
              - - - - - - - - - - -

              -
              - -
              -
              -
              -
              -
              -
              - -
              - - - - -
              -
              -
              -
              -
              - -

              - -
              - -
              - - - - -
              -
              -
              -
              - -

              - -
              - -
              - - - - -
              -
              -
              -
              -
              -
              - -

              -
              - -
              - - - - - - - - - - - - - - - - - - - - - - - - - -
              - -
                -
              1. -
              2. -
              3. -
              4. -
              5. -
              6. -
              7. -
              8. -
              9. -
              10. -
              11. -
              12. -
              - -

              - span1 - em1 - - em2 - span2 - strong1 - em3 - span3 - span4 - strong2 - em4 -

              -
              - -
              -
              -
              -
              - -

              - -

              -

              - -

              -

              - -

              -
              - -
              -

              - -

              -

              - -

              -

              - -

              - -
              -
              -
              -
              - -
              -

              - -

              -

              - - -

              -

              - - - -

              -
              - > - -
              -

              -

              -

              -

              Text node

              -

              - -

              -
              - - - -
              -
              -
              -
              -
              -
              - -
              - - - - - - - - - - - - - - - - - - - - - - - -
              - -
              -
              -
              -
              - -

              - -

              -

              - -

              -

              - -

              -
              - -
              All pseudo-element tests
              - -
              -

              -

              -

              - - -
              -
              -

              -
              -

              -
              -
              -
              -
              - - - - - - -
              - -
              -
              -
              - -
                -
              • -
              • -
              • -
              • -
              - - - - - - -
              - -
              -
              -
              -
              -
              -
              -
              -
              - -
              -
              -
              -
              -
              -
              -
              -
              - -
              -
              -
              -
              -
              -
              -

              -
              -
              -
              -

              -

              -
              - -
              -
              -
              -
              -
              -
              -

              -
              -
              -
              -

              -

              -
              - -
              - - -
              -
              - - diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/invalid_selectors.json b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/invalid_selectors.json deleted file mode 100644 index 9915d38cb..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/invalid_selectors.json +++ /dev/null @@ -1,37 +0,0 @@ -[ - {"name": "Empty String", "selector": ""}, - {"name": "Invalid character", "selector": "["}, - {"name": "Invalid character", "selector": "]"}, - {"name": "Invalid character", "selector": "("}, - {"name": "Invalid character", "selector": ")"}, - {"name": "Invalid character", "selector": "{"}, - {"name": "Invalid character", "selector": "}"}, - {"name": "Invalid character", "selector": "<"}, - {"name": "Invalid character", "selector": ">"}, - {"name": "Invalid character", "selector": ":"}, - {"name": "Invalid character", "selector": "::"}, - {"name": "Invalid ID", "selector": "#"}, - {"name": "Invalid group of selectors", "selector": "div,"}, - {"name": "Invalid class", "selector": "."}, - {"name": "Invalid class", "selector": ".5cm"}, - {"name": "Invalid class", "selector": "..test"}, - {"name": "Invalid class", "selector": ".foo..quux"}, - {"name": "Invalid class", "selector": ".bar."}, - {"name": "Invalid combinator", "selector": "div & address, p"}, - {"name": "Invalid combinator", "selector": "div >> address, p"}, - {"name": "Invalid combinator", "selector": "div ++ address, p"}, - {"name": "Invalid combinator", "selector": "div ~~ address, p"}, - {"name": "Invalid [att=value] selector", "selector": "[*=test]"}, - {"name": "Invalid [att=value] selector", "selector": "[*|*=test]"}, - {"name": "Invalid [att=value] selector", "selector": "[class= space unquoted ]"}, - {"name": "Unknown pseudo-class", "selector": "div:example"}, - {"name": "Unknown pseudo-class", "selector": ":example"}, - {"name": "Unknown pseudo-element", "selector": "div::example", "xfail": true}, - {"name": "Unknown pseudo-element", "selector": "::example", "xfail": true}, - {"name": "Invalid pseudo-element", "selector": ":::before"}, - {"name": "Undeclared namespace", "selector": "ns|div"}, - {"name": "Undeclared namespace", "selector": ":not(ns|div)"}, - {"name": "Invalid namespace", "selector": "^|div"}, - {"name": "Invalid namespace", "selector": "$|div"}, - {"name": "Case insensitive, no closing ]", "selector": "[a=a i"} -] diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/shakespeare.html b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/shakespeare.html deleted file mode 100644 index 8a42029de..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/shakespeare.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - -
              -
              -

              As You Like It

              -
              - by William Shakespeare -
              -
              -

              ACT I, SCENE III. A room in the palace.

              -
              -
              Enter CELIA and ROSALIND
              -
              -
              CELIA
              -
              -
              Why, cousin! why, Rosalind! Cupid have mercy! not a word?
              -
              -
              ROSALIND
              -
              -
              Not one to throw at a dog.
              -
              -
              CELIA
              -
              -
              No, thy words are too precious to be cast away upon
              -
              curs; throw some of them at me; come, lame me with reasons.
              -
              -
              ROSALIND
              -
              CELIA
              -
              -
              But is all this for your father?
              -
              -
              -
              Then there were two cousins laid up; when the one
              -
              should be lamed with reasons and the other mad
              -
              without any.
              -
              -
              ROSALIND
              -
              -
              No, some of it is for my child's father. O, how
              -
              full of briers is this working-day world!
              -
              -
              CELIA
              -
              -
              They are but burs, cousin, thrown upon thee in
              -
              holiday foolery: if we walk not in the trodden
              -
              paths our very petticoats will catch them.
              -
              -
              ROSALIND
              -
              -
              I could shake them off my coat: these burs are in my heart.
              -
              -
              CELIA
              -
              -
              Hem them away.
              -
              -
              ROSALIND
              -
              -
              I would try, if I could cry 'hem' and have him.
              -
              -
              CELIA
              -
              -
              Come, come, wrestle with thy affections.
              -
              -
              ROSALIND
              -
              -
              O, they take the part of a better wrestler than myself!
              -
              -
              CELIA
              -
              -
              O, a good wish upon you! you will try in time, in
              -
              despite of a fall. But, turning these jests out of
              -
              service, let us talk in good earnest: is it
              -
              possible, on such a sudden, you should fall into so
              -
              strong a liking with old Sir Rowland's youngest son?
              -
              -
              ROSALIND
              -
              -
              The duke my father loved his father dearly.
              -
              -
              CELIA
              -
              -
              Doth it therefore ensue that you should love his son
              -
              dearly? By this kind of chase, I should hate him,
              -
              for my father hated his father dearly; yet I hate
              -
              not Orlando.
              -
              -
              ROSALIND
              -
              -
              No, faith, hate him not, for my sake.
              -
              -
              CELIA
              -
              -
              Why should I not? doth he not deserve well?
              -
              -
              ROSALIND
              -
              -
              Let me love him for that, and do you love him
              -
              because I do. Look, here comes the duke.
              -
              -
              CELIA
              -
              -
              With his eyes full of anger.
              -
              Enter DUKE FREDERICK, with Lords
              -
              -
              DUKE FREDERICK
              -
              -
              Mistress, dispatch you with your safest haste
              -
              And get you from our court.
              -
              -
              ROSALIND
              -
              -
              Me, uncle?
              -
              -
              DUKE FREDERICK
              -
              -
              You, cousin
              -
              Within these ten days if that thou be'st found
              -
              So near our public court as twenty miles,
              -
              Thou diest for it.
              -
              -
              ROSALIND
              -
              -
              I do beseech your grace,
              -
              Let me the knowledge of my fault bear with me:
              -
              If with myself I hold intelligence
              -
              Or have acquaintance with mine own desires,
              -
              If that I do not dream or be not frantic,--
              -
              As I do trust I am not--then, dear uncle,
              -
              Never so much as in a thought unborn
              -
              Did I offend your highness.
              -
              -
              DUKE FREDERICK
              -
              -
              Thus do all traitors:
              -
              If their purgation did consist in words,
              -
              They are as innocent as grace itself:
              -
              Let it suffice thee that I trust thee not.
              -
              -
              ROSALIND
              -
              -
              Yet your mistrust cannot make me a traitor:
              -
              Tell me whereon the likelihood depends.
              -
              -
              DUKE FREDERICK
              -
              -
              Thou art thy father's daughter; there's enough.
              -
              -
              ROSALIND
              -
              -
              So was I when your highness took his dukedom;
              -
              So was I when your highness banish'd him:
              -
              Treason is not inherited, my lord;
              -
              Or, if we did derive it from our friends,
              -
              What's that to me? my father was no traitor:
              -
              Then, good my liege, mistake me not so much
              -
              To think my poverty is treacherous.
              -
              -
              CELIA
              -
              -
              Dear sovereign, hear me speak.
              -
              -
              DUKE FREDERICK
              -
              -
              Ay, Celia; we stay'd her for your sake,
              -
              Else had she with her father ranged along.
              -
              -
              CELIA
              -
              -
              I did not then entreat to have her stay;
              -
              It was your pleasure and your own remorse:
              -
              I was too young that time to value her;
              -
              But now I know her: if she be a traitor,
              -
              Why so am I; we still have slept together,
              -
              Rose at an instant, learn'd, play'd, eat together,
              -
              And wheresoever we went, like Juno's swans,
              -
              Still we went coupled and inseparable.
              -
              -
              DUKE FREDERICK
              -
              -
              She is too subtle for thee; and her smoothness,
              -
              Her very silence and her patience
              -
              Speak to the people, and they pity her.
              -
              Thou art a fool: she robs thee of thy name;
              -
              And thou wilt show more bright and seem more virtuous
              -
              When she is gone. Then open not thy lips:
              -
              Firm and irrevocable is my doom
              -
              Which I have pass'd upon her; she is banish'd.
              -
              -
              CELIA
              -
              -
              Pronounce that sentence then on me, my liege:
              -
              I cannot live out of her company.
              -
              -
              DUKE FREDERICK
              -
              -
              You are a fool. You, niece, provide yourself:
              -
              If you outstay the time, upon mine honour,
              -
              And in the greatness of my word, you die.
              -
              Exeunt DUKE FREDERICK and Lords
              -
              -
              CELIA
              -
              -
              O my poor Rosalind, whither wilt thou go?
              -
              Wilt thou change fathers? I will give thee mine.
              -
              I charge thee, be not thou more grieved than I am.
              -
              -
              ROSALIND
              -
              -
              I have more cause.
              -
              -
              CELIA
              -
              -
              Thou hast not, cousin;
              -
              Prithee be cheerful: know'st thou not, the duke
              -
              Hath banish'd me, his daughter?
              -
              -
              ROSALIND
              -
              -
              That he hath not.
              -
              -
              CELIA
              -
              -
              No, hath not? Rosalind lacks then the love
              -
              Which teacheth thee that thou and I am one:
              -
              Shall we be sunder'd? shall we part, sweet girl?
              -
              No: let my father seek another heir.
              -
              Therefore devise with me how we may fly,
              -
              Whither to go and what to bear with us;
              -
              And do not seek to take your change upon you,
              -
              To bear your griefs yourself and leave me out;
              -
              For, by this heaven, now at our sorrows pale,
              -
              Say what thou canst, I'll go along with thee.
              -
              -
              ROSALIND
              -
              -
              Why, whither shall we go?
              -
              -
              CELIA
              -
              -
              To seek my uncle in the forest of Arden.
              -
              -
              ROSALIND
              -
              -
              Alas, what danger will it be to us,
              -
              Maids as we are, to travel forth so far!
              -
              Beauty provoketh thieves sooner than gold.
              -
              -
              CELIA
              -
              -
              I'll put myself in poor and mean attire
              -
              And with a kind of umber smirch my face;
              -
              The like do you: so shall we pass along
              -
              And never stir assailants.
              -
              -
              ROSALIND
              -
              -
              Were it not better,
              -
              Because that I am more than common tall,
              -
              That I did suit me all points like a man?
              -
              A gallant curtle-axe upon my thigh,
              -
              A boar-spear in my hand; and--in my heart
              -
              Lie there what hidden woman's fear there will--
              -
              We'll have a swashing and a martial outside,
              -
              As many other mannish cowards have
              -
              That do outface it with their semblances.
              -
              -
              CELIA
              -
              -
              What shall I call thee when thou art a man?
              -
              -
              ROSALIND
              -
              -
              I'll have no worse a name than Jove's own page;
              -
              And therefore look you call me Ganymede.
              -
              But what will you be call'd?
              -
              -
              CELIA
              -
              -
              Something that hath a reference to my state
              -
              No longer Celia, but Aliena.
              -
              -
              ROSALIND
              -
              -
              But, cousin, what if we assay'd to steal
              -
              The clownish fool out of your father's court?
              -
              Would he not be a comfort to our travel?
              -
              -
              CELIA
              -
              -
              He'll go along o'er the wide world with me;
              -
              Leave me alone to woo him. Let's away,
              -
              And get our jewels and our wealth together,
              -
              Devise the fittest time and safest way
              -
              To hide us from pursuit that will be made
              -
              After my flight. Now go we in content
              -
              To liberty and not to banishment.
              -
              Exeunt
              -
              -
              -
              -
              - - diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/valid_selectors.json b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/valid_selectors.json deleted file mode 100644 index ff6b5253e..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/test_resources/valid_selectors.json +++ /dev/null @@ -1,1642 +0,0 @@ -[ - { - "name": "Type selector, matching html element", - "selector": "html", - "expect": [ - "html" - ], - "exclude": [ - "element", - "fragment", - "detached" - ], - "level": 1 - }, - { - "name": "Type selector, matching body element", - "selector": "body", - "expect": [ - "body" - ], - "exclude": [ - "element", - "fragment", - "detached" - ], - "level": 1 - }, - { - "name": "Universal selector, matching all children of element with specified ID", - "selector": "#universal>*", - "expect": [ - "universal-p1", - "universal-hr1", - "universal-pre1", - "universal-p2", - "universal-address1" - ], - "level": 2 - }, - { - "name": "Universal selector, matching all grandchildren of element with specified ID", - "selector": "#universal>*>*", - "expect": [ - "universal-code1", - "universal-span1", - "universal-a1", - "universal-code2" - ], - "level": 2 - }, - { - "name": "Universal selector, matching all children of empty element with specified ID", - "selector": "#empty>*", - "expect": [], - "level": 2 - }, - { - "name": "Universal selector, matching all descendants of element with specified ID", - "selector": "#universal *", - "expect": [ - "universal-p1", - "universal-code1", - "universal-hr1", - "universal-pre1", - "universal-span1", - "universal-p2", - "universal-a1", - "universal-address1", - "universal-code2", - "universal-a2" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, matching align attribute with value", - "selector": ".attr-presence-div1[align]", - "expect": [ - "attr-presence-div1" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, matching align attribute with empty value", - "selector": ".attr-presence-div2[align]", - "expect": [ - "attr-presence-div2" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, matching title attribute, case insensitivity", - "selector": "#attr-presence [TiTlE]", - "expect": [ - "attr-presence-a1", - "attr-presence-span1" - ], - "exclude": [ - "xhtml" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, matching custom data-* attribute", - "selector": "[data-attr-presence]", - "expect": [ - "attr-presence-pre1", - "attr-presence-blockquote1" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, not matching attribute with similar name", - "selector": ".attr-presence-div3[align], .attr-presence-div4[align]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute presence selector, matching attribute with non-ASCII characters", - "selector": "ul[data-中文]", - "expect": [ - "attr-presence-ul1" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, not matching default option without selected attribute", - "selector": "#attr-presence-select1 option[selected]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute presence selector, matching option with selected attribute", - "selector": "#attr-presence-select2 option[selected]", - "expect": [ - "attr-presence-select2-option4" - ], - "level": 2 - }, - { - "name": "Attribute presence selector, matching multiple options with selected attributes", - "selector": "#attr-presence-select3 option[selected]", - "expect": [ - "attr-presence-select3-option2", - "attr-presence-select3-option3" - ], - "level": 2 - }, - { - "name": "Attribute value selector, matching align attribute with value", - "selector": "#attr-value [align=\"center\"]", - "expect": [ - "attr-value-div1" - ], - "level": 2 - }, - { - "name": "Attribute value selector, matching align attribute with empty value", - "selector": "#attr-value [align=\"\"]", - "expect": [ - "attr-value-div2" - ], - "level": 2 - }, - { - "name": "Attribute value selector, not matching align attribute with partial value", - "selector": "#attr-value [align=\"c\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute value selector, not matching align attribute with incorrect value", - "selector": "#attr-value [align=\"centera\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute value selector, matching custom data-* attribute with unicode escaped value", - "selector": "[data-attr-value=\"\\e9\"]", - "expect": [ - "attr-value-div3" - ], - "level": 2 - }, - { - "name": "Attribute value selector, matching custom data-* attribute with escaped character", - "selector": "[data-attr-value_foo=\"\\e9\"]", - "expect": [ - "attr-value-div4" - ], - "level": 2 - }, - { - "name": "Attribute value selector with single-quoted value, matching multiple inputs with type attributes", - "selector": "#attr-value input[type='hidden'],#attr-value input[type='radio']", - "expect": [ - "attr-value-input3", - "attr-value-input4", - "attr-value-input6", - "attr-value-input8", - "attr-value-input9" - ], - "level": 2 - }, - { - "name": "Attribute value selector with double-quoted value, matching multiple inputs with type attributes", - "selector": "#attr-value input[type=\"hidden\"],#attr-value input[type='radio']", - "expect": [ - "attr-value-input3", - "attr-value-input4", - "attr-value-input6", - "attr-value-input8", - "attr-value-input9" - ], - "level": 2 - }, - { - "name": "Attribute value selector with unquoted value, matching multiple inputs with type attributes", - "selector": "#attr-value input[type=hidden],#attr-value input[type=radio]", - "expect": [ - "attr-value-input3", - "attr-value-input4", - "attr-value-input6", - "attr-value-input8", - "attr-value-input9" - ], - "level": 2 - }, - { - "name": "Attribute value selector, matching attribute with value using non-ASCII characters", - "selector": "[data-attr-value=中文]", - "expect": [ - "attr-value-div5" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector, matching class attribute with value", - "selector": "#attr-whitespace [class~=\"div1\"]", - "expect": [ - "attr-whitespace-div1" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector, not matching class attribute with empty value", - "selector": "#attr-whitespace [class~=\"\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector, not matching class attribute with partial value", - "selector": "[data-attr-whitespace~=\"div\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector, matching custom data-* attribute with unicode escaped value", - "selector": "[data-attr-whitespace~=\"\\0000e9\"]", - "expect": [ - "attr-whitespace-div4" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector, matching custom data-* attribute with escaped character", - "selector": "[data-attr-whitespace_foo~=\"\\e9\"]", - "expect": [ - "attr-whitespace-div5" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector with single-quoted value, matching multiple links with rel attributes", - "selector": "#attr-whitespace a[rel~='bookmark'], #attr-whitespace a[rel~='nofollow']", - "expect": [ - "attr-whitespace-a1", - "attr-whitespace-a2", - "attr-whitespace-a3", - "attr-whitespace-a5", - "attr-whitespace-a7" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector with double-quoted value, matching multiple links with rel attributes", - "selector": "#attr-whitespace a[rel~=\"bookmark\"],#attr-whitespace a[rel~='nofollow']", - "expect": [ - "attr-whitespace-a1", - "attr-whitespace-a2", - "attr-whitespace-a3", - "attr-whitespace-a5", - "attr-whitespace-a7" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector with unquoted value, matching multiple links with rel attributes", - "selector": "#attr-whitespace a[rel~=bookmark], #attr-whitespace a[rel~=nofollow]", - "expect": [ - "attr-whitespace-a1", - "attr-whitespace-a2", - "attr-whitespace-a3", - "attr-whitespace-a5", - "attr-whitespace-a7" - ], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector with double-quoted value, not matching value with space", - "selector": "#attr-whitespace a[rel~=\"book mark\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute whitespace-separated list selector, matching title attribute with value using non-ASCII characters", - "selector": "#attr-whitespace [title~=中文]", - "expect": [ - "attr-whitespace-p1" - ], - "level": 2 - }, - { - "name": "Attribute hyphen-separated list selector, not matching unspecified lang attribute", - "selector": "#attr-hyphen-div1[lang|=\"en\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute hyphen-separated list selector, matching lang attribute with exact value", - "selector": "#attr-hyphen-div2[lang|=\"fr\"]", - "expect": [ - "attr-hyphen-div2" - ], - "level": 2 - }, - { - "name": "Attribute hyphen-separated list selector, matching lang attribute with partial value", - "selector": "#attr-hyphen-div3[lang|=\"en\"]", - "expect": [ - "attr-hyphen-div3" - ], - "level": 2 - }, - { - "name": "Attribute hyphen-separated list selector, not matching incorrect value", - "selector": "#attr-hyphen-div4[lang|=\"es-AR\"]", - "expect": [], - "level": 2 - }, - { - "name": "Attribute begins with selector, matching href attributes beginning with specified substring", - "selector": "#attr-begins a[href^=\"http://www\"]", - "expect": [ - "attr-begins-a1", - "attr-begins-a3" - ], - "level": 3 - }, - { - "name": "Attribute begins with selector, matching lang attributes beginning with specified substring, ", - "selector": "#attr-begins [lang^=\"en-\"]", - "expect": [ - "attr-begins-div2", - "attr-begins-div4" - ], - "level": 3 - }, - { - "name": "Attribute begins with selector, not matching class attribute not beginning with specified substring", - "selector": "#attr-begins [class^=apple]", - "expect": [], - "level": 3 - }, - { - "name": "Attribute begins with selector with single-quoted value, matching class attribute beginning with specified substring", - "selector": "#attr-begins [class^=' apple']", - "expect": [ - "attr-begins-p1" - ], - "level": 3 - }, - { - "name": "Attribute begins with selector with double-quoted value, matching class attribute beginning with specified substring", - "selector": "#attr-begins [class^=\" apple\"]", - "expect": [ - "attr-begins-p1" - ], - "level": 3 - }, - { - "name": "Attribute begins with selector with unquoted value, not matching class attribute not beginning with specified substring", - "selector": "#attr-begins [class^= apple]", - "expect": [], - "level": 3 - }, - { - "name": "Attribute ends with selector, matching href attributes ending with specified substring", - "selector": "#attr-ends a[href$=\".org\"]", - "expect": [ - "attr-ends-a1", - "attr-ends-a3" - ], - "level": 3 - }, - { - "name": "Attribute ends with selector, matching lang attributes ending with specified substring, ", - "selector": "#attr-ends [lang$=\"-CH\"]", - "expect": [ - "attr-ends-div2", - "attr-ends-div4" - ], - "level": 3 - }, - { - "name": "Attribute ends with selector, not matching class attribute not ending with specified substring", - "selector": "#attr-ends [class$=apple]", - "expect": [], - "level": 3 - }, - { - "name": "Attribute ends with selector with single-quoted value, matching class attribute ending with specified substring", - "selector": "#attr-ends [class$='apple ']", - "expect": [ - "attr-ends-p1" - ], - "level": 3 - }, - { - "name": "Attribute ends with selector with double-quoted value, matching class attribute ending with specified substring", - "selector": "#attr-ends [class$=\"apple \"]", - "expect": [ - "attr-ends-p1" - ], - "level": 3 - }, - { - "name": "Attribute ends with selector with unquoted value, not matching class attribute not ending with specified substring", - "selector": "#attr-ends [class$=apple ]", - "expect": [], - "level": 3 - }, - { - "name": "Attribute contains selector, matching href attributes beginning with specified substring", - "selector": "#attr-contains a[href*=\"http://www\"]", - "expect": [ - "attr-contains-a1", - "attr-contains-a3" - ], - "level": 3 - }, - { - "name": "Attribute contains selector, matching href attributes ending with specified substring", - "selector": "#attr-contains a[href*=\".org\"]", - "expect": [ - "attr-contains-a1", - "attr-contains-a2" - ], - "level": 3 - }, - { - "name": "Attribute contains selector, matching href attributes containing specified substring", - "selector": "#attr-contains a[href*=\".example.\"]", - "expect": [ - "attr-contains-a1", - "attr-contains-a3" - ], - "level": 3 - }, - { - "name": "Attribute contains selector, matching lang attributes beginning with specified substring, ", - "selector": "#attr-contains [lang*=\"en-\"]", - "expect": [ - "attr-contains-div2", - "attr-contains-div6" - ], - "level": 3 - }, - { - "name": "Attribute contains selector, matching lang attributes ending with specified substring, ", - "selector": "#attr-contains [lang*=\"-CH\"]", - "expect": [ - "attr-contains-div3", - "attr-contains-div5" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with single-quoted value, matching class attribute beginning with specified substring", - "selector": "#attr-contains [class*=' apple']", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with single-quoted value, matching class attribute ending with specified substring", - "selector": "#attr-contains [class*='orange ']", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with single-quoted value, matching class attribute containing specified substring", - "selector": "#attr-contains [class*='ple banana ora']", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with double-quoted value, matching class attribute beginning with specified substring", - "selector": "#attr-contains [class*=\" apple\"]", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with double-quoted value, matching class attribute ending with specified substring", - "selector": "#attr-contains [class*=\"orange \"]", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with double-quoted value, matching class attribute containing specified substring", - "selector": "#attr-contains [class*=\"ple banana ora\"]", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with unquoted value, matching class attribute beginning with specified substring", - "selector": "#attr-contains [class*= apple]", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with unquoted value, matching class attribute ending with specified substring", - "selector": "#attr-contains [class*=orange ]", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": "Attribute contains selector with unquoted value, matching class attribute containing specified substring", - "selector": "#attr-contains [class*= banana ]", - "expect": [ - "attr-contains-p1" - ], - "level": 3 - }, - { - "name": ":root pseudo-class selector, matching document root element", - "selector": ":root", - "expect": [ - "html" - ], - "exclude": [ - "element", - "fragment", - "detached" - ], - "level": 3 - }, - { - "name": ":nth-child selector, matching the third child element", - "selector": "#pseudo-nth-table1 :nth-child(3)", - "expect": [ - "pseudo-nth-td3", - "pseudo-nth-td9", - "pseudo-nth-tr3", - "pseudo-nth-td15" - ], - "level": 3 - }, - { - "name": ":nth-child selector, matching every third child element", - "selector": "#pseudo-nth li:nth-child(3n)", - "expect": [ - "pseudo-nth-li3", - "pseudo-nth-li6", - "pseudo-nth-li9", - "pseudo-nth-li12" - ], - "level": 3 - }, - { - "name": ":nth-child selector, matching every second child element, starting from the fourth", - "selector": "#pseudo-nth li:nth-child(2n+4)", - "expect": [ - "pseudo-nth-li4", - "pseudo-nth-li6", - "pseudo-nth-li8", - "pseudo-nth-li10", - "pseudo-nth-li12" - ], - "level": 3 - }, - { - "name": ":nth-child selector, matching every fourth child element, starting from the third", - "selector": "#pseudo-nth-p1 :nth-child(4n-1)", - "expect": [ - "pseudo-nth-em2", - "pseudo-nth-span3" - ], - "level": 3 - }, - { - "name": ":nth-last-child selector, matching the third last child element", - "selector": "#pseudo-nth-table1 :nth-last-child(3)", - "expect": [ - "pseudo-nth-tr1", - "pseudo-nth-td4", - "pseudo-nth-td10", - "pseudo-nth-td16" - ], - "level": 3 - }, - { - "name": ":nth-last-child selector, matching every third child element from the end", - "selector": "#pseudo-nth li:nth-last-child(3n)", - "expect": [ - "pseudo-nth-li1", - "pseudo-nth-li4", - "pseudo-nth-li7", - "pseudo-nth-li10" - ], - "level": 3 - }, - { - "name": ":nth-last-child selector, matching every second child element from the end, starting from the fourth last", - "selector": "#pseudo-nth li:nth-last-child(2n+4)", - "expect": [ - "pseudo-nth-li1", - "pseudo-nth-li3", - "pseudo-nth-li5", - "pseudo-nth-li7", - "pseudo-nth-li9" - ], - "level": 3 - }, - { - "name": ":nth-last-child selector, matching every fourth element from the end, starting from the third last", - "selector": "#pseudo-nth-p1 :nth-last-child(4n-1)", - "expect": [ - "pseudo-nth-span2", - "pseudo-nth-span4" - ], - "level": 3 - }, - { - "name": ":nth-of-type selector, matching the third em element", - "selector": "#pseudo-nth-p1 em:nth-of-type(3)", - "expect": [ - "pseudo-nth-em3" - ], - "level": 3 - }, - { - "name": ":nth-of-type selector, matching every second element of their type", - "selector": "#pseudo-nth-p1 :nth-of-type(2n)", - "expect": [ - "pseudo-nth-em2", - "pseudo-nth-span2", - "pseudo-nth-span4", - "pseudo-nth-strong2", - "pseudo-nth-em4" - ], - "level": 3 - }, - { - "name": ":nth-of-type selector, matching every second elemetn of their type, starting from the first", - "selector": "#pseudo-nth-p1 span:nth-of-type(2n-1)", - "expect": [ - "pseudo-nth-span1", - "pseudo-nth-span3" - ], - "level": 3 - }, - { - "name": ":nth-last-of-type selector, matching the thrid last em element", - "selector": "#pseudo-nth-p1 em:nth-last-of-type(3)", - "expect": [ - "pseudo-nth-em2" - ], - "level": 3 - }, - { - "name": ":nth-last-of-type selector, matching every second last element of their type", - "selector": "#pseudo-nth-p1 :nth-last-of-type(2n)", - "expect": [ - "pseudo-nth-span1", - "pseudo-nth-em1", - "pseudo-nth-strong1", - "pseudo-nth-em3", - "pseudo-nth-span3" - ], - "level": 3 - }, - { - "name": ":nth-last-of-type selector, matching every second last element of their type, starting from the last", - "selector": "#pseudo-nth-p1 span:nth-last-of-type(2n-1)", - "expect": [ - "pseudo-nth-span2", - "pseudo-nth-span4" - ], - "level": 3 - }, - { - "name": ":first-of-type selector, matching the first em element", - "selector": "#pseudo-nth-p1 em:first-of-type", - "expect": [ - "pseudo-nth-em1" - ], - "level": 3 - }, - { - "name": ":first-of-type selector, matching the first of every type of element", - "selector": "#pseudo-nth-p1 :first-of-type", - "expect": [ - "pseudo-nth-span1", - "pseudo-nth-em1", - "pseudo-nth-strong1" - ], - "level": 3 - }, - { - "name": ":first-of-type selector, matching the first td element in each table row", - "selector": "#pseudo-nth-table1 tr :first-of-type", - "expect": [ - "pseudo-nth-td1", - "pseudo-nth-td7", - "pseudo-nth-td13" - ], - "level": 3 - }, - { - "name": ":last-of-type selector, matching the last em elemnet", - "selector": "#pseudo-nth-p1 em:last-of-type", - "expect": [ - "pseudo-nth-em4" - ], - "level": 3 - }, - { - "name": ":last-of-type selector, matching the last of every type of element", - "selector": "#pseudo-nth-p1 :last-of-type", - "expect": [ - "pseudo-nth-span4", - "pseudo-nth-strong2", - "pseudo-nth-em4" - ], - "level": 3 - }, - { - "name": ":last-of-type selector, matching the last td element in each table row", - "selector": "#pseudo-nth-table1 tr :last-of-type", - "expect": [ - "pseudo-nth-td6", - "pseudo-nth-td12", - "pseudo-nth-td18" - ], - "level": 3 - }, - { - "name": ":first-child pseudo-class selector, matching first child div element", - "selector": "#pseudo-first-child div:first-child", - "expect": [ - "pseudo-first-child-div1" - ], - "level": 2 - }, - { - "name": ":first-child pseudo-class selector, doesn't match non-first-child elements", - "selector": ".pseudo-first-child-div2:first-child, .pseudo-first-child-div3:first-child", - "expect": [], - "level": 2 - }, - { - "name": ":first-child pseudo-class selector, matching first-child of multiple elements", - "selector": "#pseudo-first-child span:first-child", - "expect": [ - "pseudo-first-child-span1", - "pseudo-first-child-span3", - "pseudo-first-child-span5" - ], - "level": 2 - }, - { - "name": ":last-child pseudo-class selector, matching last child div element", - "selector": "#pseudo-last-child div:last-child", - "expect": [ - "pseudo-last-child-div3" - ], - "level": 3 - }, - { - "name": ":last-child pseudo-class selector, doesn't match non-last-child elements", - "selector": ".pseudo-last-child-div1:last-child, .pseudo-last-child-div2:first-child", - "expect": [], - "level": 3 - }, - { - "name": ":last-child pseudo-class selector, matching first-child of multiple elements", - "selector": "#pseudo-last-child span:last-child", - "expect": [ - "pseudo-last-child-span2", - "pseudo-last-child-span4", - "pseudo-last-child-span6" - ], - "level": 3 - }, - { - "name": ":pseudo-only-child pseudo-class selector, matching all only-child elements", - "selector": "#pseudo-only :only-child", - "expect": [ - "pseudo-only-span1" - ], - "level": 3 - }, - { - "name": ":pseudo-only-child pseudo-class selector, matching only-child em elements", - "selector": "#pseudo-only em:only-child", - "expect": [], - "level": 3 - }, - { - "name": ":pseudo-only-of-type pseudo-class selector, matching all elements with no siblings of the same type", - "selector": "#pseudo-only :only-of-type", - "expect": [ - "pseudo-only-span1", - "pseudo-only-em1" - ], - "level": 3 - }, - { - "name": ":pseudo-only-of-type pseudo-class selector, matching em elements with no siblings of the same type", - "selector": "#pseudo-only em:only-of-type", - "expect": [ - "pseudo-only-em1" - ], - "level": 3 - }, - { - "name": ":empty pseudo-class selector, matching empty p elements", - "selector": "#pseudo-empty p:empty", - "expect": [ - "pseudo-empty-p1", - "pseudo-empty-p2", - "pseudo-empty-p3" - ], - "level": 3 - }, - { - "name": ":empty pseudo-class selector, matching all empty elements", - "selector": "#pseudo-empty :empty", - "expect": [ - "pseudo-empty-p1", - "pseudo-empty-p2", - "pseudo-empty-p3", - "pseudo-empty-span1" - ], - "level": 3 - }, - { - "name": ":link and :visited pseudo-class selectors, matching a and area elements with href attributes", - "selector": "#pseudo-link :link, #pseudo-link :visited", - "expect": [ - "pseudo-link-a1", - "pseudo-link-a2", - "pseudo-link-area1" - ], - "level": 1 - }, - { - "name": ":link and :visited pseudo-class selectors, matching link elements with href attributes", - "selector": "#head :link, #head :visited", - "expect": [ - "pseudo-link-link1", - "pseudo-link-link2" - ], - "exclude": [ - "element", - "fragment", - "detached" - ], - "level": 1 - }, - { - "name": ":target pseudo-class selector, matching the element referenced by the URL fragment identifier", - "selector": ":target", - "xfail": true, - "expect": [ - "target" - ], - "exclude": [ - "fragment", - "detached" - ], - "level": 3 - }, - { - "name": ":lang pseudo-class selector, matching inherited language", - "selector": "#pseudo-lang-div1:lang(en)", - "expect": [ - "pseudo-lang-div1" - ], - "exclude": [ - "detached", - "fragment" - ], - "level": 2 - }, - { - "name": ":lang pseudo-class selector, matching specified language with exact value", - "selector": "#pseudo-lang-div2:lang(fr)", - "expect": [ - "pseudo-lang-div2" - ], - "level": 2 - }, - { - "name": ":lang pseudo-class selector, matching specified language with partial value", - "selector": "#pseudo-lang-div3:lang(en)", - "expect": [ - "pseudo-lang-div3" - ], - "level": 2 - }, - { - "name": ":lang pseudo-class selector, not matching incorrect language", - "selector": "#pseudo-lang-div4:lang(es-AR)", - "expect": [], - "level": 2 - }, - { - "name": ":enabled pseudo-class selector, matching all enabled form controls", - "selector": "#pseudo-ui :enabled", - "expect": [ - "pseudo-ui-input1", - "pseudo-ui-input2", - "pseudo-ui-input3", - "pseudo-ui-input4", - "pseudo-ui-input5", - "pseudo-ui-input6", - "pseudo-ui-input7", - "pseudo-ui-input8", - "pseudo-ui-input9", - "pseudo-ui-textarea1", - "pseudo-ui-button1" - ], - "level": 3 - }, - { - "name": ":enabled pseudo-class selector, matching all disabled form controls", - "selector": "#pseudo-ui :disabled", - "expect": [ - "pseudo-ui-input10", - "pseudo-ui-input11", - "pseudo-ui-input12", - "pseudo-ui-input13", - "pseudo-ui-input14", - "pseudo-ui-input15", - "pseudo-ui-input16", - "pseudo-ui-input17", - "pseudo-ui-input18", - "pseudo-ui-textarea2", - "pseudo-ui-button2" - ], - "level": 3 - }, - { - "name": ":checked pseudo-class selector, matching checked radio buttons and checkboxes", - "selector": "#pseudo-ui :checked", - "expect": [ - "pseudo-ui-input4", - "pseudo-ui-input6", - "pseudo-ui-input13", - "pseudo-ui-input15" - ], - "level": 3 - }, - { - "name": ":not pseudo-class selector, matching ", - "selector": "#not>:not(div)", - "expect": [ - "not-p1", - "not-p2", - "not-p3" - ], - "level": 3 - }, - { - "name": ":not pseudo-class selector, matching ", - "selector": "#not * :not(:first-child)", - "expect": [ - "not-em1", - "not-em2", - "not-em3" - ], - "level": 3 - }, - { - "name": ":not pseudo-class selector, matching nothing", - "selector": ":not(*)", - "expect": [], - "level": 3 - }, - { - "name": ":not pseudo-class selector, matching nothing", - "selector": ":not(*|*)", - "expect": [], - "level": 3 - }, - { - "name": ":first-line pseudo-element (one-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element:first-line", - "expect": [], - "level": 2 - }, - { - "name": "::first-line pseudo-element (two-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element::first-line", - "expect": [], - "level": 3 - }, - { - "name": ":first-letter pseudo-element (one-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element:first-letter", - "expect": [], - "level": 2 - }, - { - "name": "::first-letter pseudo-element (two-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element::first-letter", - "expect": [], - "level": 3 - }, - { - "name": ":before pseudo-element (one-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element:before", - "expect": [], - "level": 2 - }, - { - "name": "::before pseudo-element (two-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element::before", - "expect": [], - "level": 3 - }, - { - "name": ":after pseudo-element (one-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element:after", - "expect": [], - "level": 2 - }, - { - "name": "::after pseudo-element (two-colon syntax) selector, not matching any elements", - "selector": "#pseudo-element::after", - "expect": [], - "level": 3 - }, - { - "name": "Class selector, matching element with specified class", - "selector": ".class-p", - "expect": [ - "class-p1", - "class-p2", - "class-p3" - ], - "level": 1 - }, - { - "name": "Class selector, chained, matching only elements with all specified classes", - "selector": "#class .apple.orange.banana", - "expect": [ - "class-div1", - "class-div2", - "class-p4", - "class-div3", - "class-p6", - "class-div4" - ], - "level": 1 - }, - { - "name": "Class Selector, chained, with type selector", - "selector": "div.apple.banana.orange", - "expect": [ - "class-div1", - "class-div2", - "class-div3", - "class-div4" - ], - "level": 1 - }, - { - "name": "Class selector, matching element with class value using non-ASCII characters", - "selector": ".台北Táiběi", - "expect": [ - "class-span1" - ], - "level": 1 - }, - { - "name": "Class selector, matching multiple elements with class value using non-ASCII characters", - "selector": ".台北", - "expect": [ - "class-span1", - "class-span2" - ], - "level": 1 - }, - { - "name": "Class selector, chained, matching element with multiple class values using non-ASCII characters", - "selector": ".台北Táiběi.台北", - "expect": [ - "class-span1" - ], - "level": 1 - }, - { - "name": "Class selector, matching element with class with escaped character", - "selector": ".foo\\:bar", - "expect": [ - "class-span3" - ], - "level": 1 - }, - { - "name": "Class selector, matching element with class with escaped character", - "selector": ".test\\.foo\\[5\\]bar", - "expect": [ - "class-span4" - ], - "level": 1 - }, - { - "name": "ID selector, matching element with specified id", - "selector": "#id #id-div1", - "expect": [ - "id-div1" - ], - "level": 1 - }, - { - "name": "ID selector, chained, matching element with specified id", - "selector": "#id-div1, #id-div1", - "expect": [ - "id-div1" - ], - "level": 1 - }, - { - "name": "ID selector, chained, matching element with specified id", - "selector": "#id-div1, #id-div2", - "expect": [ - "id-div1", - "id-div2" - ], - "level": 1 - }, - { - "name": "ID Selector, chained, with type selector", - "selector": "div#id-div1, div#id-div2", - "expect": [ - "id-div1", - "id-div2" - ], - "level": 1 - }, - { - "name": "ID selector, not matching non-existent descendant", - "selector": "#id #none", - "expect": [], - "level": 1 - }, - { - "name": "ID selector, not matching non-existent ancestor", - "selector": "#none #id-div1", - "expect": [], - "level": 1 - }, - { - "name": "ID selector, matching multiple elements with duplicate id", - "selector": "#id-li-duplicate", - "expect": [ - "id-li-duplicate", - "id-li-duplicate", - "id-li-duplicate", - "id-li-duplicate" - ], - "level": 1 - }, - { - "name": "ID selector, matching id value using non-ASCII characters", - "selector": "#台北Táiběi", - "expect": [ - "台北Táiběi" - ], - "level": 1 - }, - { - "name": "ID selector, matching id value using non-ASCII characters", - "selector": "#台北", - "expect": [ - "台北" - ], - "level": 1 - }, - { - "name": "ID selector, matching id values using non-ASCII characters", - "selector": "#台北Táiběi, #台北", - "expect": [ - "台北Táiběi", - "台北" - ], - "level": 1 - }, - { - "name": "ID selector, matching element with id with escaped character", - "selector": "#\\#foo\\:bar", - "expect": [ - "#foo:bar" - ], - "level": 1 - }, - { - "name": "ID selector, matching element with id with escaped character", - "selector": "#test\\.foo\\[5\\]bar", - "expect": [ - "test.foo[5]bar" - ], - "level": 1 - }, - { - "name": "Namespace selector, matching element with any namespace", - "selector": "#any-namespace *|div", - "expect": [ - "any-namespace-div1", - "any-namespace-div2", - "any-namespace-div3", - "any-namespace-div4" - ], - "level": 3, - "xfail": true - }, - { - "name": "Namespace selector, matching div elements in no namespace only", - "selector": "#no-namespace |div", - "expect": [ - "no-namespace-div3" - ], - "level": 3, - "xfail": true - }, - { - "name": "Namespace selector, matching any elements in no namespace only", - "selector": "#no-namespace |*", - "expect": [ - "no-namespace-div3" - ], - "level": 3, - "xfail": true - }, - { - "name": "Descendant combinator, matching element that is a descendant of an element with id", - "selector": "#descendant div", - "expect": [ - "descendant-div1", - "descendant-div2", - "descendant-div3", - "descendant-div4" - ], - "level": 1 - }, - { - "name": "Descendant combinator, matching element with id that is a descendant of an element", - "selector": "body #descendant-div1", - "expect": [ - "descendant-div1" - ], - "exclude": [ - "detached", - "fragment" - ], - "level": 1 - }, - { - "name": "Descendant combinator, matching element with id that is a descendant of an element", - "selector": "div #descendant-div1", - "expect": [ - "descendant-div1" - ], - "level": 1 - }, - { - "name": "Descendant combinator, matching element with id that is a descendant of an element with id", - "selector": "#descendant #descendant-div2", - "expect": [ - "descendant-div2" - ], - "level": 1 - }, - { - "name": "Descendant combinator, matching element with class that is a descendant of an element with id", - "selector": "#descendant .descendant-div2", - "expect": [ - "descendant-div2" - ], - "level": 1 - }, - { - "name": "Descendant combinator, matching element with class that is a descendant of an element with class", - "selector": ".descendant-div1 .descendant-div3", - "expect": [ - "descendant-div3" - ], - "level": 1 - }, - { - "name": "Descendant combinator, not matching element with id that is not a descendant of an element with id", - "selector": "#descendant-div1 #descendant-div4", - "expect": [], - "level": 1 - }, - { - "name": "Descendant combinator, whitespace characters", - "selector": "#descendant\t\r\n#descendant-div2", - "expect": [ - "descendant-div2" - ], - "level": 1 - }, - { - "name": "Child combinator, matching element that is a child of an element with id", - "selector": "#child>div", - "expect": [ - "child-div1", - "child-div4" - ], - "level": 2 - }, - { - "name": "Child combinator, matching element with id that is a child of an element", - "selector": "div>#child-div1", - "expect": [ - "child-div1" - ], - "level": 2 - }, - { - "name": "Child combinator, matching element with id that is a child of an element with id", - "selector": "#child>#child-div1", - "expect": [ - "child-div1" - ], - "level": 2 - }, - { - "name": "Child combinator, matching element with id that is a child of an element with class", - "selector": "#child-div1>.child-div2", - "expect": [ - "child-div2" - ], - "level": 2 - }, - { - "name": "Child combinator, matching element with class that is a child of an element with class", - "selector": ".child-div1>.child-div2", - "expect": [ - "child-div2" - ], - "level": 2 - }, - { - "name": "Child combinator, not matching element with id that is not a child of an element with id", - "selector": "#child>#child-div3", - "expect": [], - "level": 2 - }, - { - "name": "Child combinator, not matching element with id that is not a child of an element with class", - "selector": "#child-div1>.child-div3", - "expect": [], - "level": 2 - }, - { - "name": "Child combinator, not matching element with class that is not a child of an element with class", - "selector": ".child-div1>.child-div3", - "expect": [], - "level": 2 - }, - { - "name": "Child combinator, surrounded by whitespace", - "selector": "#child-div1\t\r\n>\t\r\n#child-div2", - "expect": [ - "child-div2" - ], - "level": 2 - }, - { - "name": "Child combinator, whitespace after", - "selector": "#child-div1>\t\r\n#child-div2", - "expect": [ - "child-div2" - ], - "level": 2 - }, - { - "name": "Child combinator, whitespace before", - "selector": "#child-div1\t\r\n>#child-div2", - "expect": [ - "child-div2" - ], - "level": 2 - }, - { - "name": "Child combinator, no whitespace", - "selector": "#child-div1>#child-div2", - "expect": [ - "child-div2" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, matching element that is an adjacent sibling of an element with id", - "selector": "#adjacent-div2+div", - "expect": [ - "adjacent-div4" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, matching element with id that is an adjacent sibling of an element", - "selector": "div+#adjacent-div4", - "expect": [ - "adjacent-div4" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, matching element with id that is an adjacent sibling of an element with id", - "selector": "#adjacent-div2+#adjacent-div4", - "expect": [ - "adjacent-div4" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, matching element with class that is an adjacent sibling of an element with id", - "selector": "#adjacent-div2+.adjacent-div4", - "expect": [ - "adjacent-div4" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, matching element with class that is an adjacent sibling of an element with class", - "selector": ".adjacent-div2+.adjacent-div4", - "expect": [ - "adjacent-div4" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, matching p element that is an adjacent sibling of a div element", - "selector": "#adjacent div+p", - "expect": [ - "adjacent-p2" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, not matching element with id that is not an adjacent sibling of an element with id", - "selector": "#adjacent-div2+#adjacent-p2, #adjacent-div2+#adjacent-div1", - "expect": [], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, surrounded by whitespace", - "selector": "#adjacent-p2\t\r\n+\t\r\n#adjacent-p3", - "expect": [ - "adjacent-p3" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, whitespace after", - "selector": "#adjacent-p2+\t\r\n#adjacent-p3", - "expect": [ - "adjacent-p3" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, whitespace before", - "selector": "#adjacent-p2\t\r\n+#adjacent-p3", - "expect": [ - "adjacent-p3" - ], - "level": 2 - }, - { - "name": "Adjacent sibling combinator, no whitespace", - "selector": "#adjacent-p2+#adjacent-p3", - "expect": [ - "adjacent-p3" - ], - "level": 2 - }, - { - "name": "General sibling combinator, matching element that is a sibling of an element with id", - "selector": "#sibling-div2~div", - "expect": [ - "sibling-div4", - "sibling-div6" - ], - "level": 3 - }, - { - "name": "General sibling combinator, matching element with id that is a sibling of an element", - "selector": "div~#sibling-div4", - "expect": [ - "sibling-div4" - ], - "level": 3 - }, - { - "name": "General sibling combinator, matching element with id that is a sibling of an element with id", - "selector": "#sibling-div2~#sibling-div4", - "expect": [ - "sibling-div4" - ], - "level": 3 - }, - { - "name": "General sibling combinator, matching element with class that is a sibling of an element with id", - "selector": "#sibling-div2~.sibling-div", - "expect": [ - "sibling-div4", - "sibling-div6" - ], - "level": 3 - }, - { - "name": "General sibling combinator, matching p element that is a sibling of a div element", - "selector": "#sibling div~p", - "expect": [ - "sibling-p2", - "sibling-p3" - ], - "level": 3 - }, - { - "name": "General sibling combinator, not matching element with id that is not a sibling after a p element", - "selector": "#sibling>p~div", - "expect": [], - "level": 3 - }, - { - "name": "General sibling combinator, not matching element with id that is not a sibling after an element with id", - "selector": "#sibling-div2~#sibling-div3, #sibling-div2~#sibling-div1", - "expect": [], - "level": 3 - }, - { - "name": "General sibling combinator, surrounded by whitespace", - "selector": "#sibling-p2\t\r\n~\t\r\n#sibling-p3", - "expect": [ - "sibling-p3" - ], - "level": 3 - }, - { - "name": "General sibling combinator, whitespace after", - "selector": "#sibling-p2~\t\r\n#sibling-p3", - "expect": [ - "sibling-p3" - ], - "level": 3 - }, - { - "name": "General sibling combinator, whitespace before", - "selector": "#sibling-p2\t\r\n~#sibling-p3", - "expect": [ - "sibling-p3" - ], - "level": 3 - }, - { - "name": "General sibling combinator, no whitespace", - "selector": "#sibling-p2~#sibling-p3", - "expect": [ - "sibling-p3" - ], - "level": 3 - }, - { - "name": "Syntax, group of selectors separator, surrounded by whitespace", - "selector": "#group em\t\r \n,\t\r \n#group strong", - "expect": [ - "group-em1", - "group-strong1" - ], - "level": 1 - }, - { - "name": "Syntax, group of selectors separator, whitespace after", - "selector": "#group em,\t\r\n#group strong", - "expect": [ - "group-em1", - "group-strong1" - ], - "level": 1 - }, - { - "name": "Syntax, group of selectors separator, whitespace before", - "selector": "#group em\t\r\n,#group strong", - "expect": [ - "group-em1", - "group-strong1" - ], - "level": 1 - }, - { - "name": "Syntax, group of selectors separator, no whitespace", - "selector": "#group em,#group strong", - "expect": [ - "group-em1", - "group-strong1" - ], - "level": 1 - } -] \ No newline at end of file diff --git a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/w3_test.go b/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/w3_test.go deleted file mode 100644 index f1dcf3ab6..000000000 --- a/pkg/mod/github.com/andybalholm/cascadia@v1.3.1/w3_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package cascadia - -import ( - "encoding/json" - "io/ioutil" - "log" - "os" - "reflect" - "testing" - - "golang.org/x/net/html" -) - -func TestInvalidSelectors(t *testing.T) { - c, err := ioutil.ReadFile("test_resources/invalid_selectors.json") - if err != nil { - t.Fatal(err) - } - var tests []invalidSelector - if err = json.Unmarshal(c, &tests); err != nil { - t.Fatal(err) - } - for _, test := range tests { - _, err := ParseGroupWithPseudoElements(test.Selector) - if err == nil { - t.Fatalf("%s -> expected error on invalid selector : %s", test.Name, test.Selector) - } - } -} - -func parseReference(filename string) *html.Node { - f, err := os.Open(filename) - if err != nil { - log.Fatal(err) - } - node, err := html.Parse(f) - if err != nil { - log.Fatal(err) - } - return node -} - -func getId(n *html.Node) string { - for _, attr := range n.Attr { - if attr.Key == "id" { - return attr.Val - } - } - return "" -} - -func isEqual(m map[string]int, l []string) bool { - expected := map[string]int{} - for _, s := range l { - expected[s]++ - } - return reflect.DeepEqual(m, expected) -} - -func loadValidSelectors(t *testing.T) []validSelector { - c, err := ioutil.ReadFile("test_resources/valid_selectors.json") - if err != nil { - t.Fatal(err) - } - var tests []validSelector - if err = json.Unmarshal(c, &tests); err != nil { - t.Fatal(err) - } - return tests -} - -func TestValidSelectors(t *testing.T) { - tests := loadValidSelectors(t) - doc := parseReference("test_resources/content.xhtml") - for i, test := range tests { - if test.Xfail { - t.Logf("skiped test %s", test.Name) - continue - } - sels, err := ParseGroupWithPseudoElements(test.Selector) - if err != nil { - t.Fatalf("%s -> unable to parse valid selector : %s : %s", test.Name, test.Selector, err) - } - matchingNodes := map[*html.Node]bool{} - for _, sel := range sels { - if sel.PseudoElement() != "" { - continue // pseudo element doesn't count as a match in this test since they are not part of the document - } - for _, node := range Selector(sel.Match).MatchAll(doc) { - matchingNodes[node] = true - } - } - matchingIds := map[string]int{} - for node := range matchingNodes { - matchingIds[getId(node)]++ - } - if !isEqual(matchingIds, test.Expect) { - t.Fatalf("test %d %s : expected %v got %v", i, test.Name, test.Expect, matchingIds) - } - - } -} diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/.travis.yml b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/.travis.yml deleted file mode 100644 index 5e5830abf..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go -go: - - 1.6 -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi -script: - - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken=$COVERALLS diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/LICENCE b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/LICENCE deleted file mode 100644 index 77b3d1cef..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 geofrey ernest - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/README.md b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/README.md deleted file mode 100644 index 197df8798..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# front [![Build Status](https://travis-ci.org/gernest/front.svg)](https://travis-ci.org/gernest/front) [![GoDoc](https://godoc.org/github.com/gernest/front?status.svg)](https://godoc.org/github.com/gernest/front)[![Coverage Status](https://coveralls.io/repos/gernest/front/badge.svg?branch=master&service=github)](https://coveralls.io/github/gernest/front?branch=master) - -extracts frontmatter from text files with ease. - -## Features -* Custom delimiters. You are free to register any delimiter of your choice. Provided its a three character string. e.g `+++`, `$$$`, `---`, `%%%` -* Custom Handlers. Anything that implements `HandlerFunc` can be used to decode the values from the frontmatter text, you can see the `JSONHandler` for how to implement one. -* Support YAML frontmatter -* Support JSON frontmatter. - -## Installation - - go get github.com/gernest/front - -## How to use - -```go -package main - -import ( - "fmt" - "strings" - - "github.com/gernest/front" -) - -var txt = `+++ -{ - "title":"front" -} -+++ - -# Body -Over my dead body -` - -func main() { - m := front.NewMatter() - m.Handle("+++", front.JSONHandler) - f, body, err := m.Parse(strings.NewReader(txt)) - if err != nil { - panic(err) - } - - fmt.Printf("The front matter is:\n%#v\n", f) - fmt.Printf("The body is:\n%q\n", body) -} -``` - -Please see the tests formore details - -## Licence - -This project is under the MIT Licence. See the [LICENCE](LICENCE) file for the full license text. - diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/front.go b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/front.go deleted file mode 100644 index 2073a34c3..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/front.go +++ /dev/null @@ -1,146 +0,0 @@ -// Package front is a frontmatter extraction library. -package front - -import ( - "bufio" - "bytes" - "encoding/json" - "errors" - "io" - "strings" - - "gopkg.in/yaml.v2" -) - -var ( - //ErrIsEmpty is an error indicating no front matter was found - ErrIsEmpty = errors.New("front: an empty file") - - //ErrUnknownDelim is returned when the delimiters are not known by the - //FrontMatter implementation. - ErrUnknownDelim = errors.New("front: unknown delim") -) - -type ( - //HandlerFunc is an interface for a function that process front matter text. - HandlerFunc func(string) (map[string]interface{}, error) -) - -//Matter is all what matters here. -type Matter struct { - handlers map[string]HandlerFunc -} - -//NewMatter creates a new Matter instance -func NewMatter() *Matter { - return &Matter{handlers: make(map[string]HandlerFunc)} -} - -//Handle registers a handler for the given frontmatter delimiter -func (m *Matter) Handle(delim string, fn HandlerFunc) { - m.handlers[delim] = fn -} - -// Parse parses the input and extract the frontmatter -func (m *Matter) Parse(input io.Reader) (front map[string]interface{}, body string, err error) { - return m.parse(input) -} -func (m *Matter) parse(input io.Reader) (front map[string]interface{}, body string, err error) { - var getFront = func(f string) string { - return strings.TrimSpace(f[3:]) - } - f, body, err := m.splitFront(input) - if err != nil { - return nil, "", err - } else if len(f) < 3 { - return map[string]interface{}{}, body, nil - } - h := m.handlers[f[:3]] - front, err = h(getFront(f)) - if err != nil { - return nil, "", err - } - return front, body, nil - -} -func sniffDelim(input []byte) (string, error) { - if len(input) < 4 { - return "", ErrIsEmpty - } - return string(input[:3]), nil -} - -func (m *Matter) splitFront(input io.Reader) (front, body string, err error) { - bufsize := 1024 * 1024 - buf := make([]byte, bufsize) - - s := bufio.NewScanner(input) - // Necessary so we can handle larger than default 4096b buffer - s.Buffer(buf, bufsize) - - rst := make([]string, 2) - s.Split(m.split) - n := 0 - for s.Scan() { - if n == 0 { - rst[0] = s.Text() - } else if n == 1 { - rst[1] = s.Text() - } - n++ - } - if err = s.Err(); err != nil { - return - } - return rst[0], rst[1], nil -} - -//split implements bufio.SplitFunc for spliting front matter from the body text. -func (m *Matter) split(data []byte, atEOF bool) (advance int, token []byte, err error) { - if atEOF && len(data) == 0 { - return 0, nil, nil - } - delim, err := sniffDelim(data) - if err != nil { - return 0, nil, err - } - if _, ok := m.handlers[delim]; !ok { - return 0, nil, ErrUnknownDelim - } - if x := bytes.Index(data, []byte(delim)); x >= 0 { - // check the next delim index - if next := bytes.Index(data[x+len(delim):], []byte(delim)); next > 0 { - return next + len(delim), dropSpace(data[:next+len(delim)]), nil - } - return len(data), dropSpace(data[x+len(delim):]), nil - } - if atEOF { - return len(data), data, nil - } - return 0, nil, nil -} - -func dropSpace(d []byte) []byte { - return bytes.TrimSpace(d) -} - -//JSONHandler implements HandlerFunc interface. It extracts front matter data from the given -// string argument by interpreting it as a json string. -func JSONHandler(front string) (map[string]interface{}, error) { - var rst interface{} - err := json.Unmarshal([]byte(front), &rst) - if err != nil { - return nil, err - } - return rst.(map[string]interface{}), nil -} - -//YAMLHandler decodes ymal string into a go map[string]interface{} -func YAMLHandler(front string) (map[string]interface{}, error) { - out := make(map[string]interface{}) - err := yaml.Unmarshal([]byte(front), out) - if err != nil { - return nil, err - } - return out, nil -} diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/front_test.go b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/front_test.go deleted file mode 100644 index 7b2d35cca..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/front_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package front - -import ( - "bytes" - "io/ioutil" - "testing" -) - -func TestMatter(t *testing.T) { - bodyData, err := ioutil.ReadFile("testdata/front/body.md") - if err != nil { - t.Error(err) - } - m := NewMatter() - m.Handle("+++", JSONHandler) - b, err := ioutil.ReadFile("testdata/front/json.md") - if err != nil { - t.Error(err) - } - front, body, err := m.Parse(bytes.NewReader(b)) - if err != nil { - t.Error(err) - } - if body != string(bodyData) { - t.Errorf("expected %s got %s", string(bodyData), body) - } - if _, ok := front["title"]; !ok { - t.Error("expected front matter to contain title got nil instead") - } -} - -func TestYAMLHandler(t *testing.T) { - data, err := ioutil.ReadFile("testdata/sample.yml") - if err != nil { - t.Fatal(err) - } - f, err := YAMLHandler(string(data)) - if err != nil { - t.Errorf("handling yaml %v", err) - } - if _, ok := f["language"]; !ok { - t.Errorf("expected language got nil instead") - } -} - -func TestEmptyFile(t *testing.T) { - data, err := ioutil.ReadFile("testdata/front/empty.md") - if err != nil { - t.Fatal(err) - } - - m := NewMatter() - m.Handle("+++", JSONHandler) - front, body, err := m.Parse(bytes.NewReader(data)) - if err != nil { - t.Error(err) - } - if len(front) != 0 { - t.Fatal("front was not empty") - } - if len(body) != 0 { - t.Fatal("body was not empty") - } -} diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/body.md b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/body.md deleted file mode 100644 index f44eed4d0..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/body.md +++ /dev/null @@ -1,2 +0,0 @@ -# Body -Over my dead body \ No newline at end of file diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/empty.md b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/empty.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/json.md b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/json.md deleted file mode 100644 index 73b898c85..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/front/json.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -{ - "title":"bongo" -} -+++ - -# Body -Over my dead body \ No newline at end of file diff --git a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/sample.yml b/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/sample.yml deleted file mode 100644 index f1a88bedf..000000000 --- a/pkg/mod/github.com/gernest/front@v0.0.0-20210301115436-8a0b0a782d0a/testdata/sample.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -go: - - 1.2 - - 1.3 - - release - - tip -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi -script: - - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken=$COVERALLS \ No newline at end of file diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/.gitignore b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/.gitignore deleted file mode 100644 index 485dee64b..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/Dockerfile b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/Dockerfile deleted file mode 100644 index 5ccf52416..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# File generated by github.com/posener/goaction. DO NOT EDIT. - - -FROM golang:1.16-alpine3.14 -RUN apk add git - -COPY . /home/src -WORKDIR /home/src -RUN go build -o /bin/action ./ - -ENTRYPOINT [ "/bin/action" ] diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/LICENSE.txt b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/LICENSE.txt deleted file mode 100644 index 147e2ca14..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 jackyzha0 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/README.md b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/README.md deleted file mode 100644 index 52cdeb4ac..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Obsidian Link Scrapper -Used by [Quartz](https://github.com/jackyzha0/quartz) - -This repository comes to you in two parts. - -1. GitHub Action (scrapes links into a `.json` file) -2. Hugo Partial (turns `.json` file into graphs and tables) - -## GitHub Action -GitHub action and binary to scrape [Obsidian](http://obsidian.md/) vault for links and exposes them as a `.json` file for easy consumption by [Hugo](https://gohugo.io/). -### Example Usage (Binary) -Read Markdown from the `/content` folder and place the resulting `linkIndex.json` (and `contentIndex.yaml` if the `index` flag is enabled) into `/data` - -```shell -# Installation -go install github.com/jackyzha0/hugo-obsidian - -# Run -hugo-obsidian -input=content -output=data -index=true -``` - -### Example Usage (GitHub Action) - -Add 'Build Link Index' as a build step in your workflow file (e.g. `.github/workflows/deploy.yaml`) -```yaml -... - -jobs: - deploy: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: Build Link Index - uses: jackyzha0/hugo-obsidian@v2.1 - with: - input: content # input folder - output: data # output folder - index: true # whether to index content - ... -``` diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/action.yml b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/action.yml deleted file mode 100644 index e18c2e560..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: hugo-obsidian -inputs: - input: - default: . - description: "Input Directory" - required: false - output: - default: . - description: "Output Directory" - required: false - index: - default: "false" - description: "Index content" - required: false - root: - default: "." - description: "Root of Repository" - required: false -description: simple GitHub action to parse Markdown Links into a .yaml file for Hugo -branding: - icon: anchor - color: purple -runs: - using: docker - image: Dockerfile - args: - - "-input=${{ inputs.input }}" - - "-output=${{ inputs.output }}" - - "-index=${{ inputs.index }}" - - "-root=${{ inputs.root }}" diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/go.mod b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/go.mod deleted file mode 100644 index 81f6c7842..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module github.com/jackyzha0/hugo-obsidian - -go 1.16 - -require ( - github.com/BurntSushi/toml v0.4.1 // indirect - github.com/PuerkitoBio/goquery v1.8.0 - github.com/abhinav/goldmark-wikilink v0.3.0 - github.com/gernest/front v0.0.0-20210301115436-8a0b0a782d0a - github.com/yuin/goldmark v1.4.4 - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b -) diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/go.sum b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/go.sum deleted file mode 100644 index c04e03230..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/go.sum +++ /dev/null @@ -1,34 +0,0 @@ -github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= -github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= -github.com/abhinav/goldmark-wikilink v0.3.0 h1:ry8CBaULn410PKCSkwLz/WVI2f/g7EB+yqY7LKHDcPQ= -github.com/abhinav/goldmark-wikilink v0.3.0/go.mod h1:MHRZiLRE1ZDZDjHCFYwKEEgITXGbB7N0Yr00dbmfHM8= -github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= -github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gernest/front v0.0.0-20210301115436-8a0b0a782d0a h1:z7BePknRd4Nz3CeWDhcmCkuCliM2YY/RnjWpdPUuQQo= -github.com/gernest/front v0.0.0-20210301115436-8a0b0a782d0a/go.mod h1:FwEMwQ5+xky8tbzDLj72k2RAqXnFByLNwxg+9UZDtqU= -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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs= -github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= -golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/main.go b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/main.go deleted file mode 100644 index 8e86154a8..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/main.go +++ /dev/null @@ -1,83 +0,0 @@ -package main - -import ( - "flag" - "github.com/BurntSushi/toml" - wikilink "github.com/abhinav/goldmark-wikilink" - "github.com/yuin/goldmark" - "io/ioutil" - "path/filepath" - "time" -) - -var md goldmark.Markdown - -func init() { - md = goldmark.New( - goldmark.WithExtensions(&wikilink.Extender{}), - ) -} - -type Link struct { - Source string `json:"source"` - Target string `json:"target"` - Text string `json:"text"` -} - -type LinkTable = map[string][]Link -type Index struct { - Links LinkTable `json:"links"` - Backlinks LinkTable `json:"backlinks"` -} - -type Content struct { - Title string `json:"title"` - Content string `json:"content"` - LastModified time.Time `json:"lastmodified"` - Tags []string `json:"tags"` -} - -type ContentIndex = map[string]Content - -type ConfigTOML struct { - IgnoredFiles []string `toml:"ignoreFiles"` -} - -func getIgnoredFiles(base string) (res map[string]struct{}) { - res = make(map[string]struct{}) - - source, err := ioutil.ReadFile(filepath.FromSlash(base + "/config.toml")) - if err != nil { - return res - } - - var config ConfigTOML - if _, err := toml.Decode(string(source), &config); err != nil { - return res - } - - for _, glb := range config.IgnoredFiles { - matches, _ := filepath.Glob(base + glb) - for _, match := range matches { - res[match] = struct{}{} - } - } - - return res -} - -func main() { - in := flag.String("input", ".", "Input Directory") - out := flag.String("output", ".", "Output Directory") - root := flag.String("root", "..", "Root Directory (for config parsing)") - index := flag.Bool("index", false, "Whether to index the content") - flag.Parse() - - ignoreBlobs := getIgnoredFiles(*root) - l, i := walk(*in, ".md", *index, ignoreBlobs) - f := filter(l) - err := write(f, i, *index, *out) - if err != nil { - panic(err) - } -} diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/parse.go b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/parse.go deleted file mode 100644 index 65b1510f4..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/parse.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "github.com/PuerkitoBio/goquery" - "io/ioutil" - "strings" -) - -// parse single file for links -func parse(dir, pathPrefix string) []Link { - // read file - source, err := ioutil.ReadFile(dir) - if err != nil { - panic(err) - } - - // parse md - var links []Link - fmt.Printf("[Parsing note] %s => ", trim(dir, pathPrefix, ".md")) - - var buf bytes.Buffer - if err := md.Convert(source, &buf); err != nil { - panic(err) - } - - doc, err := goquery.NewDocumentFromReader(&buf) - var n int - doc.Find("a").Each(func(i int, s *goquery.Selection) { - text := strings.TrimSpace(s.Text()) - target, ok := s.Attr("href") - if !ok { - target = "#" - } - - target = processTarget(target) - source := processSource(trim(dir, pathPrefix, ".md")) - - // fmt.Printf(" '%s' => %s\n", source, target) - links = append(links, Link{ - Source: source, - Target: target, - Text: text, - }) - n++ - }) - fmt.Printf("found: %d links\n", n) - - return links -} diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/util.go b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/util.go deleted file mode 100644 index a90878959..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/util.go +++ /dev/null @@ -1,94 +0,0 @@ -package main - -import ( - "fmt" - "net/url" - "path/filepath" - "strings" - "unicode" -) - -func trim(source, prefix, suffix string) string { - return strings.TrimPrefix(strings.TrimSuffix(source, suffix), prefix) -} - -func hugoPathTrim(source string) string { - return strings.TrimSuffix(strings.TrimSuffix(source, "/index"), "_index") -} - -func processTarget(source string) string { - if !isInternal(source) { - return source - } - if strings.HasPrefix(source, "/") { - return strings.TrimSuffix(source, ".md") - } - res := "/" + strings.TrimSuffix(strings.TrimSuffix(source, ".html"), ".md") - res, _ = url.PathUnescape(res) - res = strings.Split(res, "#")[0] - res = strings.TrimSpace(res) - res = UnicodeSanitize(res) - return strings.ReplaceAll(url.PathEscape(res), "%2F", "/") -} - -func processSource(source string) string { - res := filepath.ToSlash(hugoPathTrim(source)) - res = UnicodeSanitize(res) - return strings.ReplaceAll(url.PathEscape(res), "%2F", "/") -} - -func isInternal(link string) bool { - return !strings.HasPrefix(link, "http") -} - -// From https://golang.org/src/net/url/url.go -func ishex(c rune) bool { - switch { - case '0' <= c && c <= '9': - return true - case 'a' <= c && c <= 'f': - return true - case 'A' <= c && c <= 'F': - return true - } - return false -} - -// UnicodeSanitize sanitizes string to be used in Hugo URL's -// from https://github.com/gohugoio/hugo/blob/93aad3c543828efca2adeb7f96cf50ae29878593/helpers/path.go#L94 -func UnicodeSanitize(s string) string { - source := []rune(s) - target := make([]rune, 0, len(source)) - var prependHyphen bool - - for i, r := range source { - isAllowed := r == '.' || r == '/' || r == '\\' || r == '_' || r == '#' || r == '+' || r == '~' - isAllowed = isAllowed || unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.IsMark(r) - isAllowed = isAllowed || (r == '%' && i+2 < len(source) && ishex(source[i+1]) && ishex(source[i+2])) - - if isAllowed { - if prependHyphen { - target = append(target, '-') - prependHyphen = false - } - target = append(target, r) - } else if len(target) > 0 && (r == '-' || unicode.IsSpace(r)) { - prependHyphen = true - } - } - - return string(target) -} - -// filter out certain links (e.g. to media) -func filter(links []Link) (res []Link) { - for _, l := range links { - // filter external and non-md - isMarkdown := filepath.Ext(l.Target) == "" || filepath.Ext(l.Target) == ".md" - if isInternal(l.Target) && isMarkdown { - res = append(res, l) - } - } - fmt.Printf("Removed %d external and non-markdown links\n", len(links)-len(res)) - return res -} diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/walk.go b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/walk.go deleted file mode 100644 index 7833a92ee..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/walk.go +++ /dev/null @@ -1,92 +0,0 @@ -package main - -import ( - "fmt" - "github.com/gernest/front" - "io/fs" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -// recursively walk directory and return all files with given extension -func walk(root, ext string, index bool, ignorePaths map[string]struct{}) (res []Link, i ContentIndex) { - fmt.Printf("Scraping %s\n", root) - i = make(ContentIndex) - - m := front.NewMatter() - m.Handle("---", front.YAMLHandler) - nPrivate := 0 - - start := time.Now() - - err := filepath.WalkDir(root, func(fp string, d fs.DirEntry, e error) error { - if e != nil { - return e - } - - // path normalize fp - s := filepath.ToSlash(fp) - if _, ignored := ignorePaths[s]; ignored { - fmt.Printf("[Ignored] %s\n", d.Name()) - nPrivate++ - } else if filepath.Ext(d.Name()) == ext { - res = append(res, parse(s, root)...) - if index { - text := getText(s) - - frontmatter, body, err := m.Parse(strings.NewReader(text)) - if err != nil { - frontmatter = map[string]interface{}{} - body = text - } - - var title string - if parsedTitle, ok := frontmatter["title"]; ok { - title = parsedTitle.(string) - } else { - title = "Untitled Page" - } - - // check if page is private - if parsedPrivate, ok := frontmatter["draft"]; !ok || !parsedPrivate.(bool) { - info, _ := os.Stat(s) - source := processSource(trim(s, root, ".md")) - - // adjustedPath := UnicodeSanitize(strings.Replace(hugoPathTrim(trim(s, root, ".md")), " ", "-", -1)) - i[source] = Content{ - LastModified: info.ModTime(), - Title: title, - Content: body, - } - } else { - fmt.Printf("[Ignored] %s\n", d.Name()) - nPrivate++ - } - } - } - return nil - }) - if err != nil { - panic(err) - } - - end := time.Now() - - fmt.Printf("[DONE] in %s\n", end.Sub(start).Round(time.Millisecond)) - fmt.Printf("Ignored %d private files \n", nPrivate) - fmt.Printf("Parsed %d total links \n", len(res)) - return res, i -} - -func getText(dir string) string { - // read file - fileBytes, err := ioutil.ReadFile(dir) - if err != nil { - panic(err) - } - - return string(fileBytes) -} diff --git a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/write.go b/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/write.go deleted file mode 100644 index e199e0af0..000000000 --- a/pkg/mod/github.com/jackyzha0/hugo-obsidian@v0.0.0-20220403030921-3ce308411ee3/write.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "encoding/json" - "io/ioutil" - "path" -) - -func write(links []Link, contentIndex ContentIndex, toIndex bool, out string) error { - index := index(links) - resStruct := struct { - Index Index `json:"index"` - Links []Link `json:"links"` - }{ - Index: index, - Links: links, - } - marshalledIndex, mErr := json.MarshalIndent(&resStruct, "", " ") - if mErr != nil { - return mErr - } - - writeErr := ioutil.WriteFile(path.Join(out, "linkIndex.json"), marshalledIndex, 0644) - if writeErr != nil { - return writeErr - } - - if toIndex { - marshalledContentIndex, mcErr := json.MarshalIndent(&contentIndex, "", " ") - if mcErr != nil { - return mcErr - } - - writeErr = ioutil.WriteFile(path.Join(out, "contentIndex.json"), marshalledContentIndex, 0644) - if writeErr != nil { - return writeErr - } - } - - return nil -} - -// constructs index from links -func index(links []Link) (index Index) { - linkMap := make(map[string][]Link) - backlinkMap := make(map[string][]Link) - for _, l := range links { - // backlink (only if internal) - if _, ok := backlinkMap[l.Target]; ok { - backlinkMap[l.Target] = append(backlinkMap[l.Target], l) - } else { - backlinkMap[l.Target] = []Link{l} - } - - // regular link - if _, ok := linkMap[l.Source]; ok { - linkMap[l.Source] = append(linkMap[l.Source], l) - } else { - linkMap[l.Source] = []Link{l} - } - } - index.Links = linkMap - index.Backlinks = backlinkMap - return index -} - - - diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/ISSUE_TEMPLATE.md b/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 51e3b62f1..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ -goldmark has [https://github.com/yuin/goldmark/discussions](Discussions) in github. -You should post only issues here. Feature requests and questions should be posted at discussions. - - -- [ ] goldmark is fully compliant with the CommonMark. Before submitting issue, you **must** read [CommonMark spec](https://spec.commonmark.org/0.29/) and confirm your output is different from [CommonMark online demo](https://spec.commonmark.org/dingus/). - - [ ] **Extensions(Autolink without `<` `>`, Table, etc) are not part of CommonMark spec.** You should confirm your output is different from other official renderers correspond with an extension. -- [ ] **goldmark is not dedicated for Hugo**. If you are Hugo user and your issue was raised by your experience in Hugo, **you should consider create issue at Hugo repository at first** . - -Please answer the following before submitting your issue: - -1. What version of goldmark are you using? : -2. What version of Go are you using? : -3. What operating system and processor architecture are you using? : -4. What did you do? : -5. What did you expect to see? : -6. What did you see instead? : -7. Did you confirm your output is different from [CommonMark online demo](https://spec.commonmark.org/dingus/) or other official renderer correspond with an extension?: diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/stale.yml b/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/stale.yml deleted file mode 100644 index 470349fb1..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/workflows/test.yaml b/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/workflows/test.yaml deleted file mode 100644 index b9d887915..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.github/workflows/test.yaml +++ /dev/null @@ -1,26 +0,0 @@ -on: [push, pull_request] -name: test -jobs: - test: - strategy: - fail-fast: false - matrix: - go-version: [1.16.x, 1.17.x] - platform: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.platform }} - steps: - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v1 - - name: Run tests - run: go test -v ./... -covermode=count -coverprofile=coverage.out -coverpkg=./... - - name: Send coverage - if: "matrix.platform == 'ubuntu-latest'" - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - GO111MODULE=off go get github.com/mattn/goveralls - $(go env GOPATH)/bin/goveralls -coverprofile=coverage.out -service=github diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.gitignore b/pkg/mod/github.com/yuin/goldmark@v1.4.4/.gitignore deleted file mode 100644 index 06c135f17..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test -*.pprof - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -.DS_Store -fuzz/corpus -fuzz/crashers -fuzz/suppressions -fuzz/fuzz-fuzz.zip diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/LICENSE b/pkg/mod/github.com/yuin/goldmark@v1.4.4/LICENSE deleted file mode 100644 index dc5b2a690..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Yusuke Inuzuka - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/Makefile b/pkg/mod/github.com/yuin/goldmark@v1.4.4/Makefile deleted file mode 100644 index 667a19a47..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -.PHONY: test fuzz - -test: - go test -coverprofile=profile.out -coverpkg=github.com/yuin/goldmark,github.com/yuin/goldmark/ast,github.com/yuin/goldmark/extension,github.com/yuin/goldmark/extension/ast,github.com/yuin/goldmark/parser,github.com/yuin/goldmark/renderer,github.com/yuin/goldmark/renderer/html,github.com/yuin/goldmark/text,github.com/yuin/goldmark/util ./... - -cov: test - go tool cover -html=profile.out - -fuzz: - which go-fuzz > /dev/null 2>&1 || (GO111MODULE=off go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build; GO111MODULE=off go get -d github.com/dvyukov/go-fuzz-corpus; true) - rm -rf ./fuzz/corpus - rm -rf ./fuzz/crashers - rm -rf ./fuzz/suppressions - rm -f ./fuzz/fuzz-fuzz.zip - cd ./fuzz && go-fuzz-build - cd ./fuzz && go-fuzz diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/README.md b/pkg/mod/github.com/yuin/goldmark@v1.4.4/README.md deleted file mode 100644 index 2e54d9b85..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/README.md +++ /dev/null @@ -1,494 +0,0 @@ -goldmark -========================================== - -[![https://pkg.go.dev/github.com/yuin/goldmark](https://pkg.go.dev/badge/github.com/yuin/goldmark.svg)](https://pkg.go.dev/github.com/yuin/goldmark) -[![https://github.com/yuin/goldmark/actions?query=workflow:test](https://github.com/yuin/goldmark/workflows/test/badge.svg?branch=master&event=push)](https://github.com/yuin/goldmark/actions?query=workflow:test) -[![https://coveralls.io/github/yuin/goldmark](https://coveralls.io/repos/github/yuin/goldmark/badge.svg?branch=master)](https://coveralls.io/github/yuin/goldmark) -[![https://goreportcard.com/report/github.com/yuin/goldmark](https://goreportcard.com/badge/github.com/yuin/goldmark)](https://goreportcard.com/report/github.com/yuin/goldmark) - -> A Markdown parser written in Go. Easy to extend, standards-compliant, well-structured. - -goldmark is compliant with CommonMark 0.30. - -Motivation ----------------------- -I needed a Markdown parser for Go that satisfies the following requirements: - -- Easy to extend. - - Markdown is poor in document expressions compared to other light markup languages such as reStructuredText. - - We have extensions to the Markdown syntax, e.g. PHP Markdown Extra, GitHub Flavored Markdown. -- Standards-compliant. - - Markdown has many dialects. - - GitHub-Flavored Markdown is widely used and is based upon CommonMark, effectively mooting the question of whether or not CommonMark is an ideal specification. - - CommonMark is complicated and hard to implement. -- Well-structured. - - AST-based; preserves source position of nodes. -- Written in pure Go. - -[golang-commonmark](https://gitlab.com/golang-commonmark/markdown) may be a good choice, but it seems to be a copy of [markdown-it](https://github.com/markdown-it). - -[blackfriday.v2](https://github.com/russross/blackfriday/tree/v2) is a fast and widely-used implementation, but is not CommonMark-compliant and cannot be extended from outside of the package, since its AST uses structs instead of interfaces. - -Furthermore, its behavior differs from other implementations in some cases, especially regarding lists: [Deep nested lists don't output correctly #329](https://github.com/russross/blackfriday/issues/329), [List block cannot have a second line #244](https://github.com/russross/blackfriday/issues/244), etc. - -This behavior sometimes causes problems. If you migrate your Markdown text from GitHub to blackfriday-based wikis, many lists will immediately be broken. - -As mentioned above, CommonMark is complicated and hard to implement, so Markdown parsers based on CommonMark are few and far between. - -Features ----------------------- - -- **Standards-compliant.** goldmark is fully compliant with the latest [CommonMark](https://commonmark.org/) specification. -- **Extensible.** Do you want to add a `@username` mention syntax to Markdown? - You can easily do so in goldmark. You can add your AST nodes, - parsers for block-level elements, parsers for inline-level elements, - transformers for paragraphs, transformers for the whole AST structure, and - renderers. -- **Performance.** goldmark's performance is on par with that of cmark, - the CommonMark reference implementation written in C. -- **Robust.** goldmark is tested with [go-fuzz](https://github.com/dvyukov/go-fuzz), a fuzz testing tool. -- **Built-in extensions.** goldmark ships with common extensions like tables, strikethrough, - task lists, and definition lists. -- **Depends only on standard libraries.** - -Installation ----------------------- -```bash -$ go get github.com/yuin/goldmark -``` - - -Usage ----------------------- -Import packages: - -```go -import ( - "bytes" - "github.com/yuin/goldmark" -) -``` - - -Convert Markdown documents with the CommonMark-compliant mode: - -```go -var buf bytes.Buffer -if err := goldmark.Convert(source, &buf); err != nil { - panic(err) -} -``` - -With options ------------------------------- - -```go -var buf bytes.Buffer -if err := goldmark.Convert(source, &buf, parser.WithContext(ctx)); err != nil { - panic(err) -} -``` - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `parser.WithContext` | A `parser.Context` | Context for the parsing phase. | - -Context options ----------------------- - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `parser.WithIDs` | A `parser.IDs` | `IDs` allows you to change logics that are related to element id(ex: Auto heading id generation). | - - -Custom parser and renderer --------------------------- -```go -import ( - "bytes" - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/extension" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer/html" -) - -md := goldmark.New( - goldmark.WithExtensions(extension.GFM), - goldmark.WithParserOptions( - parser.WithAutoHeadingID(), - ), - goldmark.WithRendererOptions( - html.WithHardWraps(), - html.WithXHTML(), - ), - ) -var buf bytes.Buffer -if err := md.Convert(source, &buf); err != nil { - panic(err) -} -``` - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `goldmark.WithParser` | `parser.Parser` | This option must be passed before `goldmark.WithParserOptions` and `goldmark.WithExtensions` | -| `goldmark.WithRenderer` | `renderer.Renderer` | This option must be passed before `goldmark.WithRendererOptions` and `goldmark.WithExtensions` | -| `goldmark.WithParserOptions` | `...parser.Option` | | -| `goldmark.WithRendererOptions` | `...renderer.Option` | | -| `goldmark.WithExtensions` | `...goldmark.Extender` | | - -Parser and Renderer options ------------------------------- - -### Parser options - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `parser.WithBlockParsers` | A `util.PrioritizedSlice` whose elements are `parser.BlockParser` | Parsers for parsing block level elements. | -| `parser.WithInlineParsers` | A `util.PrioritizedSlice` whose elements are `parser.InlineParser` | Parsers for parsing inline level elements. | -| `parser.WithParagraphTransformers` | A `util.PrioritizedSlice` whose elements are `parser.ParagraphTransformer` | Transformers for transforming paragraph nodes. | -| `parser.WithASTTransformers` | A `util.PrioritizedSlice` whose elements are `parser.ASTTransformer` | Transformers for transforming an AST. | -| `parser.WithAutoHeadingID` | `-` | Enables auto heading ids. | -| `parser.WithAttribute` | `-` | Enables custom attributes. Currently only headings supports attributes. | - -### HTML Renderer options - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `html.WithWriter` | `html.Writer` | `html.Writer` for writing contents to an `io.Writer`. | -| `html.WithHardWraps` | `-` | Render newlines as `
              `.| -| `html.WithXHTML` | `-` | Render as XHTML. | -| `html.WithUnsafe` | `-` | By default, goldmark does not render raw HTML or potentially dangerous links. With this option, goldmark renders such content as written. | - -### Built-in extensions - -- `extension.Table` - - [GitHub Flavored Markdown: Tables](https://github.github.com/gfm/#tables-extension-) -- `extension.Strikethrough` - - [GitHub Flavored Markdown: Strikethrough](https://github.github.com/gfm/#strikethrough-extension-) -- `extension.Linkify` - - [GitHub Flavored Markdown: Autolinks](https://github.github.com/gfm/#autolinks-extension-) -- `extension.TaskList` - - [GitHub Flavored Markdown: Task list items](https://github.github.com/gfm/#task-list-items-extension-) -- `extension.GFM` - - This extension enables Table, Strikethrough, Linkify and TaskList. - - This extension does not filter tags defined in [6.11: Disallowed Raw HTML (extension)](https://github.github.com/gfm/#disallowed-raw-html-extension-). - If you need to filter HTML tags, see [Security](#security). - - If you need to parse github emojis, you can use [goldmark-emoji](https://github.com/yuin/goldmark-emoji) extension. -- `extension.DefinitionList` - - [PHP Markdown Extra: Definition lists](https://michelf.ca/projects/php-markdown/extra/#def-list) -- `extension.Footnote` - - [PHP Markdown Extra: Footnotes](https://michelf.ca/projects/php-markdown/extra/#footnotes) -- `extension.Typographer` - - This extension substitutes punctuations with typographic entities like [smartypants](https://daringfireball.net/projects/smartypants/). - -### Attributes -The `parser.WithAttribute` option allows you to define attributes on some elements. - -Currently only headings support attributes. - -**Attributes are being discussed in the -[CommonMark forum](https://talk.commonmark.org/t/consistent-attribute-syntax/272). -This syntax may possibly change in the future.** - - -#### Headings - -``` -## heading ## {#id .className attrName=attrValue class="class1 class2"} - -## heading {#id .className attrName=attrValue class="class1 class2"} -``` - -``` -heading {#id .className attrName=attrValue} -============ -``` - -### Table extension -The Table extension implements [Table(extension)](https://github.github.com/gfm/#tables-extension-), as -defined in [GitHub Flavored Markdown Spec](https://github.github.com/gfm/). - -Specs are defined for XHTML, so specs use some deprecated attributes for HTML5. - -You can override alignment rendering method via options. - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `extension.WithTableCellAlignMethod` | `extension.TableCellAlignMethod` | Option indicates how are table cells aligned. | - -### Typographer extension - -The Typographer extension translates plain ASCII punctuation characters into typographic-punctuation HTML entities. - -Default substitutions are: - -| Punctuation | Default entity | -| ------------ | ---------- | -| `'` | `‘`, `’` | -| `"` | `“`, `”` | -| `--` | `–` | -| `---` | `—` | -| `...` | `…` | -| `<<` | `«` | -| `>>` | `»` | - -You can override the default substitutions via `extensions.WithTypographicSubstitutions`: - -```go -markdown := goldmark.New( - goldmark.WithExtensions( - extension.NewTypographer( - extension.WithTypographicSubstitutions(extension.TypographicSubstitutions{ - extension.LeftSingleQuote: []byte("‚"), - extension.RightSingleQuote: nil, // nil disables a substitution - }), - ), - ), -) -``` - -### Linkify extension - -The Linkify extension implements [Autolinks(extension)](https://github.github.com/gfm/#autolinks-extension-), as -defined in [GitHub Flavored Markdown Spec](https://github.github.com/gfm/). - -Since the spec does not define details about URLs, there are numerous ambiguous cases. - -You can override autolinking patterns via options. - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `extension.WithLinkifyAllowedProtocols` | `[][]byte` | List of allowed protocols such as `[][]byte{ []byte("http:") }` | -| `extension.WithLinkifyURLRegexp` | `*regexp.Regexp` | Regexp that defines URLs, including protocols | -| `extension.WithLinkifyWWWRegexp` | `*regexp.Regexp` | Regexp that defines URL starting with `www.`. This pattern corresponds to [the extended www autolink](https://github.github.com/gfm/#extended-www-autolink) | -| `extension.WithLinkifyEmailRegexp` | `*regexp.Regexp` | Regexp that defines email addresses` | - -Example, using [xurls](https://github.com/mvdan/xurls): - -```go -import "mvdan.cc/xurls/v2" - -markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - extension.NewLinkify( - extension.WithLinkifyAllowedProtocols([][]byte{ - []byte("http:"), - []byte("https:"), - }), - extension.WithLinkifyURLRegexp( - xurls.Strict, - ), - ), - ), -) -``` - -### Footnotes extension - -The Footnote extension implements [PHP Markdown Extra: Footnotes](https://michelf.ca/projects/php-markdown/extra/#footnotes). - -This extension has some options: - -| Functional option | Type | Description | -| ----------------- | ---- | ----------- | -| `extension.WithFootnoteIDPrefix` | `[]byte` | a prefix for the id attributes.| -| `extension.WithFootnoteIDPrefixFunction` | `func(gast.Node) []byte` | a function that determines the id attribute for given Node.| -| `extension.WithFootnoteLinkTitle` | `[]byte` | an optional title attribute for footnote links.| -| `extension.WithFootnoteBacklinkTitle` | `[]byte` | an optional title attribute for footnote backlinks. | -| `extension.WithFootnoteLinkClass` | `[]byte` | a class for footnote links. This defaults to `footnote-ref`. | -| `extension.WithFootnoteBacklinkClass` | `[]byte` | a class for footnote backlinks. This defaults to `footnote-backref`. | -| `extension.WithFootnoteBacklinkHTML` | `[]byte` | a class for footnote backlinks. This defaults to `↩︎`. | - -Some options can have special substitutions. Occurrences of “^^” in the string will be replaced by the corresponding footnote number in the HTML output. Occurrences of “%%” will be replaced by a number for the reference (footnotes can have multiple references). - -`extension.WithFootnoteIDPrefix` and `extension.WithFootnoteIDPrefixFunction` are useful if you have multiple Markdown documents displayed inside one HTML document to avoid footnote ids to clash each other. - -`extension.WithFootnoteIDPrefix` sets fixed id prefix, so you may write codes like the following: - -```go -for _, path := range files { - source := readAll(path) - prefix := getPrefix(path) - - markdown := goldmark.New( - goldmark.WithExtensions( - NewFootnote( - WithFootnoteIDPrefix([]byte(path)), - ), - ), - ) - var b bytes.Buffer - err := markdown.Convert(source, &b) - if err != nil { - t.Error(err.Error()) - } -} -``` - -`extension.WithFootnoteIDPrefixFunction` determines an id prefix by calling given function, so you may write codes like the following: - -```go -markdown := goldmark.New( - goldmark.WithExtensions( - NewFootnote( - WithFootnoteIDPrefixFunction(func(n gast.Node) []byte { - v, ok := n.OwnerDocument().Meta()["footnote-prefix"] - if ok { - return util.StringToReadOnlyBytes(v.(string)) - } - return nil - }), - ), - ), -) - -for _, path := range files { - source := readAll(path) - var b bytes.Buffer - - doc := markdown.Parser().Parse(text.NewReader(source)) - doc.Meta()["footnote-prefix"] = getPrefix(path) - err := markdown.Renderer().Render(&b, source, doc) -} -``` - -You can use [goldmark-meta](https://github.com/yuin/goldmark-meta) to define a id prefix in the markdown document: - - -```markdown ---- -title: document title -slug: article1 -footnote-prefix: article1 ---- - -# My article - -``` - -Security --------------------- -By default, goldmark does not render raw HTML or potentially-dangerous URLs. -If you need to gain more control over untrusted contents, it is recommended that you -use an HTML sanitizer such as [bluemonday](https://github.com/microcosm-cc/bluemonday). - -Benchmark --------------------- -You can run this benchmark in the `_benchmark` directory. - -### against other golang libraries - -blackfriday v2 seems to be the fastest, but as it is not CommonMark compliant, its performance cannot be directly compared to that of the CommonMark-compliant libraries. - -goldmark, meanwhile, builds a clean, extensible AST structure, achieves full compliance with -CommonMark, and consumes less memory, all while being reasonably fast. - -``` -goos: darwin -goarch: amd64 -BenchmarkMarkdown/Blackfriday-v2-12 326 3465240 ns/op 3298861 B/op 20047 allocs/op -BenchmarkMarkdown/GoldMark-12 303 3927494 ns/op 2574809 B/op 13853 allocs/op -BenchmarkMarkdown/CommonMark-12 244 4900853 ns/op 2753851 B/op 20527 allocs/op -BenchmarkMarkdown/Lute-12 130 9195245 ns/op 9175030 B/op 123534 allocs/op -BenchmarkMarkdown/GoMarkdown-12 9 113541994 ns/op 2187472 B/op 22173 allocs/op -``` - -### against cmark (CommonMark reference implementation written in C) - -``` ------------ cmark ----------- -file: _data.md -iteration: 50 -average: 0.0037760639 sec -go run ./goldmark_benchmark.go -------- goldmark ------- -file: _data.md -iteration: 50 -average: 0.0040964230 sec -``` - -As you can see, goldmark's performance is on par with cmark's. - -Extensions --------------------- - -- [goldmark-meta](https://github.com/yuin/goldmark-meta): A YAML metadata - extension for the goldmark Markdown parser. -- [goldmark-highlighting](https://github.com/yuin/goldmark-highlighting): A syntax-highlighting extension - for the goldmark markdown parser. -- [goldmark-emoji](https://github.com/yuin/goldmark-emoji): An emoji - extension for the goldmark Markdown parser. -- [goldmark-mathjax](https://github.com/litao91/goldmark-mathjax): Mathjax support for the goldmark markdown parser -- [goldmark-pdf](https://github.com/stephenafamo/goldmark-pdf): A PDF renderer that can be passed to `goldmark.WithRenderer()`. -- [goldmark-hashtag](https://github.com/abhinav/goldmark-hashtag): Adds support for `#hashtag`-based tagging to goldmark. -- [goldmark-wikilink](https://github.com/abhinav/goldmark-wikilink): Adds support for `[[wiki]]`-style links to goldmark. -- [goldmark-toc](https://github.com/abhinav/goldmark-toc): Adds support for generating tables-of-contents for goldmark documents. -- [goldmark-mermaid](https://github.com/abhinav/goldmark-mermaid): Adds support for renderng [Mermaid](https://mermaid-js.github.io/mermaid/) diagrams in goldmark documents. - -goldmark internal(for extension developers) ----------------------------------------------- -### Overview -goldmark's Markdown processing is outlined in the diagram below. - -``` - - | - V - +-------- parser.Parser --------------------------- - | 1. Parse block elements into AST - | 1. If a parsed block is a paragraph, apply - | ast.ParagraphTransformer - | 2. Traverse AST and parse blocks. - | 1. Process delimiters(emphasis) at the end of - | block parsing - | 3. Apply parser.ASTTransformers to AST - | - V - - | - V - +------- renderer.Renderer ------------------------ - | 1. Traverse AST and apply renderer.NodeRenderer - | corespond to the node type - - | - V - -``` - -### Parsing -Markdown documents are read through `text.Reader` interface. - -AST nodes do not have concrete text. AST nodes have segment information of the documents, represented by `text.Segment` . - -`text.Segment` has 3 attributes: `Start`, `End`, `Padding` . - -(TBC) - -**TODO** - -See `extension` directory for examples of extensions. - -Summary: - -1. Define AST Node as a struct in which `ast.BaseBlock` or `ast.BaseInline` is embedded. -2. Write a parser that implements `parser.BlockParser` or `parser.InlineParser`. -3. Write a renderer that implements `renderer.NodeRenderer`. -4. Define your goldmark extension that implements `goldmark.Extender`. - - -Donation --------------------- -BTC: 1NEDSyUmo4SMTDP83JJQSWi1MvQUGGNMZB - -License --------------------- -MIT - -Author --------------------- -Yusuke Inuzuka diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/.gitignore b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/.gitignore deleted file mode 100644 index 0c9a6c61a..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -cmark-master -cmark_benchmark diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/Makefile b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/Makefile deleted file mode 100644 index 5362cd188..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -CMARK_BIN=cmark_benchmark -CMARK_RUN=LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./cmark-master/build/src ./$(CMARK_BIN) -ifeq ($(OS),Windows_NT) - CMARK_BIN=cmark_benchmark.exe - CMARK_RUN=bash -c "PATH=./cmark-master/build/src:$${PATH} ./$(CMARK_BIN)" -endif -ifneq ($(WSL_INTEROP),) - CMARK_BIN=cmark_benchmark.exe - CMARK_RUN=cp ./cmark-master/build-mingw/windows/bin/libcmark.dll . && ./$(CMARK_BIN); rm -f libcmark.dll -endif - -.PHONY: run - -run: $(CMARK_BIN) - @ $(CMARK_RUN) - @ if [ -z "$${WSL_INTEROP}" ]; then \ - go run ./goldmark_benchmark.go; \ - else \ - GOOS=windows GOARCH=amd64 go build -o goldmark_benchmark.exe ./goldmark_benchmark.go && ./goldmark_benchmark.exe; \ - fi - -./cmark-master/build/src/config.h: - wget -nc -O cmark.zip https://github.com/commonmark/cmark/archive/master.zip - unzip cmark.zip - rm -f cmark.zip - @ if [ -z "$${WSL_INTEROP}" ]; then \ - cd cmark-master && make; - else \ - cd cmark-master && make mingw; \ - fi - -$(CMARK_BIN): ./cmark-master/build/src/config.h - @ if [ -z "$${WSL_INTEROP}" ]; then \ - gcc -I./cmark-master/build/src -I./cmark-master/src cmark_benchmark.c -o $(CMARK_BIN) -L./cmark-master/build/src -lcmark; \ - else \ - i686-w64-mingw32-gcc -I./cmark-master/build-mingw/windows/include cmark_benchmark.c -o $(CMARK_BIN) -L./cmark-master/build-mingw/windows/lib -lcmark.dll; \ - fi - -.PHONY: clean -clean: - rm -f $(CMARK_BIN) - rm -f goldmark_benchmark.exe diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/_data.md b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/_data.md deleted file mode 100644 index 87db650b7..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/_data.md +++ /dev/null @@ -1,9702 +0,0 @@ -# Introduction - -## What is Markdown? - -Markdown is a plain text format for writing structured documents, -based on conventions for indicating formatting in email -and usenet posts. It was developed by John Gruber (with -help from Aaron Swartz) and released in 2004 in the form of a -[syntax description](http://daringfireball.net/projects/markdown/syntax) -and a Perl script (`Markdown.pl`) for converting Markdown to -HTML. In the next decade, dozens of implementations were -developed in many languages. Some extended the original -Markdown syntax with conventions for footnotes, tables, and -other document elements. Some allowed Markdown documents to be -rendered in formats other than HTML. Websites like Reddit, -StackOverflow, and GitHub had millions of people using Markdown. -And Markdown started to be used beyond the web, to author books, -articles, slide shows, letters, and lecture notes. - -What distinguishes Markdown from many other lightweight markup -syntaxes, which are often easier to write, is its readability. -As Gruber writes: - -> The overriding design goal for Markdown's formatting syntax is -> to make it as readable as possible. The idea is that a -> Markdown-formatted document should be publishable as-is, as -> plain text, without looking like it's been marked up with tags -> or formatting instructions. -> () - -The point can be illustrated by comparing a sample of -[AsciiDoc](http://www.methods.co.nz/asciidoc/) with -an equivalent sample of Markdown. Here is a sample of -AsciiDoc from the AsciiDoc manual: - -``` -1. List item one. -+ -List item one continued with a second paragraph followed by an -Indented block. -+ -................. -$ ls *.sh -$ mv *.sh ~/tmp -................. -+ -List item continued with a third paragraph. - -2. List item two continued with an open block. -+ --- -This paragraph is part of the preceding list item. - -a. This list is nested and does not require explicit item -continuation. -+ -This paragraph is part of the preceding list item. - -b. List item b. - -This paragraph belongs to item two of the outer list. --- -``` - -And here is the equivalent in Markdown: -``` -1. List item one. - - List item one continued with a second paragraph followed by an - Indented block. - - $ ls *.sh - $ mv *.sh ~/tmp - - List item continued with a third paragraph. - -2. List item two continued with an open block. - - This paragraph is part of the preceding list item. - - 1. This list is nested and does not require explicit item continuation. - - This paragraph is part of the preceding list item. - - 2. List item b. - - This paragraph belongs to item two of the outer list. -``` - -The AsciiDoc version is, arguably, easier to write. You don't need -to worry about indentation. But the Markdown version is much easier -to read. The nesting of list items is apparent to the eye in the -source, not just in the processed document. - -## Why is a spec needed? - -John Gruber's [canonical description of Markdown's -syntax](http://daringfireball.net/projects/markdown/syntax) -does not specify the syntax unambiguously. Here are some examples of -questions it does not answer: - -1. How much indentation is needed for a sublist? The spec says that - continuation paragraphs need to be indented four spaces, but is - not fully explicit about sublists. It is natural to think that - they, too, must be indented four spaces, but `Markdown.pl` does - not require that. This is hardly a "corner case," and divergences - between implementations on this issue often lead to surprises for - users in real documents. (See [this comment by John - Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).) - -2. Is a blank line needed before a block quote or heading? - Most implementations do not require the blank line. However, - this can lead to unexpected results in hard-wrapped text, and - also to ambiguities in parsing (note that some implementations - put the heading inside the blockquote, while others do not). - (John Gruber has also spoken [in favor of requiring the blank - lines](http://article.gmane.org/gmane.text.markdown.general/2146).) - -3. Is a blank line needed before an indented code block? - (`Markdown.pl` requires it, but this is not mentioned in the - documentation, and some implementations do not require it.) - - ``` markdown - paragraph - code? - ``` - -4. What is the exact rule for determining when list items get - wrapped in `

              ` tags? Can a list be partially "loose" and partially - "tight"? What should we do with a list like this? - - ``` markdown - 1. one - - 2. two - 3. three - ``` - - Or this? - - ``` markdown - 1. one - - a - - - b - 2. two - ``` - - (There are some relevant comments by John Gruber - [here](http://article.gmane.org/gmane.text.markdown.general/2554).) - -5. Can list markers be indented? Can ordered list markers be right-aligned? - - ``` markdown - 8. item 1 - 9. item 2 - 10. item 2a - ``` - -6. Is this one list with a thematic break in its second item, - or two lists separated by a thematic break? - - ``` markdown - * a - * * * * * - * b - ``` - -7. When list markers change from numbers to bullets, do we have - two lists or one? (The Markdown syntax description suggests two, - but the perl scripts and many other implementations produce one.) - - ``` markdown - 1. fee - 2. fie - - foe - - fum - ``` - -8. What are the precedence rules for the markers of inline structure? - For example, is the following a valid link, or does the code span - take precedence ? - - ``` markdown - [a backtick (`)](/url) and [another backtick (`)](/url). - ``` - -9. What are the precedence rules for markers of emphasis and strong - emphasis? For example, how should the following be parsed? - - ``` markdown - *foo *bar* baz* - ``` - -10. What are the precedence rules between block-level and inline-level - structure? For example, how should the following be parsed? - - ``` markdown - - `a long code span can contain a hyphen like this - - and it can screw things up` - ``` - -11. Can list items include section headings? (`Markdown.pl` does not - allow this, but does allow blockquotes to include headings.) - - ``` markdown - - # Heading - ``` - -12. Can list items be empty? - - ``` markdown - * a - * - * b - ``` - -13. Can link references be defined inside block quotes or list items? - - ``` markdown - > Blockquote [foo]. - > - > [foo]: /url - ``` - -14. If there are multiple definitions for the same reference, which takes - precedence? - - ``` markdown - [foo]: /url1 - [foo]: /url2 - - [foo][] - ``` - -In the absence of a spec, early implementers consulted `Markdown.pl` -to resolve these ambiguities. But `Markdown.pl` was quite buggy, and -gave manifestly bad results in many cases, so it was not a -satisfactory replacement for a spec. - -Because there is no unambiguous spec, implementations have diverged -considerably. As a result, users are often surprised to find that -a document that renders one way on one system (say, a GitHub wiki) -renders differently on another (say, converting to docbook using -pandoc). To make matters worse, because nothing in Markdown counts -as a "syntax error," the divergence often isn't discovered right away. - -## About this document - -This document attempts to specify Markdown syntax unambiguously. -It contains many examples with side-by-side Markdown and -HTML. These are intended to double as conformance tests. An -accompanying script `spec_tests.py` can be used to run the tests -against any Markdown program: - - python test/spec_tests.py --spec spec.txt --program PROGRAM - -Since this document describes how Markdown is to be parsed into -an abstract syntax tree, it would have made sense to use an abstract -representation of the syntax tree instead of HTML. But HTML is capable -of representing the structural distinctions we need to make, and the -choice of HTML for the tests makes it possible to run the tests against -an implementation without writing an abstract syntax tree renderer. - -This document is generated from a text file, `spec.txt`, written -in Markdown with a small extension for the side-by-side tests. -The script `tools/makespec.py` can be used to convert `spec.txt` into -HTML or CommonMark (which can then be converted into other formats). - -In the examples, the `→` character is used to represent tabs. - -# Preliminaries - -## Characters and lines - -Any sequence of [characters] is a valid CommonMark -document. - -A [character](@) is a Unicode code point. Although some -code points (for example, combining accents) do not correspond to -characters in an intuitive sense, all code points count as characters -for purposes of this spec. - -This spec does not specify an encoding; it thinks of lines as composed -of [characters] rather than bytes. A conforming parser may be limited -to a certain encoding. - -A [line](@) is a sequence of zero or more [characters] -other than newline (`U+000A`) or carriage return (`U+000D`), -followed by a [line ending] or by the end of file. - -A [line ending](@) is a newline (`U+000A`), a carriage return -(`U+000D`) not followed by a newline, or a carriage return and a -following newline. - -A line containing no characters, or a line containing only spaces -(`U+0020`) or tabs (`U+0009`), is called a [blank line](@). - -The following definitions of character classes will be used in this spec: - -A [whitespace character](@) is a space -(`U+0020`), tab (`U+0009`), newline (`U+000A`), line tabulation (`U+000B`), -form feed (`U+000C`), or carriage return (`U+000D`). - -[Whitespace](@) is a sequence of one or more [whitespace -characters]. - -A [Unicode whitespace character](@) is -any code point in the Unicode `Zs` general category, or a tab (`U+0009`), -carriage return (`U+000D`), newline (`U+000A`), or form feed -(`U+000C`). - -[Unicode whitespace](@) is a sequence of one -or more [Unicode whitespace characters]. - -A [space](@) is `U+0020`. - -A [non-whitespace character](@) is any character -that is not a [whitespace character]. - -An [ASCII punctuation character](@) -is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, -`*`, `+`, `,`, `-`, `.`, `/` (U+0021–2F), -`:`, `;`, `<`, `=`, `>`, `?`, `@` (U+003A–0040), -`[`, `\`, `]`, `^`, `_`, `` ` `` (U+005B–0060), -`{`, `|`, `}`, or `~` (U+007B–007E). - -A [punctuation character](@) is an [ASCII -punctuation character] or anything in -the general Unicode categories `Pc`, `Pd`, `Pe`, `Pf`, `Pi`, `Po`, or `Ps`. - -## Tabs - -Tabs in lines are not expanded to [spaces]. However, -in contexts where whitespace helps to define block structure, -tabs behave as if they were replaced by spaces with a tab stop -of 4 characters. - -Thus, for example, a tab can be used instead of four spaces -in an indented code block. (Note, however, that internal -tabs are passed through as literal tabs, not expanded to -spaces.) - -```````````````````````````````` example -→foo→baz→→bim -. -

              foo→baz→→bim
              -
              -```````````````````````````````` - -```````````````````````````````` example - →foo→baz→→bim -. -
              foo→baz→→bim
              -
              -```````````````````````````````` - -```````````````````````````````` example - a→a - ὐ→a -. -
              a→a
              -ὐ→a
              -
              -```````````````````````````````` - -In the following example, a continuation paragraph of a list -item is indented with a tab; this has exactly the same effect -as indentation with four spaces would: - -```````````````````````````````` example - - foo - -→bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - -```````````````````````````````` example -- foo - -→→bar -. -
                -
              • -

                foo

                -
                  bar
                -
                -
              • -
              -```````````````````````````````` - -Normally the `>` that begins a block quote may be followed -optionally by a space, which is not considered part of the -content. In the following case `>` is followed by a tab, -which is treated as if it were expanded into three spaces. -Since one of these spaces is considered part of the -delimiter, `foo` is considered to be indented six spaces -inside the block quote context, so we get an indented -code block starting with two spaces. - -```````````````````````````````` example ->→→foo -. -
              -
                foo
              -
              -
              -```````````````````````````````` - -```````````````````````````````` example --→→foo -. -
                -
              • -
                  foo
                -
                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example - foo -→bar -. -
              foo
              -bar
              -
              -```````````````````````````````` - -```````````````````````````````` example - - foo - - bar -→ - baz -. -
                -
              • foo -
                  -
                • bar -
                    -
                  • baz
                  • -
                  -
                • -
                -
              • -
              -```````````````````````````````` - -```````````````````````````````` example -#→Foo -. -

              Foo

              -```````````````````````````````` - -```````````````````````````````` example -*→*→*→ -. -
              -```````````````````````````````` - - -## Insecure characters - -For security reasons, the Unicode character `U+0000` must be replaced -with the REPLACEMENT CHARACTER (`U+FFFD`). - -# Blocks and inlines - -We can think of a document as a sequence of -[blocks](@)---structural elements like paragraphs, block -quotations, lists, headings, rules, and code blocks. Some blocks (like -block quotes and list items) contain other blocks; others (like -headings and paragraphs) contain [inline](@) content---text, -links, emphasized text, images, code spans, and so on. - -## Precedence - -Indicators of block structure always take precedence over indicators -of inline structure. So, for example, the following is a list with -two items, not a list with one item containing a code span: - -```````````````````````````````` example -- `one -- two` -. -
                -
              • `one
              • -
              • two`
              • -
              -```````````````````````````````` - - -This means that parsing can proceed in two steps: first, the block -structure of the document can be discerned; second, text lines inside -paragraphs, headings, and other block constructs can be parsed for inline -structure. The second step requires information about link reference -definitions that will be available only at the end of the first -step. Note that the first step requires processing lines in sequence, -but the second can be parallelized, since the inline parsing of -one block element does not affect the inline parsing of any other. - -## Container blocks and leaf blocks - -We can divide blocks into two types: -[container blocks](@), -which can contain other blocks, and [leaf blocks](@), -which cannot. - -# Leaf blocks - -This section describes the different kinds of leaf block that make up a -Markdown document. - -## Thematic breaks - -A line consisting of 0-3 spaces of indentation, followed by a sequence -of three or more matching `-`, `_`, or `*` characters, each followed -optionally by any number of spaces or tabs, forms a -[thematic break](@). - -```````````````````````````````` example -*** ---- -___ -. -
              -
              -
              -```````````````````````````````` - - -Wrong characters: - -```````````````````````````````` example -+++ -. -

              +++

              -```````````````````````````````` - - -```````````````````````````````` example -=== -. -

              ===

              -```````````````````````````````` - - -Not enough characters: - -```````````````````````````````` example --- -** -__ -. -

              -- -** -__

              -```````````````````````````````` - - -One to three spaces indent are allowed: - -```````````````````````````````` example - *** - *** - *** -. -
              -
              -
              -```````````````````````````````` - - -Four spaces is too many: - -```````````````````````````````` example - *** -. -
              ***
              -
              -```````````````````````````````` - - -```````````````````````````````` example -Foo - *** -. -

              Foo -***

              -```````````````````````````````` - - -More than three characters may be used: - -```````````````````````````````` example -_____________________________________ -. -
              -```````````````````````````````` - - -Spaces are allowed between the characters: - -```````````````````````````````` example - - - - -. -
              -```````````````````````````````` - - -```````````````````````````````` example - ** * ** * ** * ** -. -
              -```````````````````````````````` - - -```````````````````````````````` example -- - - - -. -
              -```````````````````````````````` - - -Spaces are allowed at the end: - -```````````````````````````````` example -- - - - -. -
              -```````````````````````````````` - - -However, no other characters may occur in the line: - -```````````````````````````````` example -_ _ _ _ a - -a------ - ----a--- -. -

              _ _ _ _ a

              -

              a------

              -

              ---a---

              -```````````````````````````````` - - -It is required that all of the [non-whitespace characters] be the same. -So, this is not a thematic break: - -```````````````````````````````` example - *-* -. -

              -

              -```````````````````````````````` - - -Thematic breaks do not need blank lines before or after: - -```````````````````````````````` example -- foo -*** -- bar -. -
                -
              • foo
              • -
              -
              -
                -
              • bar
              • -
              -```````````````````````````````` - - -Thematic breaks can interrupt a paragraph: - -```````````````````````````````` example -Foo -*** -bar -. -

              Foo

              -
              -

              bar

              -```````````````````````````````` - - -If a line of dashes that meets the above conditions for being a -thematic break could also be interpreted as the underline of a [setext -heading], the interpretation as a -[setext heading] takes precedence. Thus, for example, -this is a setext heading, not a paragraph followed by a thematic break: - -```````````````````````````````` example -Foo ---- -bar -. -

              Foo

              -

              bar

              -```````````````````````````````` - - -When both a thematic break and a list item are possible -interpretations of a line, the thematic break takes precedence: - -```````````````````````````````` example -* Foo -* * * -* Bar -. -
                -
              • Foo
              • -
              -
              -
                -
              • Bar
              • -
              -```````````````````````````````` - - -If you want a thematic break in a list item, use a different bullet: - -```````````````````````````````` example -- Foo -- * * * -. -
                -
              • Foo
              • -
              • -
                -
              • -
              -```````````````````````````````` - - -## ATX headings - -An [ATX heading](@) -consists of a string of characters, parsed as inline content, between an -opening sequence of 1--6 unescaped `#` characters and an optional -closing sequence of any number of unescaped `#` characters. -The opening sequence of `#` characters must be followed by a -[space] or by the end of line. The optional closing sequence of `#`s must be -preceded by a [space] and may be followed by spaces only. The opening -`#` character may be indented 0-3 spaces. The raw contents of the -heading are stripped of leading and trailing spaces before being parsed -as inline content. The heading level is equal to the number of `#` -characters in the opening sequence. - -Simple headings: - -```````````````````````````````` example -# foo -## foo -### foo -#### foo -##### foo -###### foo -. -

              foo

              -

              foo

              -

              foo

              -

              foo

              -
              foo
              -
              foo
              -```````````````````````````````` - - -More than six `#` characters is not a heading: - -```````````````````````````````` example -####### foo -. -

              ####### foo

              -```````````````````````````````` - - -At least one space is required between the `#` characters and the -heading's contents, unless the heading is empty. Note that many -implementations currently do not require the space. However, the -space was required by the -[original ATX implementation](http://www.aaronsw.com/2002/atx/atx.py), -and it helps prevent things like the following from being parsed as -headings: - -```````````````````````````````` example -#5 bolt - -#hashtag -. -

              #5 bolt

              -

              #hashtag

              -```````````````````````````````` - - -This is not a heading, because the first `#` is escaped: - -```````````````````````````````` example -\## foo -. -

              ## foo

              -```````````````````````````````` - - -Contents are parsed as inlines: - -```````````````````````````````` example -# foo *bar* \*baz\* -. -

              foo bar *baz*

              -```````````````````````````````` - - -Leading and trailing [whitespace] is ignored in parsing inline content: - -```````````````````````````````` example -# foo -. -

              foo

              -```````````````````````````````` - - -One to three spaces indentation are allowed: - -```````````````````````````````` example - ### foo - ## foo - # foo -. -

              foo

              -

              foo

              -

              foo

              -```````````````````````````````` - - -Four spaces are too much: - -```````````````````````````````` example - # foo -. -
              # foo
              -
              -```````````````````````````````` - - -```````````````````````````````` example -foo - # bar -. -

              foo -# bar

              -```````````````````````````````` - - -A closing sequence of `#` characters is optional: - -```````````````````````````````` example -## foo ## - ### bar ### -. -

              foo

              -

              bar

              -```````````````````````````````` - - -It need not be the same length as the opening sequence: - -```````````````````````````````` example -# foo ################################## -##### foo ## -. -

              foo

              -
              foo
              -```````````````````````````````` - - -Spaces are allowed after the closing sequence: - -```````````````````````````````` example -### foo ### -. -

              foo

              -```````````````````````````````` - - -A sequence of `#` characters with anything but [spaces] following it -is not a closing sequence, but counts as part of the contents of the -heading: - -```````````````````````````````` example -### foo ### b -. -

              foo ### b

              -```````````````````````````````` - - -The closing sequence must be preceded by a space: - -```````````````````````````````` example -# foo# -. -

              foo#

              -```````````````````````````````` - - -Backslash-escaped `#` characters do not count as part -of the closing sequence: - -```````````````````````````````` example -### foo \### -## foo #\## -# foo \# -. -

              foo ###

              -

              foo ###

              -

              foo #

              -```````````````````````````````` - - -ATX headings need not be separated from surrounding content by blank -lines, and they can interrupt paragraphs: - -```````````````````````````````` example -**** -## foo -**** -. -
              -

              foo

              -
              -```````````````````````````````` - - -```````````````````````````````` example -Foo bar -# baz -Bar foo -. -

              Foo bar

              -

              baz

              -

              Bar foo

              -```````````````````````````````` - - -ATX headings can be empty: - -```````````````````````````````` example -## -# -### ### -. -

              -

              -

              -```````````````````````````````` - - -## Setext headings - -A [setext heading](@) consists of one or more -lines of text, each containing at least one [non-whitespace -character], with no more than 3 spaces indentation, followed by -a [setext heading underline]. The lines of text must be such -that, were they not followed by the setext heading underline, -they would be interpreted as a paragraph: they cannot be -interpretable as a [code fence], [ATX heading][ATX headings], -[block quote][block quotes], [thematic break][thematic breaks], -[list item][list items], or [HTML block][HTML blocks]. - -A [setext heading underline](@) is a sequence of -`=` characters or a sequence of `-` characters, with no more than 3 -spaces indentation and any number of trailing spaces. If a line -containing a single `-` can be interpreted as an -empty [list items], it should be interpreted this way -and not as a [setext heading underline]. - -The heading is a level 1 heading if `=` characters are used in -the [setext heading underline], and a level 2 heading if `-` -characters are used. The contents of the heading are the result -of parsing the preceding lines of text as CommonMark inline -content. - -In general, a setext heading need not be preceded or followed by a -blank line. However, it cannot interrupt a paragraph, so when a -setext heading comes after a paragraph, a blank line is needed between -them. - -Simple examples: - -```````````````````````````````` example -Foo *bar* -========= - -Foo *bar* ---------- -. -

              Foo bar

              -

              Foo bar

              -```````````````````````````````` - - -The content of the header may span more than one line: - -```````````````````````````````` example -Foo *bar -baz* -==== -. -

              Foo bar -baz

              -```````````````````````````````` - -The contents are the result of parsing the headings's raw -content as inlines. The heading's raw content is formed by -concatenating the lines and removing initial and final -[whitespace]. - -```````````````````````````````` example - Foo *bar -baz*→ -==== -. -

              Foo bar -baz

              -```````````````````````````````` - - -The underlining can be any length: - -```````````````````````````````` example -Foo -------------------------- - -Foo -= -. -

              Foo

              -

              Foo

              -```````````````````````````````` - - -The heading content can be indented up to three spaces, and need -not line up with the underlining: - -```````````````````````````````` example - Foo ---- - - Foo ------ - - Foo - === -. -

              Foo

              -

              Foo

              -

              Foo

              -```````````````````````````````` - - -Four spaces indent is too much: - -```````````````````````````````` example - Foo - --- - - Foo ---- -. -
              Foo
              ----
              -
              -Foo
              -
              -
              -```````````````````````````````` - - -The setext heading underline can be indented up to three spaces, and -may have trailing spaces: - -```````````````````````````````` example -Foo - ---- -. -

              Foo

              -```````````````````````````````` - - -Four spaces is too much: - -```````````````````````````````` example -Foo - --- -. -

              Foo ----

              -```````````````````````````````` - - -The setext heading underline cannot contain internal spaces: - -```````````````````````````````` example -Foo -= = - -Foo ---- - -. -

              Foo -= =

              -

              Foo

              -
              -```````````````````````````````` - - -Trailing spaces in the content line do not cause a line break: - -```````````````````````````````` example -Foo ------ -. -

              Foo

              -```````````````````````````````` - - -Nor does a backslash at the end: - -```````````````````````````````` example -Foo\ ----- -. -

              Foo\

              -```````````````````````````````` - - -Since indicators of block structure take precedence over -indicators of inline structure, the following are setext headings: - -```````````````````````````````` example -`Foo ----- -` - - -. -

              `Foo

              -

              `

              -

              <a title="a lot

              -

              of dashes"/>

              -```````````````````````````````` - - -The setext heading underline cannot be a [lazy continuation -line] in a list item or block quote: - -```````````````````````````````` example -> Foo ---- -. -
              -

              Foo

              -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> foo -bar -=== -. -
              -

              foo -bar -===

              -
              -```````````````````````````````` - - -```````````````````````````````` example -- Foo ---- -. -
                -
              • Foo
              • -
              -
              -```````````````````````````````` - - -A blank line is needed between a paragraph and a following -setext heading, since otherwise the paragraph becomes part -of the heading's content: - -```````````````````````````````` example -Foo -Bar ---- -. -

              Foo -Bar

              -```````````````````````````````` - - -But in general a blank line is not required before or after -setext headings: - -```````````````````````````````` example ---- -Foo ---- -Bar ---- -Baz -. -
              -

              Foo

              -

              Bar

              -

              Baz

              -```````````````````````````````` - - -Setext headings cannot be empty: - -```````````````````````````````` example - -==== -. -

              ====

              -```````````````````````````````` - - -Setext heading text lines must not be interpretable as block -constructs other than paragraphs. So, the line of dashes -in these examples gets interpreted as a thematic break: - -```````````````````````````````` example ---- ---- -. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -- foo ------ -. -
                -
              • foo
              • -
              -
              -```````````````````````````````` - - -```````````````````````````````` example - foo ---- -. -
              foo
              -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> foo ------ -. -
              -

              foo

              -
              -
              -```````````````````````````````` - - -If you want a heading with `> foo` as its literal text, you can -use backslash escapes: - -```````````````````````````````` example -\> foo ------- -. -

              > foo

              -```````````````````````````````` - - -**Compatibility note:** Most existing Markdown implementations -do not allow the text of setext headings to span multiple lines. -But there is no consensus about how to interpret - -``` markdown -Foo -bar ---- -baz -``` - -One can find four different interpretations: - -1. paragraph "Foo", heading "bar", paragraph "baz" -2. paragraph "Foo bar", thematic break, paragraph "baz" -3. paragraph "Foo bar --- baz" -4. heading "Foo bar", paragraph "baz" - -We find interpretation 4 most natural, and interpretation 4 -increases the expressive power of CommonMark, by allowing -multiline headings. Authors who want interpretation 1 can -put a blank line after the first paragraph: - -```````````````````````````````` example -Foo - -bar ---- -baz -. -

              Foo

              -

              bar

              -

              baz

              -```````````````````````````````` - - -Authors who want interpretation 2 can put blank lines around -the thematic break, - -```````````````````````````````` example -Foo -bar - ---- - -baz -. -

              Foo -bar

              -
              -

              baz

              -```````````````````````````````` - - -or use a thematic break that cannot count as a [setext heading -underline], such as - -```````````````````````````````` example -Foo -bar -* * * -baz -. -

              Foo -bar

              -
              -

              baz

              -```````````````````````````````` - - -Authors who want interpretation 3 can use backslash escapes: - -```````````````````````````````` example -Foo -bar -\--- -baz -. -

              Foo -bar ---- -baz

              -```````````````````````````````` - - -## Indented code blocks - -An [indented code block](@) is composed of one or more -[indented chunks] separated by blank lines. -An [indented chunk](@) is a sequence of non-blank lines, -each indented four or more spaces. The contents of the code block are -the literal contents of the lines, including trailing -[line endings], minus four spaces of indentation. -An indented code block has no [info string]. - -An indented code block cannot interrupt a paragraph, so there must be -a blank line between a paragraph and a following indented code block. -(A blank line is not needed, however, between a code block and a following -paragraph.) - -```````````````````````````````` example - a simple - indented code block -. -
              a simple
              -  indented code block
              -
              -```````````````````````````````` - - -If there is any ambiguity between an interpretation of indentation -as a code block and as indicating that material belongs to a [list -item][list items], the list item interpretation takes precedence: - -```````````````````````````````` example - - foo - - bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. foo - - - bar -. -
                -
              1. -

                foo

                -
                  -
                • bar
                • -
                -
              2. -
              -```````````````````````````````` - - - -The contents of a code block are literal text, and do not get parsed -as Markdown: - -```````````````````````````````` example -
              - *hi* - - - one -. -
              <a/>
              -*hi*
              -
              -- one
              -
              -```````````````````````````````` - - -Here we have three chunks separated by blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 - - - - chunk3 -. -
              chunk1
              -
              -chunk2
              -
              -
              -
              -chunk3
              -
              -```````````````````````````````` - - -Any initial spaces beyond four will be included in the content, even -in interior blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 -. -
              chunk1
              -  
              -  chunk2
              -
              -```````````````````````````````` - - -An indented code block cannot interrupt a paragraph. (This -allows hanging indents and the like.) - -```````````````````````````````` example -Foo - bar - -. -

              Foo -bar

              -```````````````````````````````` - - -However, any non-blank line with fewer than four leading spaces ends -the code block immediately. So a paragraph may occur immediately -after indented code: - -```````````````````````````````` example - foo -bar -. -
              foo
              -
              -

              bar

              -```````````````````````````````` - - -And indented code can occur immediately before and after other kinds of -blocks: - -```````````````````````````````` example -# Heading - foo -Heading ------- - foo ----- -. -

              Heading

              -
              foo
              -
              -

              Heading

              -
              foo
              -
              -
              -```````````````````````````````` - - -The first line can be indented more than four spaces: - -```````````````````````````````` example - foo - bar -. -
                  foo
              -bar
              -
              -```````````````````````````````` - - -Blank lines preceding or following an indented code block -are not included in it: - -```````````````````````````````` example - - - foo - - -. -
              foo
              -
              -```````````````````````````````` - - -Trailing spaces are included in the code block's content: - -```````````````````````````````` example - foo -. -
              foo  
              -
              -```````````````````````````````` - - - -## Fenced code blocks - -A [code fence](@) is a sequence -of at least three consecutive backtick characters (`` ` ``) or -tildes (`~`). (Tildes and backticks cannot be mixed.) -A [fenced code block](@) -begins with a code fence, indented no more than three spaces. - -The line with the opening code fence may optionally contain some text -following the code fence; this is trimmed of leading and trailing -whitespace and called the [info string](@). If the [info string] comes -after a backtick fence, it may not contain any backtick -characters. (The reason for this restriction is that otherwise -some inline code would be incorrectly interpreted as the -beginning of a fenced code block.) - -The content of the code block consists of all subsequent lines, until -a closing [code fence] of the same type as the code block -began with (backticks or tildes), and with at least as many backticks -or tildes as the opening code fence. If the leading code fence is -indented N spaces, then up to N spaces of indentation are removed from -each line of the content (if present). (If a content line is not -indented, it is preserved unchanged. If it is indented less than N -spaces, all of the indentation is removed.) - -The closing code fence may be indented up to three spaces, and may be -followed only by spaces, which are ignored. If the end of the -containing block (or document) is reached and no closing code fence -has been found, the code block contains all of the lines after the -opening code fence until the end of the containing block (or -document). (An alternative spec would require backtracking in the -event that a closing code fence is not found. But this makes parsing -much less efficient, and there seems to be no real down side to the -behavior described here.) - -A fenced code block may interrupt a paragraph, and does not require -a blank line either before or after. - -The content of a code fence is treated as literal text, not parsed -as inlines. The first word of the [info string] is typically used to -specify the language of the code sample, and rendered in the `class` -attribute of the `code` tag. However, this spec does not mandate any -particular treatment of the [info string]. - -Here is a simple example with backticks: - -```````````````````````````````` example -``` -< - > -``` -. -
              <
              - >
              -
              -```````````````````````````````` - - -With tildes: - -```````````````````````````````` example -~~~ -< - > -~~~ -. -
              <
              - >
              -
              -```````````````````````````````` - -Fewer than three backticks is not enough: - -```````````````````````````````` example -`` -foo -`` -. -

              foo

              -```````````````````````````````` - -The closing code fence must use the same character as the opening -fence: - -```````````````````````````````` example -``` -aaa -~~~ -``` -. -
              aaa
              -~~~
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~ -aaa -``` -~~~ -. -
              aaa
              -```
              -
              -```````````````````````````````` - - -The closing code fence must be at least as long as the opening fence: - -```````````````````````````````` example -```` -aaa -``` -`````` -. -
              aaa
              -```
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~~ -aaa -~~~ -~~~~ -. -
              aaa
              -~~~
              -
              -```````````````````````````````` - - -Unclosed code blocks are closed by the end of the document -(or the enclosing [block quote][block quotes] or [list item][list items]): - -```````````````````````````````` example -``` -. -
              -```````````````````````````````` - - -```````````````````````````````` example -````` - -``` -aaa -. -
              
              -```
              -aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> ``` -> aaa - -bbb -. -
              -
              aaa
              -
              -
              -

              bbb

              -```````````````````````````````` - - -A code block can have all empty lines as its content: - -```````````````````````````````` example -``` - - -``` -. -
              
              -  
              -
              -```````````````````````````````` - - -A code block can be empty: - -```````````````````````````````` example -``` -``` -. -
              -```````````````````````````````` - - -Fences can be indented. If the opening fence is indented, -content lines will have equivalent opening indentation removed, -if present: - -```````````````````````````````` example - ``` - aaa -aaa -``` -. -
              aaa
              -aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - aaa -aaa - ``` -. -
              aaa
              -aaa
              -aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example - ``` - aaa - aaa - aaa - ``` -. -
              aaa
              - aaa
              -aaa
              -
              -```````````````````````````````` - - -Four spaces indentation produces an indented code block: - -```````````````````````````````` example - ``` - aaa - ``` -. -
              ```
              -aaa
              -```
              -
              -```````````````````````````````` - - -Closing fences may be indented by 0-3 spaces, and their indentation -need not match that of the opening fence: - -```````````````````````````````` example -``` -aaa - ``` -. -
              aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - ``` -. -
              aaa
              -
              -```````````````````````````````` - - -This is not a closing fence, because it is indented 4 spaces: - -```````````````````````````````` example -``` -aaa - ``` -. -
              aaa
              -    ```
              -
              -```````````````````````````````` - - - -Code fences (opening and closing) cannot contain internal spaces: - -```````````````````````````````` example -``` ``` -aaa -. -

              -aaa

              -```````````````````````````````` - - -```````````````````````````````` example -~~~~~~ -aaa -~~~ ~~ -. -
              aaa
              -~~~ ~~
              -
              -```````````````````````````````` - - -Fenced code blocks can interrupt paragraphs, and can be followed -directly by paragraphs, without a blank line between: - -```````````````````````````````` example -foo -``` -bar -``` -baz -. -

              foo

              -
              bar
              -
              -

              baz

              -```````````````````````````````` - - -Other blocks can also occur before and after fenced code blocks -without an intervening blank line: - -```````````````````````````````` example -foo ---- -~~~ -bar -~~~ -# baz -. -

              foo

              -
              bar
              -
              -

              baz

              -```````````````````````````````` - - -An [info string] can be provided after the opening code fence. -Although this spec doesn't mandate any particular treatment of -the info string, the first word is typically used to specify -the language of the code block. In HTML output, the language is -normally indicated by adding a class to the `code` element consisting -of `language-` followed by the language name. - -```````````````````````````````` example -```ruby -def foo(x) - return 3 -end -``` -. -
              def foo(x)
              -  return 3
              -end
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~~ ruby startline=3 $%@#$ -def foo(x) - return 3 -end -~~~~~~~ -. -
              def foo(x)
              -  return 3
              -end
              -
              -```````````````````````````````` - - -```````````````````````````````` example -````; -```` -. -
              -```````````````````````````````` - - -[Info strings] for backtick code blocks cannot contain backticks: - -```````````````````````````````` example -``` aa ``` -foo -. -

              aa -foo

              -```````````````````````````````` - - -[Info strings] for tilde code blocks can contain backticks and tildes: - -```````````````````````````````` example -~~~ aa ``` ~~~ -foo -~~~ -. -
              foo
              -
              -```````````````````````````````` - - -Closing code fences cannot have [info strings]: - -```````````````````````````````` example -``` -``` aaa -``` -. -
              ``` aaa
              -
              -```````````````````````````````` - - - -## HTML blocks - -An [HTML block](@) is a group of lines that is treated -as raw HTML (and will not be escaped in HTML output). - -There are seven kinds of [HTML block], which can be defined by their -start and end conditions. The block begins with a line that meets a -[start condition](@) (after up to three spaces optional indentation). -It ends with the first subsequent line that meets a matching [end -condition](@), or the last line of the document, or the last line of -the [container block](#container-blocks) containing the current HTML -block, if no line is encountered that meets the [end condition]. If -the first line meets both the [start condition] and the [end -condition], the block will contain just that line. - -1. **Start condition:** line begins with the string ``, or the end of the line.\ -**End condition:** line contains an end tag -``, ``, or `` (case-insensitive; it -need not match the start tag). - -2. **Start condition:** line begins with the string ``. - -3. **Start condition:** line begins with the string ``. - -4. **Start condition:** line begins with the string ``. - -5. **Start condition:** line begins with the string -``. - -6. **Start condition:** line begins the string `<` or ``, or -the string `/>`.\ -**End condition:** line is followed by a [blank line]. - -7. **Start condition:** line begins with a complete [open tag] -(with any [tag name] other than `script`, -`style`, or `pre`) or a complete [closing tag], -followed only by [whitespace] or the end of the line.\ -**End condition:** line is followed by a [blank line]. - -HTML blocks continue until they are closed by their appropriate -[end condition], or the last line of the document or other [container -block](#container-blocks). This means any HTML **within an HTML -block** that might otherwise be recognised as a start condition will -be ignored by the parser and passed through as-is, without changing -the parser's state. - -For instance, `
              ` within a HTML block started by `` will not affect
              -the parser state; as the HTML block was started in by start condition 6, it
              -will end at any blank line. This can be surprising:
              -
              -```````````````````````````````` example
              -
              -
              -**Hello**,
              -
              -_world_.
              -
              -
              -. -
              -
              -**Hello**,
              -

              world. -

              -
              -```````````````````````````````` - -In this case, the HTML block is terminated by the newline — the `**Hello**` -text remains verbatim — and regular parsing resumes, with a paragraph, -emphasised `world` and inline and block HTML following. - -All types of [HTML blocks] except type 7 may interrupt -a paragraph. Blocks of type 7 may not interrupt a paragraph. -(This restriction is intended to prevent unwanted interpretation -of long tags inside a wrapped paragraph as starting HTML blocks.) - -Some simple examples follow. Here are some basic HTML blocks -of type 6: - -```````````````````````````````` example - - - - -
              - hi -
              - -okay. -. - - - - -
              - hi -
              -

              okay.

              -```````````````````````````````` - - -```````````````````````````````` example -
              -*foo* -```````````````````````````````` - - -Here we have two HTML blocks with a Markdown paragraph between them: - -```````````````````````````````` example -
              - -*Markdown* - -
              -. -
              -

              Markdown

              -
              -```````````````````````````````` - - -The tag on the first line can be partial, as long -as it is split where there would be whitespace: - -```````````````````````````````` example -
              -
              -. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -
              -
              -. -
              -
              -```````````````````````````````` - - -An open tag need not be closed: -```````````````````````````````` example -
              -*foo* - -*bar* -. -
              -*foo* -

              bar

              -```````````````````````````````` - - - -A partial tag need not even be completed (garbage -in, garbage out): - -```````````````````````````````` example -
              -. - -```````````````````````````````` - - -```````````````````````````````` example -
              -foo -
              -. -
              -foo -
              -```````````````````````````````` - - -Everything until the next blank line or end of document -gets included in the HTML block. So, in the following -example, what looks like a Markdown code block -is actually part of the HTML block, which continues until a blank -line or the end of the document is reached: - -```````````````````````````````` example -
              -``` c -int x = 33; -``` -. -
              -``` c -int x = 33; -``` -```````````````````````````````` - - -To start an [HTML block] with a tag that is *not* in the -list of block-level tags in (6), you must put the tag by -itself on the first line (and it must be complete): - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -In type 7 blocks, the [tag name] can be anything: - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -```````````````````````````````` example - -*bar* -. - -*bar* -```````````````````````````````` - - -These rules are designed to allow us to work with tags that -can function as either block-level or inline-level tags. -The `` tag is a nice example. We can surround content with -`` tags in three different ways. In this case, we get a raw -HTML block, because the `` tag is on a line by itself: - -```````````````````````````````` example - -*foo* - -. - -*foo* - -```````````````````````````````` - - -In this case, we get a raw HTML block that just includes -the `` tag (because it ends with the following blank -line). So the contents get interpreted as CommonMark: - -```````````````````````````````` example - - -*foo* - - -. - -

              foo

              -
              -```````````````````````````````` - - -Finally, in this case, the `` tags are interpreted -as [raw HTML] *inside* the CommonMark paragraph. (Because -the tag is not on a line by itself, we get inline HTML -rather than an [HTML block].) - -```````````````````````````````` example -*foo* -. -

              foo

              -```````````````````````````````` - - -HTML tags designed to contain literal content -(`script`, `style`, `pre`), comments, processing instructions, -and declarations are treated somewhat differently. -Instead of ending at the first blank line, these blocks -end at the first line containing a corresponding end tag. -As a result, these blocks can contain blank lines: - -A pre tag (type 1): - -```````````````````````````````` example -
              
              -import Text.HTML.TagSoup
              -
              -main :: IO ()
              -main = print $ parseTags tags
              -
              -okay -. -
              
              -import Text.HTML.TagSoup
              -
              -main :: IO ()
              -main = print $ parseTags tags
              -
              -

              okay

              -```````````````````````````````` - - -A script tag (type 1): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - -A style tag (type 1): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - -If there is no matching end tag, the block will end at the -end of the document (or the enclosing [block quote][block quotes] -or [list item][list items]): - -```````````````````````````````` example - -*foo* -. - -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -*bar* -*baz* -. -*bar* -

              baz

              -```````````````````````````````` - - -Note that anything on the last line after the -end tag will be included in the [HTML block]: - -```````````````````````````````` example -1. *bar* -. -1. *bar* -```````````````````````````````` - - -A comment (type 2): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - - -A processing instruction (type 3): - -```````````````````````````````` example -'; - -?> -okay -. -'; - -?> -

              okay

              -```````````````````````````````` - - -A declaration (type 4): - -```````````````````````````````` example - -. - -```````````````````````````````` - - -CDATA (type 5): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - -The opening tag can be indented 1-3 spaces, but not 4: - -```````````````````````````````` example - - - -. - -
              <!-- foo -->
              -
              -```````````````````````````````` - - -```````````````````````````````` example -
              - -
              -. -
              -
              <div>
              -
              -```````````````````````````````` - - -An HTML block of types 1--6 can interrupt a paragraph, and need not be -preceded by a blank line. - -```````````````````````````````` example -Foo -
              -bar -
              -. -

              Foo

              -
              -bar -
              -```````````````````````````````` - - -However, a following blank line is needed, except at the end of -a document, and except for blocks of types 1--5, [above][HTML -block]: - -```````````````````````````````` example -
              -bar -
              -*foo* -. -
              -bar -
              -*foo* -```````````````````````````````` - - -HTML blocks of type 7 cannot interrupt a paragraph: - -```````````````````````````````` example -Foo - -baz -. -

              Foo - -baz

              -```````````````````````````````` - - -This rule differs from John Gruber's original Markdown syntax -specification, which says: - -> The only restrictions are that block-level HTML elements — -> e.g. `
              `, ``, `
              `, `

              `, etc. — must be separated from -> surrounding content by blank lines, and the start and end tags of the -> block should not be indented with tabs or spaces. - -In some ways Gruber's rule is more restrictive than the one given -here: - -- It requires that an HTML block be preceded by a blank line. -- It does not allow the start tag to be indented. -- It requires a matching end tag, which it also does not allow to - be indented. - -Most Markdown implementations (including some of Gruber's own) do not -respect all of these restrictions. - -There is one respect, however, in which Gruber's rule is more liberal -than the one given here, since it allows blank lines to occur inside -an HTML block. There are two reasons for disallowing them here. -First, it removes the need to parse balanced tags, which is -expensive and can require backtracking from the end of the document -if no matching end tag is found. Second, it provides a very simple -and flexible way of including Markdown content inside HTML tags: -simply separate the Markdown from the HTML using blank lines: - -Compare: - -```````````````````````````````` example -

              - -*Emphasized* text. - -
              -. -
              -

              Emphasized text.

              -
              -```````````````````````````````` - - -```````````````````````````````` example -
              -*Emphasized* text. -
              -. -
              -*Emphasized* text. -
              -```````````````````````````````` - - -Some Markdown implementations have adopted a convention of -interpreting content inside tags as text if the open tag has -the attribute `markdown=1`. The rule given above seems a simpler and -more elegant way of achieving the same expressive power, which is also -much simpler to parse. - -The main potential drawback is that one can no longer paste HTML -blocks into Markdown documents with 100% reliability. However, -*in most cases* this will work fine, because the blank lines in -HTML are usually followed by HTML block tags. For example: - -```````````````````````````````` example -
              - - - - - - - -
              -Hi -
              -. - - - - -
              -Hi -
              -```````````````````````````````` - - -There are problems, however, if the inner tags are indented -*and* separated by spaces, as then they will be interpreted as -an indented code block: - -```````````````````````````````` example - - - - - - - - -
              - Hi -
              -. - - -
              <td>
              -  Hi
              -</td>
              -
              - -
              -```````````````````````````````` - - -Fortunately, blank lines are usually not necessary and can be -deleted. The exception is inside `
              ` tags, but as described
              -[above][HTML blocks], raw HTML blocks starting with `
              `
              -*can* contain blank lines.
              -
              -## Link reference definitions
              -
              -A [link reference definition](@)
              -consists of a [link label], indented up to three spaces, followed
              -by a colon (`:`), optional [whitespace] (including up to one
              -[line ending]), a [link destination],
              -optional [whitespace] (including up to one
              -[line ending]), and an optional [link
              -title], which if it is present must be separated
              -from the [link destination] by [whitespace].
              -No further [non-whitespace characters] may occur on the line.
              -
              -A [link reference definition]
              -does not correspond to a structural element of a document.  Instead, it
              -defines a label which can be used in [reference links]
              -and reference-style [images] elsewhere in the document.  [Link
              -reference definitions] can come either before or after the links that use
              -them.
              -
              -```````````````````````````````` example
              -[foo]: /url "title"
              -
              -[foo]
              -.
              -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example - [foo]: - /url - 'the title' - -[foo] -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[Foo*bar\]]:my_(url) 'title (with parens)' - -[Foo*bar\]] -. -

              Foo*bar]

              -```````````````````````````````` - - -```````````````````````````````` example -[Foo bar]: - -'title' - -[Foo bar] -. -

              Foo bar

              -```````````````````````````````` - - -The title may extend over multiple lines: - -```````````````````````````````` example -[foo]: /url ' -title -line1 -line2 -' - -[foo] -. -

              foo

              -```````````````````````````````` - - -However, it may not contain a [blank line]: - -```````````````````````````````` example -[foo]: /url 'title - -with blank line' - -[foo] -. -

              [foo]: /url 'title

              -

              with blank line'

              -

              [foo]

              -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[foo]: -/url - -[foo] -. -

              foo

              -```````````````````````````````` - - -The link destination may not be omitted: - -```````````````````````````````` example -[foo]: - -[foo] -. -

              [foo]:

              -

              [foo]

              -```````````````````````````````` - - However, an empty link destination may be specified using - angle brackets: - -```````````````````````````````` example -[foo]: <> - -[foo] -. -

              foo

              -```````````````````````````````` - -The title must be separated from the link destination by -whitespace: - -```````````````````````````````` example -[foo]: (baz) - -[foo] -. -

              [foo]: (baz)

              -

              [foo]

              -```````````````````````````````` - - -Both title and destination can contain backslash escapes -and literal backslashes: - -```````````````````````````````` example -[foo]: /url\bar\*baz "foo\"bar\baz" - -[foo] -. -

              foo

              -```````````````````````````````` - - -A link can come before its corresponding definition: - -```````````````````````````````` example -[foo] - -[foo]: url -. -

              foo

              -```````````````````````````````` - - -If there are several matching definitions, the first one takes -precedence: - -```````````````````````````````` example -[foo] - -[foo]: first -[foo]: second -. -

              foo

              -```````````````````````````````` - - -As noted in the section on [Links], matching of labels is -case-insensitive (see [matches]). - -```````````````````````````````` example -[FOO]: /url - -[Foo] -. -

              Foo

              -```````````````````````````````` - - -```````````````````````````````` example -[ΑΓΩ]: /φου - -[αγω] -. -

              αγω

              -```````````````````````````````` - - -Here is a link reference definition with no corresponding link. -It contributes nothing to the document. - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -Here is another one: - -```````````````````````````````` example -[ -foo -]: /url -bar -. -

              bar

              -```````````````````````````````` - - -This is not a link reference definition, because there are -[non-whitespace characters] after the title: - -```````````````````````````````` example -[foo]: /url "title" ok -. -

              [foo]: /url "title" ok

              -```````````````````````````````` - - -This is a link reference definition, but it has no title: - -```````````````````````````````` example -[foo]: /url -"title" ok -. -

              "title" ok

              -```````````````````````````````` - - -This is not a link reference definition, because it is indented -four spaces: - -```````````````````````````````` example - [foo]: /url "title" - -[foo] -. -
              [foo]: /url "title"
              -
              -

              [foo]

              -```````````````````````````````` - - -This is not a link reference definition, because it occurs inside -a code block: - -```````````````````````````````` example -``` -[foo]: /url -``` - -[foo] -. -
              [foo]: /url
              -
              -

              [foo]

              -```````````````````````````````` - - -A [link reference definition] cannot interrupt a paragraph. - -```````````````````````````````` example -Foo -[bar]: /baz - -[bar] -. -

              Foo -[bar]: /baz

              -

              [bar]

              -```````````````````````````````` - - -However, it can directly follow other block elements, such as headings -and thematic breaks, and it need not be followed by a blank line. - -```````````````````````````````` example -# [Foo] -[foo]: /url -> bar -. -

              Foo

              -
              -

              bar

              -
              -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -bar -=== -[foo] -. -

              bar

              -

              foo

              -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -=== -[foo] -. -

              === -foo

              -```````````````````````````````` - - -Several [link reference definitions] -can occur one after another, without intervening blank lines. - -```````````````````````````````` example -[foo]: /foo-url "foo" -[bar]: /bar-url - "bar" -[baz]: /baz-url - -[foo], -[bar], -[baz] -. -

              foo, -bar, -baz

              -```````````````````````````````` - - -[Link reference definitions] can occur -inside block containers, like lists and block quotations. They -affect the entire document, not just the container in which they -are defined: - -```````````````````````````````` example -[foo] - -> [foo]: /url -. -

              foo

              -
              -
              -```````````````````````````````` - - -Whether something is a [link reference definition] is -independent of whether the link reference it defines is -used in the document. Thus, for example, the following -document contains just a link reference definition, and -no visible content: - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -## Paragraphs - -A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a [paragraph](@). -The contents of the paragraph are the result of parsing the -paragraph's raw content as inlines. The paragraph's raw content -is formed by concatenating the lines and removing initial and final -[whitespace]. - -A simple example with two paragraphs: - -```````````````````````````````` example -aaa - -bbb -. -

              aaa

              -

              bbb

              -```````````````````````````````` - - -Paragraphs can contain multiple lines, but no blank lines: - -```````````````````````````````` example -aaa -bbb - -ccc -ddd -. -

              aaa -bbb

              -

              ccc -ddd

              -```````````````````````````````` - - -Multiple blank lines between paragraph have no effect: - -```````````````````````````````` example -aaa - - -bbb -. -

              aaa

              -

              bbb

              -```````````````````````````````` - - -Leading spaces are skipped: - -```````````````````````````````` example - aaa - bbb -. -

              aaa -bbb

              -```````````````````````````````` - - -Lines after the first may be indented any amount, since indented -code blocks cannot interrupt paragraphs. - -```````````````````````````````` example -aaa - bbb - ccc -. -

              aaa -bbb -ccc

              -```````````````````````````````` - - -However, the first line may be indented at most three spaces, -or an indented code block will be triggered: - -```````````````````````````````` example - aaa -bbb -. -

              aaa -bbb

              -```````````````````````````````` - - -```````````````````````````````` example - aaa -bbb -. -
              aaa
              -
              -

              bbb

              -```````````````````````````````` - - -Final spaces are stripped before inline parsing, so a paragraph -that ends with two or more spaces will not end with a [hard line -break]: - -```````````````````````````````` example -aaa -bbb -. -

              aaa
              -bbb

              -```````````````````````````````` - - -## Blank lines - -[Blank lines] between block-level elements are ignored, -except for the role they play in determining whether a [list] -is [tight] or [loose]. - -Blank lines at the beginning and end of the document are also ignored. - -```````````````````````````````` example - - -aaa - - -# aaa - - -. -

              aaa

              -

              aaa

              -```````````````````````````````` - - - -# Container blocks - -A [container block](#container-blocks) is a block that has other -blocks as its contents. There are two basic kinds of container blocks: -[block quotes] and [list items]. -[Lists] are meta-containers for [list items]. - -We define the syntax for container blocks recursively. The general -form of the definition is: - -> If X is a sequence of blocks, then the result of -> transforming X in such-and-such a way is a container of type Y -> with these blocks as its content. - -So, we explain what counts as a block quote or list item by explaining -how these can be *generated* from their contents. This should suffice -to define the syntax, although it does not give a recipe for *parsing* -these constructions. (A recipe is provided below in the section entitled -[A parsing strategy](#appendix-a-parsing-strategy).) - -## Block quotes - -A [block quote marker](@) -consists of 0-3 spaces of initial indent, plus (a) the character `>` together -with a following space, or (b) a single character `>` not followed by a space. - -The following rules define [block quotes]: - -1. **Basic case.** If a string of lines *Ls* constitute a sequence - of blocks *Bs*, then the result of prepending a [block quote - marker] to the beginning of each line in *Ls* - is a [block quote](#block-quotes) containing *Bs*. - -2. **Laziness.** If a string of lines *Ls* constitute a [block - quote](#block-quotes) with contents *Bs*, then the result of deleting - the initial [block quote marker] from one or - more lines in which the next [non-whitespace character] after the [block - quote marker] is [paragraph continuation - text] is a block quote with *Bs* as its content. - [Paragraph continuation text](@) is text - that will be parsed as part of the content of a paragraph, but does - not occur at the beginning of the paragraph. - -3. **Consecutiveness.** A document cannot contain two [block - quotes] in a row unless there is a [blank line] between them. - -Nothing else counts as a [block quote](#block-quotes). - -Here is a simple example: - -```````````````````````````````` example -> # Foo -> bar -> baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -The spaces after the `>` characters can be omitted: - -```````````````````````````````` example -># Foo ->bar -> baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -The `>` characters can be indented 1-3 spaces: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -Four spaces gives us a code block: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -
              > # Foo
              -> bar
              -> baz
              -
              -```````````````````````````````` - - -The Laziness clause allows us to omit the `>` before -[paragraph continuation text]: - -```````````````````````````````` example -> # Foo -> bar -baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -A block quote can contain some lazy and some non-lazy -continuation lines: - -```````````````````````````````` example -> bar -baz -> foo -. -
              -

              bar -baz -foo

              -
              -```````````````````````````````` - - -Laziness only applies to lines that would have been continuations of -paragraphs had they been prepended with [block quote markers]. -For example, the `> ` cannot be omitted in the second line of - -``` markdown -> foo -> --- -``` - -without changing the meaning: - -```````````````````````````````` example -> foo ---- -. -
              -

              foo

              -
              -
              -```````````````````````````````` - - -Similarly, if we omit the `> ` in the second line of - -``` markdown -> - foo -> - bar -``` - -then the block quote ends after the first line: - -```````````````````````````````` example -> - foo -- bar -. -
              -
                -
              • foo
              • -
              -
              -
                -
              • bar
              • -
              -```````````````````````````````` - - -For the same reason, we can't omit the `> ` in front of -subsequent lines of an indented or fenced code block: - -```````````````````````````````` example -> foo - bar -. -
              -
              foo
              -
              -
              -
              bar
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> ``` -foo -``` -. -
              -
              -
              -

              foo

              -
              -```````````````````````````````` - - -Note that in the following case, we have a [lazy -continuation line]: - -```````````````````````````````` example -> foo - - bar -. -
              -

              foo -- bar

              -
              -```````````````````````````````` - - -To see why, note that in - -```markdown -> foo -> - bar -``` - -the `- bar` is indented too far to start a list, and can't -be an indented code block because indented code blocks cannot -interrupt paragraphs, so it is [paragraph continuation text]. - -A block quote can be empty: - -```````````````````````````````` example -> -. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> -> -> -. -
              -
              -```````````````````````````````` - - -A block quote can have initial or final blank lines: - -```````````````````````````````` example -> -> foo -> -. -
              -

              foo

              -
              -```````````````````````````````` - - -A blank line always separates block quotes: - -```````````````````````````````` example -> foo - -> bar -. -
              -

              foo

              -
              -
              -

              bar

              -
              -```````````````````````````````` - - -(Most current Markdown implementations, including John Gruber's -original `Markdown.pl`, will parse this example as a single block quote -with two paragraphs. But it seems better to allow the author to decide -whether two block quotes or one are wanted.) - -Consecutiveness means that if we put these block quotes together, -we get a single block quote: - -```````````````````````````````` example -> foo -> bar -. -
              -

              foo -bar

              -
              -```````````````````````````````` - - -To get a block quote with two paragraphs, use: - -```````````````````````````````` example -> foo -> -> bar -. -
              -

              foo

              -

              bar

              -
              -```````````````````````````````` - - -Block quotes can interrupt paragraphs: - -```````````````````````````````` example -foo -> bar -. -

              foo

              -
              -

              bar

              -
              -```````````````````````````````` - - -In general, blank lines are not needed before or after block -quotes: - -```````````````````````````````` example -> aaa -*** -> bbb -. -
              -

              aaa

              -
              -
              -
              -

              bbb

              -
              -```````````````````````````````` - - -However, because of laziness, a blank line is needed between -a block quote and a following paragraph: - -```````````````````````````````` example -> bar -baz -. -
              -

              bar -baz

              -
              -```````````````````````````````` - - -```````````````````````````````` example -> bar - -baz -. -
              -

              bar

              -
              -

              baz

              -```````````````````````````````` - - -```````````````````````````````` example -> bar -> -baz -. -
              -

              bar

              -
              -

              baz

              -```````````````````````````````` - - -It is a consequence of the Laziness rule that any number -of initial `>`s may be omitted on a continuation line of a -nested block quote: - -```````````````````````````````` example -> > > foo -bar -. -
              -
              -
              -

              foo -bar

              -
              -
              -
              -```````````````````````````````` - - -```````````````````````````````` example ->>> foo -> bar ->>baz -. -
              -
              -
              -

              foo -bar -baz

              -
              -
              -
              -```````````````````````````````` - - -When including an indented code block in a block quote, -remember that the [block quote marker] includes -both the `>` and a following space. So *five spaces* are needed after -the `>`: - -```````````````````````````````` example -> code - -> not code -. -
              -
              code
              -
              -
              -
              -

              not code

              -
              -```````````````````````````````` - - - -## List items - -A [list marker](@) is a -[bullet list marker] or an [ordered list marker]. - -A [bullet list marker](@) -is a `-`, `+`, or `*` character. - -An [ordered list marker](@) -is a sequence of 1--9 arabic digits (`0-9`), followed by either a -`.` character or a `)` character. (The reason for the length -limit is that with 10 digits we start seeing integer overflows -in some browsers.) - -The following rules define [list items]: - -1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of - blocks *Bs* starting with a [non-whitespace character], and *M* is a - list marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces, then the result - of prepending *M* and the following spaces to the first line of - *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a - list item with *Bs* as its contents. The type of the list item - (bullet or ordered) is determined by the type of its list marker. - If the list item is ordered, then it is also assigned a start - number, based on the ordered list marker. - - Exceptions: - - 1. When the first list item in a [list] interrupts - a paragraph---that is, when it starts on a line that would - otherwise count as [paragraph continuation text]---then (a) - the lines *Ls* must not begin with a blank line, and (b) if - the list item is ordered, the start number must be 1. - 2. If any line is a [thematic break][thematic breaks] then - that line is not a list item. - -For example, let *Ls* be the lines - -```````````````````````````````` example -A paragraph -with two lines. - - indented code - -> A block quote. -. -

              A paragraph -with two lines.

              -
              indented code
              -
              -
              -

              A block quote.

              -
              -```````````````````````````````` - - -And let *M* be the marker `1.`, and *N* = 2. Then rule #1 says -that the following is an ordered list item with start number 1, -and the same contents as *Ls*: - -```````````````````````````````` example -1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -The most important thing to notice is that the position of -the text after the list marker determines how much indentation -is needed in subsequent blocks in the list item. If the list -marker takes up two spaces, and there are three spaces between -the list marker and the next [non-whitespace character], then blocks -must be indented five spaces in order to fall under the list -item. - -Here are some examples showing how far content must be indented to be -put under the list item: - -```````````````````````````````` example -- one - - two -. -
                -
              • one
              • -
              -

              two

              -```````````````````````````````` - - -```````````````````````````````` example -- one - - two -. -
                -
              • -

                one

                -

                two

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -
                -
              • one
              • -
              -
               two
              -
              -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -
                -
              • -

                one

                -

                two

                -
              • -
              -```````````````````````````````` - - -It is tempting to think of this in terms of columns: the continuation -blocks must be indented at least to the column of the first -[non-whitespace character] after the list marker. However, that is not quite right. -The spaces after the list marker determine how much relative indentation -is needed. Which column this indentation reaches will depend on -how the list item is embedded in other constructions, as shown by -this example: - -```````````````````````````````` example - > > 1. one ->> ->> two -. -
              -
              -
                -
              1. -

                one

                -

                two

                -
              2. -
              -
              -
              -```````````````````````````````` - - -Here `two` occurs in the same column as the list marker `1.`, -but is actually contained in the list item, because there is -sufficient indentation after the last containing blockquote marker. - -The converse is also possible. In the following example, the word `two` -occurs far to the right of the initial text of the list item, `one`, but -it is not considered part of the list item, because it is not indented -far enough past the blockquote marker: - -```````````````````````````````` example ->>- one ->> - > > two -. -
              -
              -
                -
              • one
              • -
              -

              two

              -
              -
              -```````````````````````````````` - - -Note that at least one space is needed between the list marker and -any following content, so these are not list items: - -```````````````````````````````` example --one - -2.two -. -

              -one

              -

              2.two

              -```````````````````````````````` - - -A list item may contain blocks that are separated by more than -one blank line. - -```````````````````````````````` example -- foo - - - bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - - -A list item may contain any kind of block: - -```````````````````````````````` example -1. foo - - ``` - bar - ``` - - baz - - > bam -. -
                -
              1. -

                foo

                -
                bar
                -
                -

                baz

                -
                -

                bam

                -
                -
              2. -
              -```````````````````````````````` - - -A list item that contains an indented code block will preserve -empty lines within the code block verbatim. - -```````````````````````````````` example -- Foo - - bar - - - baz -. -
                -
              • -

                Foo

                -
                bar
                -
                -
                -baz
                -
                -
              • -
              -```````````````````````````````` - -Note that ordered list start numbers must be nine digits or less: - -```````````````````````````````` example -123456789. ok -. -
                -
              1. ok
              2. -
              -```````````````````````````````` - - -```````````````````````````````` example -1234567890. not ok -. -

              1234567890. not ok

              -```````````````````````````````` - - -A start number may begin with 0s: - -```````````````````````````````` example -0. ok -. -
                -
              1. ok
              2. -
              -```````````````````````````````` - - -```````````````````````````````` example -003. ok -. -
                -
              1. ok
              2. -
              -```````````````````````````````` - - -A start number may not be negative: - -```````````````````````````````` example --1. not ok -. -

              -1. not ok

              -```````````````````````````````` - - - -2. **Item starting with indented code.** If a sequence of lines *Ls* - constitute a sequence of blocks *Bs* starting with an indented code - block, and *M* is a list marker of width *W* followed by - one space, then the result of prepending *M* and the following - space to the first line of *Ls*, and indenting subsequent lines of - *Ls* by *W + 1* spaces, is a list item with *Bs* as its contents. - If a line is empty, then it need not be indented. The type of the - list item (bullet or ordered) is determined by the type of its list - marker. If the list item is ordered, then it is also assigned a - start number, based on the ordered list marker. - -An indented code block will have to be indented four spaces beyond -the edge of the region where text will be included in the list item. -In the following case that is 6 spaces: - -```````````````````````````````` example -- foo - - bar -. -
                -
              • -

                foo

                -
                bar
                -
                -
              • -
              -```````````````````````````````` - - -And in this case it is 11 spaces: - -```````````````````````````````` example - 10. foo - - bar -. -
                -
              1. -

                foo

                -
                bar
                -
                -
              2. -
              -```````````````````````````````` - - -If the *first* block in the list item is an indented code block, -then by rule #2, the contents must be indented *one* space after the -list marker: - -```````````````````````````````` example - indented code - -paragraph - - more code -. -
              indented code
              -
              -

              paragraph

              -
              more code
              -
              -```````````````````````````````` - - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -
                -
              1. -
                indented code
                -
                -

                paragraph

                -
                more code
                -
                -
              2. -
              -```````````````````````````````` - - -Note that an additional space indent is interpreted as space -inside the code block: - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -
                -
              1. -
                 indented code
                -
                -

                paragraph

                -
                more code
                -
                -
              2. -
              -```````````````````````````````` - - -Note that rules #1 and #2 only apply to two cases: (a) cases -in which the lines to be included in a list item begin with a -[non-whitespace character], and (b) cases in which -they begin with an indented code -block. In a case like the following, where the first block begins with -a three-space indent, the rules do not allow us to form a list item by -indenting the whole thing and prepending a list marker: - -```````````````````````````````` example - foo - -bar -. -

              foo

              -

              bar

              -```````````````````````````````` - - -```````````````````````````````` example -- foo - - bar -. -
                -
              • foo
              • -
              -

              bar

              -```````````````````````````````` - - -This is not a significant restriction, because when a block begins -with 1-3 spaces indent, the indentation can always be removed without -a change in interpretation, allowing rule #1 to be applied. So, in -the above case: - -```````````````````````````````` example -- foo - - bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - - -3. **Item starting with a blank line.** If a sequence of lines *Ls* - starting with a single [blank line] constitute a (possibly empty) - sequence of blocks *Bs*, not separated from each other by more than - one blank line, and *M* is a list marker of width *W*, - then the result of prepending *M* to the first line of *Ls*, and - indenting subsequent lines of *Ls* by *W + 1* spaces, is a list - item with *Bs* as its contents. - If a line is empty, then it need not be indented. The type of the - list item (bullet or ordered) is determined by the type of its list - marker. If the list item is ordered, then it is also assigned a - start number, based on the ordered list marker. - -Here are some list items that start with a blank line but are not empty: - -```````````````````````````````` example -- - foo -- - ``` - bar - ``` -- - baz -. -
                -
              • foo
              • -
              • -
                bar
                -
                -
              • -
              • -
                baz
                -
                -
              • -
              -```````````````````````````````` - -When the list item starts with a blank line, the number of spaces -following the list marker doesn't change the required indentation: - -```````````````````````````````` example -- - foo -. -
                -
              • foo
              • -
              -```````````````````````````````` - - -A list item can begin with at most one blank line. -In the following example, `foo` is not part of the list -item: - -```````````````````````````````` example -- - - foo -. -
                -
              • -
              -

              foo

              -```````````````````````````````` - - -Here is an empty bullet list item: - -```````````````````````````````` example -- foo -- -- bar -. -
                -
              • foo
              • -
              • -
              • bar
              • -
              -```````````````````````````````` - - -It does not matter whether there are spaces following the [list marker]: - -```````````````````````````````` example -- foo -- -- bar -. -
                -
              • foo
              • -
              • -
              • bar
              • -
              -```````````````````````````````` - - -Here is an empty ordered list item: - -```````````````````````````````` example -1. foo -2. -3. bar -. -
                -
              1. foo
              2. -
              3. -
              4. bar
              5. -
              -```````````````````````````````` - - -A list may start or end with an empty list item: - -```````````````````````````````` example -* -. -
                -
              • -
              -```````````````````````````````` - -However, an empty list item cannot interrupt a paragraph: - -```````````````````````````````` example -foo -* - -foo -1. -. -

              foo -*

              -

              foo -1.

              -```````````````````````````````` - - -4. **Indentation.** If a sequence of lines *Ls* constitutes a list item - according to rule #1, #2, or #3, then the result of indenting each line - of *Ls* by 1-3 spaces (the same for each line) also constitutes a - list item with the same contents and attributes. If a line is - empty, then it need not be indented. - -Indented one space: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Indented two spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Indented three spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Four spaces indent gives a code block: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
              1.  A paragraph
              -    with two lines.
              -
              -        indented code
              -
              -    > A block quote.
              -
              -```````````````````````````````` - - - -5. **Laziness.** If a string of lines *Ls* constitute a [list - item](#list-items) with contents *Bs*, then the result of deleting - some or all of the indentation from one or more lines in which the - next [non-whitespace character] after the indentation is - [paragraph continuation text] is a - list item with the same contents and attributes. The unindented - lines are called - [lazy continuation line](@)s. - -Here is an example with [lazy continuation lines]: - -```````````````````````````````` example - 1. A paragraph -with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Indentation can be partially deleted: - -```````````````````````````````` example - 1. A paragraph - with two lines. -. -
                -
              1. A paragraph -with two lines.
              2. -
              -```````````````````````````````` - - -These examples show how laziness can work in nested structures: - -```````````````````````````````` example -> 1. > Blockquote -continued here. -. -
              -
                -
              1. -
                -

                Blockquote -continued here.

                -
                -
              2. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> 1. > Blockquote -> continued here. -. -
              -
                -
              1. -
                -

                Blockquote -continued here.

                -
                -
              2. -
              -
              -```````````````````````````````` - - - -6. **That's all.** Nothing that is not counted as a list item by rules - #1--5 counts as a [list item](#list-items). - -The rules for sublists follow from the general rules -[above][List items]. A sublist must be indented the same number -of spaces a paragraph would need to be in order to be included -in the list item. - -So, in this case we need two spaces indent: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -
                -
              • foo -
                  -
                • bar -
                    -
                  • baz -
                      -
                    • boo
                    • -
                    -
                  • -
                  -
                • -
                -
              • -
              -```````````````````````````````` - - -One is not enough: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -
                -
              • foo
              • -
              • bar
              • -
              • baz
              • -
              • boo
              • -
              -```````````````````````````````` - - -Here we need four, because the list marker is wider: - -```````````````````````````````` example -10) foo - - bar -. -
                -
              1. foo -
                  -
                • bar
                • -
                -
              2. -
              -```````````````````````````````` - - -Three is not enough: - -```````````````````````````````` example -10) foo - - bar -. -
                -
              1. foo
              2. -
              -
                -
              • bar
              • -
              -```````````````````````````````` - - -A list may be the first block in a list item: - -```````````````````````````````` example -- - foo -. -
                -
              • -
                  -
                • foo
                • -
                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. - 2. foo -. -
                -
              1. -
                  -
                • -
                    -
                  1. foo
                  2. -
                  -
                • -
                -
              2. -
              -```````````````````````````````` - - -A list item can contain a heading: - -```````````````````````````````` example -- # Foo -- Bar - --- - baz -. -
                -
              • -

                Foo

                -
              • -
              • -

                Bar

                -baz
              • -
              -```````````````````````````````` - - -### Motivation - -John Gruber's Markdown spec says the following about list items: - -1. "List markers typically start at the left margin, but may be indented - by up to three spaces. List markers must be followed by one or more - spaces or a tab." - -2. "To make lists look nice, you can wrap items with hanging indents.... - But if you don't want to, you don't have to." - -3. "List items may consist of multiple paragraphs. Each subsequent - paragraph in a list item must be indented by either 4 spaces or one - tab." - -4. "It looks nice if you indent every line of the subsequent paragraphs, - but here again, Markdown will allow you to be lazy." - -5. "To put a blockquote within a list item, the blockquote's `>` - delimiters need to be indented." - -6. "To put a code block within a list item, the code block needs to be - indented twice — 8 spaces or two tabs." - -These rules specify that a paragraph under a list item must be indented -four spaces (presumably, from the left margin, rather than the start of -the list marker, but this is not said), and that code under a list item -must be indented eight spaces instead of the usual four. They also say -that a block quote must be indented, but not by how much; however, the -example given has four spaces indentation. Although nothing is said -about other kinds of block-level content, it is certainly reasonable to -infer that *all* block elements under a list item, including other -lists, must be indented four spaces. This principle has been called the -*four-space rule*. - -The four-space rule is clear and principled, and if the reference -implementation `Markdown.pl` had followed it, it probably would have -become the standard. However, `Markdown.pl` allowed paragraphs and -sublists to start with only two spaces indentation, at least on the -outer level. Worse, its behavior was inconsistent: a sublist of an -outer-level list needed two spaces indentation, but a sublist of this -sublist needed three spaces. It is not surprising, then, that different -implementations of Markdown have developed very different rules for -determining what comes under a list item. (Pandoc and python-Markdown, -for example, stuck with Gruber's syntax description and the four-space -rule, while discount, redcarpet, marked, PHP Markdown, and others -followed `Markdown.pl`'s behavior more closely.) - -Unfortunately, given the divergences between implementations, there -is no way to give a spec for list items that will be guaranteed not -to break any existing documents. However, the spec given here should -correctly handle lists formatted with either the four-space rule or -the more forgiving `Markdown.pl` behavior, provided they are laid out -in a way that is natural for a human to read. - -The strategy here is to let the width and indentation of the list marker -determine the indentation necessary for blocks to fall under the list -item, rather than having a fixed and arbitrary number. The writer can -think of the body of the list item as a unit which gets indented to the -right enough to fit the list marker (and any indentation on the list -marker). (The laziness rule, #5, then allows continuation lines to be -unindented if needed.) - -This rule is superior, we claim, to any rule requiring a fixed level of -indentation from the margin. The four-space rule is clear but -unnatural. It is quite unintuitive that - -``` markdown -- foo - - bar - - - baz -``` - -should be parsed as two lists with an intervening paragraph, - -``` html -
                -
              • foo
              • -
              -

              bar

              -
                -
              • baz
              • -
              -``` - -as the four-space rule demands, rather than a single list, - -``` html -
                -
              • -

                foo

                -

                bar

                -
                  -
                • baz
                • -
                -
              • -
              -``` - -The choice of four spaces is arbitrary. It can be learned, but it is -not likely to be guessed, and it trips up beginners regularly. - -Would it help to adopt a two-space rule? The problem is that such -a rule, together with the rule allowing 1--3 spaces indentation of the -initial list marker, allows text that is indented *less than* the -original list marker to be included in the list item. For example, -`Markdown.pl` parses - -``` markdown - - one - - two -``` - -as a single list item, with `two` a continuation paragraph: - -``` html -
                -
              • -

                one

                -

                two

                -
              • -
              -``` - -and similarly - -``` markdown -> - one -> -> two -``` - -as - -``` html -
              -
                -
              • -

                one

                -

                two

                -
              • -
              -
              -``` - -This is extremely unintuitive. - -Rather than requiring a fixed indent from the margin, we could require -a fixed indent (say, two spaces, or even one space) from the list marker (which -may itself be indented). This proposal would remove the last anomaly -discussed. Unlike the spec presented above, it would count the following -as a list item with a subparagraph, even though the paragraph `bar` -is not indented as far as the first paragraph `foo`: - -``` markdown - 10. foo - - bar -``` - -Arguably this text does read like a list item with `bar` as a subparagraph, -which may count in favor of the proposal. However, on this proposal indented -code would have to be indented six spaces after the list marker. And this -would break a lot of existing Markdown, which has the pattern: - -``` markdown -1. foo - - indented code -``` - -where the code is indented eight spaces. The spec above, by contrast, will -parse this text as expected, since the code block's indentation is measured -from the beginning of `foo`. - -The one case that needs special treatment is a list item that *starts* -with indented code. How much indentation is required in that case, since -we don't have a "first paragraph" to measure from? Rule #2 simply stipulates -that in such cases, we require one space indentation from the list marker -(and then the normal four spaces for the indented code). This will match the -four-space rule in cases where the list marker plus its initial indentation -takes four spaces (a common case), but diverge in other cases. - -## Lists - -A [list](@) is a sequence of one or more -list items [of the same type]. The list items -may be separated by any number of blank lines. - -Two list items are [of the same type](@) -if they begin with a [list marker] of the same type. -Two list markers are of the -same type if (a) they are bullet list markers using the same character -(`-`, `+`, or `*`) or (b) they are ordered list numbers with the same -delimiter (either `.` or `)`). - -A list is an [ordered list](@) -if its constituent list items begin with -[ordered list markers], and a -[bullet list](@) if its constituent list -items begin with [bullet list markers]. - -The [start number](@) -of an [ordered list] is determined by the list number of -its initial list item. The numbers of subsequent list items are -disregarded. - -A list is [loose](@) if any of its constituent -list items are separated by blank lines, or if any of its constituent -list items directly contain two block-level elements with a blank line -between them. Otherwise a list is [tight](@). -(The difference in HTML output is that paragraphs in a loose list are -wrapped in `

              ` tags, while paragraphs in a tight list are not.) - -Changing the bullet or ordered list delimiter starts a new list: - -```````````````````````````````` example -- foo -- bar -+ baz -. -

                -
              • foo
              • -
              • bar
              • -
              -
                -
              • baz
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. foo -2. bar -3) baz -. -
                -
              1. foo
              2. -
              3. bar
              4. -
              -
                -
              1. baz
              2. -
              -```````````````````````````````` - - -In CommonMark, a list can interrupt a paragraph. That is, -no blank line is needed to separate a paragraph from a following -list: - -```````````````````````````````` example -Foo -- bar -- baz -. -

              Foo

              -
                -
              • bar
              • -
              • baz
              • -
              -```````````````````````````````` - -`Markdown.pl` does not allow this, through fear of triggering a list -via a numeral in a hard-wrapped line: - -``` markdown -The number of windows in my house is -14. The number of doors is 6. -``` - -Oddly, though, `Markdown.pl` *does* allow a blockquote to -interrupt a paragraph, even though the same considerations might -apply. - -In CommonMark, we do allow lists to interrupt paragraphs, for -two reasons. First, it is natural and not uncommon for people -to start lists without blank lines: - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -Second, we are attracted to a - -> [principle of uniformity](@): -> if a chunk of text has a certain -> meaning, it will continue to have the same meaning when put into a -> container block (such as a list item or blockquote). - -(Indeed, the spec for [list items] and [block quotes] presupposes -this principle.) This principle implies that if - -``` markdown - * I need to buy - - new shoes - - a coat - - a plane ticket -``` - -is a list item containing a paragraph followed by a nested sublist, -as all Markdown implementations agree it is (though the paragraph -may be rendered without `

              ` tags, since the list is "tight"), -then - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -by itself should be a paragraph followed by a nested sublist. - -Since it is well established Markdown practice to allow lists to -interrupt paragraphs inside list items, the [principle of -uniformity] requires us to allow this outside list items as -well. ([reStructuredText](http://docutils.sourceforge.net/rst.html) -takes a different approach, requiring blank lines before lists -even inside other list items.) - -In order to solve of unwanted lists in paragraphs with -hard-wrapped numerals, we allow only lists starting with `1` to -interrupt paragraphs. Thus, - -```````````````````````````````` example -The number of windows in my house is -14. The number of doors is 6. -. -

              The number of windows in my house is -14. The number of doors is 6.

              -```````````````````````````````` - -We may still get an unintended result in cases like - -```````````````````````````````` example -The number of windows in my house is -1. The number of doors is 6. -. -

              The number of windows in my house is

              -
                -
              1. The number of doors is 6.
              2. -
              -```````````````````````````````` - -but this rule should prevent most spurious list captures. - -There can be any number of blank lines between items: - -```````````````````````````````` example -- foo - -- bar - - -- baz -. -
                -
              • -

                foo

                -
              • -
              • -

                bar

                -
              • -
              • -

                baz

                -
              • -
              -```````````````````````````````` - -```````````````````````````````` example -- foo - - bar - - baz - - - bim -. -
                -
              • foo -
                  -
                • bar -
                    -
                  • -

                    baz

                    -

                    bim

                    -
                  • -
                  -
                • -
                -
              • -
              -```````````````````````````````` - - -To separate consecutive lists of the same type, or to separate a -list from an indented code block that would otherwise be parsed -as a subparagraph of the final list item, you can insert a blank HTML -comment: - -```````````````````````````````` example -- foo -- bar - - - -- baz -- bim -. -
                -
              • foo
              • -
              • bar
              • -
              - -
                -
              • baz
              • -
              • bim
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- foo - - notcode - -- foo - - - - code -. -
                -
              • -

                foo

                -

                notcode

                -
              • -
              • -

                foo

                -
              • -
              - -
              code
              -
              -```````````````````````````````` - - -List items need not be indented to the same level. The following -list items will be treated as items at the same list level, -since none is indented enough to belong to the previous list -item: - -```````````````````````````````` example -- a - - b - - c - - d - - e - - f -- g -. -
                -
              • a
              • -
              • b
              • -
              • c
              • -
              • d
              • -
              • e
              • -
              • f
              • -
              • g
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -
                -
              1. -

                a

                -
              2. -
              3. -

                b

                -
              4. -
              5. -

                c

                -
              6. -
              -```````````````````````````````` - -Note, however, that list items may not be indented more than -three spaces. Here `- e` is treated as a paragraph continuation -line, because it is indented more than three spaces: - -```````````````````````````````` example -- a - - b - - c - - d - - e -. -
                -
              • a
              • -
              • b
              • -
              • c
              • -
              • d -- e
              • -
              -```````````````````````````````` - -And here, `3. c` is treated as in indented code block, -because it is indented four spaces and preceded by a -blank line. - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -
                -
              1. -

                a

                -
              2. -
              3. -

                b

                -
              4. -
              -
              3. c
              -
              -```````````````````````````````` - - -This is a loose list, because there is a blank line between -two of the list items: - -```````````````````````````````` example -- a -- b - -- c -. -
                -
              • -

                a

                -
              • -
              • -

                b

                -
              • -
              • -

                c

                -
              • -
              -```````````````````````````````` - - -So is this, with a empty second item: - -```````````````````````````````` example -* a -* - -* c -. -
                -
              • -

                a

                -
              • -
              • -
              • -

                c

                -
              • -
              -```````````````````````````````` - - -These are loose lists, even though there is no space between the items, -because one of the items directly contains two block-level elements -with a blank line between them: - -```````````````````````````````` example -- a -- b - - c -- d -. -
                -
              • -

                a

                -
              • -
              • -

                b

                -

                c

                -
              • -
              • -

                d

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- a -- b - - [ref]: /url -- d -. -
                -
              • -

                a

                -
              • -
              • -

                b

                -
              • -
              • -

                d

                -
              • -
              -```````````````````````````````` - - -This is a tight list, because the blank lines are in a code block: - -```````````````````````````````` example -- a -- ``` - b - - - ``` -- c -. -
                -
              • a
              • -
              • -
                b
                -
                -
                -
                -
              • -
              • c
              • -
              -```````````````````````````````` - - -This is a tight list, because the blank line is between two -paragraphs of a sublist. So the sublist is loose while -the outer list is tight: - -```````````````````````````````` example -- a - - b - - c -- d -. -
                -
              • a -
                  -
                • -

                  b

                  -

                  c

                  -
                • -
                -
              • -
              • d
              • -
              -```````````````````````````````` - - -This is a tight list, because the blank line is inside the -block quote: - -```````````````````````````````` example -* a - > b - > -* c -. -
                -
              • a -
                -

                b

                -
                -
              • -
              • c
              • -
              -```````````````````````````````` - - -This list is tight, because the consecutive block elements -are not separated by blank lines: - -```````````````````````````````` example -- a - > b - ``` - c - ``` -- d -. -
                -
              • a -
                -

                b

                -
                -
                c
                -
                -
              • -
              • d
              • -
              -```````````````````````````````` - - -A single-paragraph list is tight: - -```````````````````````````````` example -- a -. -
                -
              • a
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- a - - b -. -
                -
              • a -
                  -
                • b
                • -
                -
              • -
              -```````````````````````````````` - - -This list is loose, because of the blank line between the -two block elements in the list item: - -```````````````````````````````` example -1. ``` - foo - ``` - - bar -. -
                -
              1. -
                foo
                -
                -

                bar

                -
              2. -
              -```````````````````````````````` - - -Here the outer list is loose, the inner list tight: - -```````````````````````````````` example -* foo - * bar - - baz -. -
                -
              • -

                foo

                -
                  -
                • bar
                • -
                -

                baz

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- a - - b - - c - -- d - - e - - f -. -
                -
              • -

                a

                -
                  -
                • b
                • -
                • c
                • -
                -
              • -
              • -

                d

                -
                  -
                • e
                • -
                • f
                • -
                -
              • -
              -```````````````````````````````` - - -# Inlines - -Inlines are parsed sequentially from the beginning of the character -stream to the end (left to right, in left-to-right languages). -Thus, for example, in - -```````````````````````````````` example -`hi`lo` -. -

              hilo`

              -```````````````````````````````` - -`hi` is parsed as code, leaving the backtick at the end as a literal -backtick. - - -## Backslash escapes - -Any ASCII punctuation character may be backslash-escaped: - -```````````````````````````````` example -\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -. -

              !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

              -```````````````````````````````` - - -Backslashes before other characters are treated as literal -backslashes: - -```````````````````````````````` example -\→\A\a\ \3\φ\« -. -

              \→\A\a\ \3\φ\«

              -```````````````````````````````` - - -Escaped characters are treated as regular characters and do -not have their usual Markdown meanings: - -```````````````````````````````` example -\*not emphasized* -\
              not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" -\ö not a character entity -. -

              *not emphasized* -<br/> not a tag -[not a link](/foo) -`not code` -1. not a list -* not a list -# not a heading -[foo]: /url "not a reference" -&ouml; not a character entity

              -```````````````````````````````` - - -If a backslash is itself escaped, the following character is not: - -```````````````````````````````` example -\\*emphasis* -. -

              \emphasis

              -```````````````````````````````` - - -A backslash at the end of the line is a [hard line break]: - -```````````````````````````````` example -foo\ -bar -. -

              foo
              -bar

              -```````````````````````````````` - - -Backslash escapes do not work in code blocks, code spans, autolinks, or -raw HTML: - -```````````````````````````````` example -`` \[\` `` -. -

              \[\`

              -```````````````````````````````` - - -```````````````````````````````` example - \[\] -. -
              \[\]
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~ -\[\] -~~~ -. -
              \[\]
              -
              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              http://example.com?find=\*

              -```````````````````````````````` - - -```````````````````````````````` example - -. - -```````````````````````````````` - - -But they work in all other contexts, including URLs and link titles, -link references, and [info strings] in [fenced code blocks]: - -```````````````````````````````` example -[foo](/bar\* "ti\*tle") -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /bar\* "ti\*tle" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -``` foo\+bar -foo -``` -. -
              foo
              -
              -```````````````````````````````` - - - -## Entity and numeric character references - -Valid HTML entity references and numeric character references -can be used in place of the corresponding Unicode character, -with the following exceptions: - -- Entity and character references are not recognized in code - blocks and code spans. - -- Entity and character references cannot stand in place of - special characters that define structural elements in - CommonMark. For example, although `*` can be used - in place of a literal `*` character, `*` cannot replace - `*` in emphasis delimiters, bullet list markers, or thematic - breaks. - -Conforming CommonMark parsers need not store information about -whether a particular character was represented in the source -using a Unicode character or an entity reference. - -[Entity references](@) consist of `&` + any of the valid -HTML5 entity names + `;`. The -document -is used as an authoritative source for the valid entity -references and their corresponding code points. - -```````````````````````````````` example -  & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸ -. -

                & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸

              -```````````````````````````````` - - -[Decimal numeric character -references](@) -consist of `&#` + a string of 1--7 arabic digits + `;`. A -numeric character reference is parsed as the corresponding -Unicode character. Invalid Unicode code points will be replaced by -the REPLACEMENT CHARACTER (`U+FFFD`). For security reasons, -the code point `U+0000` will also be replaced by `U+FFFD`. - -```````````````````````````````` example -# Ӓ Ϡ � -. -

              # Ӓ Ϡ �

              -```````````````````````````````` - - -[Hexadecimal numeric character -references](@) consist of `&#` + -either `X` or `x` + a string of 1-6 hexadecimal digits + `;`. -They too are parsed as the corresponding Unicode character (this -time specified with a hexadecimal numeral instead of decimal). - -```````````````````````````````` example -" ആ ಫ -. -

              " ആ ಫ

              -```````````````````````````````` - - -Here are some nonentities: - -```````````````````````````````` example -  &x; &#; &#x; -� -&#abcdef0; -&ThisIsNotDefined; &hi?; -. -

              &nbsp &x; &#; &#x; -&#87654321; -&#abcdef0; -&ThisIsNotDefined; &hi?;

              -```````````````````````````````` - - -Although HTML5 does accept some entity references -without a trailing semicolon (such as `©`), these are not -recognized here, because it makes the grammar too ambiguous: - -```````````````````````````````` example -© -. -

              &copy

              -```````````````````````````````` - - -Strings that are not on the list of HTML5 named entities are not -recognized as entity references either: - -```````````````````````````````` example -&MadeUpEntity; -. -

              &MadeUpEntity;

              -```````````````````````````````` - - -Entity and numeric character references are recognized in any -context besides code spans or code blocks, including -URLs, [link titles], and [fenced code block][] [info strings]: - -```````````````````````````````` example - -. - -```````````````````````````````` - - -```````````````````````````````` example -[foo](/föö "föö") -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /föö "föö" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -``` föö -foo -``` -. -
              foo
              -
              -```````````````````````````````` - - -Entity and numeric character references are treated as literal -text in code spans and code blocks: - -```````````````````````````````` example -`föö` -. -

              f&ouml;&ouml;

              -```````````````````````````````` - - -```````````````````````````````` example - föfö -. -
              f&ouml;f&ouml;
              -
              -```````````````````````````````` - - -Entity and numeric character references cannot be used -in place of symbols indicating structure in CommonMark -documents. - -```````````````````````````````` example -*foo* -*foo* -. -

              *foo* -foo

              -```````````````````````````````` - -```````````````````````````````` example -* foo - -* foo -. -

              * foo

              -
                -
              • foo
              • -
              -```````````````````````````````` - -```````````````````````````````` example -foo bar -. -

              foo - -bar

              -```````````````````````````````` - -```````````````````````````````` example - foo -. -

              →foo

              -```````````````````````````````` - - -```````````````````````````````` example -[a](url "tit") -. -

              [a](url "tit")

              -```````````````````````````````` - - -## Code spans - -A [backtick string](@) -is a string of one or more backtick characters (`` ` ``) that is neither -preceded nor followed by a backtick. - -A [code span](@) begins with a backtick string and ends with -a backtick string of equal length. The contents of the code span are -the characters between the two backtick strings, normalized in the -following ways: - -- First, [line endings] are converted to [spaces]. -- If the resulting string both begins *and* ends with a [space] - character, but does not consist entirely of [space] - characters, a single [space] character is removed from the - front and back. This allows you to include code that begins - or ends with backtick characters, which must be separated by - whitespace from the opening or closing backtick strings. - -This is a simple code span: - -```````````````````````````````` example -`foo` -. -

              foo

              -```````````````````````````````` - - -Here two backticks are used, because the code contains a backtick. -This example also illustrates stripping of a single leading and -trailing space: - -```````````````````````````````` example -`` foo ` bar `` -. -

              foo ` bar

              -```````````````````````````````` - - -This example shows the motivation for stripping leading and trailing -spaces: - -```````````````````````````````` example -` `` ` -. -

              ``

              -```````````````````````````````` - -Note that only *one* space is stripped: - -```````````````````````````````` example -` `` ` -. -

              ``

              -```````````````````````````````` - -The stripping only happens if the space is on both -sides of the string: - -```````````````````````````````` example -` a` -. -

              a

              -```````````````````````````````` - -Only [spaces], and not [unicode whitespace] in general, are -stripped in this way: - -```````````````````````````````` example -` b ` -. -

               b 

              -```````````````````````````````` - -No stripping occurs if the code span contains only spaces: - -```````````````````````````````` example -` ` -` ` -. -

                -

              -```````````````````````````````` - - -[Line endings] are treated like spaces: - -```````````````````````````````` example -`` -foo -bar -baz -`` -. -

              foo bar baz

              -```````````````````````````````` - -```````````````````````````````` example -`` -foo -`` -. -

              foo

              -```````````````````````````````` - - -Interior spaces are not collapsed: - -```````````````````````````````` example -`foo bar -baz` -. -

              foo bar baz

              -```````````````````````````````` - -Note that browsers will typically collapse consecutive spaces -when rendering `` elements, so it is recommended that -the following CSS be used: - - code{white-space: pre-wrap;} - - -Note that backslash escapes do not work in code spans. All backslashes -are treated literally: - -```````````````````````````````` example -`foo\`bar` -. -

              foo\bar`

              -```````````````````````````````` - - -Backslash escapes are never needed, because one can always choose a -string of *n* backtick characters as delimiters, where the code does -not contain any strings of exactly *n* backtick characters. - -```````````````````````````````` example -``foo`bar`` -. -

              foo`bar

              -```````````````````````````````` - -```````````````````````````````` example -` foo `` bar ` -. -

              foo `` bar

              -```````````````````````````````` - - -Code span backticks have higher precedence than any other inline -constructs except HTML tags and autolinks. Thus, for example, this is -not parsed as emphasized text, since the second `*` is part of a code -span: - -```````````````````````````````` example -*foo`*` -. -

              *foo*

              -```````````````````````````````` - - -And this is not parsed as a link: - -```````````````````````````````` example -[not a `link](/foo`) -. -

              [not a link](/foo)

              -```````````````````````````````` - - -Code spans, HTML tags, and autolinks have the same precedence. -Thus, this is code: - -```````````````````````````````` example -`` -. -

              <a href="">`

              -```````````````````````````````` - - -But this is an HTML tag: - -```````````````````````````````` example -
              ` -. -

              `

              -```````````````````````````````` - - -And this is code: - -```````````````````````````````` example -`` -. -

              <http://foo.bar.baz>`

              -```````````````````````````````` - - -But this is an autolink: - -```````````````````````````````` example -` -. -

              http://foo.bar.`baz`

              -```````````````````````````````` - - -When a backtick string is not closed by a matching backtick string, -we just have literal backticks: - -```````````````````````````````` example -```foo`` -. -

              ```foo``

              -```````````````````````````````` - - -```````````````````````````````` example -`foo -. -

              `foo

              -```````````````````````````````` - -The following case also illustrates the need for opening and -closing backtick strings to be equal in length: - -```````````````````````````````` example -`foo``bar`` -. -

              `foobar

              -```````````````````````````````` - - -## Emphasis and strong emphasis - -John Gruber's original [Markdown syntax -description](http://daringfireball.net/projects/markdown/syntax#em) says: - -> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -> emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML -> `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` -> tag. - -This is enough for most users, but these rules leave much undecided, -especially when it comes to nested emphasis. The original -`Markdown.pl` test suite makes it clear that triple `***` and -`___` delimiters can be used for strong emphasis, and most -implementations have also allowed the following patterns: - -``` markdown -***strong emph*** -***strong** in emph* -***emph* in strong** -**in strong *emph*** -*in emph **strong*** -``` - -The following patterns are less widely supported, but the intent -is clear and they are useful (especially in contexts like bibliography -entries): - -``` markdown -*emph *with emph* in it* -**strong **with strong** in it** -``` - -Many implementations have also restricted intraword emphasis to -the `*` forms, to avoid unwanted emphasis in words containing -internal underscores. (It is best practice to put these in code -spans, but users often do not.) - -``` markdown -internal emphasis: foo*bar*baz -no emphasis: foo_bar_baz -``` - -The rules given below capture all of these patterns, while allowing -for efficient parsing strategies that do not backtrack. - -First, some definitions. A [delimiter run](@) is either -a sequence of one or more `*` characters that is not preceded or -followed by a non-backslash-escaped `*` character, or a sequence -of one or more `_` characters that is not preceded or followed by -a non-backslash-escaped `_` character. - -A [left-flanking delimiter run](@) is -a [delimiter run] that is (1) not followed by [Unicode whitespace], -and either (2a) not followed by a [punctuation character], or -(2b) followed by a [punctuation character] and -preceded by [Unicode whitespace] or a [punctuation character]. -For purposes of this definition, the beginning and the end of -the line count as Unicode whitespace. - -A [right-flanking delimiter run](@) is -a [delimiter run] that is (1) not preceded by [Unicode whitespace], -and either (2a) not preceded by a [punctuation character], or -(2b) preceded by a [punctuation character] and -followed by [Unicode whitespace] or a [punctuation character]. -For purposes of this definition, the beginning and the end of -the line count as Unicode whitespace. - -Here are some examples of delimiter runs. - - - left-flanking but not right-flanking: - - ``` - ***abc - _abc - **"abc" - _"abc" - ``` - - - right-flanking but not left-flanking: - - ``` - abc*** - abc_ - "abc"** - "abc"_ - ``` - - - Both left and right-flanking: - - ``` - abc***def - "abc"_"def" - ``` - - - Neither left nor right-flanking: - - ``` - abc *** def - a _ b - ``` - -(The idea of distinguishing left-flanking and right-flanking -delimiter runs based on the character before and the character -after comes from Roopesh Chander's -[vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags). -vfmd uses the terminology "emphasis indicator string" instead of "delimiter -run," and its rules for distinguishing left- and right-flanking runs -are a bit more complex than the ones given here.) - -The following rules define emphasis and strong emphasis: - -1. A single `*` character [can open emphasis](@) - iff (if and only if) it is part of a [left-flanking delimiter run]. - -2. A single `_` character [can open emphasis] iff - it is part of a [left-flanking delimiter run] - and either (a) not part of a [right-flanking delimiter run] - or (b) part of a [right-flanking delimiter run] - preceded by punctuation. - -3. A single `*` character [can close emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -4. A single `_` character [can close emphasis] iff - it is part of a [right-flanking delimiter run] - and either (a) not part of a [left-flanking delimiter run] - or (b) part of a [left-flanking delimiter run] - followed by punctuation. - -5. A double `**` [can open strong emphasis](@) - iff it is part of a [left-flanking delimiter run]. - -6. A double `__` [can open strong emphasis] iff - it is part of a [left-flanking delimiter run] - and either (a) not part of a [right-flanking delimiter run] - or (b) part of a [right-flanking delimiter run] - preceded by punctuation. - -7. A double `**` [can close strong emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -8. A double `__` [can close strong emphasis] iff - it is part of a [right-flanking delimiter run] - and either (a) not part of a [left-flanking delimiter run] - or (b) part of a [left-flanking delimiter run] - followed by punctuation. - -9. Emphasis begins with a delimiter that [can open emphasis] and ends - with a delimiter that [can close emphasis], and that uses the same - character (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both - open and close emphasis, then the sum of the lengths of the - delimiter runs containing the opening and closing delimiters - must not be a multiple of 3 unless both lengths are - multiples of 3. - -10. Strong emphasis begins with a delimiter that - [can open strong emphasis] and ends with a delimiter that - [can close strong emphasis], and that uses the same character - (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both open - and close strong emphasis, then the sum of the lengths of - the delimiter runs containing the opening and closing - delimiters must not be a multiple of 3 unless both lengths - are multiples of 3. - -11. A literal `*` character cannot occur at the beginning or end of - `*`-delimited emphasis or `**`-delimited strong emphasis, unless it - is backslash-escaped. - -12. A literal `_` character cannot occur at the beginning or end of - `_`-delimited emphasis or `__`-delimited strong emphasis, unless it - is backslash-escaped. - -Where rules 1--12 above are compatible with multiple parsings, -the following principles resolve ambiguity: - -13. The number of nestings should be minimized. Thus, for example, - an interpretation `...` is always preferred to - `...`. - -14. An interpretation `...` is always - preferred to `...`. - -15. When two potential emphasis or strong emphasis spans overlap, - so that the second begins before the first ends and ends after - the first ends, the first takes precedence. Thus, for example, - `*foo _bar* baz_` is parsed as `foo _bar baz_` rather - than `*foo bar* baz`. - -16. When there are two potential emphasis or strong emphasis spans - with the same closing delimiter, the shorter one (the one that - opens later) takes precedence. Thus, for example, - `**foo **bar baz**` is parsed as `**foo bar baz` - rather than `foo **bar baz`. - -17. Inline code spans, links, images, and HTML tags group more tightly - than emphasis. So, when there is a choice between an interpretation - that contains one of these elements and one that does not, the - former always wins. Thus, for example, `*[foo*](bar)` is - parsed as `*foo*` rather than as - `[foo](bar)`. - -These rules can be illustrated through a series of examples. - -Rule 1: - -```````````````````````````````` example -*foo bar* -. -

              foo bar

              -```````````````````````````````` - - -This is not emphasis, because the opening `*` is followed by -whitespace, and hence not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a * foo bar* -. -

              a * foo bar*

              -```````````````````````````````` - - -This is not emphasis, because the opening `*` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a*"foo"* -. -

              a*"foo"*

              -```````````````````````````````` - - -Unicode nonbreaking spaces count as whitespace, too: - -```````````````````````````````` example -* a * -. -

              * a *

              -```````````````````````````````` - - -Intraword emphasis with `*` is permitted: - -```````````````````````````````` example -foo*bar* -. -

              foobar

              -```````````````````````````````` - - -```````````````````````````````` example -5*6*78 -. -

              5678

              -```````````````````````````````` - - -Rule 2: - -```````````````````````````````` example -_foo bar_ -. -

              foo bar

              -```````````````````````````````` - - -This is not emphasis, because the opening `_` is followed by -whitespace: - -```````````````````````````````` example -_ foo bar_ -. -

              _ foo bar_

              -```````````````````````````````` - - -This is not emphasis, because the opening `_` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a_"foo"_ -. -

              a_"foo"_

              -```````````````````````````````` - - -Emphasis with `_` is not allowed inside words: - -```````````````````````````````` example -foo_bar_ -. -

              foo_bar_

              -```````````````````````````````` - - -```````````````````````````````` example -5_6_78 -. -

              5_6_78

              -```````````````````````````````` - - -```````````````````````````````` example -пристаням_стремятся_ -. -

              пристаням_стремятся_

              -```````````````````````````````` - - -Here `_` does not generate emphasis, because the first delimiter run -is right-flanking and the second left-flanking: - -```````````````````````````````` example -aa_"bb"_cc -. -

              aa_"bb"_cc

              -```````````````````````````````` - - -This is emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-_(bar)_ -. -

              foo-(bar)

              -```````````````````````````````` - - -Rule 3: - -This is not emphasis, because the closing delimiter does -not match the opening delimiter: - -```````````````````````````````` example -_foo* -. -

              _foo*

              -```````````````````````````````` - - -This is not emphasis, because the closing `*` is preceded by -whitespace: - -```````````````````````````````` example -*foo bar * -. -

              *foo bar *

              -```````````````````````````````` - - -A newline also counts as whitespace: - -```````````````````````````````` example -*foo bar -* -. -

              *foo bar -*

              -```````````````````````````````` - - -This is not emphasis, because the second `*` is -preceded by punctuation and followed by an alphanumeric -(hence it is not part of a [right-flanking delimiter run]: - -```````````````````````````````` example -*(*foo) -. -

              *(*foo)

              -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -*(*foo*)* -. -

              (foo)

              -```````````````````````````````` - - -Intraword emphasis with `*` is allowed: - -```````````````````````````````` example -*foo*bar -. -

              foobar

              -```````````````````````````````` - - - -Rule 4: - -This is not emphasis, because the closing `_` is preceded by -whitespace: - -```````````````````````````````` example -_foo bar _ -. -

              _foo bar _

              -```````````````````````````````` - - -This is not emphasis, because the second `_` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -_(_foo) -. -

              _(_foo)

              -```````````````````````````````` - - -This is emphasis within emphasis: - -```````````````````````````````` example -_(_foo_)_ -. -

              (foo)

              -```````````````````````````````` - - -Intraword emphasis is disallowed for `_`: - -```````````````````````````````` example -_foo_bar -. -

              _foo_bar

              -```````````````````````````````` - - -```````````````````````````````` example -_пристаням_стремятся -. -

              _пристаням_стремятся

              -```````````````````````````````` - - -```````````````````````````````` example -_foo_bar_baz_ -. -

              foo_bar_baz

              -```````````````````````````````` - - -This is emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -_(bar)_. -. -

              (bar).

              -```````````````````````````````` - - -Rule 5: - -```````````````````````````````` example -**foo bar** -. -

              foo bar

              -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -** foo bar** -. -

              ** foo bar**

              -```````````````````````````````` - - -This is not strong emphasis, because the opening `**` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a**"foo"** -. -

              a**"foo"**

              -```````````````````````````````` - - -Intraword strong emphasis with `**` is permitted: - -```````````````````````````````` example -foo**bar** -. -

              foobar

              -```````````````````````````````` - - -Rule 6: - -```````````````````````````````` example -__foo bar__ -. -

              foo bar

              -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -__ foo bar__ -. -

              __ foo bar__

              -```````````````````````````````` - - -A newline counts as whitespace: -```````````````````````````````` example -__ -foo bar__ -. -

              __ -foo bar__

              -```````````````````````````````` - - -This is not strong emphasis, because the opening `__` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a__"foo"__ -. -

              a__"foo"__

              -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -foo__bar__ -. -

              foo__bar__

              -```````````````````````````````` - - -```````````````````````````````` example -5__6__78 -. -

              5__6__78

              -```````````````````````````````` - - -```````````````````````````````` example -пристаням__стремятся__ -. -

              пристаням__стремятся__

              -```````````````````````````````` - - -```````````````````````````````` example -__foo, __bar__, baz__ -. -

              foo, bar, baz

              -```````````````````````````````` - - -This is strong emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-__(bar)__ -. -

              foo-(bar)

              -```````````````````````````````` - - - -Rule 7: - -This is not strong emphasis, because the closing delimiter is preceded -by whitespace: - -```````````````````````````````` example -**foo bar ** -. -

              **foo bar **

              -```````````````````````````````` - - -(Nor can it be interpreted as an emphasized `*foo bar *`, because of -Rule 11.) - -This is not strong emphasis, because the second `**` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -**(**foo) -. -

              **(**foo)

              -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with these examples: - -```````````````````````````````` example -*(**foo**)* -. -

              (foo)

              -```````````````````````````````` - - -```````````````````````````````` example -**Gomphocarpus (*Gomphocarpus physocarpus*, syn. -*Asclepias physocarpa*)** -. -

              Gomphocarpus (Gomphocarpus physocarpus, syn. -Asclepias physocarpa)

              -```````````````````````````````` - - -```````````````````````````````` example -**foo "*bar*" foo** -. -

              foo "bar" foo

              -```````````````````````````````` - - -Intraword emphasis: - -```````````````````````````````` example -**foo**bar -. -

              foobar

              -```````````````````````````````` - - -Rule 8: - -This is not strong emphasis, because the closing delimiter is -preceded by whitespace: - -```````````````````````````````` example -__foo bar __ -. -

              __foo bar __

              -```````````````````````````````` - - -This is not strong emphasis, because the second `__` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -__(__foo) -. -

              __(__foo)

              -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -_(__foo__)_ -. -

              (foo)

              -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -__foo__bar -. -

              __foo__bar

              -```````````````````````````````` - - -```````````````````````````````` example -__пристаням__стремятся -. -

              __пристаням__стремятся

              -```````````````````````````````` - - -```````````````````````````````` example -__foo__bar__baz__ -. -

              foo__bar__baz

              -```````````````````````````````` - - -This is strong emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -__(bar)__. -. -

              (bar).

              -```````````````````````````````` - - -Rule 9: - -Any nonempty sequence of inline elements can be the contents of an -emphasized span. - -```````````````````````````````` example -*foo [bar](/url)* -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo -bar* -. -

              foo -bar

              -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside emphasis: - -```````````````````````````````` example -_foo __bar__ baz_ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -_foo _bar_ baz_ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -__foo_ bar_ -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar** baz* -. -

              foo bar baz

              -```````````````````````````````` - -```````````````````````````````` example -*foo**bar**baz* -. -

              foobarbaz

              -```````````````````````````````` - -Note that in the preceding case, the interpretation - -``` markdown -

              foobarbaz

              -``` - - -is precluded by the condition that a delimiter that -can both open and close (like the `*` after `foo`) -cannot form emphasis if the sum of the lengths of -the delimiter runs containing the opening and -closing delimiters is a multiple of 3 unless -both lengths are multiples of 3. - - -For the same reason, we don't get two consecutive -emphasis sections in this example: - -```````````````````````````````` example -*foo**bar* -. -

              foo**bar

              -```````````````````````````````` - - -The same condition ensures that the following -cases are all strong emphasis nested inside -emphasis, even when the interior spaces are -omitted: - - -```````````````````````````````` example -***foo** bar* -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar*** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo**bar*** -. -

              foobar

              -```````````````````````````````` - - -When the lengths of the interior closing and opening -delimiter runs are *both* multiples of 3, though, -they can match to create emphasis: - -```````````````````````````````` example -foo***bar***baz -. -

              foobarbaz

              -```````````````````````````````` - -```````````````````````````````` example -foo******bar*********baz -. -

              foobar***baz

              -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -*foo **bar *baz* bim** bop* -. -

              foo bar baz bim bop

              -```````````````````````````````` - - -```````````````````````````````` example -*foo [*bar*](/url)* -. -

              foo bar

              -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -** is not an empty emphasis -. -

              ** is not an empty emphasis

              -```````````````````````````````` - - -```````````````````````````````` example -**** is not an empty strong emphasis -. -

              **** is not an empty strong emphasis

              -```````````````````````````````` - - - -Rule 10: - -Any nonempty sequence of inline elements can be the contents of an -strongly emphasized span. - -```````````````````````````````` example -**foo [bar](/url)** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo -bar** -. -

              foo -bar

              -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside strong emphasis: - -```````````````````````````````` example -__foo _bar_ baz__ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -__foo __bar__ baz__ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -____foo__ bar__ -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo **bar**** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar* baz** -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -**foo*bar*baz** -. -

              foobarbaz

              -```````````````````````````````` - - -```````````````````````````````` example -***foo* bar** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar*** -. -

              foo bar

              -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -**foo *bar **baz** -bim* bop** -. -

              foo bar baz -bim bop

              -```````````````````````````````` - - -```````````````````````````````` example -**foo [*bar*](/url)** -. -

              foo bar

              -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -__ is not an empty emphasis -. -

              __ is not an empty emphasis

              -```````````````````````````````` - - -```````````````````````````````` example -____ is not an empty strong emphasis -. -

              ____ is not an empty strong emphasis

              -```````````````````````````````` - - - -Rule 11: - -```````````````````````````````` example -foo *** -. -

              foo ***

              -```````````````````````````````` - - -```````````````````````````````` example -foo *\** -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -foo *_* -. -

              foo _

              -```````````````````````````````` - - -```````````````````````````````` example -foo ***** -. -

              foo *****

              -```````````````````````````````` - - -```````````````````````````````` example -foo **\*** -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -foo **_** -. -

              foo _

              -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 11 determines -that the excess literal `*` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -**foo* -. -

              *foo

              -```````````````````````````````` - - -```````````````````````````````` example -*foo** -. -

              foo*

              -```````````````````````````````` - - -```````````````````````````````` example -***foo** -. -

              *foo

              -```````````````````````````````` - - -```````````````````````````````` example -****foo* -. -

              ***foo

              -```````````````````````````````` - - -```````````````````````````````` example -**foo*** -. -

              foo*

              -```````````````````````````````` - - -```````````````````````````````` example -*foo**** -. -

              foo***

              -```````````````````````````````` - - - -Rule 12: - -```````````````````````````````` example -foo ___ -. -

              foo ___

              -```````````````````````````````` - - -```````````````````````````````` example -foo _\__ -. -

              foo _

              -```````````````````````````````` - - -```````````````````````````````` example -foo _*_ -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -foo _____ -. -

              foo _____

              -```````````````````````````````` - - -```````````````````````````````` example -foo __\___ -. -

              foo _

              -```````````````````````````````` - - -```````````````````````````````` example -foo __*__ -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -__foo_ -. -

              _foo

              -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 12 determines -that the excess literal `_` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -_foo__ -. -

              foo_

              -```````````````````````````````` - - -```````````````````````````````` example -___foo__ -. -

              _foo

              -```````````````````````````````` - - -```````````````````````````````` example -____foo_ -. -

              ___foo

              -```````````````````````````````` - - -```````````````````````````````` example -__foo___ -. -

              foo_

              -```````````````````````````````` - - -```````````````````````````````` example -_foo____ -. -

              foo___

              -```````````````````````````````` - - -Rule 13 implies that if you want emphasis nested directly inside -emphasis, you must use different delimiters: - -```````````````````````````````` example -**foo** -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -*_foo_* -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -__foo__ -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -_*foo*_ -. -

              foo

              -```````````````````````````````` - - -However, strong emphasis within strong emphasis is possible without -switching delimiters: - -```````````````````````````````` example -****foo**** -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -____foo____ -. -

              foo

              -```````````````````````````````` - - - -Rule 13 can be applied to arbitrarily long sequences of -delimiters: - -```````````````````````````````` example -******foo****** -. -

              foo

              -```````````````````````````````` - - -Rule 14: - -```````````````````````````````` example -***foo*** -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -_____foo_____ -. -

              foo

              -```````````````````````````````` - - -Rule 15: - -```````````````````````````````` example -*foo _bar* baz_ -. -

              foo _bar baz_

              -```````````````````````````````` - - -```````````````````````````````` example -*foo __bar *baz bim__ bam* -. -

              foo bar *baz bim bam

              -```````````````````````````````` - - -Rule 16: - -```````````````````````````````` example -**foo **bar baz** -. -

              **foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar baz* -. -

              *foo bar baz

              -```````````````````````````````` - - -Rule 17: - -```````````````````````````````` example -*[bar*](/url) -. -

              *bar*

              -```````````````````````````````` - - -```````````````````````````````` example -_foo [bar_](/url) -. -

              _foo bar_

              -```````````````````````````````` - - -```````````````````````````````` example -* -. -

              *

              -```````````````````````````````` - - -```````````````````````````````` example -** -. -

              **

              -```````````````````````````````` - - -```````````````````````````````` example -__ -. -

              __

              -```````````````````````````````` - - -```````````````````````````````` example -*a `*`* -. -

              a *

              -```````````````````````````````` - - -```````````````````````````````` example -_a `_`_ -. -

              a _

              -```````````````````````````````` - - -```````````````````````````````` example -**a -. -

              **ahttp://foo.bar/?q=**

              -```````````````````````````````` - - -```````````````````````````````` example -__a -. -

              __ahttp://foo.bar/?q=__

              -```````````````````````````````` - - - -## Links - -A link contains [link text] (the visible text), a [link destination] -(the URI that is the link destination), and optionally a [link title]. -There are two basic kinds of links in Markdown. In [inline links] the -destination and title are given immediately after the link text. In -[reference links] the destination and title are defined elsewhere in -the document. - -A [link text](@) consists of a sequence of zero or more -inline elements enclosed by square brackets (`[` and `]`). The -following rules apply: - -- Links may not contain other links, at any level of nesting. If - multiple otherwise valid link definitions appear nested inside each - other, the inner-most definition is used. - -- Brackets are allowed in the [link text] only if (a) they - are backslash-escaped or (b) they appear as a matched pair of brackets, - with an open bracket `[`, a sequence of zero or more inlines, and - a close bracket `]`. - -- Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly - than the brackets in link text. Thus, for example, - `` [foo`]` `` could not be a link text, since the second `]` - is part of a code span. - -- The brackets in link text bind more tightly than markers for - [emphasis and strong emphasis]. Thus, for example, `*[foo*](url)` is a link. - -A [link destination](@) consists of either - -- a sequence of zero or more characters between an opening `<` and a - closing `>` that contains no line breaks or unescaped - `<` or `>` characters, or - -- a nonempty sequence of characters that does not start with - `<`, does not include ASCII space or control characters, and - includes parentheses only if (a) they are backslash-escaped or - (b) they are part of a balanced pair of unescaped parentheses. - (Implementations may impose limits on parentheses nesting to - avoid performance issues, but at least three levels of nesting - should be supported.) - -A [link title](@) consists of either - -- a sequence of zero or more characters between straight double-quote - characters (`"`), including a `"` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between straight single-quote - characters (`'`), including a `'` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between matching parentheses - (`(...)`), including a `(` or `)` character only if it is - backslash-escaped. - -Although [link titles] may span multiple lines, they may not contain -a [blank line]. - -An [inline link](@) consists of a [link text] followed immediately -by a left parenthesis `(`, optional [whitespace], an optional -[link destination], an optional [link title] separated from the link -destination by [whitespace], optional [whitespace], and a right -parenthesis `)`. The link's text consists of the inlines contained -in the [link text] (excluding the enclosing square brackets). -The link's URI consists of the link destination, excluding enclosing -`<...>` if present, with backslash-escapes in effect as described -above. The link's title consists of the link title, excluding its -enclosing delimiters, with backslash-escapes in effect as described -above. - -Here is a simple inline link: - -```````````````````````````````` example -[link](/uri "title") -. -

              link

              -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[link](/uri) -. -

              link

              -```````````````````````````````` - - -Both the title and the destination may be omitted: - -```````````````````````````````` example -[link]() -. -

              link

              -```````````````````````````````` - - -```````````````````````````````` example -[link](<>) -. -

              link

              -```````````````````````````````` - -The destination can only contain spaces if it is -enclosed in pointy brackets: - -```````````````````````````````` example -[link](/my uri) -. -

              [link](/my uri)

              -```````````````````````````````` - -```````````````````````````````` example -[link](
              ) -. -

              link

              -```````````````````````````````` - -The destination cannot contain line breaks, -even if enclosed in pointy brackets: - -```````````````````````````````` example -[link](foo -bar) -. -

              [link](foo -bar)

              -```````````````````````````````` - -```````````````````````````````` example -[link]() -. -

              [link]()

              -```````````````````````````````` - -The destination can contain `)` if it is enclosed -in pointy brackets: - -```````````````````````````````` example -[a]() -. -

              a

              -```````````````````````````````` - -Pointy brackets that enclose links must be unescaped: - -```````````````````````````````` example -[link]() -. -

              [link](<foo>)

              -```````````````````````````````` - -These are not links, because the opening pointy bracket -is not matched properly: - -```````````````````````````````` example -[a]( -[a](c) -. -

              [a](<b)c -[a](<b)c> -[a](c)

              -```````````````````````````````` - -Parentheses inside the link destination may be escaped: - -```````````````````````````````` example -[link](\(foo\)) -. -

              link

              -```````````````````````````````` - -Any number of parentheses are allowed without escaping, as long as they are -balanced: - -```````````````````````````````` example -[link](foo(and(bar))) -. -

              link

              -```````````````````````````````` - -However, if you have unbalanced parentheses, you need to escape or use the -`<...>` form: - -```````````````````````````````` example -[link](foo\(and\(bar\)) -. -

              link

              -```````````````````````````````` - - -```````````````````````````````` example -[link]() -. -

              link

              -```````````````````````````````` - - -Parentheses and other symbols can also be escaped, as usual -in Markdown: - -```````````````````````````````` example -[link](foo\)\:) -. -

              link

              -```````````````````````````````` - - -A link can contain fragment identifiers and queries: - -```````````````````````````````` example -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) -. -

              link

              -

              link

              -

              link

              -```````````````````````````````` - - -Note that a backslash before a non-escapable character is -just a backslash: - -```````````````````````````````` example -[link](foo\bar) -. -

              link

              -```````````````````````````````` - - -URL-escaping should be left alone inside the destination, as all -URL-escaped characters are also valid URL characters. Entity and -numerical character references in the destination will be parsed -into the corresponding Unicode code points, as usual. These may -be optionally URL-escaped when written as HTML, but this spec -does not enforce any particular policy for rendering URLs in -HTML or other formats. Renderers may make different decisions -about how to escape or normalize URLs in the output. - -```````````````````````````````` example -[link](foo%20bä) -. -

              link

              -```````````````````````````````` - - -Note that, because titles can often be parsed as destinations, -if you try to omit the destination and keep the title, you'll -get unexpected results: - -```````````````````````````````` example -[link]("title") -. -

              link

              -```````````````````````````````` - - -Titles may be in single quotes, double quotes, or parentheses: - -```````````````````````````````` example -[link](/url "title") -[link](/url 'title') -[link](/url (title)) -. -

              link -link -link

              -```````````````````````````````` - - -Backslash escapes and entity and numeric character references -may be used in titles: - -```````````````````````````````` example -[link](/url "title \""") -. -

              link

              -```````````````````````````````` - - -Titles must be separated from the link using a [whitespace]. -Other [Unicode whitespace] like non-breaking space doesn't work. - -```````````````````````````````` example -[link](/url "title") -. -

              link

              -```````````````````````````````` - - -Nested balanced quotes are not allowed without escaping: - -```````````````````````````````` example -[link](/url "title "and" title") -. -

              [link](/url "title "and" title")

              -```````````````````````````````` - - -But it is easy to work around this by using a different quote type: - -```````````````````````````````` example -[link](/url 'title "and" title') -. -

              link

              -```````````````````````````````` - - -(Note: `Markdown.pl` did allow double quotes inside a double-quoted -title, and its test suite included a test demonstrating this. -But it is hard to see a good rationale for the extra complexity this -brings, since there are already many ways---backslash escaping, -entity and numeric character references, or using a different -quote type for the enclosing title---to write titles containing -double quotes. `Markdown.pl`'s handling of titles has a number -of other strange features. For example, it allows single-quoted -titles in inline links, but not reference links. And, in -reference links but not inline links, it allows a title to begin -with `"` and end with `)`. `Markdown.pl` 1.0.1 even allows -titles with no closing quotation mark, though 1.0.2b8 does not. -It seems preferable to adopt a simple, rational rule that works -the same way in inline links and link reference definitions.) - -[Whitespace] is allowed around the destination and title: - -```````````````````````````````` example -[link]( /uri - "title" ) -. -

              link

              -```````````````````````````````` - - -But it is not allowed between the link text and the -following parenthesis: - -```````````````````````````````` example -[link] (/uri) -. -

              [link] (/uri)

              -```````````````````````````````` - - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]](/uri) -. -

              link [foo [bar]]

              -```````````````````````````````` - - -```````````````````````````````` example -[link] bar](/uri) -. -

              [link] bar](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -[link [bar](/uri) -. -

              [link bar

              -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar](/uri) -. -

              link [bar

              -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*](/uri) -. -

              link foo bar #

              -```````````````````````````````` - - -```````````````````````````````` example -[![moon](moon.jpg)](/uri) -. -

              moon

              -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)](/uri) -. -

              [foo bar](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *[bar [baz](/uri)](/uri)*](/uri) -. -

              [foo [bar baz](/uri)](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -![[[foo](uri1)](uri2)](uri3) -. -

              [foo](uri2)

              -```````````````````````````````` - - -These cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*](/uri) -. -

              *foo*

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar](baz*) -. -

              foo *bar

              -```````````````````````````````` - - -Note that brackets that *aren't* part of links do not take -precedence: - -```````````````````````````````` example -*foo [bar* baz] -. -

              foo [bar baz]

              -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo -. -

              [foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo`](/uri)` -. -

              [foo](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -[foo -. -

              [foohttp://example.com/?search=](uri)

              -```````````````````````````````` - - -There are three kinds of [reference link](@)s: -[full](#full-reference-link), [collapsed](#collapsed-reference-link), -and [shortcut](#shortcut-reference-link). - -A [full reference link](@) -consists of a [link text] immediately followed by a [link label] -that [matches] a [link reference definition] elsewhere in the document. - -A [link label](@) begins with a left bracket (`[`) and ends -with the first right bracket (`]`) that is not backslash-escaped. -Between these brackets there must be at least one [non-whitespace character]. -Unescaped square bracket characters are not allowed inside the -opening and closing square brackets of [link labels]. A link -label can have at most 999 characters inside the square -brackets. - -One label [matches](@) -another just in case their normalized forms are equal. To normalize a -label, strip off the opening and closing brackets, -perform the *Unicode case fold*, strip leading and trailing -[whitespace] and collapse consecutive internal -[whitespace] to a single space. If there are multiple -matching reference link definitions, the one that comes first in the -document is used. (It is desirable in such cases to emit a warning.) - -The contents of the first link label are parsed as inlines, which are -used as the link's text. The link's URI and title are provided by the -matching [link reference definition]. - -Here is a simple example: - -```````````````````````````````` example -[foo][bar] - -[bar]: /url "title" -. -

              foo

              -```````````````````````````````` - - -The rules for the [link text] are the same as with -[inline links]. Thus: - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]][ref] - -[ref]: /uri -. -

              link [foo [bar]]

              -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar][ref] - -[ref]: /uri -. -

              link [bar

              -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*][ref] - -[ref]: /uri -. -

              link foo bar #

              -```````````````````````````````` - - -```````````````````````````````` example -[![moon](moon.jpg)][ref] - -[ref]: /uri -. -

              moon

              -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)][ref] - -[ref]: /uri -. -

              [foo bar]ref

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar [baz][ref]*][ref] - -[ref]: /uri -. -

              [foo bar baz]ref

              -```````````````````````````````` - - -(In the examples above, we have two [shortcut reference links] -instead of one [full reference link].) - -The following cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*][ref] - -[ref]: /uri -. -

              *foo*

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar][ref] - -[ref]: /uri -. -

              foo *bar

              -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo - -[ref]: /uri -. -

              [foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo`][ref]` - -[ref]: /uri -. -

              [foo][ref]

              -```````````````````````````````` - - -```````````````````````````````` example -[foo - -[ref]: /uri -. -

              [foohttp://example.com/?search=][ref]

              -```````````````````````````````` - - -Matching is case-insensitive: - -```````````````````````````````` example -[foo][BaR] - -[bar]: /url "title" -. -

              foo

              -```````````````````````````````` - - -Unicode case fold is used: - -```````````````````````````````` example -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url -. -

              Толпой is a Russian word.

              -```````````````````````````````` - - -Consecutive internal [whitespace] is treated as one space for -purposes of determining matching: - -```````````````````````````````` example -[Foo - bar]: /url - -[Baz][Foo bar] -. -

              Baz

              -```````````````````````````````` - - -No [whitespace] is allowed between the [link text] and the -[link label]: - -```````````````````````````````` example -[foo] [bar] - -[bar]: /url "title" -. -

              [foo] bar

              -```````````````````````````````` - - -```````````````````````````````` example -[foo] -[bar] - -[bar]: /url "title" -. -

              [foo] -bar

              -```````````````````````````````` - - -This is a departure from John Gruber's original Markdown syntax -description, which explicitly allows whitespace between the link -text and the link label. It brings reference links in line with -[inline links], which (according to both original Markdown and -this spec) cannot have whitespace after the link text. More -importantly, it prevents inadvertent capture of consecutive -[shortcut reference links]. If whitespace is allowed between the -link text and the link label, then in the following we will have -a single reference link, not two shortcut reference links, as -intended: - -``` markdown -[foo] -[bar] - -[foo]: /url1 -[bar]: /url2 -``` - -(Note that [shortcut reference links] were introduced by Gruber -himself in a beta version of `Markdown.pl`, but never included -in the official syntax description. Without shortcut reference -links, it is harmless to allow space between the link text and -link label; but once shortcut references are introduced, it is -too dangerous to allow this, as it frequently leads to -unintended results.) - -When there are multiple matching [link reference definitions], -the first is used: - -```````````````````````````````` example -[foo]: /url1 - -[foo]: /url2 - -[bar][foo] -. -

              bar

              -```````````````````````````````` - - -Note that matching is performed on normalized strings, not parsed -inline content. So the following does not match, even though the -labels define equivalent inline content: - -```````````````````````````````` example -[bar][foo\!] - -[foo!]: /url -. -

              [bar][foo!]

              -```````````````````````````````` - - -[Link labels] cannot contain brackets, unless they are -backslash-escaped: - -```````````````````````````````` example -[foo][ref[] - -[ref[]: /uri -. -

              [foo][ref[]

              -

              [ref[]: /uri

              -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref[bar]] - -[ref[bar]]: /uri -. -

              [foo][ref[bar]]

              -

              [ref[bar]]: /uri

              -```````````````````````````````` - - -```````````````````````````````` example -[[[foo]]] - -[[[foo]]]: /url -. -

              [[[foo]]]

              -

              [[[foo]]]: /url

              -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref\[] - -[ref\[]: /uri -. -

              foo

              -```````````````````````````````` - - -Note that in this example `]` is not backslash-escaped: - -```````````````````````````````` example -[bar\\]: /uri - -[bar\\] -. -

              bar\

              -```````````````````````````````` - - -A [link label] must contain at least one [non-whitespace character]: - -```````````````````````````````` example -[] - -[]: /uri -. -

              []

              -

              []: /uri

              -```````````````````````````````` - - -```````````````````````````````` example -[ - ] - -[ - ]: /uri -. -

              [ -]

              -

              [ -]: /uri

              -```````````````````````````````` - - -A [collapsed reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document, followed by the string `[]`. -The contents of the first link label are parsed as inlines, -which are used as the link's text. The link's URI and title are -provided by the matching reference link definition. Thus, -`[foo][]` is equivalent to `[foo][foo]`. - -```````````````````````````````` example -[foo][] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar][] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo][] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - - -As with full reference links, [whitespace] is not -allowed between the two sets of brackets: - -```````````````````````````````` example -[foo] -[] - -[foo]: /url "title" -. -

              foo -[]

              -```````````````````````````````` - - -A [shortcut reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document and is not followed by `[]` or a link label. -The contents of the first link label are parsed as inlines, -which are used as the link's text. The link's URI and title -are provided by the matching link reference definition. -Thus, `[foo]` is equivalent to `[foo][]`. - -```````````````````````````````` example -[foo] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -[[*foo* bar]] - -[*foo* bar]: /url "title" -. -

              [foo bar]

              -```````````````````````````````` - - -```````````````````````````````` example -[[bar [foo] - -[foo]: /url -. -

              [[bar foo

              -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - -A space after the link text should be preserved: - -```````````````````````````````` example -[foo] bar - -[foo]: /url -. -

              foo bar

              -```````````````````````````````` - - -If you just want bracketed text, you can backslash-escape the -opening bracket to avoid links: - -```````````````````````````````` example -\[foo] - -[foo]: /url "title" -. -

              [foo]

              -```````````````````````````````` - - -Note that this is a link, because a link label ends with the first -following closing bracket: - -```````````````````````````````` example -[foo*]: /url - -*[foo*] -. -

              *foo*

              -```````````````````````````````` - - -Full and compact references take precedence over shortcut -references: - -```````````````````````````````` example -[foo][bar] - -[foo]: /url1 -[bar]: /url2 -. -

              foo

              -```````````````````````````````` - -```````````````````````````````` example -[foo][] - -[foo]: /url1 -. -

              foo

              -```````````````````````````````` - -Inline links also take precedence: - -```````````````````````````````` example -[foo]() - -[foo]: /url1 -. -

              foo

              -```````````````````````````````` - -```````````````````````````````` example -[foo](not a link) - -[foo]: /url1 -. -

              foo(not a link)

              -```````````````````````````````` - -In the following case `[bar][baz]` is parsed as a reference, -`[foo]` as normal text: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url -. -

              [foo]bar

              -```````````````````````````````` - - -Here, though, `[foo][bar]` is parsed as a reference, since -`[bar]` is defined: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[bar]: /url2 -. -

              foobaz

              -```````````````````````````````` - - -Here `[foo]` is not parsed as a shortcut reference, because it -is followed by a link label (even though `[bar]` is not defined): - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[foo]: /url2 -. -

              [foo]bar

              -```````````````````````````````` - - - -## Images - -Syntax for images is like the syntax for links, with one -difference. Instead of [link text], we have an -[image description](@). The rules for this are the -same as for [link text], except that (a) an -image description starts with `![` rather than `[`, and -(b) an image description may contain links. -An image description has inline elements -as its contents. When an image is rendered to HTML, -this is standardly used as the image's `alt` attribute. - -```````````````````````````````` example -![foo](/url "title") -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*] - -[foo *bar*]: train.jpg "train & tracks" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo ![bar](/url)](/url2) -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo [bar](/url)](/url2) -. -

              foo bar

              -```````````````````````````````` - - -Though this spec is concerned with parsing, not rendering, it is -recommended that in rendering to HTML, only the plain string content -of the [image description] be used. Note that in -the above example, the alt attribute's value is `foo bar`, not `foo -[bar](/url)` or `foo bar`. Only the plain string -content is rendered, without formatting. - -```````````````````````````````` example -![foo *bar*][] - -[foo *bar*]: train.jpg "train & tracks" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*][foobar] - -[FOOBAR]: train.jpg "train & tracks" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo](train.jpg) -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -My ![foo bar](/path/to/train.jpg "title" ) -. -

              My foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo]() -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![](/url) -. -

              -```````````````````````````````` - - -Reference-style: - -```````````````````````````````` example -![foo][bar] - -[bar]: /url -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![foo][bar] - -[BAR]: /url -. -

              foo

              -```````````````````````````````` - - -Collapsed: - -```````````````````````````````` example -![foo][] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar][] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -The labels are case-insensitive: - -```````````````````````````````` example -![Foo][] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - -As with reference links, [whitespace] is not allowed -between the two sets of brackets: - -```````````````````````````````` example -![foo] -[] - -[foo]: /url "title" -. -

              foo -[]

              -```````````````````````````````` - - -Shortcut: - -```````````````````````````````` example -![foo] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -Note that link labels cannot contain unescaped brackets: - -```````````````````````````````` example -![[foo]] - -[[foo]]: /url "title" -. -

              ![[foo]]

              -

              [[foo]]: /url "title"

              -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -![Foo] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - -If you just want a literal `!` followed by bracketed text, you can -backslash-escape the opening `[`: - -```````````````````````````````` example -!\[foo] - -[foo]: /url "title" -. -

              ![foo]

              -```````````````````````````````` - - -If you want a link after a literal `!`, backslash-escape the -`!`: - -```````````````````````````````` example -\![foo] - -[foo]: /url "title" -. -

              !foo

              -```````````````````````````````` - - -## Autolinks - -[Autolink](@)s are absolute URIs and email addresses inside -`<` and `>`. They are parsed as links, with the URL or email address -as the link label. - -A [URI autolink](@) consists of `<`, followed by an -[absolute URI] followed by `>`. It is parsed as -a link to the URI, with the URI as the link's label. - -An [absolute URI](@), -for these purposes, consists of a [scheme] followed by a colon (`:`) -followed by zero or more characters other than ASCII -[whitespace] and control characters, `<`, and `>`. If -the URI includes these characters, they must be percent-encoded -(e.g. `%20` for a space). - -For purposes of this spec, a [scheme](@) is any sequence -of 2--32 characters beginning with an ASCII letter and followed -by any combination of ASCII letters, digits, or the symbols plus -("+"), period ("."), or hyphen ("-"). - -Here are some valid autolinks: - -```````````````````````````````` example - -. -

              http://foo.bar.baz

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              http://foo.bar.baz/test?q=hello&id=22&boolean

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              irc://foo.bar:2233/baz

              -```````````````````````````````` - - -Uppercase is also fine: - -```````````````````````````````` example - -. -

              MAILTO:FOO@BAR.BAZ

              -```````````````````````````````` - - -Note that many strings that count as [absolute URIs] for -purposes of this spec are not valid URIs, because their -schemes are not registered or because of other problems -with their syntax: - -```````````````````````````````` example - -. -

              a+b+c:d

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              made-up-scheme://foo,bar

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              http://../

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              localhost:5001/foo

              -```````````````````````````````` - - -Spaces are not allowed in autolinks: - -```````````````````````````````` example - -. -

              <http://foo.bar/baz bim>

              -```````````````````````````````` - - -Backslash-escapes do not work inside autolinks: - -```````````````````````````````` example - -. -

              http://example.com/\[\

              -```````````````````````````````` - - -An [email autolink](@) -consists of `<`, followed by an [email address], -followed by `>`. The link's label is the email address, -and the URL is `mailto:` followed by the email address. - -An [email address](@), -for these purposes, is anything that matches -the [non-normative regex from the HTML5 -spec](https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)): - - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? - (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ - -Examples of email autolinks: - -```````````````````````````````` example - -. -

              foo@bar.example.com

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              foo+special@Bar.baz-bar0.com

              -```````````````````````````````` - - -Backslash-escapes do not work inside email autolinks: - -```````````````````````````````` example - -. -

              <foo+@bar.example.com>

              -```````````````````````````````` - - -These are not autolinks: - -```````````````````````````````` example -<> -. -

              <>

              -```````````````````````````````` - - -```````````````````````````````` example -< http://foo.bar > -. -

              < http://foo.bar >

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              <m:abc>

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              <foo.bar.baz>

              -```````````````````````````````` - - -```````````````````````````````` example -http://example.com -. -

              http://example.com

              -```````````````````````````````` - - -```````````````````````````````` example -foo@bar.example.com -. -

              foo@bar.example.com

              -```````````````````````````````` - - -## Raw HTML - -Text between `<` and `>` that looks like an HTML tag is parsed as a -raw HTML tag and will be rendered in HTML without escaping. -Tag and attribute names are not limited to current HTML tags, -so custom tags (and even, say, DocBook tags) may be used. - -Here is the grammar for tags: - -A [tag name](@) consists of an ASCII letter -followed by zero or more ASCII letters, digits, or -hyphens (`-`). - -An [attribute](@) consists of [whitespace], -an [attribute name], and an optional -[attribute value specification]. - -An [attribute name](@) -consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII -letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML -specification restricted to ASCII. HTML5 is laxer.) - -An [attribute value specification](@) -consists of optional [whitespace], -a `=` character, optional [whitespace], and an [attribute -value]. - -An [attribute value](@) -consists of an [unquoted attribute value], -a [single-quoted attribute value], or a [double-quoted attribute value]. - -An [unquoted attribute value](@) -is a nonempty string of characters not -including [whitespace], `"`, `'`, `=`, `<`, `>`, or `` ` ``. - -A [single-quoted attribute value](@) -consists of `'`, zero or more -characters not including `'`, and a final `'`. - -A [double-quoted attribute value](@) -consists of `"`, zero or more -characters not including `"`, and a final `"`. - -An [open tag](@) consists of a `<` character, a [tag name], -zero or more [attributes], optional [whitespace], an optional `/` -character, and a `>` character. - -A [closing tag](@) consists of the string ``. - -An [HTML comment](@) consists of ``, -where *text* does not start with `>` or `->`, does not end with `-`, -and does not contain `--`. (See the -[HTML5 spec](http://www.w3.org/TR/html5/syntax.html#comments).) - -A [processing instruction](@) -consists of the string ``, and the string -`?>`. - -A [declaration](@) consists of the -string ``, and the character `>`. - -A [CDATA section](@) consists of -the string ``, and the string `]]>`. - -An [HTML tag](@) consists of an [open tag], a [closing tag], -an [HTML comment], a [processing instruction], a [declaration], -or a [CDATA section]. - -Here are some simple open tags: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -Empty elements: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -[Whitespace] is allowed: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -With attributes: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -Custom tag names can be used: - -```````````````````````````````` example -Foo -. -

              Foo

              -```````````````````````````````` - - -Illegal tag names, not parsed as HTML: - -```````````````````````````````` example -<33> <__> -. -

              <33> <__>

              -```````````````````````````````` - - -Illegal attribute names: - -```````````````````````````````` example -
              -. -

              <a h*#ref="hi">

              -```````````````````````````````` - - -Illegal attribute values: - -```````````````````````````````` example -
              -. -

              </a href="foo">

              -```````````````````````````````` - - -Comments: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -foo -. -

              foo <!-- not a comment -- two hyphens -->

              -```````````````````````````````` - - -Not comments: - -```````````````````````````````` example -foo foo --> - -foo -. -

              foo <!--> foo -->

              -

              foo <!-- foo--->

              -```````````````````````````````` - - -Processing instructions: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -Declarations: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -CDATA sections: - -```````````````````````````````` example -foo &<]]> -. -

              foo &<]]>

              -```````````````````````````````` - - -Entity and numeric character references are preserved in HTML -attributes: - -```````````````````````````````` example -foo
              -. -

              foo

              -```````````````````````````````` - - -Backslash escapes do not work in HTML attributes: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              <a href=""">

              -```````````````````````````````` - - -## Hard line breaks - -A line break (not in a code span or HTML tag) that is preceded -by two or more spaces and does not occur at the end of a block -is parsed as a [hard line break](@) (rendered -in HTML as a `
              ` tag): - -```````````````````````````````` example -foo -baz -. -

              foo
              -baz

              -```````````````````````````````` - - -For a more visible alternative, a backslash before the -[line ending] may be used instead of two spaces: - -```````````````````````````````` example -foo\ -baz -. -

              foo
              -baz

              -```````````````````````````````` - - -More than two spaces can be used: - -```````````````````````````````` example -foo -baz -. -

              foo
              -baz

              -```````````````````````````````` - - -Leading spaces at the beginning of the next line are ignored: - -```````````````````````````````` example -foo - bar -. -

              foo
              -bar

              -```````````````````````````````` - - -```````````````````````````````` example -foo\ - bar -. -

              foo
              -bar

              -```````````````````````````````` - - -Line breaks can occur inside emphasis, links, and other constructs -that allow inline content: - -```````````````````````````````` example -*foo -bar* -. -

              foo
              -bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo\ -bar* -. -

              foo
              -bar

              -```````````````````````````````` - - -Line breaks do not occur inside code spans - -```````````````````````````````` example -`code -span` -. -

              code span

              -```````````````````````````````` - - -```````````````````````````````` example -`code\ -span` -. -

              code\ span

              -```````````````````````````````` - - -or HTML tags: - -```````````````````````````````` example -
              -. -

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -Hard line breaks are for separating inline content within a block. -Neither syntax for hard line breaks works at the end of a paragraph or -other block element: - -```````````````````````````````` example -foo\ -. -

              foo\

              -```````````````````````````````` - - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -### foo\ -. -

              foo\

              -```````````````````````````````` - - -```````````````````````````````` example -### foo -. -

              foo

              -```````````````````````````````` - - -## Soft line breaks - -A regular line break (not in a code span or HTML tag) that is not -preceded by two or more spaces or a backslash is parsed as a -[softbreak](@). (A softbreak may be rendered in HTML either as a -[line ending] or as a space. The result will be the same in -browsers. In the examples here, a [line ending] will be used.) - -```````````````````````````````` example -foo -baz -. -

              foo -baz

              -```````````````````````````````` - - -Spaces at the end of the line and beginning of the next line are -removed: - -```````````````````````````````` example -foo - baz -. -

              foo -baz

              -```````````````````````````````` - - -A conforming parser may render a soft line break in HTML either as a -line break or as a space. - -A renderer may also provide an option to render soft line breaks -as hard line breaks. - -## Textual content - -Any characters not given an interpretation by the above rules will -be parsed as plain textual content. - -```````````````````````````````` example -hello $.;'there -. -

              hello $.;'there

              -```````````````````````````````` - - -```````````````````````````````` example -Foo χρῆν -. -

              Foo χρῆν

              -```````````````````````````````` - - -Internal spaces are preserved verbatim: - -```````````````````````````````` example -Multiple spaces -. -

              Multiple spaces

              -```````````````````````````````` - - - - -# Appendix: A parsing strategy - -In this appendix we describe some features of the parsing strategy -used in the CommonMark reference implementations. - -## Overview - -Parsing has two phases: - -1. In the first phase, lines of input are consumed and the block -structure of the document---its division into paragraphs, block quotes, -list items, and so on---is constructed. Text is assigned to these -blocks but not parsed. Link reference definitions are parsed and a -map of links is constructed. - -2. In the second phase, the raw text contents of paragraphs and headings -are parsed into sequences of Markdown inline elements (strings, -code spans, links, emphasis, and so on), using the map of link -references constructed in phase 1. - -At each point in processing, the document is represented as a tree of -**blocks**. The root of the tree is a `document` block. The `document` -may have any number of other blocks as **children**. These children -may, in turn, have other blocks as children. The last child of a block -is normally considered **open**, meaning that subsequent lines of input -can alter its contents. (Blocks that are not open are **closed**.) -Here, for example, is a possible document tree, with the open blocks -marked by arrows: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 1: block structure - -Each line that is processed has an effect on this tree. The line is -analyzed and, depending on its contents, the document may be altered -in one or more of the following ways: - -1. One or more open blocks may be closed. -2. One or more new blocks may be created as children of the - last open block. -3. Text may be added to the last (deepest) open block remaining - on the tree. - -Once a line has been incorporated into the tree in this way, -it can be discarded, so input can be read in a stream. - -For each line, we follow this procedure: - -1. First we iterate through the open blocks, starting with the -root document, and descending through last children down to the last -open block. Each block imposes a condition that the line must satisfy -if the block is to remain open. For example, a block quote requires a -`>` character. A paragraph requires a non-blank line. -In this phase we may match all or just some of the open -blocks. But we cannot close unmatched blocks yet, because we may have a -[lazy continuation line]. - -2. Next, after consuming the continuation markers for existing -blocks, we look for new block starts (e.g. `>` for a block quote). -If we encounter a new block start, we close any blocks unmatched -in step 1 before creating the new block as a child of the last -matched block. - -3. Finally, we look at the remainder of the line (after block -markers like `>`, list markers, and indentation have been consumed). -This is text that can be incorporated into the last open -block (a paragraph, code block, heading, or raw HTML). - -Setext headings are formed when we see a line of a paragraph -that is a [setext heading underline]. - -Reference link definitions are detected when a paragraph is closed; -the accumulated text lines are parsed to see if they begin with -one or more reference link definitions. Any remainder becomes a -normal paragraph. - -We can see how this works by considering how the tree above is -generated by four lines of Markdown: - -``` markdown -> Lorem ipsum dolor -sit amet. -> - Qui *quodsi iracundia* -> - aliquando id -``` - -At the outset, our document model is just - -``` tree --> document -``` - -The first line of our text, - -``` markdown -> Lorem ipsum dolor -``` - -causes a `block_quote` block to be created as a child of our -open `document` block, and a `paragraph` block as a child of -the `block_quote`. Then the text is added to the last open -block, the `paragraph`: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor" -``` - -The next line, - -``` markdown -sit amet. -``` - -is a "lazy continuation" of the open `paragraph`, so it gets added -to the paragraph's text: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor\nsit amet." -``` - -The third line, - -``` markdown -> - Qui *quodsi iracundia* -``` - -causes the `paragraph` block to be closed, and a new `list` block -opened as a child of the `block_quote`. A `list_item` is also -added as a child of the `list`, and a `paragraph` as a child of -the `list_item`. The text is then added to the new `paragraph`: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - -> list_item - -> paragraph - "Qui *quodsi iracundia*" -``` - -The fourth line, - -``` markdown -> - aliquando id -``` - -causes the `list_item` (and its child the `paragraph`) to be closed, -and a new `list_item` opened up as child of the `list`. A `paragraph` -is added as a child of the new `list_item`, to contain the text. -We thus obtain the final tree: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 2: inline structure - -Once all of the input has been parsed, all open blocks are closed. - -We then "walk the tree," visiting every node, and parse raw -string contents of paragraphs and headings as inlines. At this -point we have seen all the link reference definitions, so we can -resolve reference links as we go. - -``` tree -document - block_quote - paragraph - str "Lorem ipsum dolor" - softbreak - str "sit amet." - list (type=bullet tight=true bullet_char=-) - list_item - paragraph - str "Qui " - emph - str "quodsi iracundia" - list_item - paragraph - str "aliquando id" -``` - -Notice how the [line ending] in the first paragraph has -been parsed as a `softbreak`, and the asterisks in the first list item -have become an `emph`. - -### An algorithm for parsing nested emphasis and links - -By far the trickiest part of inline parsing is handling emphasis, -strong emphasis, links, and images. This is done using the following -algorithm. - -When we're parsing inlines and we hit either - -- a run of `*` or `_` characters, or -- a `[` or `![` - -we insert a text node with these symbols as its literal content, and we -add a pointer to this text node to the [delimiter stack](@). - -The [delimiter stack] is a doubly linked list. Each -element contains a pointer to a text node, plus information about - -- the type of delimiter (`[`, `![`, `*`, `_`) -- the number of delimiters, -- whether the delimiter is "active" (all are active to start), and -- whether the delimiter is a potential opener, a potential closer, - or both (which depends on what sort of characters precede - and follow the delimiters). - -When we hit a `]` character, we call the *look for link or image* -procedure (see below). - -When we hit the end of the input, we call the *process emphasis* -procedure (see below), with `stack_bottom` = NULL. - -#### *look for link or image* - -Starting at the top of the delimiter stack, we look backwards -through the stack for an opening `[` or `![` delimiter. - -- If we don't find one, we return a literal text node `]`. - -- If we do find one, but it's not *active*, we remove the inactive - delimiter from the stack, and return a literal text node `]`. - -- If we find one and it's active, then we parse ahead to see if - we have an inline link/image, reference link/image, compact reference - link/image, or shortcut reference link/image. - - + If we don't, then we remove the opening delimiter from the - delimiter stack and return a literal text node `]`. - - + If we do, then - - * We return a link or image node whose children are the inlines - after the text node pointed to by the opening delimiter. - - * We run *process emphasis* on these inlines, with the `[` opener - as `stack_bottom`. - - * We remove the opening delimiter. - - * If we have a link (and not an image), we also set all - `[` delimiters before the opening delimiter to *inactive*. (This - will prevent us from getting links within links.) - -#### *process emphasis* - -Parameter `stack_bottom` sets a lower bound to how far we -descend in the [delimiter stack]. If it is NULL, we can -go all the way to the bottom. Otherwise, we stop before -visiting `stack_bottom`. - -Let `current_position` point to the element on the [delimiter stack] -just above `stack_bottom` (or the first element if `stack_bottom` -is NULL). - -We keep track of the `openers_bottom` for each delimiter -type (`*`, `_`) and each length of the closing delimiter run -(modulo 3). Initialize this to `stack_bottom`. - -Then we repeat the following until we run out of potential -closers: - -- Move `current_position` forward in the delimiter stack (if needed) - until we find the first potential closer with delimiter `*` or `_`. - (This will be the potential closer closest - to the beginning of the input -- the first one in parse order.) - -- Now, look back in the stack (staying above `stack_bottom` and - the `openers_bottom` for this delimiter type) for the - first matching potential opener ("matching" means same delimiter). - -- If one is found: - - + Figure out whether we have emphasis or strong emphasis: - if both closer and opener spans have length >= 2, we have - strong, otherwise regular. - - + Insert an emph or strong emph node accordingly, after - the text node corresponding to the opener. - - + Remove any delimiters between the opener and closer from - the delimiter stack. - - + Remove 1 (for regular emph) or 2 (for strong emph) delimiters - from the opening and closing text nodes. If they become empty - as a result, remove them and remove the corresponding element - of the delimiter stack. If the closing node is removed, reset - `current_position` to the next element in the stack. - -- If none is found: - - + Set `openers_bottom` to the element before `current_position`. - (We know that there are no openers for this kind of closer up to and - including this point, so this puts a lower bound on future searches.) - - + If the closer at `current_position` is not a potential opener, - remove it from the delimiter stack (since we know it can't - be a closer either). - - + Advance `current_position` to the next element in the stack. - -After we're done, we remove all delimiters above `stack_bottom` from the -delimiter stack. - diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/cmark_benchmark.c b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/cmark_benchmark.c deleted file mode 100644 index b4743584f..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/cmark_benchmark.c +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include -#ifdef WIN32 -# include -#else -# include -# include -#endif -#include "cmark.h" - - -#ifdef WIN32 - -double get_time() -{ - LARGE_INTEGER t, f; - QueryPerformanceCounter(&t); - QueryPerformanceFrequency(&f); - return (double)t.QuadPart/(double)f.QuadPart; -} - -#else - - -double get_time() -{ - struct timeval t; - struct timezone tzp; - gettimeofday(&t, &tzp); - return t.tv_sec + t.tv_usec*1e-6; -} - -#endif - -int main(int argc, char **argv) { - char *markdown_file; - FILE *fp; - size_t size; - char *buf; - char *html; - double start, sum; - int i, n; - - n = argc > 1 ? atoi(argv[1]) : 50; - markdown_file = argc > 2 ? argv[2] : "_data.md"; - - fp = fopen(markdown_file,"r"); - if(fp == NULL){ - fprintf(stderr, "can not open %s", markdown_file); - exit(1); - } - - if(fseek(fp, 0, SEEK_END) != 0) { - fprintf(stderr, "can not seek %s", markdown_file); - exit(1); - } - if((size = ftell(fp)) < 0) { - fprintf(stderr, "can not get size of %s", markdown_file); - exit(1); - } - if(fseek(fp, 0, SEEK_SET) != 0) { - fprintf(stderr, "can not seek %s", markdown_file); - exit(1); - } - buf = malloc(sizeof(char) * size); - if(buf == NULL) { - fprintf(stderr, "can not allocate memory for %s", markdown_file); - exit(1); - } - - if(fread(buf, 1, size, fp) < size) { - fprintf(stderr, "failed to read for %s", markdown_file); - exit(1); - } - - fclose(fp); - - for(i = 0; i < n; i++) { - start = get_time(); - html = cmark_markdown_to_html(buf, size, CMARK_OPT_UNSAFE); - free(html); - sum += get_time() - start; - } - printf("----------- cmark -----------\n"); - printf("file: %s\n", markdown_file); - printf("iteration: %d\n", n); - printf("average: %.10f sec\n", sum / (double)n); - - free(buf); - return 0; -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/goldmark_benchmark.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/goldmark_benchmark.go deleted file mode 100644 index 9647de347..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/cmark/goldmark_benchmark.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "strconv" - "time" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" -) - -func main() { - n := 50 - file := "_data.md" - if len(os.Args) > 1 { - n, _ = strconv.Atoi(os.Args[1]) - } - if len(os.Args) > 2 { - file = os.Args[2] - } - source, err := ioutil.ReadFile(file) - if err != nil { - panic(err) - } - markdown := goldmark.New(goldmark.WithRendererOptions(html.WithXHTML(), html.WithUnsafe())) - var out bytes.Buffer - markdown.Convert([]byte(""), &out) - - sum := time.Duration(0) - for i := 0; i < n; i++ { - start := time.Now() - out.Reset() - if err := markdown.Convert(source, &out); err != nil { - panic(err) - } - sum += time.Since(start) - } - fmt.Printf("------- goldmark -------\n") - fmt.Printf("file: %s\n", file) - fmt.Printf("iteration: %d\n", n) - fmt.Printf("average: %.10f sec\n", float64((int64(sum)/int64(n)))/1000000000.0) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/go/_data.md b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/go/_data.md deleted file mode 100644 index 87db650b7..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/go/_data.md +++ /dev/null @@ -1,9702 +0,0 @@ -# Introduction - -## What is Markdown? - -Markdown is a plain text format for writing structured documents, -based on conventions for indicating formatting in email -and usenet posts. It was developed by John Gruber (with -help from Aaron Swartz) and released in 2004 in the form of a -[syntax description](http://daringfireball.net/projects/markdown/syntax) -and a Perl script (`Markdown.pl`) for converting Markdown to -HTML. In the next decade, dozens of implementations were -developed in many languages. Some extended the original -Markdown syntax with conventions for footnotes, tables, and -other document elements. Some allowed Markdown documents to be -rendered in formats other than HTML. Websites like Reddit, -StackOverflow, and GitHub had millions of people using Markdown. -And Markdown started to be used beyond the web, to author books, -articles, slide shows, letters, and lecture notes. - -What distinguishes Markdown from many other lightweight markup -syntaxes, which are often easier to write, is its readability. -As Gruber writes: - -> The overriding design goal for Markdown's formatting syntax is -> to make it as readable as possible. The idea is that a -> Markdown-formatted document should be publishable as-is, as -> plain text, without looking like it's been marked up with tags -> or formatting instructions. -> () - -The point can be illustrated by comparing a sample of -[AsciiDoc](http://www.methods.co.nz/asciidoc/) with -an equivalent sample of Markdown. Here is a sample of -AsciiDoc from the AsciiDoc manual: - -``` -1. List item one. -+ -List item one continued with a second paragraph followed by an -Indented block. -+ -................. -$ ls *.sh -$ mv *.sh ~/tmp -................. -+ -List item continued with a third paragraph. - -2. List item two continued with an open block. -+ --- -This paragraph is part of the preceding list item. - -a. This list is nested and does not require explicit item -continuation. -+ -This paragraph is part of the preceding list item. - -b. List item b. - -This paragraph belongs to item two of the outer list. --- -``` - -And here is the equivalent in Markdown: -``` -1. List item one. - - List item one continued with a second paragraph followed by an - Indented block. - - $ ls *.sh - $ mv *.sh ~/tmp - - List item continued with a third paragraph. - -2. List item two continued with an open block. - - This paragraph is part of the preceding list item. - - 1. This list is nested and does not require explicit item continuation. - - This paragraph is part of the preceding list item. - - 2. List item b. - - This paragraph belongs to item two of the outer list. -``` - -The AsciiDoc version is, arguably, easier to write. You don't need -to worry about indentation. But the Markdown version is much easier -to read. The nesting of list items is apparent to the eye in the -source, not just in the processed document. - -## Why is a spec needed? - -John Gruber's [canonical description of Markdown's -syntax](http://daringfireball.net/projects/markdown/syntax) -does not specify the syntax unambiguously. Here are some examples of -questions it does not answer: - -1. How much indentation is needed for a sublist? The spec says that - continuation paragraphs need to be indented four spaces, but is - not fully explicit about sublists. It is natural to think that - they, too, must be indented four spaces, but `Markdown.pl` does - not require that. This is hardly a "corner case," and divergences - between implementations on this issue often lead to surprises for - users in real documents. (See [this comment by John - Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).) - -2. Is a blank line needed before a block quote or heading? - Most implementations do not require the blank line. However, - this can lead to unexpected results in hard-wrapped text, and - also to ambiguities in parsing (note that some implementations - put the heading inside the blockquote, while others do not). - (John Gruber has also spoken [in favor of requiring the blank - lines](http://article.gmane.org/gmane.text.markdown.general/2146).) - -3. Is a blank line needed before an indented code block? - (`Markdown.pl` requires it, but this is not mentioned in the - documentation, and some implementations do not require it.) - - ``` markdown - paragraph - code? - ``` - -4. What is the exact rule for determining when list items get - wrapped in `

              ` tags? Can a list be partially "loose" and partially - "tight"? What should we do with a list like this? - - ``` markdown - 1. one - - 2. two - 3. three - ``` - - Or this? - - ``` markdown - 1. one - - a - - - b - 2. two - ``` - - (There are some relevant comments by John Gruber - [here](http://article.gmane.org/gmane.text.markdown.general/2554).) - -5. Can list markers be indented? Can ordered list markers be right-aligned? - - ``` markdown - 8. item 1 - 9. item 2 - 10. item 2a - ``` - -6. Is this one list with a thematic break in its second item, - or two lists separated by a thematic break? - - ``` markdown - * a - * * * * * - * b - ``` - -7. When list markers change from numbers to bullets, do we have - two lists or one? (The Markdown syntax description suggests two, - but the perl scripts and many other implementations produce one.) - - ``` markdown - 1. fee - 2. fie - - foe - - fum - ``` - -8. What are the precedence rules for the markers of inline structure? - For example, is the following a valid link, or does the code span - take precedence ? - - ``` markdown - [a backtick (`)](/url) and [another backtick (`)](/url). - ``` - -9. What are the precedence rules for markers of emphasis and strong - emphasis? For example, how should the following be parsed? - - ``` markdown - *foo *bar* baz* - ``` - -10. What are the precedence rules between block-level and inline-level - structure? For example, how should the following be parsed? - - ``` markdown - - `a long code span can contain a hyphen like this - - and it can screw things up` - ``` - -11. Can list items include section headings? (`Markdown.pl` does not - allow this, but does allow blockquotes to include headings.) - - ``` markdown - - # Heading - ``` - -12. Can list items be empty? - - ``` markdown - * a - * - * b - ``` - -13. Can link references be defined inside block quotes or list items? - - ``` markdown - > Blockquote [foo]. - > - > [foo]: /url - ``` - -14. If there are multiple definitions for the same reference, which takes - precedence? - - ``` markdown - [foo]: /url1 - [foo]: /url2 - - [foo][] - ``` - -In the absence of a spec, early implementers consulted `Markdown.pl` -to resolve these ambiguities. But `Markdown.pl` was quite buggy, and -gave manifestly bad results in many cases, so it was not a -satisfactory replacement for a spec. - -Because there is no unambiguous spec, implementations have diverged -considerably. As a result, users are often surprised to find that -a document that renders one way on one system (say, a GitHub wiki) -renders differently on another (say, converting to docbook using -pandoc). To make matters worse, because nothing in Markdown counts -as a "syntax error," the divergence often isn't discovered right away. - -## About this document - -This document attempts to specify Markdown syntax unambiguously. -It contains many examples with side-by-side Markdown and -HTML. These are intended to double as conformance tests. An -accompanying script `spec_tests.py` can be used to run the tests -against any Markdown program: - - python test/spec_tests.py --spec spec.txt --program PROGRAM - -Since this document describes how Markdown is to be parsed into -an abstract syntax tree, it would have made sense to use an abstract -representation of the syntax tree instead of HTML. But HTML is capable -of representing the structural distinctions we need to make, and the -choice of HTML for the tests makes it possible to run the tests against -an implementation without writing an abstract syntax tree renderer. - -This document is generated from a text file, `spec.txt`, written -in Markdown with a small extension for the side-by-side tests. -The script `tools/makespec.py` can be used to convert `spec.txt` into -HTML or CommonMark (which can then be converted into other formats). - -In the examples, the `→` character is used to represent tabs. - -# Preliminaries - -## Characters and lines - -Any sequence of [characters] is a valid CommonMark -document. - -A [character](@) is a Unicode code point. Although some -code points (for example, combining accents) do not correspond to -characters in an intuitive sense, all code points count as characters -for purposes of this spec. - -This spec does not specify an encoding; it thinks of lines as composed -of [characters] rather than bytes. A conforming parser may be limited -to a certain encoding. - -A [line](@) is a sequence of zero or more [characters] -other than newline (`U+000A`) or carriage return (`U+000D`), -followed by a [line ending] or by the end of file. - -A [line ending](@) is a newline (`U+000A`), a carriage return -(`U+000D`) not followed by a newline, or a carriage return and a -following newline. - -A line containing no characters, or a line containing only spaces -(`U+0020`) or tabs (`U+0009`), is called a [blank line](@). - -The following definitions of character classes will be used in this spec: - -A [whitespace character](@) is a space -(`U+0020`), tab (`U+0009`), newline (`U+000A`), line tabulation (`U+000B`), -form feed (`U+000C`), or carriage return (`U+000D`). - -[Whitespace](@) is a sequence of one or more [whitespace -characters]. - -A [Unicode whitespace character](@) is -any code point in the Unicode `Zs` general category, or a tab (`U+0009`), -carriage return (`U+000D`), newline (`U+000A`), or form feed -(`U+000C`). - -[Unicode whitespace](@) is a sequence of one -or more [Unicode whitespace characters]. - -A [space](@) is `U+0020`. - -A [non-whitespace character](@) is any character -that is not a [whitespace character]. - -An [ASCII punctuation character](@) -is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, -`*`, `+`, `,`, `-`, `.`, `/` (U+0021–2F), -`:`, `;`, `<`, `=`, `>`, `?`, `@` (U+003A–0040), -`[`, `\`, `]`, `^`, `_`, `` ` `` (U+005B–0060), -`{`, `|`, `}`, or `~` (U+007B–007E). - -A [punctuation character](@) is an [ASCII -punctuation character] or anything in -the general Unicode categories `Pc`, `Pd`, `Pe`, `Pf`, `Pi`, `Po`, or `Ps`. - -## Tabs - -Tabs in lines are not expanded to [spaces]. However, -in contexts where whitespace helps to define block structure, -tabs behave as if they were replaced by spaces with a tab stop -of 4 characters. - -Thus, for example, a tab can be used instead of four spaces -in an indented code block. (Note, however, that internal -tabs are passed through as literal tabs, not expanded to -spaces.) - -```````````````````````````````` example -→foo→baz→→bim -. -

              foo→baz→→bim
              -
              -```````````````````````````````` - -```````````````````````````````` example - →foo→baz→→bim -. -
              foo→baz→→bim
              -
              -```````````````````````````````` - -```````````````````````````````` example - a→a - ὐ→a -. -
              a→a
              -ὐ→a
              -
              -```````````````````````````````` - -In the following example, a continuation paragraph of a list -item is indented with a tab; this has exactly the same effect -as indentation with four spaces would: - -```````````````````````````````` example - - foo - -→bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - -```````````````````````````````` example -- foo - -→→bar -. -
                -
              • -

                foo

                -
                  bar
                -
                -
              • -
              -```````````````````````````````` - -Normally the `>` that begins a block quote may be followed -optionally by a space, which is not considered part of the -content. In the following case `>` is followed by a tab, -which is treated as if it were expanded into three spaces. -Since one of these spaces is considered part of the -delimiter, `foo` is considered to be indented six spaces -inside the block quote context, so we get an indented -code block starting with two spaces. - -```````````````````````````````` example ->→→foo -. -
              -
                foo
              -
              -
              -```````````````````````````````` - -```````````````````````````````` example --→→foo -. -
                -
              • -
                  foo
                -
                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example - foo -→bar -. -
              foo
              -bar
              -
              -```````````````````````````````` - -```````````````````````````````` example - - foo - - bar -→ - baz -. -
                -
              • foo -
                  -
                • bar -
                    -
                  • baz
                  • -
                  -
                • -
                -
              • -
              -```````````````````````````````` - -```````````````````````````````` example -#→Foo -. -

              Foo

              -```````````````````````````````` - -```````````````````````````````` example -*→*→*→ -. -
              -```````````````````````````````` - - -## Insecure characters - -For security reasons, the Unicode character `U+0000` must be replaced -with the REPLACEMENT CHARACTER (`U+FFFD`). - -# Blocks and inlines - -We can think of a document as a sequence of -[blocks](@)---structural elements like paragraphs, block -quotations, lists, headings, rules, and code blocks. Some blocks (like -block quotes and list items) contain other blocks; others (like -headings and paragraphs) contain [inline](@) content---text, -links, emphasized text, images, code spans, and so on. - -## Precedence - -Indicators of block structure always take precedence over indicators -of inline structure. So, for example, the following is a list with -two items, not a list with one item containing a code span: - -```````````````````````````````` example -- `one -- two` -. -
                -
              • `one
              • -
              • two`
              • -
              -```````````````````````````````` - - -This means that parsing can proceed in two steps: first, the block -structure of the document can be discerned; second, text lines inside -paragraphs, headings, and other block constructs can be parsed for inline -structure. The second step requires information about link reference -definitions that will be available only at the end of the first -step. Note that the first step requires processing lines in sequence, -but the second can be parallelized, since the inline parsing of -one block element does not affect the inline parsing of any other. - -## Container blocks and leaf blocks - -We can divide blocks into two types: -[container blocks](@), -which can contain other blocks, and [leaf blocks](@), -which cannot. - -# Leaf blocks - -This section describes the different kinds of leaf block that make up a -Markdown document. - -## Thematic breaks - -A line consisting of 0-3 spaces of indentation, followed by a sequence -of three or more matching `-`, `_`, or `*` characters, each followed -optionally by any number of spaces or tabs, forms a -[thematic break](@). - -```````````````````````````````` example -*** ---- -___ -. -
              -
              -
              -```````````````````````````````` - - -Wrong characters: - -```````````````````````````````` example -+++ -. -

              +++

              -```````````````````````````````` - - -```````````````````````````````` example -=== -. -

              ===

              -```````````````````````````````` - - -Not enough characters: - -```````````````````````````````` example --- -** -__ -. -

              -- -** -__

              -```````````````````````````````` - - -One to three spaces indent are allowed: - -```````````````````````````````` example - *** - *** - *** -. -
              -
              -
              -```````````````````````````````` - - -Four spaces is too many: - -```````````````````````````````` example - *** -. -
              ***
              -
              -```````````````````````````````` - - -```````````````````````````````` example -Foo - *** -. -

              Foo -***

              -```````````````````````````````` - - -More than three characters may be used: - -```````````````````````````````` example -_____________________________________ -. -
              -```````````````````````````````` - - -Spaces are allowed between the characters: - -```````````````````````````````` example - - - - -. -
              -```````````````````````````````` - - -```````````````````````````````` example - ** * ** * ** * ** -. -
              -```````````````````````````````` - - -```````````````````````````````` example -- - - - -. -
              -```````````````````````````````` - - -Spaces are allowed at the end: - -```````````````````````````````` example -- - - - -. -
              -```````````````````````````````` - - -However, no other characters may occur in the line: - -```````````````````````````````` example -_ _ _ _ a - -a------ - ----a--- -. -

              _ _ _ _ a

              -

              a------

              -

              ---a---

              -```````````````````````````````` - - -It is required that all of the [non-whitespace characters] be the same. -So, this is not a thematic break: - -```````````````````````````````` example - *-* -. -

              -

              -```````````````````````````````` - - -Thematic breaks do not need blank lines before or after: - -```````````````````````````````` example -- foo -*** -- bar -. -
                -
              • foo
              • -
              -
              -
                -
              • bar
              • -
              -```````````````````````````````` - - -Thematic breaks can interrupt a paragraph: - -```````````````````````````````` example -Foo -*** -bar -. -

              Foo

              -
              -

              bar

              -```````````````````````````````` - - -If a line of dashes that meets the above conditions for being a -thematic break could also be interpreted as the underline of a [setext -heading], the interpretation as a -[setext heading] takes precedence. Thus, for example, -this is a setext heading, not a paragraph followed by a thematic break: - -```````````````````````````````` example -Foo ---- -bar -. -

              Foo

              -

              bar

              -```````````````````````````````` - - -When both a thematic break and a list item are possible -interpretations of a line, the thematic break takes precedence: - -```````````````````````````````` example -* Foo -* * * -* Bar -. -
                -
              • Foo
              • -
              -
              -
                -
              • Bar
              • -
              -```````````````````````````````` - - -If you want a thematic break in a list item, use a different bullet: - -```````````````````````````````` example -- Foo -- * * * -. -
                -
              • Foo
              • -
              • -
                -
              • -
              -```````````````````````````````` - - -## ATX headings - -An [ATX heading](@) -consists of a string of characters, parsed as inline content, between an -opening sequence of 1--6 unescaped `#` characters and an optional -closing sequence of any number of unescaped `#` characters. -The opening sequence of `#` characters must be followed by a -[space] or by the end of line. The optional closing sequence of `#`s must be -preceded by a [space] and may be followed by spaces only. The opening -`#` character may be indented 0-3 spaces. The raw contents of the -heading are stripped of leading and trailing spaces before being parsed -as inline content. The heading level is equal to the number of `#` -characters in the opening sequence. - -Simple headings: - -```````````````````````````````` example -# foo -## foo -### foo -#### foo -##### foo -###### foo -. -

              foo

              -

              foo

              -

              foo

              -

              foo

              -
              foo
              -
              foo
              -```````````````````````````````` - - -More than six `#` characters is not a heading: - -```````````````````````````````` example -####### foo -. -

              ####### foo

              -```````````````````````````````` - - -At least one space is required between the `#` characters and the -heading's contents, unless the heading is empty. Note that many -implementations currently do not require the space. However, the -space was required by the -[original ATX implementation](http://www.aaronsw.com/2002/atx/atx.py), -and it helps prevent things like the following from being parsed as -headings: - -```````````````````````````````` example -#5 bolt - -#hashtag -. -

              #5 bolt

              -

              #hashtag

              -```````````````````````````````` - - -This is not a heading, because the first `#` is escaped: - -```````````````````````````````` example -\## foo -. -

              ## foo

              -```````````````````````````````` - - -Contents are parsed as inlines: - -```````````````````````````````` example -# foo *bar* \*baz\* -. -

              foo bar *baz*

              -```````````````````````````````` - - -Leading and trailing [whitespace] is ignored in parsing inline content: - -```````````````````````````````` example -# foo -. -

              foo

              -```````````````````````````````` - - -One to three spaces indentation are allowed: - -```````````````````````````````` example - ### foo - ## foo - # foo -. -

              foo

              -

              foo

              -

              foo

              -```````````````````````````````` - - -Four spaces are too much: - -```````````````````````````````` example - # foo -. -
              # foo
              -
              -```````````````````````````````` - - -```````````````````````````````` example -foo - # bar -. -

              foo -# bar

              -```````````````````````````````` - - -A closing sequence of `#` characters is optional: - -```````````````````````````````` example -## foo ## - ### bar ### -. -

              foo

              -

              bar

              -```````````````````````````````` - - -It need not be the same length as the opening sequence: - -```````````````````````````````` example -# foo ################################## -##### foo ## -. -

              foo

              -
              foo
              -```````````````````````````````` - - -Spaces are allowed after the closing sequence: - -```````````````````````````````` example -### foo ### -. -

              foo

              -```````````````````````````````` - - -A sequence of `#` characters with anything but [spaces] following it -is not a closing sequence, but counts as part of the contents of the -heading: - -```````````````````````````````` example -### foo ### b -. -

              foo ### b

              -```````````````````````````````` - - -The closing sequence must be preceded by a space: - -```````````````````````````````` example -# foo# -. -

              foo#

              -```````````````````````````````` - - -Backslash-escaped `#` characters do not count as part -of the closing sequence: - -```````````````````````````````` example -### foo \### -## foo #\## -# foo \# -. -

              foo ###

              -

              foo ###

              -

              foo #

              -```````````````````````````````` - - -ATX headings need not be separated from surrounding content by blank -lines, and they can interrupt paragraphs: - -```````````````````````````````` example -**** -## foo -**** -. -
              -

              foo

              -
              -```````````````````````````````` - - -```````````````````````````````` example -Foo bar -# baz -Bar foo -. -

              Foo bar

              -

              baz

              -

              Bar foo

              -```````````````````````````````` - - -ATX headings can be empty: - -```````````````````````````````` example -## -# -### ### -. -

              -

              -

              -```````````````````````````````` - - -## Setext headings - -A [setext heading](@) consists of one or more -lines of text, each containing at least one [non-whitespace -character], with no more than 3 spaces indentation, followed by -a [setext heading underline]. The lines of text must be such -that, were they not followed by the setext heading underline, -they would be interpreted as a paragraph: they cannot be -interpretable as a [code fence], [ATX heading][ATX headings], -[block quote][block quotes], [thematic break][thematic breaks], -[list item][list items], or [HTML block][HTML blocks]. - -A [setext heading underline](@) is a sequence of -`=` characters or a sequence of `-` characters, with no more than 3 -spaces indentation and any number of trailing spaces. If a line -containing a single `-` can be interpreted as an -empty [list items], it should be interpreted this way -and not as a [setext heading underline]. - -The heading is a level 1 heading if `=` characters are used in -the [setext heading underline], and a level 2 heading if `-` -characters are used. The contents of the heading are the result -of parsing the preceding lines of text as CommonMark inline -content. - -In general, a setext heading need not be preceded or followed by a -blank line. However, it cannot interrupt a paragraph, so when a -setext heading comes after a paragraph, a blank line is needed between -them. - -Simple examples: - -```````````````````````````````` example -Foo *bar* -========= - -Foo *bar* ---------- -. -

              Foo bar

              -

              Foo bar

              -```````````````````````````````` - - -The content of the header may span more than one line: - -```````````````````````````````` example -Foo *bar -baz* -==== -. -

              Foo bar -baz

              -```````````````````````````````` - -The contents are the result of parsing the headings's raw -content as inlines. The heading's raw content is formed by -concatenating the lines and removing initial and final -[whitespace]. - -```````````````````````````````` example - Foo *bar -baz*→ -==== -. -

              Foo bar -baz

              -```````````````````````````````` - - -The underlining can be any length: - -```````````````````````````````` example -Foo -------------------------- - -Foo -= -. -

              Foo

              -

              Foo

              -```````````````````````````````` - - -The heading content can be indented up to three spaces, and need -not line up with the underlining: - -```````````````````````````````` example - Foo ---- - - Foo ------ - - Foo - === -. -

              Foo

              -

              Foo

              -

              Foo

              -```````````````````````````````` - - -Four spaces indent is too much: - -```````````````````````````````` example - Foo - --- - - Foo ---- -. -
              Foo
              ----
              -
              -Foo
              -
              -
              -```````````````````````````````` - - -The setext heading underline can be indented up to three spaces, and -may have trailing spaces: - -```````````````````````````````` example -Foo - ---- -. -

              Foo

              -```````````````````````````````` - - -Four spaces is too much: - -```````````````````````````````` example -Foo - --- -. -

              Foo ----

              -```````````````````````````````` - - -The setext heading underline cannot contain internal spaces: - -```````````````````````````````` example -Foo -= = - -Foo ---- - -. -

              Foo -= =

              -

              Foo

              -
              -```````````````````````````````` - - -Trailing spaces in the content line do not cause a line break: - -```````````````````````````````` example -Foo ------ -. -

              Foo

              -```````````````````````````````` - - -Nor does a backslash at the end: - -```````````````````````````````` example -Foo\ ----- -. -

              Foo\

              -```````````````````````````````` - - -Since indicators of block structure take precedence over -indicators of inline structure, the following are setext headings: - -```````````````````````````````` example -`Foo ----- -` - -
              -. -

              `Foo

              -

              `

              -

              <a title="a lot

              -

              of dashes"/>

              -```````````````````````````````` - - -The setext heading underline cannot be a [lazy continuation -line] in a list item or block quote: - -```````````````````````````````` example -> Foo ---- -. -
              -

              Foo

              -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> foo -bar -=== -. -
              -

              foo -bar -===

              -
              -```````````````````````````````` - - -```````````````````````````````` example -- Foo ---- -. -
                -
              • Foo
              • -
              -
              -```````````````````````````````` - - -A blank line is needed between a paragraph and a following -setext heading, since otherwise the paragraph becomes part -of the heading's content: - -```````````````````````````````` example -Foo -Bar ---- -. -

              Foo -Bar

              -```````````````````````````````` - - -But in general a blank line is not required before or after -setext headings: - -```````````````````````````````` example ---- -Foo ---- -Bar ---- -Baz -. -
              -

              Foo

              -

              Bar

              -

              Baz

              -```````````````````````````````` - - -Setext headings cannot be empty: - -```````````````````````````````` example - -==== -. -

              ====

              -```````````````````````````````` - - -Setext heading text lines must not be interpretable as block -constructs other than paragraphs. So, the line of dashes -in these examples gets interpreted as a thematic break: - -```````````````````````````````` example ---- ---- -. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -- foo ------ -. -
                -
              • foo
              • -
              -
              -```````````````````````````````` - - -```````````````````````````````` example - foo ---- -. -
              foo
              -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> foo ------ -. -
              -

              foo

              -
              -
              -```````````````````````````````` - - -If you want a heading with `> foo` as its literal text, you can -use backslash escapes: - -```````````````````````````````` example -\> foo ------- -. -

              > foo

              -```````````````````````````````` - - -**Compatibility note:** Most existing Markdown implementations -do not allow the text of setext headings to span multiple lines. -But there is no consensus about how to interpret - -``` markdown -Foo -bar ---- -baz -``` - -One can find four different interpretations: - -1. paragraph "Foo", heading "bar", paragraph "baz" -2. paragraph "Foo bar", thematic break, paragraph "baz" -3. paragraph "Foo bar --- baz" -4. heading "Foo bar", paragraph "baz" - -We find interpretation 4 most natural, and interpretation 4 -increases the expressive power of CommonMark, by allowing -multiline headings. Authors who want interpretation 1 can -put a blank line after the first paragraph: - -```````````````````````````````` example -Foo - -bar ---- -baz -. -

              Foo

              -

              bar

              -

              baz

              -```````````````````````````````` - - -Authors who want interpretation 2 can put blank lines around -the thematic break, - -```````````````````````````````` example -Foo -bar - ---- - -baz -. -

              Foo -bar

              -
              -

              baz

              -```````````````````````````````` - - -or use a thematic break that cannot count as a [setext heading -underline], such as - -```````````````````````````````` example -Foo -bar -* * * -baz -. -

              Foo -bar

              -
              -

              baz

              -```````````````````````````````` - - -Authors who want interpretation 3 can use backslash escapes: - -```````````````````````````````` example -Foo -bar -\--- -baz -. -

              Foo -bar ---- -baz

              -```````````````````````````````` - - -## Indented code blocks - -An [indented code block](@) is composed of one or more -[indented chunks] separated by blank lines. -An [indented chunk](@) is a sequence of non-blank lines, -each indented four or more spaces. The contents of the code block are -the literal contents of the lines, including trailing -[line endings], minus four spaces of indentation. -An indented code block has no [info string]. - -An indented code block cannot interrupt a paragraph, so there must be -a blank line between a paragraph and a following indented code block. -(A blank line is not needed, however, between a code block and a following -paragraph.) - -```````````````````````````````` example - a simple - indented code block -. -
              a simple
              -  indented code block
              -
              -```````````````````````````````` - - -If there is any ambiguity between an interpretation of indentation -as a code block and as indicating that material belongs to a [list -item][list items], the list item interpretation takes precedence: - -```````````````````````````````` example - - foo - - bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. foo - - - bar -. -
                -
              1. -

                foo

                -
                  -
                • bar
                • -
                -
              2. -
              -```````````````````````````````` - - - -The contents of a code block are literal text, and do not get parsed -as Markdown: - -```````````````````````````````` example -
              - *hi* - - - one -. -
              <a/>
              -*hi*
              -
              -- one
              -
              -```````````````````````````````` - - -Here we have three chunks separated by blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 - - - - chunk3 -. -
              chunk1
              -
              -chunk2
              -
              -
              -
              -chunk3
              -
              -```````````````````````````````` - - -Any initial spaces beyond four will be included in the content, even -in interior blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 -. -
              chunk1
              -  
              -  chunk2
              -
              -```````````````````````````````` - - -An indented code block cannot interrupt a paragraph. (This -allows hanging indents and the like.) - -```````````````````````````````` example -Foo - bar - -. -

              Foo -bar

              -```````````````````````````````` - - -However, any non-blank line with fewer than four leading spaces ends -the code block immediately. So a paragraph may occur immediately -after indented code: - -```````````````````````````````` example - foo -bar -. -
              foo
              -
              -

              bar

              -```````````````````````````````` - - -And indented code can occur immediately before and after other kinds of -blocks: - -```````````````````````````````` example -# Heading - foo -Heading ------- - foo ----- -. -

              Heading

              -
              foo
              -
              -

              Heading

              -
              foo
              -
              -
              -```````````````````````````````` - - -The first line can be indented more than four spaces: - -```````````````````````````````` example - foo - bar -. -
                  foo
              -bar
              -
              -```````````````````````````````` - - -Blank lines preceding or following an indented code block -are not included in it: - -```````````````````````````````` example - - - foo - - -. -
              foo
              -
              -```````````````````````````````` - - -Trailing spaces are included in the code block's content: - -```````````````````````````````` example - foo -. -
              foo  
              -
              -```````````````````````````````` - - - -## Fenced code blocks - -A [code fence](@) is a sequence -of at least three consecutive backtick characters (`` ` ``) or -tildes (`~`). (Tildes and backticks cannot be mixed.) -A [fenced code block](@) -begins with a code fence, indented no more than three spaces. - -The line with the opening code fence may optionally contain some text -following the code fence; this is trimmed of leading and trailing -whitespace and called the [info string](@). If the [info string] comes -after a backtick fence, it may not contain any backtick -characters. (The reason for this restriction is that otherwise -some inline code would be incorrectly interpreted as the -beginning of a fenced code block.) - -The content of the code block consists of all subsequent lines, until -a closing [code fence] of the same type as the code block -began with (backticks or tildes), and with at least as many backticks -or tildes as the opening code fence. If the leading code fence is -indented N spaces, then up to N spaces of indentation are removed from -each line of the content (if present). (If a content line is not -indented, it is preserved unchanged. If it is indented less than N -spaces, all of the indentation is removed.) - -The closing code fence may be indented up to three spaces, and may be -followed only by spaces, which are ignored. If the end of the -containing block (or document) is reached and no closing code fence -has been found, the code block contains all of the lines after the -opening code fence until the end of the containing block (or -document). (An alternative spec would require backtracking in the -event that a closing code fence is not found. But this makes parsing -much less efficient, and there seems to be no real down side to the -behavior described here.) - -A fenced code block may interrupt a paragraph, and does not require -a blank line either before or after. - -The content of a code fence is treated as literal text, not parsed -as inlines. The first word of the [info string] is typically used to -specify the language of the code sample, and rendered in the `class` -attribute of the `code` tag. However, this spec does not mandate any -particular treatment of the [info string]. - -Here is a simple example with backticks: - -```````````````````````````````` example -``` -< - > -``` -. -
              <
              - >
              -
              -```````````````````````````````` - - -With tildes: - -```````````````````````````````` example -~~~ -< - > -~~~ -. -
              <
              - >
              -
              -```````````````````````````````` - -Fewer than three backticks is not enough: - -```````````````````````````````` example -`` -foo -`` -. -

              foo

              -```````````````````````````````` - -The closing code fence must use the same character as the opening -fence: - -```````````````````````````````` example -``` -aaa -~~~ -``` -. -
              aaa
              -~~~
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~ -aaa -``` -~~~ -. -
              aaa
              -```
              -
              -```````````````````````````````` - - -The closing code fence must be at least as long as the opening fence: - -```````````````````````````````` example -```` -aaa -``` -`````` -. -
              aaa
              -```
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~~ -aaa -~~~ -~~~~ -. -
              aaa
              -~~~
              -
              -```````````````````````````````` - - -Unclosed code blocks are closed by the end of the document -(or the enclosing [block quote][block quotes] or [list item][list items]): - -```````````````````````````````` example -``` -. -
              -```````````````````````````````` - - -```````````````````````````````` example -````` - -``` -aaa -. -
              
              -```
              -aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> ``` -> aaa - -bbb -. -
              -
              aaa
              -
              -
              -

              bbb

              -```````````````````````````````` - - -A code block can have all empty lines as its content: - -```````````````````````````````` example -``` - - -``` -. -
              
              -  
              -
              -```````````````````````````````` - - -A code block can be empty: - -```````````````````````````````` example -``` -``` -. -
              -```````````````````````````````` - - -Fences can be indented. If the opening fence is indented, -content lines will have equivalent opening indentation removed, -if present: - -```````````````````````````````` example - ``` - aaa -aaa -``` -. -
              aaa
              -aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - aaa -aaa - ``` -. -
              aaa
              -aaa
              -aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example - ``` - aaa - aaa - aaa - ``` -. -
              aaa
              - aaa
              -aaa
              -
              -```````````````````````````````` - - -Four spaces indentation produces an indented code block: - -```````````````````````````````` example - ``` - aaa - ``` -. -
              ```
              -aaa
              -```
              -
              -```````````````````````````````` - - -Closing fences may be indented by 0-3 spaces, and their indentation -need not match that of the opening fence: - -```````````````````````````````` example -``` -aaa - ``` -. -
              aaa
              -
              -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - ``` -. -
              aaa
              -
              -```````````````````````````````` - - -This is not a closing fence, because it is indented 4 spaces: - -```````````````````````````````` example -``` -aaa - ``` -. -
              aaa
              -    ```
              -
              -```````````````````````````````` - - - -Code fences (opening and closing) cannot contain internal spaces: - -```````````````````````````````` example -``` ``` -aaa -. -

              -aaa

              -```````````````````````````````` - - -```````````````````````````````` example -~~~~~~ -aaa -~~~ ~~ -. -
              aaa
              -~~~ ~~
              -
              -```````````````````````````````` - - -Fenced code blocks can interrupt paragraphs, and can be followed -directly by paragraphs, without a blank line between: - -```````````````````````````````` example -foo -``` -bar -``` -baz -. -

              foo

              -
              bar
              -
              -

              baz

              -```````````````````````````````` - - -Other blocks can also occur before and after fenced code blocks -without an intervening blank line: - -```````````````````````````````` example -foo ---- -~~~ -bar -~~~ -# baz -. -

              foo

              -
              bar
              -
              -

              baz

              -```````````````````````````````` - - -An [info string] can be provided after the opening code fence. -Although this spec doesn't mandate any particular treatment of -the info string, the first word is typically used to specify -the language of the code block. In HTML output, the language is -normally indicated by adding a class to the `code` element consisting -of `language-` followed by the language name. - -```````````````````````````````` example -```ruby -def foo(x) - return 3 -end -``` -. -
              def foo(x)
              -  return 3
              -end
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~~ ruby startline=3 $%@#$ -def foo(x) - return 3 -end -~~~~~~~ -. -
              def foo(x)
              -  return 3
              -end
              -
              -```````````````````````````````` - - -```````````````````````````````` example -````; -```` -. -
              -```````````````````````````````` - - -[Info strings] for backtick code blocks cannot contain backticks: - -```````````````````````````````` example -``` aa ``` -foo -. -

              aa -foo

              -```````````````````````````````` - - -[Info strings] for tilde code blocks can contain backticks and tildes: - -```````````````````````````````` example -~~~ aa ``` ~~~ -foo -~~~ -. -
              foo
              -
              -```````````````````````````````` - - -Closing code fences cannot have [info strings]: - -```````````````````````````````` example -``` -``` aaa -``` -. -
              ``` aaa
              -
              -```````````````````````````````` - - - -## HTML blocks - -An [HTML block](@) is a group of lines that is treated -as raw HTML (and will not be escaped in HTML output). - -There are seven kinds of [HTML block], which can be defined by their -start and end conditions. The block begins with a line that meets a -[start condition](@) (after up to three spaces optional indentation). -It ends with the first subsequent line that meets a matching [end -condition](@), or the last line of the document, or the last line of -the [container block](#container-blocks) containing the current HTML -block, if no line is encountered that meets the [end condition]. If -the first line meets both the [start condition] and the [end -condition], the block will contain just that line. - -1. **Start condition:** line begins with the string ``, or the end of the line.\ -**End condition:** line contains an end tag -``, `
              `, or `` (case-insensitive; it -need not match the start tag). - -2. **Start condition:** line begins with the string ``. - -3. **Start condition:** line begins with the string ``. - -4. **Start condition:** line begins with the string ``. - -5. **Start condition:** line begins with the string -``. - -6. **Start condition:** line begins the string `<` or ``, or -the string `/>`.\ -**End condition:** line is followed by a [blank line]. - -7. **Start condition:** line begins with a complete [open tag] -(with any [tag name] other than `script`, -`style`, or `pre`) or a complete [closing tag], -followed only by [whitespace] or the end of the line.\ -**End condition:** line is followed by a [blank line]. - -HTML blocks continue until they are closed by their appropriate -[end condition], or the last line of the document or other [container -block](#container-blocks). This means any HTML **within an HTML -block** that might otherwise be recognised as a start condition will -be ignored by the parser and passed through as-is, without changing -the parser's state. - -For instance, `
              ` within a HTML block started by `` will not affect
              -the parser state; as the HTML block was started in by start condition 6, it
              -will end at any blank line. This can be surprising:
              -
              -```````````````````````````````` example
              -
              -
              -**Hello**,
              -
              -_world_.
              -
              -
              -. -
              -
              -**Hello**,
              -

              world. -

              -
              -```````````````````````````````` - -In this case, the HTML block is terminated by the newline — the `**Hello**` -text remains verbatim — and regular parsing resumes, with a paragraph, -emphasised `world` and inline and block HTML following. - -All types of [HTML blocks] except type 7 may interrupt -a paragraph. Blocks of type 7 may not interrupt a paragraph. -(This restriction is intended to prevent unwanted interpretation -of long tags inside a wrapped paragraph as starting HTML blocks.) - -Some simple examples follow. Here are some basic HTML blocks -of type 6: - -```````````````````````````````` example - - - - -
              - hi -
              - -okay. -. - - - - -
              - hi -
              -

              okay.

              -```````````````````````````````` - - -```````````````````````````````` example -
              -*foo* -```````````````````````````````` - - -Here we have two HTML blocks with a Markdown paragraph between them: - -```````````````````````````````` example -
              - -*Markdown* - -
              -. -
              -

              Markdown

              -
              -```````````````````````````````` - - -The tag on the first line can be partial, as long -as it is split where there would be whitespace: - -```````````````````````````````` example -
              -
              -. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -
              -
              -. -
              -
              -```````````````````````````````` - - -An open tag need not be closed: -```````````````````````````````` example -
              -*foo* - -*bar* -. -
              -*foo* -

              bar

              -```````````````````````````````` - - - -A partial tag need not even be completed (garbage -in, garbage out): - -```````````````````````````````` example -
              -. - -```````````````````````````````` - - -```````````````````````````````` example -
              -foo -
              -. -
              -foo -
              -```````````````````````````````` - - -Everything until the next blank line or end of document -gets included in the HTML block. So, in the following -example, what looks like a Markdown code block -is actually part of the HTML block, which continues until a blank -line or the end of the document is reached: - -```````````````````````````````` example -
              -``` c -int x = 33; -``` -. -
              -``` c -int x = 33; -``` -```````````````````````````````` - - -To start an [HTML block] with a tag that is *not* in the -list of block-level tags in (6), you must put the tag by -itself on the first line (and it must be complete): - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -In type 7 blocks, the [tag name] can be anything: - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -```````````````````````````````` example - -*bar* -. - -*bar* -```````````````````````````````` - - -These rules are designed to allow us to work with tags that -can function as either block-level or inline-level tags. -The `` tag is a nice example. We can surround content with -`` tags in three different ways. In this case, we get a raw -HTML block, because the `` tag is on a line by itself: - -```````````````````````````````` example - -*foo* - -. - -*foo* - -```````````````````````````````` - - -In this case, we get a raw HTML block that just includes -the `` tag (because it ends with the following blank -line). So the contents get interpreted as CommonMark: - -```````````````````````````````` example - - -*foo* - - -. - -

              foo

              -
              -```````````````````````````````` - - -Finally, in this case, the `` tags are interpreted -as [raw HTML] *inside* the CommonMark paragraph. (Because -the tag is not on a line by itself, we get inline HTML -rather than an [HTML block].) - -```````````````````````````````` example -*foo* -. -

              foo

              -```````````````````````````````` - - -HTML tags designed to contain literal content -(`script`, `style`, `pre`), comments, processing instructions, -and declarations are treated somewhat differently. -Instead of ending at the first blank line, these blocks -end at the first line containing a corresponding end tag. -As a result, these blocks can contain blank lines: - -A pre tag (type 1): - -```````````````````````````````` example -
              
              -import Text.HTML.TagSoup
              -
              -main :: IO ()
              -main = print $ parseTags tags
              -
              -okay -. -
              
              -import Text.HTML.TagSoup
              -
              -main :: IO ()
              -main = print $ parseTags tags
              -
              -

              okay

              -```````````````````````````````` - - -A script tag (type 1): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - -A style tag (type 1): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - -If there is no matching end tag, the block will end at the -end of the document (or the enclosing [block quote][block quotes] -or [list item][list items]): - -```````````````````````````````` example - -*foo* -. - -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -*bar* -*baz* -. -*bar* -

              baz

              -```````````````````````````````` - - -Note that anything on the last line after the -end tag will be included in the [HTML block]: - -```````````````````````````````` example -1. *bar* -. -1. *bar* -```````````````````````````````` - - -A comment (type 2): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - - -A processing instruction (type 3): - -```````````````````````````````` example -'; - -?> -okay -. -'; - -?> -

              okay

              -```````````````````````````````` - - -A declaration (type 4): - -```````````````````````````````` example - -. - -```````````````````````````````` - - -CDATA (type 5): - -```````````````````````````````` example - -okay -. - -

              okay

              -```````````````````````````````` - - -The opening tag can be indented 1-3 spaces, but not 4: - -```````````````````````````````` example - - - -. - -
              <!-- foo -->
              -
              -```````````````````````````````` - - -```````````````````````````````` example -
              - -
              -. -
              -
              <div>
              -
              -```````````````````````````````` - - -An HTML block of types 1--6 can interrupt a paragraph, and need not be -preceded by a blank line. - -```````````````````````````````` example -Foo -
              -bar -
              -. -

              Foo

              -
              -bar -
              -```````````````````````````````` - - -However, a following blank line is needed, except at the end of -a document, and except for blocks of types 1--5, [above][HTML -block]: - -```````````````````````````````` example -
              -bar -
              -*foo* -. -
              -bar -
              -*foo* -```````````````````````````````` - - -HTML blocks of type 7 cannot interrupt a paragraph: - -```````````````````````````````` example -Foo - -baz -. -

              Foo - -baz

              -```````````````````````````````` - - -This rule differs from John Gruber's original Markdown syntax -specification, which says: - -> The only restrictions are that block-level HTML elements — -> e.g. `
              `, ``, `
              `, `

              `, etc. — must be separated from -> surrounding content by blank lines, and the start and end tags of the -> block should not be indented with tabs or spaces. - -In some ways Gruber's rule is more restrictive than the one given -here: - -- It requires that an HTML block be preceded by a blank line. -- It does not allow the start tag to be indented. -- It requires a matching end tag, which it also does not allow to - be indented. - -Most Markdown implementations (including some of Gruber's own) do not -respect all of these restrictions. - -There is one respect, however, in which Gruber's rule is more liberal -than the one given here, since it allows blank lines to occur inside -an HTML block. There are two reasons for disallowing them here. -First, it removes the need to parse balanced tags, which is -expensive and can require backtracking from the end of the document -if no matching end tag is found. Second, it provides a very simple -and flexible way of including Markdown content inside HTML tags: -simply separate the Markdown from the HTML using blank lines: - -Compare: - -```````````````````````````````` example -

              - -*Emphasized* text. - -
              -. -
              -

              Emphasized text.

              -
              -```````````````````````````````` - - -```````````````````````````````` example -
              -*Emphasized* text. -
              -. -
              -*Emphasized* text. -
              -```````````````````````````````` - - -Some Markdown implementations have adopted a convention of -interpreting content inside tags as text if the open tag has -the attribute `markdown=1`. The rule given above seems a simpler and -more elegant way of achieving the same expressive power, which is also -much simpler to parse. - -The main potential drawback is that one can no longer paste HTML -blocks into Markdown documents with 100% reliability. However, -*in most cases* this will work fine, because the blank lines in -HTML are usually followed by HTML block tags. For example: - -```````````````````````````````` example -
              - - - - - - - -
              -Hi -
              -. - - - - -
              -Hi -
              -```````````````````````````````` - - -There are problems, however, if the inner tags are indented -*and* separated by spaces, as then they will be interpreted as -an indented code block: - -```````````````````````````````` example - - - - - - - - -
              - Hi -
              -. - - -
              <td>
              -  Hi
              -</td>
              -
              - -
              -```````````````````````````````` - - -Fortunately, blank lines are usually not necessary and can be -deleted. The exception is inside `
              ` tags, but as described
              -[above][HTML blocks], raw HTML blocks starting with `
              `
              -*can* contain blank lines.
              -
              -## Link reference definitions
              -
              -A [link reference definition](@)
              -consists of a [link label], indented up to three spaces, followed
              -by a colon (`:`), optional [whitespace] (including up to one
              -[line ending]), a [link destination],
              -optional [whitespace] (including up to one
              -[line ending]), and an optional [link
              -title], which if it is present must be separated
              -from the [link destination] by [whitespace].
              -No further [non-whitespace characters] may occur on the line.
              -
              -A [link reference definition]
              -does not correspond to a structural element of a document.  Instead, it
              -defines a label which can be used in [reference links]
              -and reference-style [images] elsewhere in the document.  [Link
              -reference definitions] can come either before or after the links that use
              -them.
              -
              -```````````````````````````````` example
              -[foo]: /url "title"
              -
              -[foo]
              -.
              -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example - [foo]: - /url - 'the title' - -[foo] -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[Foo*bar\]]:my_(url) 'title (with parens)' - -[Foo*bar\]] -. -

              Foo*bar]

              -```````````````````````````````` - - -```````````````````````````````` example -[Foo bar]: - -'title' - -[Foo bar] -. -

              Foo bar

              -```````````````````````````````` - - -The title may extend over multiple lines: - -```````````````````````````````` example -[foo]: /url ' -title -line1 -line2 -' - -[foo] -. -

              foo

              -```````````````````````````````` - - -However, it may not contain a [blank line]: - -```````````````````````````````` example -[foo]: /url 'title - -with blank line' - -[foo] -. -

              [foo]: /url 'title

              -

              with blank line'

              -

              [foo]

              -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[foo]: -/url - -[foo] -. -

              foo

              -```````````````````````````````` - - -The link destination may not be omitted: - -```````````````````````````````` example -[foo]: - -[foo] -. -

              [foo]:

              -

              [foo]

              -```````````````````````````````` - - However, an empty link destination may be specified using - angle brackets: - -```````````````````````````````` example -[foo]: <> - -[foo] -. -

              foo

              -```````````````````````````````` - -The title must be separated from the link destination by -whitespace: - -```````````````````````````````` example -[foo]: (baz) - -[foo] -. -

              [foo]: (baz)

              -

              [foo]

              -```````````````````````````````` - - -Both title and destination can contain backslash escapes -and literal backslashes: - -```````````````````````````````` example -[foo]: /url\bar\*baz "foo\"bar\baz" - -[foo] -. -

              foo

              -```````````````````````````````` - - -A link can come before its corresponding definition: - -```````````````````````````````` example -[foo] - -[foo]: url -. -

              foo

              -```````````````````````````````` - - -If there are several matching definitions, the first one takes -precedence: - -```````````````````````````````` example -[foo] - -[foo]: first -[foo]: second -. -

              foo

              -```````````````````````````````` - - -As noted in the section on [Links], matching of labels is -case-insensitive (see [matches]). - -```````````````````````````````` example -[FOO]: /url - -[Foo] -. -

              Foo

              -```````````````````````````````` - - -```````````````````````````````` example -[ΑΓΩ]: /φου - -[αγω] -. -

              αγω

              -```````````````````````````````` - - -Here is a link reference definition with no corresponding link. -It contributes nothing to the document. - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -Here is another one: - -```````````````````````````````` example -[ -foo -]: /url -bar -. -

              bar

              -```````````````````````````````` - - -This is not a link reference definition, because there are -[non-whitespace characters] after the title: - -```````````````````````````````` example -[foo]: /url "title" ok -. -

              [foo]: /url "title" ok

              -```````````````````````````````` - - -This is a link reference definition, but it has no title: - -```````````````````````````````` example -[foo]: /url -"title" ok -. -

              "title" ok

              -```````````````````````````````` - - -This is not a link reference definition, because it is indented -four spaces: - -```````````````````````````````` example - [foo]: /url "title" - -[foo] -. -
              [foo]: /url "title"
              -
              -

              [foo]

              -```````````````````````````````` - - -This is not a link reference definition, because it occurs inside -a code block: - -```````````````````````````````` example -``` -[foo]: /url -``` - -[foo] -. -
              [foo]: /url
              -
              -

              [foo]

              -```````````````````````````````` - - -A [link reference definition] cannot interrupt a paragraph. - -```````````````````````````````` example -Foo -[bar]: /baz - -[bar] -. -

              Foo -[bar]: /baz

              -

              [bar]

              -```````````````````````````````` - - -However, it can directly follow other block elements, such as headings -and thematic breaks, and it need not be followed by a blank line. - -```````````````````````````````` example -# [Foo] -[foo]: /url -> bar -. -

              Foo

              -
              -

              bar

              -
              -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -bar -=== -[foo] -. -

              bar

              -

              foo

              -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -=== -[foo] -. -

              === -foo

              -```````````````````````````````` - - -Several [link reference definitions] -can occur one after another, without intervening blank lines. - -```````````````````````````````` example -[foo]: /foo-url "foo" -[bar]: /bar-url - "bar" -[baz]: /baz-url - -[foo], -[bar], -[baz] -. -

              foo, -bar, -baz

              -```````````````````````````````` - - -[Link reference definitions] can occur -inside block containers, like lists and block quotations. They -affect the entire document, not just the container in which they -are defined: - -```````````````````````````````` example -[foo] - -> [foo]: /url -. -

              foo

              -
              -
              -```````````````````````````````` - - -Whether something is a [link reference definition] is -independent of whether the link reference it defines is -used in the document. Thus, for example, the following -document contains just a link reference definition, and -no visible content: - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -## Paragraphs - -A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a [paragraph](@). -The contents of the paragraph are the result of parsing the -paragraph's raw content as inlines. The paragraph's raw content -is formed by concatenating the lines and removing initial and final -[whitespace]. - -A simple example with two paragraphs: - -```````````````````````````````` example -aaa - -bbb -. -

              aaa

              -

              bbb

              -```````````````````````````````` - - -Paragraphs can contain multiple lines, but no blank lines: - -```````````````````````````````` example -aaa -bbb - -ccc -ddd -. -

              aaa -bbb

              -

              ccc -ddd

              -```````````````````````````````` - - -Multiple blank lines between paragraph have no effect: - -```````````````````````````````` example -aaa - - -bbb -. -

              aaa

              -

              bbb

              -```````````````````````````````` - - -Leading spaces are skipped: - -```````````````````````````````` example - aaa - bbb -. -

              aaa -bbb

              -```````````````````````````````` - - -Lines after the first may be indented any amount, since indented -code blocks cannot interrupt paragraphs. - -```````````````````````````````` example -aaa - bbb - ccc -. -

              aaa -bbb -ccc

              -```````````````````````````````` - - -However, the first line may be indented at most three spaces, -or an indented code block will be triggered: - -```````````````````````````````` example - aaa -bbb -. -

              aaa -bbb

              -```````````````````````````````` - - -```````````````````````````````` example - aaa -bbb -. -
              aaa
              -
              -

              bbb

              -```````````````````````````````` - - -Final spaces are stripped before inline parsing, so a paragraph -that ends with two or more spaces will not end with a [hard line -break]: - -```````````````````````````````` example -aaa -bbb -. -

              aaa
              -bbb

              -```````````````````````````````` - - -## Blank lines - -[Blank lines] between block-level elements are ignored, -except for the role they play in determining whether a [list] -is [tight] or [loose]. - -Blank lines at the beginning and end of the document are also ignored. - -```````````````````````````````` example - - -aaa - - -# aaa - - -. -

              aaa

              -

              aaa

              -```````````````````````````````` - - - -# Container blocks - -A [container block](#container-blocks) is a block that has other -blocks as its contents. There are two basic kinds of container blocks: -[block quotes] and [list items]. -[Lists] are meta-containers for [list items]. - -We define the syntax for container blocks recursively. The general -form of the definition is: - -> If X is a sequence of blocks, then the result of -> transforming X in such-and-such a way is a container of type Y -> with these blocks as its content. - -So, we explain what counts as a block quote or list item by explaining -how these can be *generated* from their contents. This should suffice -to define the syntax, although it does not give a recipe for *parsing* -these constructions. (A recipe is provided below in the section entitled -[A parsing strategy](#appendix-a-parsing-strategy).) - -## Block quotes - -A [block quote marker](@) -consists of 0-3 spaces of initial indent, plus (a) the character `>` together -with a following space, or (b) a single character `>` not followed by a space. - -The following rules define [block quotes]: - -1. **Basic case.** If a string of lines *Ls* constitute a sequence - of blocks *Bs*, then the result of prepending a [block quote - marker] to the beginning of each line in *Ls* - is a [block quote](#block-quotes) containing *Bs*. - -2. **Laziness.** If a string of lines *Ls* constitute a [block - quote](#block-quotes) with contents *Bs*, then the result of deleting - the initial [block quote marker] from one or - more lines in which the next [non-whitespace character] after the [block - quote marker] is [paragraph continuation - text] is a block quote with *Bs* as its content. - [Paragraph continuation text](@) is text - that will be parsed as part of the content of a paragraph, but does - not occur at the beginning of the paragraph. - -3. **Consecutiveness.** A document cannot contain two [block - quotes] in a row unless there is a [blank line] between them. - -Nothing else counts as a [block quote](#block-quotes). - -Here is a simple example: - -```````````````````````````````` example -> # Foo -> bar -> baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -The spaces after the `>` characters can be omitted: - -```````````````````````````````` example -># Foo ->bar -> baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -The `>` characters can be indented 1-3 spaces: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -Four spaces gives us a code block: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -
              > # Foo
              -> bar
              -> baz
              -
              -```````````````````````````````` - - -The Laziness clause allows us to omit the `>` before -[paragraph continuation text]: - -```````````````````````````````` example -> # Foo -> bar -baz -. -
              -

              Foo

              -

              bar -baz

              -
              -```````````````````````````````` - - -A block quote can contain some lazy and some non-lazy -continuation lines: - -```````````````````````````````` example -> bar -baz -> foo -. -
              -

              bar -baz -foo

              -
              -```````````````````````````````` - - -Laziness only applies to lines that would have been continuations of -paragraphs had they been prepended with [block quote markers]. -For example, the `> ` cannot be omitted in the second line of - -``` markdown -> foo -> --- -``` - -without changing the meaning: - -```````````````````````````````` example -> foo ---- -. -
              -

              foo

              -
              -
              -```````````````````````````````` - - -Similarly, if we omit the `> ` in the second line of - -``` markdown -> - foo -> - bar -``` - -then the block quote ends after the first line: - -```````````````````````````````` example -> - foo -- bar -. -
              -
                -
              • foo
              • -
              -
              -
                -
              • bar
              • -
              -```````````````````````````````` - - -For the same reason, we can't omit the `> ` in front of -subsequent lines of an indented or fenced code block: - -```````````````````````````````` example -> foo - bar -. -
              -
              foo
              -
              -
              -
              bar
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> ``` -foo -``` -. -
              -
              -
              -

              foo

              -
              -```````````````````````````````` - - -Note that in the following case, we have a [lazy -continuation line]: - -```````````````````````````````` example -> foo - - bar -. -
              -

              foo -- bar

              -
              -```````````````````````````````` - - -To see why, note that in - -```markdown -> foo -> - bar -``` - -the `- bar` is indented too far to start a list, and can't -be an indented code block because indented code blocks cannot -interrupt paragraphs, so it is [paragraph continuation text]. - -A block quote can be empty: - -```````````````````````````````` example -> -. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> -> -> -. -
              -
              -```````````````````````````````` - - -A block quote can have initial or final blank lines: - -```````````````````````````````` example -> -> foo -> -. -
              -

              foo

              -
              -```````````````````````````````` - - -A blank line always separates block quotes: - -```````````````````````````````` example -> foo - -> bar -. -
              -

              foo

              -
              -
              -

              bar

              -
              -```````````````````````````````` - - -(Most current Markdown implementations, including John Gruber's -original `Markdown.pl`, will parse this example as a single block quote -with two paragraphs. But it seems better to allow the author to decide -whether two block quotes or one are wanted.) - -Consecutiveness means that if we put these block quotes together, -we get a single block quote: - -```````````````````````````````` example -> foo -> bar -. -
              -

              foo -bar

              -
              -```````````````````````````````` - - -To get a block quote with two paragraphs, use: - -```````````````````````````````` example -> foo -> -> bar -. -
              -

              foo

              -

              bar

              -
              -```````````````````````````````` - - -Block quotes can interrupt paragraphs: - -```````````````````````````````` example -foo -> bar -. -

              foo

              -
              -

              bar

              -
              -```````````````````````````````` - - -In general, blank lines are not needed before or after block -quotes: - -```````````````````````````````` example -> aaa -*** -> bbb -. -
              -

              aaa

              -
              -
              -
              -

              bbb

              -
              -```````````````````````````````` - - -However, because of laziness, a blank line is needed between -a block quote and a following paragraph: - -```````````````````````````````` example -> bar -baz -. -
              -

              bar -baz

              -
              -```````````````````````````````` - - -```````````````````````````````` example -> bar - -baz -. -
              -

              bar

              -
              -

              baz

              -```````````````````````````````` - - -```````````````````````````````` example -> bar -> -baz -. -
              -

              bar

              -
              -

              baz

              -```````````````````````````````` - - -It is a consequence of the Laziness rule that any number -of initial `>`s may be omitted on a continuation line of a -nested block quote: - -```````````````````````````````` example -> > > foo -bar -. -
              -
              -
              -

              foo -bar

              -
              -
              -
              -```````````````````````````````` - - -```````````````````````````````` example ->>> foo -> bar ->>baz -. -
              -
              -
              -

              foo -bar -baz

              -
              -
              -
              -```````````````````````````````` - - -When including an indented code block in a block quote, -remember that the [block quote marker] includes -both the `>` and a following space. So *five spaces* are needed after -the `>`: - -```````````````````````````````` example -> code - -> not code -. -
              -
              code
              -
              -
              -
              -

              not code

              -
              -```````````````````````````````` - - - -## List items - -A [list marker](@) is a -[bullet list marker] or an [ordered list marker]. - -A [bullet list marker](@) -is a `-`, `+`, or `*` character. - -An [ordered list marker](@) -is a sequence of 1--9 arabic digits (`0-9`), followed by either a -`.` character or a `)` character. (The reason for the length -limit is that with 10 digits we start seeing integer overflows -in some browsers.) - -The following rules define [list items]: - -1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of - blocks *Bs* starting with a [non-whitespace character], and *M* is a - list marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces, then the result - of prepending *M* and the following spaces to the first line of - *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a - list item with *Bs* as its contents. The type of the list item - (bullet or ordered) is determined by the type of its list marker. - If the list item is ordered, then it is also assigned a start - number, based on the ordered list marker. - - Exceptions: - - 1. When the first list item in a [list] interrupts - a paragraph---that is, when it starts on a line that would - otherwise count as [paragraph continuation text]---then (a) - the lines *Ls* must not begin with a blank line, and (b) if - the list item is ordered, the start number must be 1. - 2. If any line is a [thematic break][thematic breaks] then - that line is not a list item. - -For example, let *Ls* be the lines - -```````````````````````````````` example -A paragraph -with two lines. - - indented code - -> A block quote. -. -

              A paragraph -with two lines.

              -
              indented code
              -
              -
              -

              A block quote.

              -
              -```````````````````````````````` - - -And let *M* be the marker `1.`, and *N* = 2. Then rule #1 says -that the following is an ordered list item with start number 1, -and the same contents as *Ls*: - -```````````````````````````````` example -1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -The most important thing to notice is that the position of -the text after the list marker determines how much indentation -is needed in subsequent blocks in the list item. If the list -marker takes up two spaces, and there are three spaces between -the list marker and the next [non-whitespace character], then blocks -must be indented five spaces in order to fall under the list -item. - -Here are some examples showing how far content must be indented to be -put under the list item: - -```````````````````````````````` example -- one - - two -. -
                -
              • one
              • -
              -

              two

              -```````````````````````````````` - - -```````````````````````````````` example -- one - - two -. -
                -
              • -

                one

                -

                two

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -
                -
              • one
              • -
              -
               two
              -
              -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -
                -
              • -

                one

                -

                two

                -
              • -
              -```````````````````````````````` - - -It is tempting to think of this in terms of columns: the continuation -blocks must be indented at least to the column of the first -[non-whitespace character] after the list marker. However, that is not quite right. -The spaces after the list marker determine how much relative indentation -is needed. Which column this indentation reaches will depend on -how the list item is embedded in other constructions, as shown by -this example: - -```````````````````````````````` example - > > 1. one ->> ->> two -. -
              -
              -
                -
              1. -

                one

                -

                two

                -
              2. -
              -
              -
              -```````````````````````````````` - - -Here `two` occurs in the same column as the list marker `1.`, -but is actually contained in the list item, because there is -sufficient indentation after the last containing blockquote marker. - -The converse is also possible. In the following example, the word `two` -occurs far to the right of the initial text of the list item, `one`, but -it is not considered part of the list item, because it is not indented -far enough past the blockquote marker: - -```````````````````````````````` example ->>- one ->> - > > two -. -
              -
              -
                -
              • one
              • -
              -

              two

              -
              -
              -```````````````````````````````` - - -Note that at least one space is needed between the list marker and -any following content, so these are not list items: - -```````````````````````````````` example --one - -2.two -. -

              -one

              -

              2.two

              -```````````````````````````````` - - -A list item may contain blocks that are separated by more than -one blank line. - -```````````````````````````````` example -- foo - - - bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - - -A list item may contain any kind of block: - -```````````````````````````````` example -1. foo - - ``` - bar - ``` - - baz - - > bam -. -
                -
              1. -

                foo

                -
                bar
                -
                -

                baz

                -
                -

                bam

                -
                -
              2. -
              -```````````````````````````````` - - -A list item that contains an indented code block will preserve -empty lines within the code block verbatim. - -```````````````````````````````` example -- Foo - - bar - - - baz -. -
                -
              • -

                Foo

                -
                bar
                -
                -
                -baz
                -
                -
              • -
              -```````````````````````````````` - -Note that ordered list start numbers must be nine digits or less: - -```````````````````````````````` example -123456789. ok -. -
                -
              1. ok
              2. -
              -```````````````````````````````` - - -```````````````````````````````` example -1234567890. not ok -. -

              1234567890. not ok

              -```````````````````````````````` - - -A start number may begin with 0s: - -```````````````````````````````` example -0. ok -. -
                -
              1. ok
              2. -
              -```````````````````````````````` - - -```````````````````````````````` example -003. ok -. -
                -
              1. ok
              2. -
              -```````````````````````````````` - - -A start number may not be negative: - -```````````````````````````````` example --1. not ok -. -

              -1. not ok

              -```````````````````````````````` - - - -2. **Item starting with indented code.** If a sequence of lines *Ls* - constitute a sequence of blocks *Bs* starting with an indented code - block, and *M* is a list marker of width *W* followed by - one space, then the result of prepending *M* and the following - space to the first line of *Ls*, and indenting subsequent lines of - *Ls* by *W + 1* spaces, is a list item with *Bs* as its contents. - If a line is empty, then it need not be indented. The type of the - list item (bullet or ordered) is determined by the type of its list - marker. If the list item is ordered, then it is also assigned a - start number, based on the ordered list marker. - -An indented code block will have to be indented four spaces beyond -the edge of the region where text will be included in the list item. -In the following case that is 6 spaces: - -```````````````````````````````` example -- foo - - bar -. -
                -
              • -

                foo

                -
                bar
                -
                -
              • -
              -```````````````````````````````` - - -And in this case it is 11 spaces: - -```````````````````````````````` example - 10. foo - - bar -. -
                -
              1. -

                foo

                -
                bar
                -
                -
              2. -
              -```````````````````````````````` - - -If the *first* block in the list item is an indented code block, -then by rule #2, the contents must be indented *one* space after the -list marker: - -```````````````````````````````` example - indented code - -paragraph - - more code -. -
              indented code
              -
              -

              paragraph

              -
              more code
              -
              -```````````````````````````````` - - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -
                -
              1. -
                indented code
                -
                -

                paragraph

                -
                more code
                -
                -
              2. -
              -```````````````````````````````` - - -Note that an additional space indent is interpreted as space -inside the code block: - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -
                -
              1. -
                 indented code
                -
                -

                paragraph

                -
                more code
                -
                -
              2. -
              -```````````````````````````````` - - -Note that rules #1 and #2 only apply to two cases: (a) cases -in which the lines to be included in a list item begin with a -[non-whitespace character], and (b) cases in which -they begin with an indented code -block. In a case like the following, where the first block begins with -a three-space indent, the rules do not allow us to form a list item by -indenting the whole thing and prepending a list marker: - -```````````````````````````````` example - foo - -bar -. -

              foo

              -

              bar

              -```````````````````````````````` - - -```````````````````````````````` example -- foo - - bar -. -
                -
              • foo
              • -
              -

              bar

              -```````````````````````````````` - - -This is not a significant restriction, because when a block begins -with 1-3 spaces indent, the indentation can always be removed without -a change in interpretation, allowing rule #1 to be applied. So, in -the above case: - -```````````````````````````````` example -- foo - - bar -. -
                -
              • -

                foo

                -

                bar

                -
              • -
              -```````````````````````````````` - - -3. **Item starting with a blank line.** If a sequence of lines *Ls* - starting with a single [blank line] constitute a (possibly empty) - sequence of blocks *Bs*, not separated from each other by more than - one blank line, and *M* is a list marker of width *W*, - then the result of prepending *M* to the first line of *Ls*, and - indenting subsequent lines of *Ls* by *W + 1* spaces, is a list - item with *Bs* as its contents. - If a line is empty, then it need not be indented. The type of the - list item (bullet or ordered) is determined by the type of its list - marker. If the list item is ordered, then it is also assigned a - start number, based on the ordered list marker. - -Here are some list items that start with a blank line but are not empty: - -```````````````````````````````` example -- - foo -- - ``` - bar - ``` -- - baz -. -
                -
              • foo
              • -
              • -
                bar
                -
                -
              • -
              • -
                baz
                -
                -
              • -
              -```````````````````````````````` - -When the list item starts with a blank line, the number of spaces -following the list marker doesn't change the required indentation: - -```````````````````````````````` example -- - foo -. -
                -
              • foo
              • -
              -```````````````````````````````` - - -A list item can begin with at most one blank line. -In the following example, `foo` is not part of the list -item: - -```````````````````````````````` example -- - - foo -. -
                -
              • -
              -

              foo

              -```````````````````````````````` - - -Here is an empty bullet list item: - -```````````````````````````````` example -- foo -- -- bar -. -
                -
              • foo
              • -
              • -
              • bar
              • -
              -```````````````````````````````` - - -It does not matter whether there are spaces following the [list marker]: - -```````````````````````````````` example -- foo -- -- bar -. -
                -
              • foo
              • -
              • -
              • bar
              • -
              -```````````````````````````````` - - -Here is an empty ordered list item: - -```````````````````````````````` example -1. foo -2. -3. bar -. -
                -
              1. foo
              2. -
              3. -
              4. bar
              5. -
              -```````````````````````````````` - - -A list may start or end with an empty list item: - -```````````````````````````````` example -* -. -
                -
              • -
              -```````````````````````````````` - -However, an empty list item cannot interrupt a paragraph: - -```````````````````````````````` example -foo -* - -foo -1. -. -

              foo -*

              -

              foo -1.

              -```````````````````````````````` - - -4. **Indentation.** If a sequence of lines *Ls* constitutes a list item - according to rule #1, #2, or #3, then the result of indenting each line - of *Ls* by 1-3 spaces (the same for each line) also constitutes a - list item with the same contents and attributes. If a line is - empty, then it need not be indented. - -Indented one space: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Indented two spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Indented three spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Four spaces indent gives a code block: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
              1.  A paragraph
              -    with two lines.
              -
              -        indented code
              -
              -    > A block quote.
              -
              -```````````````````````````````` - - - -5. **Laziness.** If a string of lines *Ls* constitute a [list - item](#list-items) with contents *Bs*, then the result of deleting - some or all of the indentation from one or more lines in which the - next [non-whitespace character] after the indentation is - [paragraph continuation text] is a - list item with the same contents and attributes. The unindented - lines are called - [lazy continuation line](@)s. - -Here is an example with [lazy continuation lines]: - -```````````````````````````````` example - 1. A paragraph -with two lines. - - indented code - - > A block quote. -. -
                -
              1. -

                A paragraph -with two lines.

                -
                indented code
                -
                -
                -

                A block quote.

                -
                -
              2. -
              -```````````````````````````````` - - -Indentation can be partially deleted: - -```````````````````````````````` example - 1. A paragraph - with two lines. -. -
                -
              1. A paragraph -with two lines.
              2. -
              -```````````````````````````````` - - -These examples show how laziness can work in nested structures: - -```````````````````````````````` example -> 1. > Blockquote -continued here. -. -
              -
                -
              1. -
                -

                Blockquote -continued here.

                -
                -
              2. -
              -
              -```````````````````````````````` - - -```````````````````````````````` example -> 1. > Blockquote -> continued here. -. -
              -
                -
              1. -
                -

                Blockquote -continued here.

                -
                -
              2. -
              -
              -```````````````````````````````` - - - -6. **That's all.** Nothing that is not counted as a list item by rules - #1--5 counts as a [list item](#list-items). - -The rules for sublists follow from the general rules -[above][List items]. A sublist must be indented the same number -of spaces a paragraph would need to be in order to be included -in the list item. - -So, in this case we need two spaces indent: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -
                -
              • foo -
                  -
                • bar -
                    -
                  • baz -
                      -
                    • boo
                    • -
                    -
                  • -
                  -
                • -
                -
              • -
              -```````````````````````````````` - - -One is not enough: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -
                -
              • foo
              • -
              • bar
              • -
              • baz
              • -
              • boo
              • -
              -```````````````````````````````` - - -Here we need four, because the list marker is wider: - -```````````````````````````````` example -10) foo - - bar -. -
                -
              1. foo -
                  -
                • bar
                • -
                -
              2. -
              -```````````````````````````````` - - -Three is not enough: - -```````````````````````````````` example -10) foo - - bar -. -
                -
              1. foo
              2. -
              -
                -
              • bar
              • -
              -```````````````````````````````` - - -A list may be the first block in a list item: - -```````````````````````````````` example -- - foo -. -
                -
              • -
                  -
                • foo
                • -
                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. - 2. foo -. -
                -
              1. -
                  -
                • -
                    -
                  1. foo
                  2. -
                  -
                • -
                -
              2. -
              -```````````````````````````````` - - -A list item can contain a heading: - -```````````````````````````````` example -- # Foo -- Bar - --- - baz -. -
                -
              • -

                Foo

                -
              • -
              • -

                Bar

                -baz
              • -
              -```````````````````````````````` - - -### Motivation - -John Gruber's Markdown spec says the following about list items: - -1. "List markers typically start at the left margin, but may be indented - by up to three spaces. List markers must be followed by one or more - spaces or a tab." - -2. "To make lists look nice, you can wrap items with hanging indents.... - But if you don't want to, you don't have to." - -3. "List items may consist of multiple paragraphs. Each subsequent - paragraph in a list item must be indented by either 4 spaces or one - tab." - -4. "It looks nice if you indent every line of the subsequent paragraphs, - but here again, Markdown will allow you to be lazy." - -5. "To put a blockquote within a list item, the blockquote's `>` - delimiters need to be indented." - -6. "To put a code block within a list item, the code block needs to be - indented twice — 8 spaces or two tabs." - -These rules specify that a paragraph under a list item must be indented -four spaces (presumably, from the left margin, rather than the start of -the list marker, but this is not said), and that code under a list item -must be indented eight spaces instead of the usual four. They also say -that a block quote must be indented, but not by how much; however, the -example given has four spaces indentation. Although nothing is said -about other kinds of block-level content, it is certainly reasonable to -infer that *all* block elements under a list item, including other -lists, must be indented four spaces. This principle has been called the -*four-space rule*. - -The four-space rule is clear and principled, and if the reference -implementation `Markdown.pl` had followed it, it probably would have -become the standard. However, `Markdown.pl` allowed paragraphs and -sublists to start with only two spaces indentation, at least on the -outer level. Worse, its behavior was inconsistent: a sublist of an -outer-level list needed two spaces indentation, but a sublist of this -sublist needed three spaces. It is not surprising, then, that different -implementations of Markdown have developed very different rules for -determining what comes under a list item. (Pandoc and python-Markdown, -for example, stuck with Gruber's syntax description and the four-space -rule, while discount, redcarpet, marked, PHP Markdown, and others -followed `Markdown.pl`'s behavior more closely.) - -Unfortunately, given the divergences between implementations, there -is no way to give a spec for list items that will be guaranteed not -to break any existing documents. However, the spec given here should -correctly handle lists formatted with either the four-space rule or -the more forgiving `Markdown.pl` behavior, provided they are laid out -in a way that is natural for a human to read. - -The strategy here is to let the width and indentation of the list marker -determine the indentation necessary for blocks to fall under the list -item, rather than having a fixed and arbitrary number. The writer can -think of the body of the list item as a unit which gets indented to the -right enough to fit the list marker (and any indentation on the list -marker). (The laziness rule, #5, then allows continuation lines to be -unindented if needed.) - -This rule is superior, we claim, to any rule requiring a fixed level of -indentation from the margin. The four-space rule is clear but -unnatural. It is quite unintuitive that - -``` markdown -- foo - - bar - - - baz -``` - -should be parsed as two lists with an intervening paragraph, - -``` html -
                -
              • foo
              • -
              -

              bar

              -
                -
              • baz
              • -
              -``` - -as the four-space rule demands, rather than a single list, - -``` html -
                -
              • -

                foo

                -

                bar

                -
                  -
                • baz
                • -
                -
              • -
              -``` - -The choice of four spaces is arbitrary. It can be learned, but it is -not likely to be guessed, and it trips up beginners regularly. - -Would it help to adopt a two-space rule? The problem is that such -a rule, together with the rule allowing 1--3 spaces indentation of the -initial list marker, allows text that is indented *less than* the -original list marker to be included in the list item. For example, -`Markdown.pl` parses - -``` markdown - - one - - two -``` - -as a single list item, with `two` a continuation paragraph: - -``` html -
                -
              • -

                one

                -

                two

                -
              • -
              -``` - -and similarly - -``` markdown -> - one -> -> two -``` - -as - -``` html -
              -
                -
              • -

                one

                -

                two

                -
              • -
              -
              -``` - -This is extremely unintuitive. - -Rather than requiring a fixed indent from the margin, we could require -a fixed indent (say, two spaces, or even one space) from the list marker (which -may itself be indented). This proposal would remove the last anomaly -discussed. Unlike the spec presented above, it would count the following -as a list item with a subparagraph, even though the paragraph `bar` -is not indented as far as the first paragraph `foo`: - -``` markdown - 10. foo - - bar -``` - -Arguably this text does read like a list item with `bar` as a subparagraph, -which may count in favor of the proposal. However, on this proposal indented -code would have to be indented six spaces after the list marker. And this -would break a lot of existing Markdown, which has the pattern: - -``` markdown -1. foo - - indented code -``` - -where the code is indented eight spaces. The spec above, by contrast, will -parse this text as expected, since the code block's indentation is measured -from the beginning of `foo`. - -The one case that needs special treatment is a list item that *starts* -with indented code. How much indentation is required in that case, since -we don't have a "first paragraph" to measure from? Rule #2 simply stipulates -that in such cases, we require one space indentation from the list marker -(and then the normal four spaces for the indented code). This will match the -four-space rule in cases where the list marker plus its initial indentation -takes four spaces (a common case), but diverge in other cases. - -## Lists - -A [list](@) is a sequence of one or more -list items [of the same type]. The list items -may be separated by any number of blank lines. - -Two list items are [of the same type](@) -if they begin with a [list marker] of the same type. -Two list markers are of the -same type if (a) they are bullet list markers using the same character -(`-`, `+`, or `*`) or (b) they are ordered list numbers with the same -delimiter (either `.` or `)`). - -A list is an [ordered list](@) -if its constituent list items begin with -[ordered list markers], and a -[bullet list](@) if its constituent list -items begin with [bullet list markers]. - -The [start number](@) -of an [ordered list] is determined by the list number of -its initial list item. The numbers of subsequent list items are -disregarded. - -A list is [loose](@) if any of its constituent -list items are separated by blank lines, or if any of its constituent -list items directly contain two block-level elements with a blank line -between them. Otherwise a list is [tight](@). -(The difference in HTML output is that paragraphs in a loose list are -wrapped in `

              ` tags, while paragraphs in a tight list are not.) - -Changing the bullet or ordered list delimiter starts a new list: - -```````````````````````````````` example -- foo -- bar -+ baz -. -

                -
              • foo
              • -
              • bar
              • -
              -
                -
              • baz
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. foo -2. bar -3) baz -. -
                -
              1. foo
              2. -
              3. bar
              4. -
              -
                -
              1. baz
              2. -
              -```````````````````````````````` - - -In CommonMark, a list can interrupt a paragraph. That is, -no blank line is needed to separate a paragraph from a following -list: - -```````````````````````````````` example -Foo -- bar -- baz -. -

              Foo

              -
                -
              • bar
              • -
              • baz
              • -
              -```````````````````````````````` - -`Markdown.pl` does not allow this, through fear of triggering a list -via a numeral in a hard-wrapped line: - -``` markdown -The number of windows in my house is -14. The number of doors is 6. -``` - -Oddly, though, `Markdown.pl` *does* allow a blockquote to -interrupt a paragraph, even though the same considerations might -apply. - -In CommonMark, we do allow lists to interrupt paragraphs, for -two reasons. First, it is natural and not uncommon for people -to start lists without blank lines: - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -Second, we are attracted to a - -> [principle of uniformity](@): -> if a chunk of text has a certain -> meaning, it will continue to have the same meaning when put into a -> container block (such as a list item or blockquote). - -(Indeed, the spec for [list items] and [block quotes] presupposes -this principle.) This principle implies that if - -``` markdown - * I need to buy - - new shoes - - a coat - - a plane ticket -``` - -is a list item containing a paragraph followed by a nested sublist, -as all Markdown implementations agree it is (though the paragraph -may be rendered without `

              ` tags, since the list is "tight"), -then - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -by itself should be a paragraph followed by a nested sublist. - -Since it is well established Markdown practice to allow lists to -interrupt paragraphs inside list items, the [principle of -uniformity] requires us to allow this outside list items as -well. ([reStructuredText](http://docutils.sourceforge.net/rst.html) -takes a different approach, requiring blank lines before lists -even inside other list items.) - -In order to solve of unwanted lists in paragraphs with -hard-wrapped numerals, we allow only lists starting with `1` to -interrupt paragraphs. Thus, - -```````````````````````````````` example -The number of windows in my house is -14. The number of doors is 6. -. -

              The number of windows in my house is -14. The number of doors is 6.

              -```````````````````````````````` - -We may still get an unintended result in cases like - -```````````````````````````````` example -The number of windows in my house is -1. The number of doors is 6. -. -

              The number of windows in my house is

              -
                -
              1. The number of doors is 6.
              2. -
              -```````````````````````````````` - -but this rule should prevent most spurious list captures. - -There can be any number of blank lines between items: - -```````````````````````````````` example -- foo - -- bar - - -- baz -. -
                -
              • -

                foo

                -
              • -
              • -

                bar

                -
              • -
              • -

                baz

                -
              • -
              -```````````````````````````````` - -```````````````````````````````` example -- foo - - bar - - baz - - - bim -. -
                -
              • foo -
                  -
                • bar -
                    -
                  • -

                    baz

                    -

                    bim

                    -
                  • -
                  -
                • -
                -
              • -
              -```````````````````````````````` - - -To separate consecutive lists of the same type, or to separate a -list from an indented code block that would otherwise be parsed -as a subparagraph of the final list item, you can insert a blank HTML -comment: - -```````````````````````````````` example -- foo -- bar - - - -- baz -- bim -. -
                -
              • foo
              • -
              • bar
              • -
              - -
                -
              • baz
              • -
              • bim
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- foo - - notcode - -- foo - - - - code -. -
                -
              • -

                foo

                -

                notcode

                -
              • -
              • -

                foo

                -
              • -
              - -
              code
              -
              -```````````````````````````````` - - -List items need not be indented to the same level. The following -list items will be treated as items at the same list level, -since none is indented enough to belong to the previous list -item: - -```````````````````````````````` example -- a - - b - - c - - d - - e - - f -- g -. -
                -
              • a
              • -
              • b
              • -
              • c
              • -
              • d
              • -
              • e
              • -
              • f
              • -
              • g
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -
                -
              1. -

                a

                -
              2. -
              3. -

                b

                -
              4. -
              5. -

                c

                -
              6. -
              -```````````````````````````````` - -Note, however, that list items may not be indented more than -three spaces. Here `- e` is treated as a paragraph continuation -line, because it is indented more than three spaces: - -```````````````````````````````` example -- a - - b - - c - - d - - e -. -
                -
              • a
              • -
              • b
              • -
              • c
              • -
              • d -- e
              • -
              -```````````````````````````````` - -And here, `3. c` is treated as in indented code block, -because it is indented four spaces and preceded by a -blank line. - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -
                -
              1. -

                a

                -
              2. -
              3. -

                b

                -
              4. -
              -
              3. c
              -
              -```````````````````````````````` - - -This is a loose list, because there is a blank line between -two of the list items: - -```````````````````````````````` example -- a -- b - -- c -. -
                -
              • -

                a

                -
              • -
              • -

                b

                -
              • -
              • -

                c

                -
              • -
              -```````````````````````````````` - - -So is this, with a empty second item: - -```````````````````````````````` example -* a -* - -* c -. -
                -
              • -

                a

                -
              • -
              • -
              • -

                c

                -
              • -
              -```````````````````````````````` - - -These are loose lists, even though there is no space between the items, -because one of the items directly contains two block-level elements -with a blank line between them: - -```````````````````````````````` example -- a -- b - - c -- d -. -
                -
              • -

                a

                -
              • -
              • -

                b

                -

                c

                -
              • -
              • -

                d

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- a -- b - - [ref]: /url -- d -. -
                -
              • -

                a

                -
              • -
              • -

                b

                -
              • -
              • -

                d

                -
              • -
              -```````````````````````````````` - - -This is a tight list, because the blank lines are in a code block: - -```````````````````````````````` example -- a -- ``` - b - - - ``` -- c -. -
                -
              • a
              • -
              • -
                b
                -
                -
                -
                -
              • -
              • c
              • -
              -```````````````````````````````` - - -This is a tight list, because the blank line is between two -paragraphs of a sublist. So the sublist is loose while -the outer list is tight: - -```````````````````````````````` example -- a - - b - - c -- d -. -
                -
              • a -
                  -
                • -

                  b

                  -

                  c

                  -
                • -
                -
              • -
              • d
              • -
              -```````````````````````````````` - - -This is a tight list, because the blank line is inside the -block quote: - -```````````````````````````````` example -* a - > b - > -* c -. -
                -
              • a -
                -

                b

                -
                -
              • -
              • c
              • -
              -```````````````````````````````` - - -This list is tight, because the consecutive block elements -are not separated by blank lines: - -```````````````````````````````` example -- a - > b - ``` - c - ``` -- d -. -
                -
              • a -
                -

                b

                -
                -
                c
                -
                -
              • -
              • d
              • -
              -```````````````````````````````` - - -A single-paragraph list is tight: - -```````````````````````````````` example -- a -. -
                -
              • a
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- a - - b -. -
                -
              • a -
                  -
                • b
                • -
                -
              • -
              -```````````````````````````````` - - -This list is loose, because of the blank line between the -two block elements in the list item: - -```````````````````````````````` example -1. ``` - foo - ``` - - bar -. -
                -
              1. -
                foo
                -
                -

                bar

                -
              2. -
              -```````````````````````````````` - - -Here the outer list is loose, the inner list tight: - -```````````````````````````````` example -* foo - * bar - - baz -. -
                -
              • -

                foo

                -
                  -
                • bar
                • -
                -

                baz

                -
              • -
              -```````````````````````````````` - - -```````````````````````````````` example -- a - - b - - c - -- d - - e - - f -. -
                -
              • -

                a

                -
                  -
                • b
                • -
                • c
                • -
                -
              • -
              • -

                d

                -
                  -
                • e
                • -
                • f
                • -
                -
              • -
              -```````````````````````````````` - - -# Inlines - -Inlines are parsed sequentially from the beginning of the character -stream to the end (left to right, in left-to-right languages). -Thus, for example, in - -```````````````````````````````` example -`hi`lo` -. -

              hilo`

              -```````````````````````````````` - -`hi` is parsed as code, leaving the backtick at the end as a literal -backtick. - - -## Backslash escapes - -Any ASCII punctuation character may be backslash-escaped: - -```````````````````````````````` example -\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -. -

              !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

              -```````````````````````````````` - - -Backslashes before other characters are treated as literal -backslashes: - -```````````````````````````````` example -\→\A\a\ \3\φ\« -. -

              \→\A\a\ \3\φ\«

              -```````````````````````````````` - - -Escaped characters are treated as regular characters and do -not have their usual Markdown meanings: - -```````````````````````````````` example -\*not emphasized* -\
              not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" -\ö not a character entity -. -

              *not emphasized* -<br/> not a tag -[not a link](/foo) -`not code` -1. not a list -* not a list -# not a heading -[foo]: /url "not a reference" -&ouml; not a character entity

              -```````````````````````````````` - - -If a backslash is itself escaped, the following character is not: - -```````````````````````````````` example -\\*emphasis* -. -

              \emphasis

              -```````````````````````````````` - - -A backslash at the end of the line is a [hard line break]: - -```````````````````````````````` example -foo\ -bar -. -

              foo
              -bar

              -```````````````````````````````` - - -Backslash escapes do not work in code blocks, code spans, autolinks, or -raw HTML: - -```````````````````````````````` example -`` \[\` `` -. -

              \[\`

              -```````````````````````````````` - - -```````````````````````````````` example - \[\] -. -
              \[\]
              -
              -```````````````````````````````` - - -```````````````````````````````` example -~~~ -\[\] -~~~ -. -
              \[\]
              -
              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              http://example.com?find=\*

              -```````````````````````````````` - - -```````````````````````````````` example - -. - -```````````````````````````````` - - -But they work in all other contexts, including URLs and link titles, -link references, and [info strings] in [fenced code blocks]: - -```````````````````````````````` example -[foo](/bar\* "ti\*tle") -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /bar\* "ti\*tle" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -``` foo\+bar -foo -``` -. -
              foo
              -
              -```````````````````````````````` - - - -## Entity and numeric character references - -Valid HTML entity references and numeric character references -can be used in place of the corresponding Unicode character, -with the following exceptions: - -- Entity and character references are not recognized in code - blocks and code spans. - -- Entity and character references cannot stand in place of - special characters that define structural elements in - CommonMark. For example, although `*` can be used - in place of a literal `*` character, `*` cannot replace - `*` in emphasis delimiters, bullet list markers, or thematic - breaks. - -Conforming CommonMark parsers need not store information about -whether a particular character was represented in the source -using a Unicode character or an entity reference. - -[Entity references](@) consist of `&` + any of the valid -HTML5 entity names + `;`. The -document -is used as an authoritative source for the valid entity -references and their corresponding code points. - -```````````````````````````````` example -  & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸ -. -

                & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸

              -```````````````````````````````` - - -[Decimal numeric character -references](@) -consist of `&#` + a string of 1--7 arabic digits + `;`. A -numeric character reference is parsed as the corresponding -Unicode character. Invalid Unicode code points will be replaced by -the REPLACEMENT CHARACTER (`U+FFFD`). For security reasons, -the code point `U+0000` will also be replaced by `U+FFFD`. - -```````````````````````````````` example -# Ӓ Ϡ � -. -

              # Ӓ Ϡ �

              -```````````````````````````````` - - -[Hexadecimal numeric character -references](@) consist of `&#` + -either `X` or `x` + a string of 1-6 hexadecimal digits + `;`. -They too are parsed as the corresponding Unicode character (this -time specified with a hexadecimal numeral instead of decimal). - -```````````````````````````````` example -" ആ ಫ -. -

              " ആ ಫ

              -```````````````````````````````` - - -Here are some nonentities: - -```````````````````````````````` example -  &x; &#; &#x; -� -&#abcdef0; -&ThisIsNotDefined; &hi?; -. -

              &nbsp &x; &#; &#x; -&#87654321; -&#abcdef0; -&ThisIsNotDefined; &hi?;

              -```````````````````````````````` - - -Although HTML5 does accept some entity references -without a trailing semicolon (such as `©`), these are not -recognized here, because it makes the grammar too ambiguous: - -```````````````````````````````` example -© -. -

              &copy

              -```````````````````````````````` - - -Strings that are not on the list of HTML5 named entities are not -recognized as entity references either: - -```````````````````````````````` example -&MadeUpEntity; -. -

              &MadeUpEntity;

              -```````````````````````````````` - - -Entity and numeric character references are recognized in any -context besides code spans or code blocks, including -URLs, [link titles], and [fenced code block][] [info strings]: - -```````````````````````````````` example - -. - -```````````````````````````````` - - -```````````````````````````````` example -[foo](/föö "föö") -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /föö "föö" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -``` föö -foo -``` -. -
              foo
              -
              -```````````````````````````````` - - -Entity and numeric character references are treated as literal -text in code spans and code blocks: - -```````````````````````````````` example -`föö` -. -

              f&ouml;&ouml;

              -```````````````````````````````` - - -```````````````````````````````` example - föfö -. -
              f&ouml;f&ouml;
              -
              -```````````````````````````````` - - -Entity and numeric character references cannot be used -in place of symbols indicating structure in CommonMark -documents. - -```````````````````````````````` example -*foo* -*foo* -. -

              *foo* -foo

              -```````````````````````````````` - -```````````````````````````````` example -* foo - -* foo -. -

              * foo

              -
                -
              • foo
              • -
              -```````````````````````````````` - -```````````````````````````````` example -foo bar -. -

              foo - -bar

              -```````````````````````````````` - -```````````````````````````````` example - foo -. -

              →foo

              -```````````````````````````````` - - -```````````````````````````````` example -[a](url "tit") -. -

              [a](url "tit")

              -```````````````````````````````` - - -## Code spans - -A [backtick string](@) -is a string of one or more backtick characters (`` ` ``) that is neither -preceded nor followed by a backtick. - -A [code span](@) begins with a backtick string and ends with -a backtick string of equal length. The contents of the code span are -the characters between the two backtick strings, normalized in the -following ways: - -- First, [line endings] are converted to [spaces]. -- If the resulting string both begins *and* ends with a [space] - character, but does not consist entirely of [space] - characters, a single [space] character is removed from the - front and back. This allows you to include code that begins - or ends with backtick characters, which must be separated by - whitespace from the opening or closing backtick strings. - -This is a simple code span: - -```````````````````````````````` example -`foo` -. -

              foo

              -```````````````````````````````` - - -Here two backticks are used, because the code contains a backtick. -This example also illustrates stripping of a single leading and -trailing space: - -```````````````````````````````` example -`` foo ` bar `` -. -

              foo ` bar

              -```````````````````````````````` - - -This example shows the motivation for stripping leading and trailing -spaces: - -```````````````````````````````` example -` `` ` -. -

              ``

              -```````````````````````````````` - -Note that only *one* space is stripped: - -```````````````````````````````` example -` `` ` -. -

              ``

              -```````````````````````````````` - -The stripping only happens if the space is on both -sides of the string: - -```````````````````````````````` example -` a` -. -

              a

              -```````````````````````````````` - -Only [spaces], and not [unicode whitespace] in general, are -stripped in this way: - -```````````````````````````````` example -` b ` -. -

               b 

              -```````````````````````````````` - -No stripping occurs if the code span contains only spaces: - -```````````````````````````````` example -` ` -` ` -. -

                -

              -```````````````````````````````` - - -[Line endings] are treated like spaces: - -```````````````````````````````` example -`` -foo -bar -baz -`` -. -

              foo bar baz

              -```````````````````````````````` - -```````````````````````````````` example -`` -foo -`` -. -

              foo

              -```````````````````````````````` - - -Interior spaces are not collapsed: - -```````````````````````````````` example -`foo bar -baz` -. -

              foo bar baz

              -```````````````````````````````` - -Note that browsers will typically collapse consecutive spaces -when rendering `` elements, so it is recommended that -the following CSS be used: - - code{white-space: pre-wrap;} - - -Note that backslash escapes do not work in code spans. All backslashes -are treated literally: - -```````````````````````````````` example -`foo\`bar` -. -

              foo\bar`

              -```````````````````````````````` - - -Backslash escapes are never needed, because one can always choose a -string of *n* backtick characters as delimiters, where the code does -not contain any strings of exactly *n* backtick characters. - -```````````````````````````````` example -``foo`bar`` -. -

              foo`bar

              -```````````````````````````````` - -```````````````````````````````` example -` foo `` bar ` -. -

              foo `` bar

              -```````````````````````````````` - - -Code span backticks have higher precedence than any other inline -constructs except HTML tags and autolinks. Thus, for example, this is -not parsed as emphasized text, since the second `*` is part of a code -span: - -```````````````````````````````` example -*foo`*` -. -

              *foo*

              -```````````````````````````````` - - -And this is not parsed as a link: - -```````````````````````````````` example -[not a `link](/foo`) -. -

              [not a link](/foo)

              -```````````````````````````````` - - -Code spans, HTML tags, and autolinks have the same precedence. -Thus, this is code: - -```````````````````````````````` example -`` -. -

              <a href="">`

              -```````````````````````````````` - - -But this is an HTML tag: - -```````````````````````````````` example -
              ` -. -

              `

              -```````````````````````````````` - - -And this is code: - -```````````````````````````````` example -`` -. -

              <http://foo.bar.baz>`

              -```````````````````````````````` - - -But this is an autolink: - -```````````````````````````````` example -` -. -

              http://foo.bar.`baz`

              -```````````````````````````````` - - -When a backtick string is not closed by a matching backtick string, -we just have literal backticks: - -```````````````````````````````` example -```foo`` -. -

              ```foo``

              -```````````````````````````````` - - -```````````````````````````````` example -`foo -. -

              `foo

              -```````````````````````````````` - -The following case also illustrates the need for opening and -closing backtick strings to be equal in length: - -```````````````````````````````` example -`foo``bar`` -. -

              `foobar

              -```````````````````````````````` - - -## Emphasis and strong emphasis - -John Gruber's original [Markdown syntax -description](http://daringfireball.net/projects/markdown/syntax#em) says: - -> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -> emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML -> `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` -> tag. - -This is enough for most users, but these rules leave much undecided, -especially when it comes to nested emphasis. The original -`Markdown.pl` test suite makes it clear that triple `***` and -`___` delimiters can be used for strong emphasis, and most -implementations have also allowed the following patterns: - -``` markdown -***strong emph*** -***strong** in emph* -***emph* in strong** -**in strong *emph*** -*in emph **strong*** -``` - -The following patterns are less widely supported, but the intent -is clear and they are useful (especially in contexts like bibliography -entries): - -``` markdown -*emph *with emph* in it* -**strong **with strong** in it** -``` - -Many implementations have also restricted intraword emphasis to -the `*` forms, to avoid unwanted emphasis in words containing -internal underscores. (It is best practice to put these in code -spans, but users often do not.) - -``` markdown -internal emphasis: foo*bar*baz -no emphasis: foo_bar_baz -``` - -The rules given below capture all of these patterns, while allowing -for efficient parsing strategies that do not backtrack. - -First, some definitions. A [delimiter run](@) is either -a sequence of one or more `*` characters that is not preceded or -followed by a non-backslash-escaped `*` character, or a sequence -of one or more `_` characters that is not preceded or followed by -a non-backslash-escaped `_` character. - -A [left-flanking delimiter run](@) is -a [delimiter run] that is (1) not followed by [Unicode whitespace], -and either (2a) not followed by a [punctuation character], or -(2b) followed by a [punctuation character] and -preceded by [Unicode whitespace] or a [punctuation character]. -For purposes of this definition, the beginning and the end of -the line count as Unicode whitespace. - -A [right-flanking delimiter run](@) is -a [delimiter run] that is (1) not preceded by [Unicode whitespace], -and either (2a) not preceded by a [punctuation character], or -(2b) preceded by a [punctuation character] and -followed by [Unicode whitespace] or a [punctuation character]. -For purposes of this definition, the beginning and the end of -the line count as Unicode whitespace. - -Here are some examples of delimiter runs. - - - left-flanking but not right-flanking: - - ``` - ***abc - _abc - **"abc" - _"abc" - ``` - - - right-flanking but not left-flanking: - - ``` - abc*** - abc_ - "abc"** - "abc"_ - ``` - - - Both left and right-flanking: - - ``` - abc***def - "abc"_"def" - ``` - - - Neither left nor right-flanking: - - ``` - abc *** def - a _ b - ``` - -(The idea of distinguishing left-flanking and right-flanking -delimiter runs based on the character before and the character -after comes from Roopesh Chander's -[vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags). -vfmd uses the terminology "emphasis indicator string" instead of "delimiter -run," and its rules for distinguishing left- and right-flanking runs -are a bit more complex than the ones given here.) - -The following rules define emphasis and strong emphasis: - -1. A single `*` character [can open emphasis](@) - iff (if and only if) it is part of a [left-flanking delimiter run]. - -2. A single `_` character [can open emphasis] iff - it is part of a [left-flanking delimiter run] - and either (a) not part of a [right-flanking delimiter run] - or (b) part of a [right-flanking delimiter run] - preceded by punctuation. - -3. A single `*` character [can close emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -4. A single `_` character [can close emphasis] iff - it is part of a [right-flanking delimiter run] - and either (a) not part of a [left-flanking delimiter run] - or (b) part of a [left-flanking delimiter run] - followed by punctuation. - -5. A double `**` [can open strong emphasis](@) - iff it is part of a [left-flanking delimiter run]. - -6. A double `__` [can open strong emphasis] iff - it is part of a [left-flanking delimiter run] - and either (a) not part of a [right-flanking delimiter run] - or (b) part of a [right-flanking delimiter run] - preceded by punctuation. - -7. A double `**` [can close strong emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -8. A double `__` [can close strong emphasis] iff - it is part of a [right-flanking delimiter run] - and either (a) not part of a [left-flanking delimiter run] - or (b) part of a [left-flanking delimiter run] - followed by punctuation. - -9. Emphasis begins with a delimiter that [can open emphasis] and ends - with a delimiter that [can close emphasis], and that uses the same - character (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both - open and close emphasis, then the sum of the lengths of the - delimiter runs containing the opening and closing delimiters - must not be a multiple of 3 unless both lengths are - multiples of 3. - -10. Strong emphasis begins with a delimiter that - [can open strong emphasis] and ends with a delimiter that - [can close strong emphasis], and that uses the same character - (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both open - and close strong emphasis, then the sum of the lengths of - the delimiter runs containing the opening and closing - delimiters must not be a multiple of 3 unless both lengths - are multiples of 3. - -11. A literal `*` character cannot occur at the beginning or end of - `*`-delimited emphasis or `**`-delimited strong emphasis, unless it - is backslash-escaped. - -12. A literal `_` character cannot occur at the beginning or end of - `_`-delimited emphasis or `__`-delimited strong emphasis, unless it - is backslash-escaped. - -Where rules 1--12 above are compatible with multiple parsings, -the following principles resolve ambiguity: - -13. The number of nestings should be minimized. Thus, for example, - an interpretation `...` is always preferred to - `...`. - -14. An interpretation `...` is always - preferred to `...`. - -15. When two potential emphasis or strong emphasis spans overlap, - so that the second begins before the first ends and ends after - the first ends, the first takes precedence. Thus, for example, - `*foo _bar* baz_` is parsed as `foo _bar baz_` rather - than `*foo bar* baz`. - -16. When there are two potential emphasis or strong emphasis spans - with the same closing delimiter, the shorter one (the one that - opens later) takes precedence. Thus, for example, - `**foo **bar baz**` is parsed as `**foo bar baz` - rather than `foo **bar baz`. - -17. Inline code spans, links, images, and HTML tags group more tightly - than emphasis. So, when there is a choice between an interpretation - that contains one of these elements and one that does not, the - former always wins. Thus, for example, `*[foo*](bar)` is - parsed as `*foo*` rather than as - `[foo](bar)`. - -These rules can be illustrated through a series of examples. - -Rule 1: - -```````````````````````````````` example -*foo bar* -. -

              foo bar

              -```````````````````````````````` - - -This is not emphasis, because the opening `*` is followed by -whitespace, and hence not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a * foo bar* -. -

              a * foo bar*

              -```````````````````````````````` - - -This is not emphasis, because the opening `*` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a*"foo"* -. -

              a*"foo"*

              -```````````````````````````````` - - -Unicode nonbreaking spaces count as whitespace, too: - -```````````````````````````````` example -* a * -. -

              * a *

              -```````````````````````````````` - - -Intraword emphasis with `*` is permitted: - -```````````````````````````````` example -foo*bar* -. -

              foobar

              -```````````````````````````````` - - -```````````````````````````````` example -5*6*78 -. -

              5678

              -```````````````````````````````` - - -Rule 2: - -```````````````````````````````` example -_foo bar_ -. -

              foo bar

              -```````````````````````````````` - - -This is not emphasis, because the opening `_` is followed by -whitespace: - -```````````````````````````````` example -_ foo bar_ -. -

              _ foo bar_

              -```````````````````````````````` - - -This is not emphasis, because the opening `_` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a_"foo"_ -. -

              a_"foo"_

              -```````````````````````````````` - - -Emphasis with `_` is not allowed inside words: - -```````````````````````````````` example -foo_bar_ -. -

              foo_bar_

              -```````````````````````````````` - - -```````````````````````````````` example -5_6_78 -. -

              5_6_78

              -```````````````````````````````` - - -```````````````````````````````` example -пристаням_стремятся_ -. -

              пристаням_стремятся_

              -```````````````````````````````` - - -Here `_` does not generate emphasis, because the first delimiter run -is right-flanking and the second left-flanking: - -```````````````````````````````` example -aa_"bb"_cc -. -

              aa_"bb"_cc

              -```````````````````````````````` - - -This is emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-_(bar)_ -. -

              foo-(bar)

              -```````````````````````````````` - - -Rule 3: - -This is not emphasis, because the closing delimiter does -not match the opening delimiter: - -```````````````````````````````` example -_foo* -. -

              _foo*

              -```````````````````````````````` - - -This is not emphasis, because the closing `*` is preceded by -whitespace: - -```````````````````````````````` example -*foo bar * -. -

              *foo bar *

              -```````````````````````````````` - - -A newline also counts as whitespace: - -```````````````````````````````` example -*foo bar -* -. -

              *foo bar -*

              -```````````````````````````````` - - -This is not emphasis, because the second `*` is -preceded by punctuation and followed by an alphanumeric -(hence it is not part of a [right-flanking delimiter run]: - -```````````````````````````````` example -*(*foo) -. -

              *(*foo)

              -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -*(*foo*)* -. -

              (foo)

              -```````````````````````````````` - - -Intraword emphasis with `*` is allowed: - -```````````````````````````````` example -*foo*bar -. -

              foobar

              -```````````````````````````````` - - - -Rule 4: - -This is not emphasis, because the closing `_` is preceded by -whitespace: - -```````````````````````````````` example -_foo bar _ -. -

              _foo bar _

              -```````````````````````````````` - - -This is not emphasis, because the second `_` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -_(_foo) -. -

              _(_foo)

              -```````````````````````````````` - - -This is emphasis within emphasis: - -```````````````````````````````` example -_(_foo_)_ -. -

              (foo)

              -```````````````````````````````` - - -Intraword emphasis is disallowed for `_`: - -```````````````````````````````` example -_foo_bar -. -

              _foo_bar

              -```````````````````````````````` - - -```````````````````````````````` example -_пристаням_стремятся -. -

              _пристаням_стремятся

              -```````````````````````````````` - - -```````````````````````````````` example -_foo_bar_baz_ -. -

              foo_bar_baz

              -```````````````````````````````` - - -This is emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -_(bar)_. -. -

              (bar).

              -```````````````````````````````` - - -Rule 5: - -```````````````````````````````` example -**foo bar** -. -

              foo bar

              -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -** foo bar** -. -

              ** foo bar**

              -```````````````````````````````` - - -This is not strong emphasis, because the opening `**` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a**"foo"** -. -

              a**"foo"**

              -```````````````````````````````` - - -Intraword strong emphasis with `**` is permitted: - -```````````````````````````````` example -foo**bar** -. -

              foobar

              -```````````````````````````````` - - -Rule 6: - -```````````````````````````````` example -__foo bar__ -. -

              foo bar

              -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -__ foo bar__ -. -

              __ foo bar__

              -```````````````````````````````` - - -A newline counts as whitespace: -```````````````````````````````` example -__ -foo bar__ -. -

              __ -foo bar__

              -```````````````````````````````` - - -This is not strong emphasis, because the opening `__` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a__"foo"__ -. -

              a__"foo"__

              -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -foo__bar__ -. -

              foo__bar__

              -```````````````````````````````` - - -```````````````````````````````` example -5__6__78 -. -

              5__6__78

              -```````````````````````````````` - - -```````````````````````````````` example -пристаням__стремятся__ -. -

              пристаням__стремятся__

              -```````````````````````````````` - - -```````````````````````````````` example -__foo, __bar__, baz__ -. -

              foo, bar, baz

              -```````````````````````````````` - - -This is strong emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-__(bar)__ -. -

              foo-(bar)

              -```````````````````````````````` - - - -Rule 7: - -This is not strong emphasis, because the closing delimiter is preceded -by whitespace: - -```````````````````````````````` example -**foo bar ** -. -

              **foo bar **

              -```````````````````````````````` - - -(Nor can it be interpreted as an emphasized `*foo bar *`, because of -Rule 11.) - -This is not strong emphasis, because the second `**` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -**(**foo) -. -

              **(**foo)

              -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with these examples: - -```````````````````````````````` example -*(**foo**)* -. -

              (foo)

              -```````````````````````````````` - - -```````````````````````````````` example -**Gomphocarpus (*Gomphocarpus physocarpus*, syn. -*Asclepias physocarpa*)** -. -

              Gomphocarpus (Gomphocarpus physocarpus, syn. -Asclepias physocarpa)

              -```````````````````````````````` - - -```````````````````````````````` example -**foo "*bar*" foo** -. -

              foo "bar" foo

              -```````````````````````````````` - - -Intraword emphasis: - -```````````````````````````````` example -**foo**bar -. -

              foobar

              -```````````````````````````````` - - -Rule 8: - -This is not strong emphasis, because the closing delimiter is -preceded by whitespace: - -```````````````````````````````` example -__foo bar __ -. -

              __foo bar __

              -```````````````````````````````` - - -This is not strong emphasis, because the second `__` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -__(__foo) -. -

              __(__foo)

              -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -_(__foo__)_ -. -

              (foo)

              -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -__foo__bar -. -

              __foo__bar

              -```````````````````````````````` - - -```````````````````````````````` example -__пристаням__стремятся -. -

              __пристаням__стремятся

              -```````````````````````````````` - - -```````````````````````````````` example -__foo__bar__baz__ -. -

              foo__bar__baz

              -```````````````````````````````` - - -This is strong emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -__(bar)__. -. -

              (bar).

              -```````````````````````````````` - - -Rule 9: - -Any nonempty sequence of inline elements can be the contents of an -emphasized span. - -```````````````````````````````` example -*foo [bar](/url)* -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo -bar* -. -

              foo -bar

              -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside emphasis: - -```````````````````````````````` example -_foo __bar__ baz_ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -_foo _bar_ baz_ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -__foo_ bar_ -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar** baz* -. -

              foo bar baz

              -```````````````````````````````` - -```````````````````````````````` example -*foo**bar**baz* -. -

              foobarbaz

              -```````````````````````````````` - -Note that in the preceding case, the interpretation - -``` markdown -

              foobarbaz

              -``` - - -is precluded by the condition that a delimiter that -can both open and close (like the `*` after `foo`) -cannot form emphasis if the sum of the lengths of -the delimiter runs containing the opening and -closing delimiters is a multiple of 3 unless -both lengths are multiples of 3. - - -For the same reason, we don't get two consecutive -emphasis sections in this example: - -```````````````````````````````` example -*foo**bar* -. -

              foo**bar

              -```````````````````````````````` - - -The same condition ensures that the following -cases are all strong emphasis nested inside -emphasis, even when the interior spaces are -omitted: - - -```````````````````````````````` example -***foo** bar* -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar*** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo**bar*** -. -

              foobar

              -```````````````````````````````` - - -When the lengths of the interior closing and opening -delimiter runs are *both* multiples of 3, though, -they can match to create emphasis: - -```````````````````````````````` example -foo***bar***baz -. -

              foobarbaz

              -```````````````````````````````` - -```````````````````````````````` example -foo******bar*********baz -. -

              foobar***baz

              -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -*foo **bar *baz* bim** bop* -. -

              foo bar baz bim bop

              -```````````````````````````````` - - -```````````````````````````````` example -*foo [*bar*](/url)* -. -

              foo bar

              -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -** is not an empty emphasis -. -

              ** is not an empty emphasis

              -```````````````````````````````` - - -```````````````````````````````` example -**** is not an empty strong emphasis -. -

              **** is not an empty strong emphasis

              -```````````````````````````````` - - - -Rule 10: - -Any nonempty sequence of inline elements can be the contents of an -strongly emphasized span. - -```````````````````````````````` example -**foo [bar](/url)** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo -bar** -. -

              foo -bar

              -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside strong emphasis: - -```````````````````````````````` example -__foo _bar_ baz__ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -__foo __bar__ baz__ -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -____foo__ bar__ -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo **bar**** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar* baz** -. -

              foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -**foo*bar*baz** -. -

              foobarbaz

              -```````````````````````````````` - - -```````````````````````````````` example -***foo* bar** -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar*** -. -

              foo bar

              -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -**foo *bar **baz** -bim* bop** -. -

              foo bar baz -bim bop

              -```````````````````````````````` - - -```````````````````````````````` example -**foo [*bar*](/url)** -. -

              foo bar

              -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -__ is not an empty emphasis -. -

              __ is not an empty emphasis

              -```````````````````````````````` - - -```````````````````````````````` example -____ is not an empty strong emphasis -. -

              ____ is not an empty strong emphasis

              -```````````````````````````````` - - - -Rule 11: - -```````````````````````````````` example -foo *** -. -

              foo ***

              -```````````````````````````````` - - -```````````````````````````````` example -foo *\** -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -foo *_* -. -

              foo _

              -```````````````````````````````` - - -```````````````````````````````` example -foo ***** -. -

              foo *****

              -```````````````````````````````` - - -```````````````````````````````` example -foo **\*** -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -foo **_** -. -

              foo _

              -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 11 determines -that the excess literal `*` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -**foo* -. -

              *foo

              -```````````````````````````````` - - -```````````````````````````````` example -*foo** -. -

              foo*

              -```````````````````````````````` - - -```````````````````````````````` example -***foo** -. -

              *foo

              -```````````````````````````````` - - -```````````````````````````````` example -****foo* -. -

              ***foo

              -```````````````````````````````` - - -```````````````````````````````` example -**foo*** -. -

              foo*

              -```````````````````````````````` - - -```````````````````````````````` example -*foo**** -. -

              foo***

              -```````````````````````````````` - - - -Rule 12: - -```````````````````````````````` example -foo ___ -. -

              foo ___

              -```````````````````````````````` - - -```````````````````````````````` example -foo _\__ -. -

              foo _

              -```````````````````````````````` - - -```````````````````````````````` example -foo _*_ -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -foo _____ -. -

              foo _____

              -```````````````````````````````` - - -```````````````````````````````` example -foo __\___ -. -

              foo _

              -```````````````````````````````` - - -```````````````````````````````` example -foo __*__ -. -

              foo *

              -```````````````````````````````` - - -```````````````````````````````` example -__foo_ -. -

              _foo

              -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 12 determines -that the excess literal `_` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -_foo__ -. -

              foo_

              -```````````````````````````````` - - -```````````````````````````````` example -___foo__ -. -

              _foo

              -```````````````````````````````` - - -```````````````````````````````` example -____foo_ -. -

              ___foo

              -```````````````````````````````` - - -```````````````````````````````` example -__foo___ -. -

              foo_

              -```````````````````````````````` - - -```````````````````````````````` example -_foo____ -. -

              foo___

              -```````````````````````````````` - - -Rule 13 implies that if you want emphasis nested directly inside -emphasis, you must use different delimiters: - -```````````````````````````````` example -**foo** -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -*_foo_* -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -__foo__ -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -_*foo*_ -. -

              foo

              -```````````````````````````````` - - -However, strong emphasis within strong emphasis is possible without -switching delimiters: - -```````````````````````````````` example -****foo**** -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -____foo____ -. -

              foo

              -```````````````````````````````` - - - -Rule 13 can be applied to arbitrarily long sequences of -delimiters: - -```````````````````````````````` example -******foo****** -. -

              foo

              -```````````````````````````````` - - -Rule 14: - -```````````````````````````````` example -***foo*** -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -_____foo_____ -. -

              foo

              -```````````````````````````````` - - -Rule 15: - -```````````````````````````````` example -*foo _bar* baz_ -. -

              foo _bar baz_

              -```````````````````````````````` - - -```````````````````````````````` example -*foo __bar *baz bim__ bam* -. -

              foo bar *baz bim bam

              -```````````````````````````````` - - -Rule 16: - -```````````````````````````````` example -**foo **bar baz** -. -

              **foo bar baz

              -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar baz* -. -

              *foo bar baz

              -```````````````````````````````` - - -Rule 17: - -```````````````````````````````` example -*[bar*](/url) -. -

              *bar*

              -```````````````````````````````` - - -```````````````````````````````` example -_foo [bar_](/url) -. -

              _foo bar_

              -```````````````````````````````` - - -```````````````````````````````` example -* -. -

              *

              -```````````````````````````````` - - -```````````````````````````````` example -** -. -

              **

              -```````````````````````````````` - - -```````````````````````````````` example -__ -. -

              __

              -```````````````````````````````` - - -```````````````````````````````` example -*a `*`* -. -

              a *

              -```````````````````````````````` - - -```````````````````````````````` example -_a `_`_ -. -

              a _

              -```````````````````````````````` - - -```````````````````````````````` example -**a -. -

              **ahttp://foo.bar/?q=**

              -```````````````````````````````` - - -```````````````````````````````` example -__a -. -

              __ahttp://foo.bar/?q=__

              -```````````````````````````````` - - - -## Links - -A link contains [link text] (the visible text), a [link destination] -(the URI that is the link destination), and optionally a [link title]. -There are two basic kinds of links in Markdown. In [inline links] the -destination and title are given immediately after the link text. In -[reference links] the destination and title are defined elsewhere in -the document. - -A [link text](@) consists of a sequence of zero or more -inline elements enclosed by square brackets (`[` and `]`). The -following rules apply: - -- Links may not contain other links, at any level of nesting. If - multiple otherwise valid link definitions appear nested inside each - other, the inner-most definition is used. - -- Brackets are allowed in the [link text] only if (a) they - are backslash-escaped or (b) they appear as a matched pair of brackets, - with an open bracket `[`, a sequence of zero or more inlines, and - a close bracket `]`. - -- Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly - than the brackets in link text. Thus, for example, - `` [foo`]` `` could not be a link text, since the second `]` - is part of a code span. - -- The brackets in link text bind more tightly than markers for - [emphasis and strong emphasis]. Thus, for example, `*[foo*](url)` is a link. - -A [link destination](@) consists of either - -- a sequence of zero or more characters between an opening `<` and a - closing `>` that contains no line breaks or unescaped - `<` or `>` characters, or - -- a nonempty sequence of characters that does not start with - `<`, does not include ASCII space or control characters, and - includes parentheses only if (a) they are backslash-escaped or - (b) they are part of a balanced pair of unescaped parentheses. - (Implementations may impose limits on parentheses nesting to - avoid performance issues, but at least three levels of nesting - should be supported.) - -A [link title](@) consists of either - -- a sequence of zero or more characters between straight double-quote - characters (`"`), including a `"` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between straight single-quote - characters (`'`), including a `'` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between matching parentheses - (`(...)`), including a `(` or `)` character only if it is - backslash-escaped. - -Although [link titles] may span multiple lines, they may not contain -a [blank line]. - -An [inline link](@) consists of a [link text] followed immediately -by a left parenthesis `(`, optional [whitespace], an optional -[link destination], an optional [link title] separated from the link -destination by [whitespace], optional [whitespace], and a right -parenthesis `)`. The link's text consists of the inlines contained -in the [link text] (excluding the enclosing square brackets). -The link's URI consists of the link destination, excluding enclosing -`<...>` if present, with backslash-escapes in effect as described -above. The link's title consists of the link title, excluding its -enclosing delimiters, with backslash-escapes in effect as described -above. - -Here is a simple inline link: - -```````````````````````````````` example -[link](/uri "title") -. -

              link

              -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[link](/uri) -. -

              link

              -```````````````````````````````` - - -Both the title and the destination may be omitted: - -```````````````````````````````` example -[link]() -. -

              link

              -```````````````````````````````` - - -```````````````````````````````` example -[link](<>) -. -

              link

              -```````````````````````````````` - -The destination can only contain spaces if it is -enclosed in pointy brackets: - -```````````````````````````````` example -[link](/my uri) -. -

              [link](/my uri)

              -```````````````````````````````` - -```````````````````````````````` example -[link](
              ) -. -

              link

              -```````````````````````````````` - -The destination cannot contain line breaks, -even if enclosed in pointy brackets: - -```````````````````````````````` example -[link](foo -bar) -. -

              [link](foo -bar)

              -```````````````````````````````` - -```````````````````````````````` example -[link]() -. -

              [link]()

              -```````````````````````````````` - -The destination can contain `)` if it is enclosed -in pointy brackets: - -```````````````````````````````` example -[a]() -. -

              a

              -```````````````````````````````` - -Pointy brackets that enclose links must be unescaped: - -```````````````````````````````` example -[link]() -. -

              [link](<foo>)

              -```````````````````````````````` - -These are not links, because the opening pointy bracket -is not matched properly: - -```````````````````````````````` example -[a]( -[a](c) -. -

              [a](<b)c -[a](<b)c> -[a](c)

              -```````````````````````````````` - -Parentheses inside the link destination may be escaped: - -```````````````````````````````` example -[link](\(foo\)) -. -

              link

              -```````````````````````````````` - -Any number of parentheses are allowed without escaping, as long as they are -balanced: - -```````````````````````````````` example -[link](foo(and(bar))) -. -

              link

              -```````````````````````````````` - -However, if you have unbalanced parentheses, you need to escape or use the -`<...>` form: - -```````````````````````````````` example -[link](foo\(and\(bar\)) -. -

              link

              -```````````````````````````````` - - -```````````````````````````````` example -[link]() -. -

              link

              -```````````````````````````````` - - -Parentheses and other symbols can also be escaped, as usual -in Markdown: - -```````````````````````````````` example -[link](foo\)\:) -. -

              link

              -```````````````````````````````` - - -A link can contain fragment identifiers and queries: - -```````````````````````````````` example -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) -. -

              link

              -

              link

              -

              link

              -```````````````````````````````` - - -Note that a backslash before a non-escapable character is -just a backslash: - -```````````````````````````````` example -[link](foo\bar) -. -

              link

              -```````````````````````````````` - - -URL-escaping should be left alone inside the destination, as all -URL-escaped characters are also valid URL characters. Entity and -numerical character references in the destination will be parsed -into the corresponding Unicode code points, as usual. These may -be optionally URL-escaped when written as HTML, but this spec -does not enforce any particular policy for rendering URLs in -HTML or other formats. Renderers may make different decisions -about how to escape or normalize URLs in the output. - -```````````````````````````````` example -[link](foo%20bä) -. -

              link

              -```````````````````````````````` - - -Note that, because titles can often be parsed as destinations, -if you try to omit the destination and keep the title, you'll -get unexpected results: - -```````````````````````````````` example -[link]("title") -. -

              link

              -```````````````````````````````` - - -Titles may be in single quotes, double quotes, or parentheses: - -```````````````````````````````` example -[link](/url "title") -[link](/url 'title') -[link](/url (title)) -. -

              link -link -link

              -```````````````````````````````` - - -Backslash escapes and entity and numeric character references -may be used in titles: - -```````````````````````````````` example -[link](/url "title \""") -. -

              link

              -```````````````````````````````` - - -Titles must be separated from the link using a [whitespace]. -Other [Unicode whitespace] like non-breaking space doesn't work. - -```````````````````````````````` example -[link](/url "title") -. -

              link

              -```````````````````````````````` - - -Nested balanced quotes are not allowed without escaping: - -```````````````````````````````` example -[link](/url "title "and" title") -. -

              [link](/url "title "and" title")

              -```````````````````````````````` - - -But it is easy to work around this by using a different quote type: - -```````````````````````````````` example -[link](/url 'title "and" title') -. -

              link

              -```````````````````````````````` - - -(Note: `Markdown.pl` did allow double quotes inside a double-quoted -title, and its test suite included a test demonstrating this. -But it is hard to see a good rationale for the extra complexity this -brings, since there are already many ways---backslash escaping, -entity and numeric character references, or using a different -quote type for the enclosing title---to write titles containing -double quotes. `Markdown.pl`'s handling of titles has a number -of other strange features. For example, it allows single-quoted -titles in inline links, but not reference links. And, in -reference links but not inline links, it allows a title to begin -with `"` and end with `)`. `Markdown.pl` 1.0.1 even allows -titles with no closing quotation mark, though 1.0.2b8 does not. -It seems preferable to adopt a simple, rational rule that works -the same way in inline links and link reference definitions.) - -[Whitespace] is allowed around the destination and title: - -```````````````````````````````` example -[link]( /uri - "title" ) -. -

              link

              -```````````````````````````````` - - -But it is not allowed between the link text and the -following parenthesis: - -```````````````````````````````` example -[link] (/uri) -. -

              [link] (/uri)

              -```````````````````````````````` - - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]](/uri) -. -

              link [foo [bar]]

              -```````````````````````````````` - - -```````````````````````````````` example -[link] bar](/uri) -. -

              [link] bar](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -[link [bar](/uri) -. -

              [link bar

              -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar](/uri) -. -

              link [bar

              -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*](/uri) -. -

              link foo bar #

              -```````````````````````````````` - - -```````````````````````````````` example -[![moon](moon.jpg)](/uri) -. -

              moon

              -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)](/uri) -. -

              [foo bar](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *[bar [baz](/uri)](/uri)*](/uri) -. -

              [foo [bar baz](/uri)](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -![[[foo](uri1)](uri2)](uri3) -. -

              [foo](uri2)

              -```````````````````````````````` - - -These cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*](/uri) -. -

              *foo*

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar](baz*) -. -

              foo *bar

              -```````````````````````````````` - - -Note that brackets that *aren't* part of links do not take -precedence: - -```````````````````````````````` example -*foo [bar* baz] -. -

              foo [bar baz]

              -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo -. -

              [foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo`](/uri)` -. -

              [foo](/uri)

              -```````````````````````````````` - - -```````````````````````````````` example -[foo -. -

              [foohttp://example.com/?search=](uri)

              -```````````````````````````````` - - -There are three kinds of [reference link](@)s: -[full](#full-reference-link), [collapsed](#collapsed-reference-link), -and [shortcut](#shortcut-reference-link). - -A [full reference link](@) -consists of a [link text] immediately followed by a [link label] -that [matches] a [link reference definition] elsewhere in the document. - -A [link label](@) begins with a left bracket (`[`) and ends -with the first right bracket (`]`) that is not backslash-escaped. -Between these brackets there must be at least one [non-whitespace character]. -Unescaped square bracket characters are not allowed inside the -opening and closing square brackets of [link labels]. A link -label can have at most 999 characters inside the square -brackets. - -One label [matches](@) -another just in case their normalized forms are equal. To normalize a -label, strip off the opening and closing brackets, -perform the *Unicode case fold*, strip leading and trailing -[whitespace] and collapse consecutive internal -[whitespace] to a single space. If there are multiple -matching reference link definitions, the one that comes first in the -document is used. (It is desirable in such cases to emit a warning.) - -The contents of the first link label are parsed as inlines, which are -used as the link's text. The link's URI and title are provided by the -matching [link reference definition]. - -Here is a simple example: - -```````````````````````````````` example -[foo][bar] - -[bar]: /url "title" -. -

              foo

              -```````````````````````````````` - - -The rules for the [link text] are the same as with -[inline links]. Thus: - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]][ref] - -[ref]: /uri -. -

              link [foo [bar]]

              -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar][ref] - -[ref]: /uri -. -

              link [bar

              -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*][ref] - -[ref]: /uri -. -

              link foo bar #

              -```````````````````````````````` - - -```````````````````````````````` example -[![moon](moon.jpg)][ref] - -[ref]: /uri -. -

              moon

              -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)][ref] - -[ref]: /uri -. -

              [foo bar]ref

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar [baz][ref]*][ref] - -[ref]: /uri -. -

              [foo bar baz]ref

              -```````````````````````````````` - - -(In the examples above, we have two [shortcut reference links] -instead of one [full reference link].) - -The following cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*][ref] - -[ref]: /uri -. -

              *foo*

              -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar][ref] - -[ref]: /uri -. -

              foo *bar

              -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo - -[ref]: /uri -. -

              [foo

              -```````````````````````````````` - - -```````````````````````````````` example -[foo`][ref]` - -[ref]: /uri -. -

              [foo][ref]

              -```````````````````````````````` - - -```````````````````````````````` example -[foo - -[ref]: /uri -. -

              [foohttp://example.com/?search=][ref]

              -```````````````````````````````` - - -Matching is case-insensitive: - -```````````````````````````````` example -[foo][BaR] - -[bar]: /url "title" -. -

              foo

              -```````````````````````````````` - - -Unicode case fold is used: - -```````````````````````````````` example -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url -. -

              Толпой is a Russian word.

              -```````````````````````````````` - - -Consecutive internal [whitespace] is treated as one space for -purposes of determining matching: - -```````````````````````````````` example -[Foo - bar]: /url - -[Baz][Foo bar] -. -

              Baz

              -```````````````````````````````` - - -No [whitespace] is allowed between the [link text] and the -[link label]: - -```````````````````````````````` example -[foo] [bar] - -[bar]: /url "title" -. -

              [foo] bar

              -```````````````````````````````` - - -```````````````````````````````` example -[foo] -[bar] - -[bar]: /url "title" -. -

              [foo] -bar

              -```````````````````````````````` - - -This is a departure from John Gruber's original Markdown syntax -description, which explicitly allows whitespace between the link -text and the link label. It brings reference links in line with -[inline links], which (according to both original Markdown and -this spec) cannot have whitespace after the link text. More -importantly, it prevents inadvertent capture of consecutive -[shortcut reference links]. If whitespace is allowed between the -link text and the link label, then in the following we will have -a single reference link, not two shortcut reference links, as -intended: - -``` markdown -[foo] -[bar] - -[foo]: /url1 -[bar]: /url2 -``` - -(Note that [shortcut reference links] were introduced by Gruber -himself in a beta version of `Markdown.pl`, but never included -in the official syntax description. Without shortcut reference -links, it is harmless to allow space between the link text and -link label; but once shortcut references are introduced, it is -too dangerous to allow this, as it frequently leads to -unintended results.) - -When there are multiple matching [link reference definitions], -the first is used: - -```````````````````````````````` example -[foo]: /url1 - -[foo]: /url2 - -[bar][foo] -. -

              bar

              -```````````````````````````````` - - -Note that matching is performed on normalized strings, not parsed -inline content. So the following does not match, even though the -labels define equivalent inline content: - -```````````````````````````````` example -[bar][foo\!] - -[foo!]: /url -. -

              [bar][foo!]

              -```````````````````````````````` - - -[Link labels] cannot contain brackets, unless they are -backslash-escaped: - -```````````````````````````````` example -[foo][ref[] - -[ref[]: /uri -. -

              [foo][ref[]

              -

              [ref[]: /uri

              -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref[bar]] - -[ref[bar]]: /uri -. -

              [foo][ref[bar]]

              -

              [ref[bar]]: /uri

              -```````````````````````````````` - - -```````````````````````````````` example -[[[foo]]] - -[[[foo]]]: /url -. -

              [[[foo]]]

              -

              [[[foo]]]: /url

              -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref\[] - -[ref\[]: /uri -. -

              foo

              -```````````````````````````````` - - -Note that in this example `]` is not backslash-escaped: - -```````````````````````````````` example -[bar\\]: /uri - -[bar\\] -. -

              bar\

              -```````````````````````````````` - - -A [link label] must contain at least one [non-whitespace character]: - -```````````````````````````````` example -[] - -[]: /uri -. -

              []

              -

              []: /uri

              -```````````````````````````````` - - -```````````````````````````````` example -[ - ] - -[ - ]: /uri -. -

              [ -]

              -

              [ -]: /uri

              -```````````````````````````````` - - -A [collapsed reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document, followed by the string `[]`. -The contents of the first link label are parsed as inlines, -which are used as the link's text. The link's URI and title are -provided by the matching reference link definition. Thus, -`[foo][]` is equivalent to `[foo][foo]`. - -```````````````````````````````` example -[foo][] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar][] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo][] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - - -As with full reference links, [whitespace] is not -allowed between the two sets of brackets: - -```````````````````````````````` example -[foo] -[] - -[foo]: /url "title" -. -

              foo -[]

              -```````````````````````````````` - - -A [shortcut reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document and is not followed by `[]` or a link label. -The contents of the first link label are parsed as inlines, -which are used as the link's text. The link's URI and title -are provided by the matching link reference definition. -Thus, `[foo]` is equivalent to `[foo][]`. - -```````````````````````````````` example -[foo] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -[[*foo* bar]] - -[*foo* bar]: /url "title" -. -

              [foo bar]

              -```````````````````````````````` - - -```````````````````````````````` example -[[bar [foo] - -[foo]: /url -. -

              [[bar foo

              -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - -A space after the link text should be preserved: - -```````````````````````````````` example -[foo] bar - -[foo]: /url -. -

              foo bar

              -```````````````````````````````` - - -If you just want bracketed text, you can backslash-escape the -opening bracket to avoid links: - -```````````````````````````````` example -\[foo] - -[foo]: /url "title" -. -

              [foo]

              -```````````````````````````````` - - -Note that this is a link, because a link label ends with the first -following closing bracket: - -```````````````````````````````` example -[foo*]: /url - -*[foo*] -. -

              *foo*

              -```````````````````````````````` - - -Full and compact references take precedence over shortcut -references: - -```````````````````````````````` example -[foo][bar] - -[foo]: /url1 -[bar]: /url2 -. -

              foo

              -```````````````````````````````` - -```````````````````````````````` example -[foo][] - -[foo]: /url1 -. -

              foo

              -```````````````````````````````` - -Inline links also take precedence: - -```````````````````````````````` example -[foo]() - -[foo]: /url1 -. -

              foo

              -```````````````````````````````` - -```````````````````````````````` example -[foo](not a link) - -[foo]: /url1 -. -

              foo(not a link)

              -```````````````````````````````` - -In the following case `[bar][baz]` is parsed as a reference, -`[foo]` as normal text: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url -. -

              [foo]bar

              -```````````````````````````````` - - -Here, though, `[foo][bar]` is parsed as a reference, since -`[bar]` is defined: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[bar]: /url2 -. -

              foobaz

              -```````````````````````````````` - - -Here `[foo]` is not parsed as a shortcut reference, because it -is followed by a link label (even though `[bar]` is not defined): - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[foo]: /url2 -. -

              [foo]bar

              -```````````````````````````````` - - - -## Images - -Syntax for images is like the syntax for links, with one -difference. Instead of [link text], we have an -[image description](@). The rules for this are the -same as for [link text], except that (a) an -image description starts with `![` rather than `[`, and -(b) an image description may contain links. -An image description has inline elements -as its contents. When an image is rendered to HTML, -this is standardly used as the image's `alt` attribute. - -```````````````````````````````` example -![foo](/url "title") -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*] - -[foo *bar*]: train.jpg "train & tracks" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo ![bar](/url)](/url2) -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo [bar](/url)](/url2) -. -

              foo bar

              -```````````````````````````````` - - -Though this spec is concerned with parsing, not rendering, it is -recommended that in rendering to HTML, only the plain string content -of the [image description] be used. Note that in -the above example, the alt attribute's value is `foo bar`, not `foo -[bar](/url)` or `foo bar`. Only the plain string -content is rendered, without formatting. - -```````````````````````````````` example -![foo *bar*][] - -[foo *bar*]: train.jpg "train & tracks" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*][foobar] - -[FOOBAR]: train.jpg "train & tracks" -. -

              foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo](train.jpg) -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -My ![foo bar](/path/to/train.jpg "title" ) -. -

              My foo bar

              -```````````````````````````````` - - -```````````````````````````````` example -![foo]() -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![](/url) -. -

              -```````````````````````````````` - - -Reference-style: - -```````````````````````````````` example -![foo][bar] - -[bar]: /url -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![foo][bar] - -[BAR]: /url -. -

              foo

              -```````````````````````````````` - - -Collapsed: - -```````````````````````````````` example -![foo][] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar][] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -The labels are case-insensitive: - -```````````````````````````````` example -![Foo][] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - -As with reference links, [whitespace] is not allowed -between the two sets of brackets: - -```````````````````````````````` example -![foo] -[] - -[foo]: /url "title" -. -

              foo -[]

              -```````````````````````````````` - - -Shortcut: - -```````````````````````````````` example -![foo] - -[foo]: /url "title" -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar] - -[*foo* bar]: /url "title" -. -

              foo bar

              -```````````````````````````````` - - -Note that link labels cannot contain unescaped brackets: - -```````````````````````````````` example -![[foo]] - -[[foo]]: /url "title" -. -

              ![[foo]]

              -

              [[foo]]: /url "title"

              -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -![Foo] - -[foo]: /url "title" -. -

              Foo

              -```````````````````````````````` - - -If you just want a literal `!` followed by bracketed text, you can -backslash-escape the opening `[`: - -```````````````````````````````` example -!\[foo] - -[foo]: /url "title" -. -

              ![foo]

              -```````````````````````````````` - - -If you want a link after a literal `!`, backslash-escape the -`!`: - -```````````````````````````````` example -\![foo] - -[foo]: /url "title" -. -

              !foo

              -```````````````````````````````` - - -## Autolinks - -[Autolink](@)s are absolute URIs and email addresses inside -`<` and `>`. They are parsed as links, with the URL or email address -as the link label. - -A [URI autolink](@) consists of `<`, followed by an -[absolute URI] followed by `>`. It is parsed as -a link to the URI, with the URI as the link's label. - -An [absolute URI](@), -for these purposes, consists of a [scheme] followed by a colon (`:`) -followed by zero or more characters other than ASCII -[whitespace] and control characters, `<`, and `>`. If -the URI includes these characters, they must be percent-encoded -(e.g. `%20` for a space). - -For purposes of this spec, a [scheme](@) is any sequence -of 2--32 characters beginning with an ASCII letter and followed -by any combination of ASCII letters, digits, or the symbols plus -("+"), period ("."), or hyphen ("-"). - -Here are some valid autolinks: - -```````````````````````````````` example - -. -

              http://foo.bar.baz

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              http://foo.bar.baz/test?q=hello&id=22&boolean

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              irc://foo.bar:2233/baz

              -```````````````````````````````` - - -Uppercase is also fine: - -```````````````````````````````` example - -. -

              MAILTO:FOO@BAR.BAZ

              -```````````````````````````````` - - -Note that many strings that count as [absolute URIs] for -purposes of this spec are not valid URIs, because their -schemes are not registered or because of other problems -with their syntax: - -```````````````````````````````` example - -. -

              a+b+c:d

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              made-up-scheme://foo,bar

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              http://../

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              localhost:5001/foo

              -```````````````````````````````` - - -Spaces are not allowed in autolinks: - -```````````````````````````````` example - -. -

              <http://foo.bar/baz bim>

              -```````````````````````````````` - - -Backslash-escapes do not work inside autolinks: - -```````````````````````````````` example - -. -

              http://example.com/\[\

              -```````````````````````````````` - - -An [email autolink](@) -consists of `<`, followed by an [email address], -followed by `>`. The link's label is the email address, -and the URL is `mailto:` followed by the email address. - -An [email address](@), -for these purposes, is anything that matches -the [non-normative regex from the HTML5 -spec](https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)): - - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? - (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ - -Examples of email autolinks: - -```````````````````````````````` example - -. -

              foo@bar.example.com

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              foo+special@Bar.baz-bar0.com

              -```````````````````````````````` - - -Backslash-escapes do not work inside email autolinks: - -```````````````````````````````` example - -. -

              <foo+@bar.example.com>

              -```````````````````````````````` - - -These are not autolinks: - -```````````````````````````````` example -<> -. -

              <>

              -```````````````````````````````` - - -```````````````````````````````` example -< http://foo.bar > -. -

              < http://foo.bar >

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              <m:abc>

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              <foo.bar.baz>

              -```````````````````````````````` - - -```````````````````````````````` example -http://example.com -. -

              http://example.com

              -```````````````````````````````` - - -```````````````````````````````` example -foo@bar.example.com -. -

              foo@bar.example.com

              -```````````````````````````````` - - -## Raw HTML - -Text between `<` and `>` that looks like an HTML tag is parsed as a -raw HTML tag and will be rendered in HTML without escaping. -Tag and attribute names are not limited to current HTML tags, -so custom tags (and even, say, DocBook tags) may be used. - -Here is the grammar for tags: - -A [tag name](@) consists of an ASCII letter -followed by zero or more ASCII letters, digits, or -hyphens (`-`). - -An [attribute](@) consists of [whitespace], -an [attribute name], and an optional -[attribute value specification]. - -An [attribute name](@) -consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII -letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML -specification restricted to ASCII. HTML5 is laxer.) - -An [attribute value specification](@) -consists of optional [whitespace], -a `=` character, optional [whitespace], and an [attribute -value]. - -An [attribute value](@) -consists of an [unquoted attribute value], -a [single-quoted attribute value], or a [double-quoted attribute value]. - -An [unquoted attribute value](@) -is a nonempty string of characters not -including [whitespace], `"`, `'`, `=`, `<`, `>`, or `` ` ``. - -A [single-quoted attribute value](@) -consists of `'`, zero or more -characters not including `'`, and a final `'`. - -A [double-quoted attribute value](@) -consists of `"`, zero or more -characters not including `"`, and a final `"`. - -An [open tag](@) consists of a `<` character, a [tag name], -zero or more [attributes], optional [whitespace], an optional `/` -character, and a `>` character. - -A [closing tag](@) consists of the string ``. - -An [HTML comment](@) consists of ``, -where *text* does not start with `>` or `->`, does not end with `-`, -and does not contain `--`. (See the -[HTML5 spec](http://www.w3.org/TR/html5/syntax.html#comments).) - -A [processing instruction](@) -consists of the string ``, and the string -`?>`. - -A [declaration](@) consists of the -string ``, and the character `>`. - -A [CDATA section](@) consists of -the string ``, and the string `]]>`. - -An [HTML tag](@) consists of an [open tag], a [closing tag], -an [HTML comment], a [processing instruction], a [declaration], -or a [CDATA section]. - -Here are some simple open tags: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -Empty elements: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -[Whitespace] is allowed: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -With attributes: - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -Custom tag names can be used: - -```````````````````````````````` example -Foo -. -

              Foo

              -```````````````````````````````` - - -Illegal tag names, not parsed as HTML: - -```````````````````````````````` example -<33> <__> -. -

              <33> <__>

              -```````````````````````````````` - - -Illegal attribute names: - -```````````````````````````````` example -
              -. -

              <a h*#ref="hi">

              -```````````````````````````````` - - -Illegal attribute values: - -```````````````````````````````` example -
              -. -

              </a href="foo">

              -```````````````````````````````` - - -Comments: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -foo -. -

              foo <!-- not a comment -- two hyphens -->

              -```````````````````````````````` - - -Not comments: - -```````````````````````````````` example -foo foo --> - -foo -. -

              foo <!--> foo -->

              -

              foo <!-- foo--->

              -```````````````````````````````` - - -Processing instructions: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -Declarations: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -CDATA sections: - -```````````````````````````````` example -foo &<]]> -. -

              foo &<]]>

              -```````````````````````````````` - - -Entity and numeric character references are preserved in HTML -attributes: - -```````````````````````````````` example -foo
              -. -

              foo

              -```````````````````````````````` - - -Backslash escapes do not work in HTML attributes: - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              <a href=""">

              -```````````````````````````````` - - -## Hard line breaks - -A line break (not in a code span or HTML tag) that is preceded -by two or more spaces and does not occur at the end of a block -is parsed as a [hard line break](@) (rendered -in HTML as a `
              ` tag): - -```````````````````````````````` example -foo -baz -. -

              foo
              -baz

              -```````````````````````````````` - - -For a more visible alternative, a backslash before the -[line ending] may be used instead of two spaces: - -```````````````````````````````` example -foo\ -baz -. -

              foo
              -baz

              -```````````````````````````````` - - -More than two spaces can be used: - -```````````````````````````````` example -foo -baz -. -

              foo
              -baz

              -```````````````````````````````` - - -Leading spaces at the beginning of the next line are ignored: - -```````````````````````````````` example -foo - bar -. -

              foo
              -bar

              -```````````````````````````````` - - -```````````````````````````````` example -foo\ - bar -. -

              foo
              -bar

              -```````````````````````````````` - - -Line breaks can occur inside emphasis, links, and other constructs -that allow inline content: - -```````````````````````````````` example -*foo -bar* -. -

              foo
              -bar

              -```````````````````````````````` - - -```````````````````````````````` example -*foo\ -bar* -. -

              foo
              -bar

              -```````````````````````````````` - - -Line breaks do not occur inside code spans - -```````````````````````````````` example -`code -span` -. -

              code span

              -```````````````````````````````` - - -```````````````````````````````` example -`code\ -span` -. -

              code\ span

              -```````````````````````````````` - - -or HTML tags: - -```````````````````````````````` example -
              -. -

              -```````````````````````````````` - - -```````````````````````````````` example - -. -

              -```````````````````````````````` - - -Hard line breaks are for separating inline content within a block. -Neither syntax for hard line breaks works at the end of a paragraph or -other block element: - -```````````````````````````````` example -foo\ -. -

              foo\

              -```````````````````````````````` - - -```````````````````````````````` example -foo -. -

              foo

              -```````````````````````````````` - - -```````````````````````````````` example -### foo\ -. -

              foo\

              -```````````````````````````````` - - -```````````````````````````````` example -### foo -. -

              foo

              -```````````````````````````````` - - -## Soft line breaks - -A regular line break (not in a code span or HTML tag) that is not -preceded by two or more spaces or a backslash is parsed as a -[softbreak](@). (A softbreak may be rendered in HTML either as a -[line ending] or as a space. The result will be the same in -browsers. In the examples here, a [line ending] will be used.) - -```````````````````````````````` example -foo -baz -. -

              foo -baz

              -```````````````````````````````` - - -Spaces at the end of the line and beginning of the next line are -removed: - -```````````````````````````````` example -foo - baz -. -

              foo -baz

              -```````````````````````````````` - - -A conforming parser may render a soft line break in HTML either as a -line break or as a space. - -A renderer may also provide an option to render soft line breaks -as hard line breaks. - -## Textual content - -Any characters not given an interpretation by the above rules will -be parsed as plain textual content. - -```````````````````````````````` example -hello $.;'there -. -

              hello $.;'there

              -```````````````````````````````` - - -```````````````````````````````` example -Foo χρῆν -. -

              Foo χρῆν

              -```````````````````````````````` - - -Internal spaces are preserved verbatim: - -```````````````````````````````` example -Multiple spaces -. -

              Multiple spaces

              -```````````````````````````````` - - - - -# Appendix: A parsing strategy - -In this appendix we describe some features of the parsing strategy -used in the CommonMark reference implementations. - -## Overview - -Parsing has two phases: - -1. In the first phase, lines of input are consumed and the block -structure of the document---its division into paragraphs, block quotes, -list items, and so on---is constructed. Text is assigned to these -blocks but not parsed. Link reference definitions are parsed and a -map of links is constructed. - -2. In the second phase, the raw text contents of paragraphs and headings -are parsed into sequences of Markdown inline elements (strings, -code spans, links, emphasis, and so on), using the map of link -references constructed in phase 1. - -At each point in processing, the document is represented as a tree of -**blocks**. The root of the tree is a `document` block. The `document` -may have any number of other blocks as **children**. These children -may, in turn, have other blocks as children. The last child of a block -is normally considered **open**, meaning that subsequent lines of input -can alter its contents. (Blocks that are not open are **closed**.) -Here, for example, is a possible document tree, with the open blocks -marked by arrows: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 1: block structure - -Each line that is processed has an effect on this tree. The line is -analyzed and, depending on its contents, the document may be altered -in one or more of the following ways: - -1. One or more open blocks may be closed. -2. One or more new blocks may be created as children of the - last open block. -3. Text may be added to the last (deepest) open block remaining - on the tree. - -Once a line has been incorporated into the tree in this way, -it can be discarded, so input can be read in a stream. - -For each line, we follow this procedure: - -1. First we iterate through the open blocks, starting with the -root document, and descending through last children down to the last -open block. Each block imposes a condition that the line must satisfy -if the block is to remain open. For example, a block quote requires a -`>` character. A paragraph requires a non-blank line. -In this phase we may match all or just some of the open -blocks. But we cannot close unmatched blocks yet, because we may have a -[lazy continuation line]. - -2. Next, after consuming the continuation markers for existing -blocks, we look for new block starts (e.g. `>` for a block quote). -If we encounter a new block start, we close any blocks unmatched -in step 1 before creating the new block as a child of the last -matched block. - -3. Finally, we look at the remainder of the line (after block -markers like `>`, list markers, and indentation have been consumed). -This is text that can be incorporated into the last open -block (a paragraph, code block, heading, or raw HTML). - -Setext headings are formed when we see a line of a paragraph -that is a [setext heading underline]. - -Reference link definitions are detected when a paragraph is closed; -the accumulated text lines are parsed to see if they begin with -one or more reference link definitions. Any remainder becomes a -normal paragraph. - -We can see how this works by considering how the tree above is -generated by four lines of Markdown: - -``` markdown -> Lorem ipsum dolor -sit amet. -> - Qui *quodsi iracundia* -> - aliquando id -``` - -At the outset, our document model is just - -``` tree --> document -``` - -The first line of our text, - -``` markdown -> Lorem ipsum dolor -``` - -causes a `block_quote` block to be created as a child of our -open `document` block, and a `paragraph` block as a child of -the `block_quote`. Then the text is added to the last open -block, the `paragraph`: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor" -``` - -The next line, - -``` markdown -sit amet. -``` - -is a "lazy continuation" of the open `paragraph`, so it gets added -to the paragraph's text: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor\nsit amet." -``` - -The third line, - -``` markdown -> - Qui *quodsi iracundia* -``` - -causes the `paragraph` block to be closed, and a new `list` block -opened as a child of the `block_quote`. A `list_item` is also -added as a child of the `list`, and a `paragraph` as a child of -the `list_item`. The text is then added to the new `paragraph`: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - -> list_item - -> paragraph - "Qui *quodsi iracundia*" -``` - -The fourth line, - -``` markdown -> - aliquando id -``` - -causes the `list_item` (and its child the `paragraph`) to be closed, -and a new `list_item` opened up as child of the `list`. A `paragraph` -is added as a child of the new `list_item`, to contain the text. -We thus obtain the final tree: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 2: inline structure - -Once all of the input has been parsed, all open blocks are closed. - -We then "walk the tree," visiting every node, and parse raw -string contents of paragraphs and headings as inlines. At this -point we have seen all the link reference definitions, so we can -resolve reference links as we go. - -``` tree -document - block_quote - paragraph - str "Lorem ipsum dolor" - softbreak - str "sit amet." - list (type=bullet tight=true bullet_char=-) - list_item - paragraph - str "Qui " - emph - str "quodsi iracundia" - list_item - paragraph - str "aliquando id" -``` - -Notice how the [line ending] in the first paragraph has -been parsed as a `softbreak`, and the asterisks in the first list item -have become an `emph`. - -### An algorithm for parsing nested emphasis and links - -By far the trickiest part of inline parsing is handling emphasis, -strong emphasis, links, and images. This is done using the following -algorithm. - -When we're parsing inlines and we hit either - -- a run of `*` or `_` characters, or -- a `[` or `![` - -we insert a text node with these symbols as its literal content, and we -add a pointer to this text node to the [delimiter stack](@). - -The [delimiter stack] is a doubly linked list. Each -element contains a pointer to a text node, plus information about - -- the type of delimiter (`[`, `![`, `*`, `_`) -- the number of delimiters, -- whether the delimiter is "active" (all are active to start), and -- whether the delimiter is a potential opener, a potential closer, - or both (which depends on what sort of characters precede - and follow the delimiters). - -When we hit a `]` character, we call the *look for link or image* -procedure (see below). - -When we hit the end of the input, we call the *process emphasis* -procedure (see below), with `stack_bottom` = NULL. - -#### *look for link or image* - -Starting at the top of the delimiter stack, we look backwards -through the stack for an opening `[` or `![` delimiter. - -- If we don't find one, we return a literal text node `]`. - -- If we do find one, but it's not *active*, we remove the inactive - delimiter from the stack, and return a literal text node `]`. - -- If we find one and it's active, then we parse ahead to see if - we have an inline link/image, reference link/image, compact reference - link/image, or shortcut reference link/image. - - + If we don't, then we remove the opening delimiter from the - delimiter stack and return a literal text node `]`. - - + If we do, then - - * We return a link or image node whose children are the inlines - after the text node pointed to by the opening delimiter. - - * We run *process emphasis* on these inlines, with the `[` opener - as `stack_bottom`. - - * We remove the opening delimiter. - - * If we have a link (and not an image), we also set all - `[` delimiters before the opening delimiter to *inactive*. (This - will prevent us from getting links within links.) - -#### *process emphasis* - -Parameter `stack_bottom` sets a lower bound to how far we -descend in the [delimiter stack]. If it is NULL, we can -go all the way to the bottom. Otherwise, we stop before -visiting `stack_bottom`. - -Let `current_position` point to the element on the [delimiter stack] -just above `stack_bottom` (or the first element if `stack_bottom` -is NULL). - -We keep track of the `openers_bottom` for each delimiter -type (`*`, `_`) and each length of the closing delimiter run -(modulo 3). Initialize this to `stack_bottom`. - -Then we repeat the following until we run out of potential -closers: - -- Move `current_position` forward in the delimiter stack (if needed) - until we find the first potential closer with delimiter `*` or `_`. - (This will be the potential closer closest - to the beginning of the input -- the first one in parse order.) - -- Now, look back in the stack (staying above `stack_bottom` and - the `openers_bottom` for this delimiter type) for the - first matching potential opener ("matching" means same delimiter). - -- If one is found: - - + Figure out whether we have emphasis or strong emphasis: - if both closer and opener spans have length >= 2, we have - strong, otherwise regular. - - + Insert an emph or strong emph node accordingly, after - the text node corresponding to the opener. - - + Remove any delimiters between the opener and closer from - the delimiter stack. - - + Remove 1 (for regular emph) or 2 (for strong emph) delimiters - from the opening and closing text nodes. If they become empty - as a result, remove them and remove the corresponding element - of the delimiter stack. If the closing node is removed, reset - `current_position` to the next element in the stack. - -- If none is found: - - + Set `openers_bottom` to the element before `current_position`. - (We know that there are no openers for this kind of closer up to and - including this point, so this puts a lower bound on future searches.) - - + If the closer at `current_position` is not a potential opener, - remove it from the delimiter stack (since we know it can't - be a closer either). - - + Advance `current_position` to the next element in the stack. - -After we're done, we remove all delimiters above `stack_bottom` from the -delimiter stack. - diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/go/benchmark_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/go/benchmark_test.go deleted file mode 100644 index 0addfa49e..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_benchmark/go/benchmark_test.go +++ /dev/null @@ -1,95 +0,0 @@ -package main - -import ( - "bytes" - "io/ioutil" - "testing" - - gomarkdown "github.com/gomarkdown/markdown" - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/util" - "gitlab.com/golang-commonmark/markdown" - - "github.com/russross/blackfriday/v2" - - "github.com/88250/lute" -) - -func BenchmarkMarkdown(b *testing.B) { - b.Run("Blackfriday-v2", func(b *testing.B) { - r := func(src []byte) ([]byte, error) { - out := blackfriday.Run(src) - return out, nil - } - doBenchmark(b, r) - }) - - b.Run("GoldMark", func(b *testing.B) { - markdown := goldmark.New( - goldmark.WithRendererOptions(html.WithXHTML(), html.WithUnsafe()), - ) - r := func(src []byte) ([]byte, error) { - var out bytes.Buffer - err := markdown.Convert(src, &out) - return out.Bytes(), err - } - doBenchmark(b, r) - }) - - b.Run("CommonMark", func(b *testing.B) { - md := markdown.New(markdown.XHTMLOutput(true)) - r := func(src []byte) ([]byte, error) { - var out bytes.Buffer - err := md.Render(&out, src) - return out.Bytes(), err - } - doBenchmark(b, r) - }) - - b.Run("Lute", func(b *testing.B) { - luteEngine := lute.New() - luteEngine.SetGFMAutoLink(false) - luteEngine.SetGFMStrikethrough(false) - luteEngine.SetGFMTable(false) - luteEngine.SetGFMTaskListItem(false) - luteEngine.SetCodeSyntaxHighlight(false) - luteEngine.SetSoftBreak2HardBreak(false) - luteEngine.SetAutoSpace(false) - luteEngine.SetFixTermTypo(false) - r := func(src []byte) ([]byte, error) { - out, err := luteEngine.MarkdownStr("Benchmark", util.BytesToReadOnlyString(src)) - return util.StringToReadOnlyBytes(out), err - } - doBenchmark(b, r) - }) - - b.Run("GoMarkdown", func(b *testing.B) { - r := func(src []byte) ([]byte, error) { - out := gomarkdown.ToHTML(src, nil, nil) - return out, nil - } - doBenchmark(b, r) - }) - -} - -// The different frameworks have different APIs. Create an adapter that -// should behave the same in the memory department. -func doBenchmark(b *testing.B, render func(src []byte) ([]byte, error)) { - b.StopTimer() - source, err := ioutil.ReadFile("_data.md") - if err != nil { - b.Fatal(err) - } - b.StartTimer() - for i := 0; i < b.N; i++ { - out, err := render(source) - if err != nil { - b.Fatal(err) - } - if len(out) < 100 { - b.Fatal("No result") - } - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/extra.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/extra.txt deleted file mode 100644 index 3cebcb944..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/extra.txt +++ /dev/null @@ -1,686 +0,0 @@ -1 -//- - - - - - - - -// -* A - B -//- - - - - - - - -// -
                -
              • A -B
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -2 -//- - - - - - - - -// -**test**\ -test**test**\ -**test**test\ -test**test** -//- - - - - - - - -// -

              test
              -testtest
              -testtest
              -testtest

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -3 -//- - - - - - - - -// ->* > -> 1 -> 2 ->3 -//- - - - - - - - -// -
              -
                -
              • -
                -
                -
              • -
              -

              1 -2 -3

              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -4 -//- - - - - - - - -// -`test`a`test` -//- - - - - - - - -// -

              testatest

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -5 -//- - - - - - - - -// -_**TL/DR** - [Go see summary.](#my-summary-area)_ -//- - - - - - - - -// -

              TL/DR - Go see summary.

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -6 -//- - - - - - - - -// -[This link won't be rendered -correctly](https://geeksocket.in/some-long-link-here "This is the -place where everything breaks") -//- - - - - - - - -// -

              This link won't be rendered -correctly

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -7 -//- - - - - - - - -// -[](./target.md) -//- - - - - - - - -// -

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -8 -//- - - - - - - - -// -[]() -//- - - - - - - - -// -

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -9 -//- - - - - - - - -// -[daß] is the old german spelling of [dass] - -[daß]: www.das-dass.de -//- - - - - - - - -// -

              daß is the old german spelling of dass

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -10 -//- - - - - - - - -// -1. First step. - - ~~~ - aaa - --- - bbb - ~~~ - -2. few other steps. -//- - - - - - - - -// -
                -
              1. -

                First step.

                -
                aaa
                ----
                -bbb
                -
                -
              2. -
              3. -

                few other steps.

                -
              4. -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -11: delimiters between ascii punctuations should be parsed -//- - - - - - - - -// -`{%`_name_`%}` -//- - - - - - - - -// -

              {%name%}

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -12: the alt attribute of img should be escaped -//- - - - - - - - -// -!["](quot.jpg) -!['](apos.jpg) -![<](lt.jpg) -![>](gt.jpg) -![&](amp.jpg) -//- - - - - - - - -// -

              " -' -< -> -&

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -13: fenced code block starting with tab inside list -//- - - - - - - - -// -* foo - ```Makefile - foo - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                foo
                -	foo
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -14: fenced code block inside list, mismatched tab start -//- - - - - - - - -// -* foo - ```Makefile - foo - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                foo
                -  foo
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -15: fenced code block inside nested list -//- - - - - - - - -// -* foo - - bar - ```Makefile - foo - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                  -
                • bar -
                  foo
                  -	foo
                  -
                  -
                • -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -16: indented code block starting with a tab. -//- - - - - - - - -// -* foo - - foo - foo - -//- - - - - - - - -// -
                -
              • -

                foo

                -
                foo
                -	foo
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -17: fenced code block in list, empty line, spaces on start -//- - - - - - - - -// -* foo - ```Makefile - foo - - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                foo
                -
                -foo
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -18: fenced code block in list, empty line, no spaces on start -//- - - - - - - - -// -* foo - ```Makefile - foo - - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                foo
                -
                -foo
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -19: fenced code block inside nested list, empty line, spaces on start -//- - - - - - - - -// -* foo - - bar - ```Makefile - foo - - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                  -
                • bar -
                  foo
                  -
                  -foo
                  -
                  -
                • -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -20: fenced code block inside nested list, empty line, no space on start -//- - - - - - - - -// -* foo - - bar - ```Makefile - foo - - foo - ``` -//- - - - - - - - -// -
                -
              • foo -
                  -
                • bar -
                  foo
                  -
                  -foo
                  -
                  -
                • -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -21: Fenced code block within list can start with tab -//- - - - - - - - -// -- List - - ``` - A - B - C - ``` -//- - - - - - - - -// -
                -
              • -

                List

                -
                A
                -	B
                -C
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -22: Indented code block within list can start with tab -//- - - - - - - - -// -- List - - A - B - C - -a -//- - - - - - - - -// -
                -
              • -

                List

                -
                A
                -	B
                -C
                -
                -
              • -
              -

              a

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -23: Emphasis corner case(yuin/goldmark#245) -//- - - - - - - - -// -a* b c d *e* -//- - - - - - - - -// -

              a* b c d e

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -24: HTML block tags can contain trailing spaces -//- - - - - - - - -// - -//- - - - - - - - -// - -//= = = = = = = = = = = = = = = = = = = = = = = =// - -25: Indented code blocks can start with tab -//- - - - - - - - -// - x -//- - - - - - - - -// -
              	x
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -26: NUL bytes must be replaced with U+FFFD - OPTIONS: {"enableEscape": true} -//- - - - - - - - -// -hello\x00world - -hello\ufffdworld

              -

              -

              x

              -

              x

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -28: Single # is a heading level 1 -//- - - - - - - - -// -# -//- - - - - - - - -// -

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -29: An empty list item cannot interrupt a paragraph -//- - - - - - - - -// -x -* -//- - - - - - - - -// -

              x -*

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -30: A link reference definition followed by a single quote without closer -//- - - - - - - - -// -[x] - -[x]: <> -' -//- - - - - - - - -// -

              x

              -

              '

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -31: A link reference definition followed by a double quote without closer -//- - - - - - - - -// -[x] - -[x]: <> -" -//- - - - - - - - -// -

              x

              -

              "

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -32: Hex character entities must be limited to 6 characters -//- - - - - - - - -// -A -//- - - - - - - - -// -

              &#x0000041;

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -33: \x01 should be escaped all the time - OPTIONS: {"enableEscape": true} -//- - - - - - - - -// -[x](\x01) -//- - - - - - - - -// -

              x

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -34: A form feed should not be treated as a space - OPTIONS: {"enableEscape": true} -//- - - - - - - - -// -x \f -//- - - - - - - - -// -

              x \f

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -35: A link reference definition can contain a new line -//- - - - - - - - -// -This is a [test][foo -bar] 1...2..3... - -[foo bar]: / -//- - - - - - - - -// -

              This is a test 1...2..3...

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -36: Emphasis and links -//- - - - - - - - -// -_a[b_c_](d) -//- - - - - - - - -// -

              _ab_c_

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -37: Tabs and spaces - OPTIONS: {"enableEscape": true} -//- - - - - - - - -// -\t\t x\n -//- - - - - - - - -// -
              \t x\n
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -38: Decimal HTML entity literals should allow 7 digits -//- - - - - - - - -// -� -//- - - - - - - - -// -

              \uFFFD

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -39: Decimal HTML entities should not be interpreted as octal when starting with a 0 -//- - - - - - - - -// -d -//- - - - - - - - -// -

              d

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -40: Invalid HTML tag names -//- - - - - - - - -// -<1> - - - - - -< p> -//- - - - - - - - -// -

              <1>

              -

              <a:>

              -

              <a\f>

              -

              < p>

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -41: Link references can not contain spaces after link label -//- - - - - - - - -// -[x] -:> - -[o] :x -//- - - - - - - - -// -

              [x] -:>

              -

              [o] :x

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -42: Unclosed link reference titles can interrupt link references -//- - - - - - - - -// -[r]: -<> -' - -[o]: -x -' -//- - - - - - - - -// -

              '

              -

              '

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -43: A link containing an image containing a link should disable the outer link -//- - - - - - - - -// -[ ![ [b](c) ](x) ](y) -//- - - - - - - - -// -

              [  b ](y)

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -44: An empty list item(with trailing spaces) cannot interrupt a paragraph -//- - - - - - - - -// -a -* -//- - - - - - - - -// -

              a -*

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -45: Multiple empty list items -//- - - - - - - - -// -- - -- -//- - - - - - - - -// -
                -
              • -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -46: Vertical tab should not be treated as spaces - OPTIONS: {"enableEscape": true} -//- - - - - - - - -// -\v -//- - - - - - - - -// -

              \v

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -47: Escape back slashes should not be treated as hard line breaks -//- - - - - - - - -// -\\\\ -a -//- - - - - - - - -// -

              \ -a

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -48: Multiple paragraphs in tight list -//- - - - - - - - -// -- a - > - b -//- - - - - - - - -// -
                -
              • a -
                -
                -b
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -49: A list item that is indented up to 3 spaces after an empty list item -//- - - - - - - - -// -1. - - 1. b - -- - - - b -//- - - - - - - - -// -
                -
              1. -
              2. -

                b

                -
              3. -
              -
                -
              • -
              • -

                b

                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -50: Spaces before a visible hard linebreak should be preserved -//- - - - - - - - -// -a \ -b -//- - - - - - - - -// -

              a
              -b

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -51: Empty line in a fenced code block under list items -//- - - - - - - - -// -* This is a list item - ``` - This is a test - - This line will be dropped. - This line will be displayed. - ``` -//- - - - - - - - -// -
                -
              • This is a list item -
                This is a test
                -
                -This line will be dropped.
                -This line will be displayed.
                -
                -
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -52: windows-style newline and HTMLs - OPTIONS: {"enableEscape": true} -//- - - - - - - - -// -link - - -//- - - - - - - - -// -

              link

              - -//= = = = = = = = = = = = = = = = = = = = = = = =// - diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/options.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/options.txt deleted file mode 100644 index 3137b6572..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/options.txt +++ /dev/null @@ -1,78 +0,0 @@ -1 -//- - - - - - - - -// -## Title 0 - -## Title1 # {#id_1 .class-1} - -## Title2 {#id_2} - -## Title3 ## {#id_3 .class-3} - -## Title4 ## {data-attr3=value3} - -## Title5 ## {#id_5 data-attr5=value5} - -## Title6 ## {#id_6 .class6 data-attr6=value6} - -## Title7 ## {#id_7 data-attr7="value \"7"} - -## Title8 {#id .className data-attrName=attrValue class="class1 class2"} -//- - - - - - - - -// -

              Title 0

              -

              Title1

              -

              Title2

              -

              Title3

              -

              Title4

              -

              Title5

              -

              Title6

              -

              Title7

              -

              Title8

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -2 -//- - - - - - - - -// -# -# FOO -//- - - - - - - - -// -

              -

              FOO

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -3 -//- - - - - - - - -// -## `records(self, zone, params={})` -//- - - - - - - - -// -

              records(self, zone, params={})

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -4 -//- - - - - - - - -// -## Test {#hey .sort,class=fine,class=shell} Doesn't matter -//- - - - - - - - -// -

              Test {#hey .sort,class=fine,class=shell} Doesn't matter

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -5 -//- - - - - - - - -// -## Test ## {#hey .sort,class=fine,class=shell} Doesn't matter -//- - - - - - - - -// -

              Test ## {#hey .sort,class=fine,class=shell} Doesn't matter

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -6: class must be a string -//- - - - - - - - -// -# Test ## {class=0#.} -//- - - - - - - - -// -

              Test ## {class=0#.}

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -7: short handed ids can contain hyphens ("-"), underscores ("_"), colons (":"), and periods (".") -//- - - - - - - - -// -# Test ## {#id-foo_bar:baz.qux .foobar} -//- - - - - - - - -// -

              Test

              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/spec.json b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/spec.json deleted file mode 100644 index d742f9413..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_test/spec.json +++ /dev/null @@ -1,5218 +0,0 @@ -[ - { - "markdown": "\tfoo\tbaz\t\tbim\n", - "html": "
              foo\tbaz\t\tbim\n
              \n", - "example": 1, - "start_line": 356, - "end_line": 361, - "section": "Tabs" - }, - { - "markdown": " \tfoo\tbaz\t\tbim\n", - "html": "
              foo\tbaz\t\tbim\n
              \n", - "example": 2, - "start_line": 363, - "end_line": 368, - "section": "Tabs" - }, - { - "markdown": " a\ta\n ὐ\ta\n", - "html": "
              a\ta\nὐ\ta\n
              \n", - "example": 3, - "start_line": 370, - "end_line": 377, - "section": "Tabs" - }, - { - "markdown": " - foo\n\n\tbar\n", - "html": "
                \n
              • \n

                foo

                \n

                bar

                \n
              • \n
              \n", - "example": 4, - "start_line": 383, - "end_line": 394, - "section": "Tabs" - }, - { - "markdown": "- foo\n\n\t\tbar\n", - "html": "
                \n
              • \n

                foo

                \n
                  bar\n
                \n
              • \n
              \n", - "example": 5, - "start_line": 396, - "end_line": 408, - "section": "Tabs" - }, - { - "markdown": ">\t\tfoo\n", - "html": "
              \n
                foo\n
              \n
              \n", - "example": 6, - "start_line": 419, - "end_line": 426, - "section": "Tabs" - }, - { - "markdown": "-\t\tfoo\n", - "html": "
                \n
              • \n
                  foo\n
                \n
              • \n
              \n", - "example": 7, - "start_line": 428, - "end_line": 437, - "section": "Tabs" - }, - { - "markdown": " foo\n\tbar\n", - "html": "
              foo\nbar\n
              \n", - "example": 8, - "start_line": 440, - "end_line": 447, - "section": "Tabs" - }, - { - "markdown": " - foo\n - bar\n\t - baz\n", - "html": "
                \n
              • foo\n
                  \n
                • bar\n
                    \n
                  • baz
                  • \n
                  \n
                • \n
                \n
              • \n
              \n", - "example": 9, - "start_line": 449, - "end_line": 465, - "section": "Tabs" - }, - { - "markdown": "#\tFoo\n", - "html": "

              Foo

              \n", - "example": 10, - "start_line": 467, - "end_line": 471, - "section": "Tabs" - }, - { - "markdown": "*\t*\t*\t\n", - "html": "
              \n", - "example": 11, - "start_line": 473, - "end_line": 477, - "section": "Tabs" - }, - { - "markdown": "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\n", - "html": "

              !"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

              \n", - "example": 12, - "start_line": 490, - "end_line": 494, - "section": "Backslash escapes" - }, - { - "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", - "html": "

              \\\t\\A\\a\\ \\3\\φ\\«

              \n", - "example": 13, - "start_line": 500, - "end_line": 504, - "section": "Backslash escapes" - }, - { - "markdown": "\\*not emphasized*\n\\
              not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity\n", - "html": "

              *not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\n&ouml; not a character entity

              \n", - "example": 14, - "start_line": 510, - "end_line": 530, - "section": "Backslash escapes" - }, - { - "markdown": "\\\\*emphasis*\n", - "html": "

              \\emphasis

              \n", - "example": 15, - "start_line": 535, - "end_line": 539, - "section": "Backslash escapes" - }, - { - "markdown": "foo\\\nbar\n", - "html": "

              foo
              \nbar

              \n", - "example": 16, - "start_line": 544, - "end_line": 550, - "section": "Backslash escapes" - }, - { - "markdown": "`` \\[\\` ``\n", - "html": "

              \\[\\`

              \n", - "example": 17, - "start_line": 556, - "end_line": 560, - "section": "Backslash escapes" - }, - { - "markdown": " \\[\\]\n", - "html": "
              \\[\\]\n
              \n", - "example": 18, - "start_line": 563, - "end_line": 568, - "section": "Backslash escapes" - }, - { - "markdown": "~~~\n\\[\\]\n~~~\n", - "html": "
              \\[\\]\n
              \n", - "example": 19, - "start_line": 571, - "end_line": 578, - "section": "Backslash escapes" - }, - { - "markdown": "\n", - "html": "

              http://example.com?find=\\*

              \n", - "example": 20, - "start_line": 581, - "end_line": 585, - "section": "Backslash escapes" - }, - { - "markdown": "\n", - "html": "\n", - "example": 21, - "start_line": 588, - "end_line": 592, - "section": "Backslash escapes" - }, - { - "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", - "html": "

              foo

              \n", - "example": 22, - "start_line": 598, - "end_line": 602, - "section": "Backslash escapes" - }, - { - "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", - "html": "

              foo

              \n", - "example": 23, - "start_line": 605, - "end_line": 611, - "section": "Backslash escapes" - }, - { - "markdown": "``` foo\\+bar\nfoo\n```\n", - "html": "
              foo\n
              \n", - "example": 24, - "start_line": 614, - "end_line": 621, - "section": "Backslash escapes" - }, - { - "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", - "html": "

                & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

              \n", - "example": 25, - "start_line": 650, - "end_line": 658, - "section": "Entity and numeric character references" - }, - { - "markdown": "# Ӓ Ϡ �\n", - "html": "

              # Ӓ Ϡ �

              \n", - "example": 26, - "start_line": 669, - "end_line": 673, - "section": "Entity and numeric character references" - }, - { - "markdown": "" ആ ಫ\n", - "html": "

              " ആ ಫ

              \n", - "example": 27, - "start_line": 682, - "end_line": 686, - "section": "Entity and numeric character references" - }, - { - "markdown": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;\n", - "html": "

              &nbsp &x; &#; &#x;\n&#87654321;\n&#abcdef0;\n&ThisIsNotDefined; &hi?;

              \n", - "example": 28, - "start_line": 691, - "end_line": 701, - "section": "Entity and numeric character references" - }, - { - "markdown": "©\n", - "html": "

              &copy

              \n", - "example": 29, - "start_line": 708, - "end_line": 712, - "section": "Entity and numeric character references" - }, - { - "markdown": "&MadeUpEntity;\n", - "html": "

              &MadeUpEntity;

              \n", - "example": 30, - "start_line": 718, - "end_line": 722, - "section": "Entity and numeric character references" - }, - { - "markdown": "\n", - "html": "\n", - "example": 31, - "start_line": 729, - "end_line": 733, - "section": "Entity and numeric character references" - }, - { - "markdown": "[foo](/föö \"föö\")\n", - "html": "

              foo

              \n", - "example": 32, - "start_line": 736, - "end_line": 740, - "section": "Entity and numeric character references" - }, - { - "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", - "html": "

              foo

              \n", - "example": 33, - "start_line": 743, - "end_line": 749, - "section": "Entity and numeric character references" - }, - { - "markdown": "``` föö\nfoo\n```\n", - "html": "
              foo\n
              \n", - "example": 34, - "start_line": 752, - "end_line": 759, - "section": "Entity and numeric character references" - }, - { - "markdown": "`föö`\n", - "html": "

              f&ouml;&ouml;

              \n", - "example": 35, - "start_line": 765, - "end_line": 769, - "section": "Entity and numeric character references" - }, - { - "markdown": " föfö\n", - "html": "
              f&ouml;f&ouml;\n
              \n", - "example": 36, - "start_line": 772, - "end_line": 777, - "section": "Entity and numeric character references" - }, - { - "markdown": "*foo*\n*foo*\n", - "html": "

              *foo*\nfoo

              \n", - "example": 37, - "start_line": 784, - "end_line": 790, - "section": "Entity and numeric character references" - }, - { - "markdown": "* foo\n\n* foo\n", - "html": "

              * foo

              \n
                \n
              • foo
              • \n
              \n", - "example": 38, - "start_line": 792, - "end_line": 801, - "section": "Entity and numeric character references" - }, - { - "markdown": "foo bar\n", - "html": "

              foo\n\nbar

              \n", - "example": 39, - "start_line": 803, - "end_line": 809, - "section": "Entity and numeric character references" - }, - { - "markdown": " foo\n", - "html": "

              \tfoo

              \n", - "example": 40, - "start_line": 811, - "end_line": 815, - "section": "Entity and numeric character references" - }, - { - "markdown": "[a](url "tit")\n", - "html": "

              [a](url "tit")

              \n", - "example": 41, - "start_line": 818, - "end_line": 822, - "section": "Entity and numeric character references" - }, - { - "markdown": "- `one\n- two`\n", - "html": "
                \n
              • `one
              • \n
              • two`
              • \n
              \n", - "example": 42, - "start_line": 841, - "end_line": 849, - "section": "Precedence" - }, - { - "markdown": "***\n---\n___\n", - "html": "
              \n
              \n
              \n", - "example": 43, - "start_line": 880, - "end_line": 888, - "section": "Thematic breaks" - }, - { - "markdown": "+++\n", - "html": "

              +++

              \n", - "example": 44, - "start_line": 893, - "end_line": 897, - "section": "Thematic breaks" - }, - { - "markdown": "===\n", - "html": "

              ===

              \n", - "example": 45, - "start_line": 900, - "end_line": 904, - "section": "Thematic breaks" - }, - { - "markdown": "--\n**\n__\n", - "html": "

              --\n**\n__

              \n", - "example": 46, - "start_line": 909, - "end_line": 917, - "section": "Thematic breaks" - }, - { - "markdown": " ***\n ***\n ***\n", - "html": "
              \n
              \n
              \n", - "example": 47, - "start_line": 922, - "end_line": 930, - "section": "Thematic breaks" - }, - { - "markdown": " ***\n", - "html": "
              ***\n
              \n", - "example": 48, - "start_line": 935, - "end_line": 940, - "section": "Thematic breaks" - }, - { - "markdown": "Foo\n ***\n", - "html": "

              Foo\n***

              \n", - "example": 49, - "start_line": 943, - "end_line": 949, - "section": "Thematic breaks" - }, - { - "markdown": "_____________________________________\n", - "html": "
              \n", - "example": 50, - "start_line": 954, - "end_line": 958, - "section": "Thematic breaks" - }, - { - "markdown": " - - -\n", - "html": "
              \n", - "example": 51, - "start_line": 963, - "end_line": 967, - "section": "Thematic breaks" - }, - { - "markdown": " ** * ** * ** * **\n", - "html": "
              \n", - "example": 52, - "start_line": 970, - "end_line": 974, - "section": "Thematic breaks" - }, - { - "markdown": "- - - -\n", - "html": "
              \n", - "example": 53, - "start_line": 977, - "end_line": 981, - "section": "Thematic breaks" - }, - { - "markdown": "- - - - \n", - "html": "
              \n", - "example": 54, - "start_line": 986, - "end_line": 990, - "section": "Thematic breaks" - }, - { - "markdown": "_ _ _ _ a\n\na------\n\n---a---\n", - "html": "

              _ _ _ _ a

              \n

              a------

              \n

              ---a---

              \n", - "example": 55, - "start_line": 995, - "end_line": 1005, - "section": "Thematic breaks" - }, - { - "markdown": " *-*\n", - "html": "

              -

              \n", - "example": 56, - "start_line": 1011, - "end_line": 1015, - "section": "Thematic breaks" - }, - { - "markdown": "- foo\n***\n- bar\n", - "html": "
                \n
              • foo
              • \n
              \n
              \n
                \n
              • bar
              • \n
              \n", - "example": 57, - "start_line": 1020, - "end_line": 1032, - "section": "Thematic breaks" - }, - { - "markdown": "Foo\n***\nbar\n", - "html": "

              Foo

              \n
              \n

              bar

              \n", - "example": 58, - "start_line": 1037, - "end_line": 1045, - "section": "Thematic breaks" - }, - { - "markdown": "Foo\n---\nbar\n", - "html": "

              Foo

              \n

              bar

              \n", - "example": 59, - "start_line": 1054, - "end_line": 1061, - "section": "Thematic breaks" - }, - { - "markdown": "* Foo\n* * *\n* Bar\n", - "html": "
                \n
              • Foo
              • \n
              \n
              \n
                \n
              • Bar
              • \n
              \n", - "example": 60, - "start_line": 1067, - "end_line": 1079, - "section": "Thematic breaks" - }, - { - "markdown": "- Foo\n- * * *\n", - "html": "
                \n
              • Foo
              • \n
              • \n
                \n
              • \n
              \n", - "example": 61, - "start_line": 1084, - "end_line": 1094, - "section": "Thematic breaks" - }, - { - "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n", - "html": "

              foo

              \n

              foo

              \n

              foo

              \n

              foo

              \n
              foo
              \n
              foo
              \n", - "example": 62, - "start_line": 1113, - "end_line": 1127, - "section": "ATX headings" - }, - { - "markdown": "####### foo\n", - "html": "

              ####### foo

              \n", - "example": 63, - "start_line": 1132, - "end_line": 1136, - "section": "ATX headings" - }, - { - "markdown": "#5 bolt\n\n#hashtag\n", - "html": "

              #5 bolt

              \n

              #hashtag

              \n", - "example": 64, - "start_line": 1147, - "end_line": 1154, - "section": "ATX headings" - }, - { - "markdown": "\\## foo\n", - "html": "

              ## foo

              \n", - "example": 65, - "start_line": 1159, - "end_line": 1163, - "section": "ATX headings" - }, - { - "markdown": "# foo *bar* \\*baz\\*\n", - "html": "

              foo bar *baz*

              \n", - "example": 66, - "start_line": 1168, - "end_line": 1172, - "section": "ATX headings" - }, - { - "markdown": "# foo \n", - "html": "

              foo

              \n", - "example": 67, - "start_line": 1177, - "end_line": 1181, - "section": "ATX headings" - }, - { - "markdown": " ### foo\n ## foo\n # foo\n", - "html": "

              foo

              \n

              foo

              \n

              foo

              \n", - "example": 68, - "start_line": 1186, - "end_line": 1194, - "section": "ATX headings" - }, - { - "markdown": " # foo\n", - "html": "
              # foo\n
              \n", - "example": 69, - "start_line": 1199, - "end_line": 1204, - "section": "ATX headings" - }, - { - "markdown": "foo\n # bar\n", - "html": "

              foo\n# bar

              \n", - "example": 70, - "start_line": 1207, - "end_line": 1213, - "section": "ATX headings" - }, - { - "markdown": "## foo ##\n ### bar ###\n", - "html": "

              foo

              \n

              bar

              \n", - "example": 71, - "start_line": 1218, - "end_line": 1224, - "section": "ATX headings" - }, - { - "markdown": "# foo ##################################\n##### foo ##\n", - "html": "

              foo

              \n
              foo
              \n", - "example": 72, - "start_line": 1229, - "end_line": 1235, - "section": "ATX headings" - }, - { - "markdown": "### foo ### \n", - "html": "

              foo

              \n", - "example": 73, - "start_line": 1240, - "end_line": 1244, - "section": "ATX headings" - }, - { - "markdown": "### foo ### b\n", - "html": "

              foo ### b

              \n", - "example": 74, - "start_line": 1251, - "end_line": 1255, - "section": "ATX headings" - }, - { - "markdown": "# foo#\n", - "html": "

              foo#

              \n", - "example": 75, - "start_line": 1260, - "end_line": 1264, - "section": "ATX headings" - }, - { - "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", - "html": "

              foo ###

              \n

              foo ###

              \n

              foo #

              \n", - "example": 76, - "start_line": 1270, - "end_line": 1278, - "section": "ATX headings" - }, - { - "markdown": "****\n## foo\n****\n", - "html": "
              \n

              foo

              \n
              \n", - "example": 77, - "start_line": 1284, - "end_line": 1292, - "section": "ATX headings" - }, - { - "markdown": "Foo bar\n# baz\nBar foo\n", - "html": "

              Foo bar

              \n

              baz

              \n

              Bar foo

              \n", - "example": 78, - "start_line": 1295, - "end_line": 1303, - "section": "ATX headings" - }, - { - "markdown": "## \n#\n### ###\n", - "html": "

              \n

              \n

              \n", - "example": 79, - "start_line": 1308, - "end_line": 1316, - "section": "ATX headings" - }, - { - "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", - "html": "

              Foo bar

              \n

              Foo bar

              \n", - "example": 80, - "start_line": 1351, - "end_line": 1360, - "section": "Setext headings" - }, - { - "markdown": "Foo *bar\nbaz*\n====\n", - "html": "

              Foo bar\nbaz

              \n", - "example": 81, - "start_line": 1365, - "end_line": 1372, - "section": "Setext headings" - }, - { - "markdown": " Foo *bar\nbaz*\t\n====\n", - "html": "

              Foo bar\nbaz

              \n", - "example": 82, - "start_line": 1379, - "end_line": 1386, - "section": "Setext headings" - }, - { - "markdown": "Foo\n-------------------------\n\nFoo\n=\n", - "html": "

              Foo

              \n

              Foo

              \n", - "example": 83, - "start_line": 1391, - "end_line": 1400, - "section": "Setext headings" - }, - { - "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", - "html": "

              Foo

              \n

              Foo

              \n

              Foo

              \n", - "example": 84, - "start_line": 1406, - "end_line": 1419, - "section": "Setext headings" - }, - { - "markdown": " Foo\n ---\n\n Foo\n---\n", - "html": "
              Foo\n---\n\nFoo\n
              \n
              \n", - "example": 85, - "start_line": 1424, - "end_line": 1437, - "section": "Setext headings" - }, - { - "markdown": "Foo\n ---- \n", - "html": "

              Foo

              \n", - "example": 86, - "start_line": 1443, - "end_line": 1448, - "section": "Setext headings" - }, - { - "markdown": "Foo\n ---\n", - "html": "

              Foo\n---

              \n", - "example": 87, - "start_line": 1453, - "end_line": 1459, - "section": "Setext headings" - }, - { - "markdown": "Foo\n= =\n\nFoo\n--- -\n", - "html": "

              Foo\n= =

              \n

              Foo

              \n
              \n", - "example": 88, - "start_line": 1464, - "end_line": 1475, - "section": "Setext headings" - }, - { - "markdown": "Foo \n-----\n", - "html": "

              Foo

              \n", - "example": 89, - "start_line": 1480, - "end_line": 1485, - "section": "Setext headings" - }, - { - "markdown": "Foo\\\n----\n", - "html": "

              Foo\\

              \n", - "example": 90, - "start_line": 1490, - "end_line": 1495, - "section": "Setext headings" - }, - { - "markdown": "`Foo\n----\n`\n\n\n", - "html": "

              `Foo

              \n

              `

              \n

              <a title="a lot

              \n

              of dashes"/>

              \n", - "example": 91, - "start_line": 1501, - "end_line": 1514, - "section": "Setext headings" - }, - { - "markdown": "> Foo\n---\n", - "html": "
              \n

              Foo

              \n
              \n
              \n", - "example": 92, - "start_line": 1520, - "end_line": 1528, - "section": "Setext headings" - }, - { - "markdown": "> foo\nbar\n===\n", - "html": "
              \n

              foo\nbar\n===

              \n
              \n", - "example": 93, - "start_line": 1531, - "end_line": 1541, - "section": "Setext headings" - }, - { - "markdown": "- Foo\n---\n", - "html": "
                \n
              • Foo
              • \n
              \n
              \n", - "example": 94, - "start_line": 1544, - "end_line": 1552, - "section": "Setext headings" - }, - { - "markdown": "Foo\nBar\n---\n", - "html": "

              Foo\nBar

              \n", - "example": 95, - "start_line": 1559, - "end_line": 1566, - "section": "Setext headings" - }, - { - "markdown": "---\nFoo\n---\nBar\n---\nBaz\n", - "html": "
              \n

              Foo

              \n

              Bar

              \n

              Baz

              \n", - "example": 96, - "start_line": 1572, - "end_line": 1584, - "section": "Setext headings" - }, - { - "markdown": "\n====\n", - "html": "

              ====

              \n", - "example": 97, - "start_line": 1589, - "end_line": 1594, - "section": "Setext headings" - }, - { - "markdown": "---\n---\n", - "html": "
              \n
              \n", - "example": 98, - "start_line": 1601, - "end_line": 1607, - "section": "Setext headings" - }, - { - "markdown": "- foo\n-----\n", - "html": "
                \n
              • foo
              • \n
              \n
              \n", - "example": 99, - "start_line": 1610, - "end_line": 1618, - "section": "Setext headings" - }, - { - "markdown": " foo\n---\n", - "html": "
              foo\n
              \n
              \n", - "example": 100, - "start_line": 1621, - "end_line": 1628, - "section": "Setext headings" - }, - { - "markdown": "> foo\n-----\n", - "html": "
              \n

              foo

              \n
              \n
              \n", - "example": 101, - "start_line": 1631, - "end_line": 1639, - "section": "Setext headings" - }, - { - "markdown": "\\> foo\n------\n", - "html": "

              > foo

              \n", - "example": 102, - "start_line": 1645, - "end_line": 1650, - "section": "Setext headings" - }, - { - "markdown": "Foo\n\nbar\n---\nbaz\n", - "html": "

              Foo

              \n

              bar

              \n

              baz

              \n", - "example": 103, - "start_line": 1676, - "end_line": 1686, - "section": "Setext headings" - }, - { - "markdown": "Foo\nbar\n\n---\n\nbaz\n", - "html": "

              Foo\nbar

              \n
              \n

              baz

              \n", - "example": 104, - "start_line": 1692, - "end_line": 1704, - "section": "Setext headings" - }, - { - "markdown": "Foo\nbar\n* * *\nbaz\n", - "html": "

              Foo\nbar

              \n
              \n

              baz

              \n", - "example": 105, - "start_line": 1710, - "end_line": 1720, - "section": "Setext headings" - }, - { - "markdown": "Foo\nbar\n\\---\nbaz\n", - "html": "

              Foo\nbar\n---\nbaz

              \n", - "example": 106, - "start_line": 1725, - "end_line": 1735, - "section": "Setext headings" - }, - { - "markdown": " a simple\n indented code block\n", - "html": "
              a simple\n  indented code block\n
              \n", - "example": 107, - "start_line": 1753, - "end_line": 1760, - "section": "Indented code blocks" - }, - { - "markdown": " - foo\n\n bar\n", - "html": "
                \n
              • \n

                foo

                \n

                bar

                \n
              • \n
              \n", - "example": 108, - "start_line": 1767, - "end_line": 1778, - "section": "Indented code blocks" - }, - { - "markdown": "1. foo\n\n - bar\n", - "html": "
                \n
              1. \n

                foo

                \n
                  \n
                • bar
                • \n
                \n
              2. \n
              \n", - "example": 109, - "start_line": 1781, - "end_line": 1794, - "section": "Indented code blocks" - }, - { - "markdown": "
              \n *hi*\n\n - one\n", - "html": "
              <a/>\n*hi*\n\n- one\n
              \n", - "example": 110, - "start_line": 1801, - "end_line": 1812, - "section": "Indented code blocks" - }, - { - "markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n", - "html": "
              chunk1\n\nchunk2\n\n\n\nchunk3\n
              \n", - "example": 111, - "start_line": 1817, - "end_line": 1834, - "section": "Indented code blocks" - }, - { - "markdown": " chunk1\n \n chunk2\n", - "html": "
              chunk1\n  \n  chunk2\n
              \n", - "example": 112, - "start_line": 1840, - "end_line": 1849, - "section": "Indented code blocks" - }, - { - "markdown": "Foo\n bar\n\n", - "html": "

              Foo\nbar

              \n", - "example": 113, - "start_line": 1855, - "end_line": 1862, - "section": "Indented code blocks" - }, - { - "markdown": " foo\nbar\n", - "html": "
              foo\n
              \n

              bar

              \n", - "example": 114, - "start_line": 1869, - "end_line": 1876, - "section": "Indented code blocks" - }, - { - "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", - "html": "

              Heading

              \n
              foo\n
              \n

              Heading

              \n
              foo\n
              \n
              \n", - "example": 115, - "start_line": 1882, - "end_line": 1897, - "section": "Indented code blocks" - }, - { - "markdown": " foo\n bar\n", - "html": "
                  foo\nbar\n
              \n", - "example": 116, - "start_line": 1902, - "end_line": 1909, - "section": "Indented code blocks" - }, - { - "markdown": "\n \n foo\n \n\n", - "html": "
              foo\n
              \n", - "example": 117, - "start_line": 1915, - "end_line": 1924, - "section": "Indented code blocks" - }, - { - "markdown": " foo \n", - "html": "
              foo  \n
              \n", - "example": 118, - "start_line": 1929, - "end_line": 1934, - "section": "Indented code blocks" - }, - { - "markdown": "```\n<\n >\n```\n", - "html": "
              <\n >\n
              \n", - "example": 119, - "start_line": 1984, - "end_line": 1993, - "section": "Fenced code blocks" - }, - { - "markdown": "~~~\n<\n >\n~~~\n", - "html": "
              <\n >\n
              \n", - "example": 120, - "start_line": 1998, - "end_line": 2007, - "section": "Fenced code blocks" - }, - { - "markdown": "``\nfoo\n``\n", - "html": "

              foo

              \n", - "example": 121, - "start_line": 2011, - "end_line": 2017, - "section": "Fenced code blocks" - }, - { - "markdown": "```\naaa\n~~~\n```\n", - "html": "
              aaa\n~~~\n
              \n", - "example": 122, - "start_line": 2022, - "end_line": 2031, - "section": "Fenced code blocks" - }, - { - "markdown": "~~~\naaa\n```\n~~~\n", - "html": "
              aaa\n```\n
              \n", - "example": 123, - "start_line": 2034, - "end_line": 2043, - "section": "Fenced code blocks" - }, - { - "markdown": "````\naaa\n```\n``````\n", - "html": "
              aaa\n```\n
              \n", - "example": 124, - "start_line": 2048, - "end_line": 2057, - "section": "Fenced code blocks" - }, - { - "markdown": "~~~~\naaa\n~~~\n~~~~\n", - "html": "
              aaa\n~~~\n
              \n", - "example": 125, - "start_line": 2060, - "end_line": 2069, - "section": "Fenced code blocks" - }, - { - "markdown": "```\n", - "html": "
              \n", - "example": 126, - "start_line": 2075, - "end_line": 2079, - "section": "Fenced code blocks" - }, - { - "markdown": "`````\n\n```\naaa\n", - "html": "
              \n```\naaa\n
              \n", - "example": 127, - "start_line": 2082, - "end_line": 2092, - "section": "Fenced code blocks" - }, - { - "markdown": "> ```\n> aaa\n\nbbb\n", - "html": "
              \n
              aaa\n
              \n
              \n

              bbb

              \n", - "example": 128, - "start_line": 2095, - "end_line": 2106, - "section": "Fenced code blocks" - }, - { - "markdown": "```\n\n \n```\n", - "html": "
              \n  \n
              \n", - "example": 129, - "start_line": 2111, - "end_line": 2120, - "section": "Fenced code blocks" - }, - { - "markdown": "```\n```\n", - "html": "
              \n", - "example": 130, - "start_line": 2125, - "end_line": 2130, - "section": "Fenced code blocks" - }, - { - "markdown": " ```\n aaa\naaa\n```\n", - "html": "
              aaa\naaa\n
              \n", - "example": 131, - "start_line": 2137, - "end_line": 2146, - "section": "Fenced code blocks" - }, - { - "markdown": " ```\naaa\n aaa\naaa\n ```\n", - "html": "
              aaa\naaa\naaa\n
              \n", - "example": 132, - "start_line": 2149, - "end_line": 2160, - "section": "Fenced code blocks" - }, - { - "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", - "html": "
              aaa\n aaa\naaa\n
              \n", - "example": 133, - "start_line": 2163, - "end_line": 2174, - "section": "Fenced code blocks" - }, - { - "markdown": " ```\n aaa\n ```\n", - "html": "
              ```\naaa\n```\n
              \n", - "example": 134, - "start_line": 2179, - "end_line": 2188, - "section": "Fenced code blocks" - }, - { - "markdown": "```\naaa\n ```\n", - "html": "
              aaa\n
              \n", - "example": 135, - "start_line": 2194, - "end_line": 2201, - "section": "Fenced code blocks" - }, - { - "markdown": " ```\naaa\n ```\n", - "html": "
              aaa\n
              \n", - "example": 136, - "start_line": 2204, - "end_line": 2211, - "section": "Fenced code blocks" - }, - { - "markdown": "```\naaa\n ```\n", - "html": "
              aaa\n    ```\n
              \n", - "example": 137, - "start_line": 2216, - "end_line": 2224, - "section": "Fenced code blocks" - }, - { - "markdown": "``` ```\naaa\n", - "html": "

              \naaa

              \n", - "example": 138, - "start_line": 2230, - "end_line": 2236, - "section": "Fenced code blocks" - }, - { - "markdown": "~~~~~~\naaa\n~~~ ~~\n", - "html": "
              aaa\n~~~ ~~\n
              \n", - "example": 139, - "start_line": 2239, - "end_line": 2247, - "section": "Fenced code blocks" - }, - { - "markdown": "foo\n```\nbar\n```\nbaz\n", - "html": "

              foo

              \n
              bar\n
              \n

              baz

              \n", - "example": 140, - "start_line": 2253, - "end_line": 2264, - "section": "Fenced code blocks" - }, - { - "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", - "html": "

              foo

              \n
              bar\n
              \n

              baz

              \n", - "example": 141, - "start_line": 2270, - "end_line": 2282, - "section": "Fenced code blocks" - }, - { - "markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n", - "html": "
              def foo(x)\n  return 3\nend\n
              \n", - "example": 142, - "start_line": 2292, - "end_line": 2303, - "section": "Fenced code blocks" - }, - { - "markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n", - "html": "
              def foo(x)\n  return 3\nend\n
              \n", - "example": 143, - "start_line": 2306, - "end_line": 2317, - "section": "Fenced code blocks" - }, - { - "markdown": "````;\n````\n", - "html": "
              \n", - "example": 144, - "start_line": 2320, - "end_line": 2325, - "section": "Fenced code blocks" - }, - { - "markdown": "``` aa ```\nfoo\n", - "html": "

              aa\nfoo

              \n", - "example": 145, - "start_line": 2330, - "end_line": 2336, - "section": "Fenced code blocks" - }, - { - "markdown": "~~~ aa ``` ~~~\nfoo\n~~~\n", - "html": "
              foo\n
              \n", - "example": 146, - "start_line": 2341, - "end_line": 2348, - "section": "Fenced code blocks" - }, - { - "markdown": "```\n``` aaa\n```\n", - "html": "
              ``` aaa\n
              \n", - "example": 147, - "start_line": 2353, - "end_line": 2360, - "section": "Fenced code blocks" - }, - { - "markdown": "
              \n
              \n**Hello**,\n\n_world_.\n
              \n
              \n", - "html": "
              \n
              \n**Hello**,\n

              world.\n

              \n
              \n", - "example": 148, - "start_line": 2432, - "end_line": 2447, - "section": "HTML blocks" - }, - { - "markdown": "\n \n \n \n
              \n hi\n
              \n\nokay.\n", - "html": "\n \n \n \n
              \n hi\n
              \n

              okay.

              \n", - "example": 149, - "start_line": 2461, - "end_line": 2480, - "section": "HTML blocks" - }, - { - "markdown": "
              \n*foo*\n", - "example": 151, - "start_line": 2496, - "end_line": 2502, - "section": "HTML blocks" - }, - { - "markdown": "
              \n\n*Markdown*\n\n
              \n", - "html": "
              \n

              Markdown

              \n
              \n", - "example": 152, - "start_line": 2507, - "end_line": 2517, - "section": "HTML blocks" - }, - { - "markdown": "
              \n
              \n", - "html": "
              \n
              \n", - "example": 153, - "start_line": 2523, - "end_line": 2531, - "section": "HTML blocks" - }, - { - "markdown": "
              \n
              \n", - "html": "
              \n
              \n", - "example": 154, - "start_line": 2534, - "end_line": 2542, - "section": "HTML blocks" - }, - { - "markdown": "
              \n*foo*\n\n*bar*\n", - "html": "
              \n*foo*\n

              bar

              \n", - "example": 155, - "start_line": 2546, - "end_line": 2555, - "section": "HTML blocks" - }, - { - "markdown": "
              \n", - "html": "\n", - "example": 159, - "start_line": 2595, - "end_line": 2599, - "section": "HTML blocks" - }, - { - "markdown": "
              \nfoo\n
              \n", - "html": "
              \nfoo\n
              \n", - "example": 160, - "start_line": 2602, - "end_line": 2610, - "section": "HTML blocks" - }, - { - "markdown": "
              \n``` c\nint x = 33;\n```\n", - "html": "
              \n``` c\nint x = 33;\n```\n", - "example": 161, - "start_line": 2619, - "end_line": 2629, - "section": "HTML blocks" - }, - { - "markdown": "\n*bar*\n\n", - "html": "\n*bar*\n\n", - "example": 162, - "start_line": 2636, - "end_line": 2644, - "section": "HTML blocks" - }, - { - "markdown": "\n*bar*\n\n", - "html": "\n*bar*\n\n", - "example": 163, - "start_line": 2649, - "end_line": 2657, - "section": "HTML blocks" - }, - { - "markdown": "\n*bar*\n\n", - "html": "\n*bar*\n\n", - "example": 164, - "start_line": 2660, - "end_line": 2668, - "section": "HTML blocks" - }, - { - "markdown": "\n*bar*\n", - "html": "\n*bar*\n", - "example": 165, - "start_line": 2671, - "end_line": 2677, - "section": "HTML blocks" - }, - { - "markdown": "\n*foo*\n\n", - "html": "\n*foo*\n\n", - "example": 166, - "start_line": 2686, - "end_line": 2694, - "section": "HTML blocks" - }, - { - "markdown": "\n\n*foo*\n\n\n", - "html": "\n

              foo

              \n
              \n", - "example": 167, - "start_line": 2701, - "end_line": 2711, - "section": "HTML blocks" - }, - { - "markdown": "*foo*\n", - "html": "

              foo

              \n", - "example": 168, - "start_line": 2719, - "end_line": 2723, - "section": "HTML blocks" - }, - { - "markdown": "
              \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
              \nokay\n", - "html": "
              \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
              \n

              okay

              \n", - "example": 169, - "start_line": 2735, - "end_line": 2751, - "section": "HTML blocks" - }, - { - "markdown": "\nokay\n", - "html": "\n

              okay

              \n", - "example": 170, - "start_line": 2756, - "end_line": 2770, - "section": "HTML blocks" - }, - { - "markdown": "\n", - "html": "\n", - "example": 171, - "start_line": 2775, - "end_line": 2791, - "section": "HTML blocks" - }, - { - "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", - "html": "\nh1 {color:red;}\n\np {color:blue;}\n\n

              okay

              \n", - "example": 172, - "start_line": 2795, - "end_line": 2811, - "section": "HTML blocks" - }, - { - "markdown": "\n\nfoo\n", - "html": "\n\nfoo\n", - "example": 173, - "start_line": 2818, - "end_line": 2828, - "section": "HTML blocks" - }, - { - "markdown": ">
              \n> foo\n\nbar\n", - "html": "
              \n
              \nfoo\n
              \n

              bar

              \n", - "example": 174, - "start_line": 2831, - "end_line": 2842, - "section": "HTML blocks" - }, - { - "markdown": "-
              \n- foo\n", - "html": "
                \n
              • \n
                \n
              • \n
              • foo
              • \n
              \n", - "example": 175, - "start_line": 2845, - "end_line": 2855, - "section": "HTML blocks" - }, - { - "markdown": "\n*foo*\n", - "html": "\n

              foo

              \n", - "example": 176, - "start_line": 2860, - "end_line": 2866, - "section": "HTML blocks" - }, - { - "markdown": "*bar*\n*baz*\n", - "html": "*bar*\n

              baz

              \n", - "example": 177, - "start_line": 2869, - "end_line": 2875, - "section": "HTML blocks" - }, - { - "markdown": "1. *bar*\n", - "html": "1. *bar*\n", - "example": 178, - "start_line": 2881, - "end_line": 2889, - "section": "HTML blocks" - }, - { - "markdown": "\nokay\n", - "html": "\n

              okay

              \n", - "example": 179, - "start_line": 2894, - "end_line": 2906, - "section": "HTML blocks" - }, - { - "markdown": "';\n\n?>\nokay\n", - "html": "';\n\n?>\n

              okay

              \n", - "example": 180, - "start_line": 2912, - "end_line": 2926, - "section": "HTML blocks" - }, - { - "markdown": "\n", - "html": "\n", - "example": 181, - "start_line": 2931, - "end_line": 2935, - "section": "HTML blocks" - }, - { - "markdown": "\nokay\n", - "html": "\n

              okay

              \n", - "example": 182, - "start_line": 2940, - "end_line": 2968, - "section": "HTML blocks" - }, - { - "markdown": " \n\n \n", - "html": " \n
              <!-- foo -->\n
              \n", - "example": 183, - "start_line": 2974, - "end_line": 2982, - "section": "HTML blocks" - }, - { - "markdown": "
              \n\n
              \n", - "html": "
              \n
              <div>\n
              \n", - "example": 184, - "start_line": 2985, - "end_line": 2993, - "section": "HTML blocks" - }, - { - "markdown": "Foo\n
              \nbar\n
              \n", - "html": "

              Foo

              \n
              \nbar\n
              \n", - "example": 185, - "start_line": 2999, - "end_line": 3009, - "section": "HTML blocks" - }, - { - "markdown": "
              \nbar\n
              \n*foo*\n", - "html": "
              \nbar\n
              \n*foo*\n", - "example": 186, - "start_line": 3016, - "end_line": 3026, - "section": "HTML blocks" - }, - { - "markdown": "Foo\n\nbaz\n", - "html": "

              Foo\n\nbaz

              \n", - "example": 187, - "start_line": 3031, - "end_line": 3039, - "section": "HTML blocks" - }, - { - "markdown": "
              \n\n*Emphasized* text.\n\n
              \n", - "html": "
              \n

              Emphasized text.

              \n
              \n", - "example": 188, - "start_line": 3072, - "end_line": 3082, - "section": "HTML blocks" - }, - { - "markdown": "
              \n*Emphasized* text.\n
              \n", - "html": "
              \n*Emphasized* text.\n
              \n", - "example": 189, - "start_line": 3085, - "end_line": 3093, - "section": "HTML blocks" - }, - { - "markdown": "\n\n\n\n\n\n\n\n
              \nHi\n
              \n", - "html": "\n\n\n\n
              \nHi\n
              \n", - "example": 190, - "start_line": 3107, - "end_line": 3127, - "section": "HTML blocks" - }, - { - "markdown": "\n\n \n\n \n\n \n\n
              \n Hi\n
              \n", - "html": "\n \n
              <td>\n  Hi\n</td>\n
              \n \n
              \n", - "example": 191, - "start_line": 3134, - "end_line": 3155, - "section": "HTML blocks" - }, - { - "markdown": "[foo]: /url \"title\"\n\n[foo]\n", - "html": "

              foo

              \n", - "example": 192, - "start_line": 3183, - "end_line": 3189, - "section": "Link reference definitions" - }, - { - "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", - "html": "

              foo

              \n", - "example": 193, - "start_line": 3192, - "end_line": 3200, - "section": "Link reference definitions" - }, - { - "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", - "html": "

              Foo*bar]

              \n", - "example": 194, - "start_line": 3203, - "end_line": 3209, - "section": "Link reference definitions" - }, - { - "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", - "html": "

              Foo bar

              \n", - "example": 195, - "start_line": 3212, - "end_line": 3220, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", - "html": "

              foo

              \n", - "example": 196, - "start_line": 3225, - "end_line": 3239, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", - "html": "

              [foo]: /url 'title

              \n

              with blank line'

              \n

              [foo]

              \n", - "example": 197, - "start_line": 3244, - "end_line": 3254, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]:\n/url\n\n[foo]\n", - "html": "

              foo

              \n", - "example": 198, - "start_line": 3259, - "end_line": 3266, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]:\n\n[foo]\n", - "html": "

              [foo]:

              \n

              [foo]

              \n", - "example": 199, - "start_line": 3271, - "end_line": 3278, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: <>\n\n[foo]\n", - "html": "

              foo

              \n", - "example": 200, - "start_line": 3283, - "end_line": 3289, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: (baz)\n\n[foo]\n", - "html": "

              [foo]: (baz)

              \n

              [foo]

              \n", - "example": 201, - "start_line": 3294, - "end_line": 3301, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", - "html": "

              foo

              \n", - "example": 202, - "start_line": 3307, - "end_line": 3313, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]\n\n[foo]: url\n", - "html": "

              foo

              \n", - "example": 203, - "start_line": 3318, - "end_line": 3324, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", - "html": "

              foo

              \n", - "example": 204, - "start_line": 3330, - "end_line": 3337, - "section": "Link reference definitions" - }, - { - "markdown": "[FOO]: /url\n\n[Foo]\n", - "html": "

              Foo

              \n", - "example": 205, - "start_line": 3343, - "end_line": 3349, - "section": "Link reference definitions" - }, - { - "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", - "html": "

              αγω

              \n", - "example": 206, - "start_line": 3352, - "end_line": 3358, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\n", - "html": "", - "example": 207, - "start_line": 3367, - "end_line": 3370, - "section": "Link reference definitions" - }, - { - "markdown": "[\nfoo\n]: /url\nbar\n", - "html": "

              bar

              \n", - "example": 208, - "start_line": 3375, - "end_line": 3382, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url \"title\" ok\n", - "html": "

              [foo]: /url "title" ok

              \n", - "example": 209, - "start_line": 3388, - "end_line": 3392, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\n\"title\" ok\n", - "html": "

              "title" ok

              \n", - "example": 210, - "start_line": 3397, - "end_line": 3402, - "section": "Link reference definitions" - }, - { - "markdown": " [foo]: /url \"title\"\n\n[foo]\n", - "html": "
              [foo]: /url "title"\n
              \n

              [foo]

              \n", - "example": 211, - "start_line": 3408, - "end_line": 3416, - "section": "Link reference definitions" - }, - { - "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", - "html": "
              [foo]: /url\n
              \n

              [foo]

              \n", - "example": 212, - "start_line": 3422, - "end_line": 3432, - "section": "Link reference definitions" - }, - { - "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", - "html": "

              Foo\n[bar]: /baz

              \n

              [bar]

              \n", - "example": 213, - "start_line": 3437, - "end_line": 3446, - "section": "Link reference definitions" - }, - { - "markdown": "# [Foo]\n[foo]: /url\n> bar\n", - "html": "

              Foo

              \n
              \n

              bar

              \n
              \n", - "example": 214, - "start_line": 3452, - "end_line": 3461, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\nbar\n===\n[foo]\n", - "html": "

              bar

              \n

              foo

              \n", - "example": 215, - "start_line": 3463, - "end_line": 3471, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\n===\n[foo]\n", - "html": "

              ===\nfoo

              \n", - "example": 216, - "start_line": 3473, - "end_line": 3480, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", - "html": "

              foo,\nbar,\nbaz

              \n", - "example": 217, - "start_line": 3486, - "end_line": 3499, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]\n\n> [foo]: /url\n", - "html": "

              foo

              \n
              \n
              \n", - "example": 218, - "start_line": 3507, - "end_line": 3515, - "section": "Link reference definitions" - }, - { - "markdown": "aaa\n\nbbb\n", - "html": "

              aaa

              \n

              bbb

              \n", - "example": 219, - "start_line": 3529, - "end_line": 3536, - "section": "Paragraphs" - }, - { - "markdown": "aaa\nbbb\n\nccc\nddd\n", - "html": "

              aaa\nbbb

              \n

              ccc\nddd

              \n", - "example": 220, - "start_line": 3541, - "end_line": 3552, - "section": "Paragraphs" - }, - { - "markdown": "aaa\n\n\nbbb\n", - "html": "

              aaa

              \n

              bbb

              \n", - "example": 221, - "start_line": 3557, - "end_line": 3565, - "section": "Paragraphs" - }, - { - "markdown": " aaa\n bbb\n", - "html": "

              aaa\nbbb

              \n", - "example": 222, - "start_line": 3570, - "end_line": 3576, - "section": "Paragraphs" - }, - { - "markdown": "aaa\n bbb\n ccc\n", - "html": "

              aaa\nbbb\nccc

              \n", - "example": 223, - "start_line": 3582, - "end_line": 3590, - "section": "Paragraphs" - }, - { - "markdown": " aaa\nbbb\n", - "html": "

              aaa\nbbb

              \n", - "example": 224, - "start_line": 3596, - "end_line": 3602, - "section": "Paragraphs" - }, - { - "markdown": " aaa\nbbb\n", - "html": "
              aaa\n
              \n

              bbb

              \n", - "example": 225, - "start_line": 3605, - "end_line": 3612, - "section": "Paragraphs" - }, - { - "markdown": "aaa \nbbb \n", - "html": "

              aaa
              \nbbb

              \n", - "example": 226, - "start_line": 3619, - "end_line": 3625, - "section": "Paragraphs" - }, - { - "markdown": " \n\naaa\n \n\n# aaa\n\n \n", - "html": "

              aaa

              \n

              aaa

              \n", - "example": 227, - "start_line": 3636, - "end_line": 3648, - "section": "Blank lines" - }, - { - "markdown": "> # Foo\n> bar\n> baz\n", - "html": "
              \n

              Foo

              \n

              bar\nbaz

              \n
              \n", - "example": 228, - "start_line": 3704, - "end_line": 3714, - "section": "Block quotes" - }, - { - "markdown": "># Foo\n>bar\n> baz\n", - "html": "
              \n

              Foo

              \n

              bar\nbaz

              \n
              \n", - "example": 229, - "start_line": 3719, - "end_line": 3729, - "section": "Block quotes" - }, - { - "markdown": " > # Foo\n > bar\n > baz\n", - "html": "
              \n

              Foo

              \n

              bar\nbaz

              \n
              \n", - "example": 230, - "start_line": 3734, - "end_line": 3744, - "section": "Block quotes" - }, - { - "markdown": " > # Foo\n > bar\n > baz\n", - "html": "
              > # Foo\n> bar\n> baz\n
              \n", - "example": 231, - "start_line": 3749, - "end_line": 3758, - "section": "Block quotes" - }, - { - "markdown": "> # Foo\n> bar\nbaz\n", - "html": "
              \n

              Foo

              \n

              bar\nbaz

              \n
              \n", - "example": 232, - "start_line": 3764, - "end_line": 3774, - "section": "Block quotes" - }, - { - "markdown": "> bar\nbaz\n> foo\n", - "html": "
              \n

              bar\nbaz\nfoo

              \n
              \n", - "example": 233, - "start_line": 3780, - "end_line": 3790, - "section": "Block quotes" - }, - { - "markdown": "> foo\n---\n", - "html": "
              \n

              foo

              \n
              \n
              \n", - "example": 234, - "start_line": 3804, - "end_line": 3812, - "section": "Block quotes" - }, - { - "markdown": "> - foo\n- bar\n", - "html": "
              \n
                \n
              • foo
              • \n
              \n
              \n
                \n
              • bar
              • \n
              \n", - "example": 235, - "start_line": 3824, - "end_line": 3836, - "section": "Block quotes" - }, - { - "markdown": "> foo\n bar\n", - "html": "
              \n
              foo\n
              \n
              \n
              bar\n
              \n", - "example": 236, - "start_line": 3842, - "end_line": 3852, - "section": "Block quotes" - }, - { - "markdown": "> ```\nfoo\n```\n", - "html": "
              \n
              \n
              \n

              foo

              \n
              \n", - "example": 237, - "start_line": 3855, - "end_line": 3865, - "section": "Block quotes" - }, - { - "markdown": "> foo\n - bar\n", - "html": "
              \n

              foo\n- bar

              \n
              \n", - "example": 238, - "start_line": 3871, - "end_line": 3879, - "section": "Block quotes" - }, - { - "markdown": ">\n", - "html": "
              \n
              \n", - "example": 239, - "start_line": 3895, - "end_line": 3900, - "section": "Block quotes" - }, - { - "markdown": ">\n> \n> \n", - "html": "
              \n
              \n", - "example": 240, - "start_line": 3903, - "end_line": 3910, - "section": "Block quotes" - }, - { - "markdown": ">\n> foo\n> \n", - "html": "
              \n

              foo

              \n
              \n", - "example": 241, - "start_line": 3915, - "end_line": 3923, - "section": "Block quotes" - }, - { - "markdown": "> foo\n\n> bar\n", - "html": "
              \n

              foo

              \n
              \n
              \n

              bar

              \n
              \n", - "example": 242, - "start_line": 3928, - "end_line": 3939, - "section": "Block quotes" - }, - { - "markdown": "> foo\n> bar\n", - "html": "
              \n

              foo\nbar

              \n
              \n", - "example": 243, - "start_line": 3950, - "end_line": 3958, - "section": "Block quotes" - }, - { - "markdown": "> foo\n>\n> bar\n", - "html": "
              \n

              foo

              \n

              bar

              \n
              \n", - "example": 244, - "start_line": 3963, - "end_line": 3972, - "section": "Block quotes" - }, - { - "markdown": "foo\n> bar\n", - "html": "

              foo

              \n
              \n

              bar

              \n
              \n", - "example": 245, - "start_line": 3977, - "end_line": 3985, - "section": "Block quotes" - }, - { - "markdown": "> aaa\n***\n> bbb\n", - "html": "
              \n

              aaa

              \n
              \n
              \n
              \n

              bbb

              \n
              \n", - "example": 246, - "start_line": 3991, - "end_line": 4003, - "section": "Block quotes" - }, - { - "markdown": "> bar\nbaz\n", - "html": "
              \n

              bar\nbaz

              \n
              \n", - "example": 247, - "start_line": 4009, - "end_line": 4017, - "section": "Block quotes" - }, - { - "markdown": "> bar\n\nbaz\n", - "html": "
              \n

              bar

              \n
              \n

              baz

              \n", - "example": 248, - "start_line": 4020, - "end_line": 4029, - "section": "Block quotes" - }, - { - "markdown": "> bar\n>\nbaz\n", - "html": "
              \n

              bar

              \n
              \n

              baz

              \n", - "example": 249, - "start_line": 4032, - "end_line": 4041, - "section": "Block quotes" - }, - { - "markdown": "> > > foo\nbar\n", - "html": "
              \n
              \n
              \n

              foo\nbar

              \n
              \n
              \n
              \n", - "example": 250, - "start_line": 4048, - "end_line": 4060, - "section": "Block quotes" - }, - { - "markdown": ">>> foo\n> bar\n>>baz\n", - "html": "
              \n
              \n
              \n

              foo\nbar\nbaz

              \n
              \n
              \n
              \n", - "example": 251, - "start_line": 4063, - "end_line": 4077, - "section": "Block quotes" - }, - { - "markdown": "> code\n\n> not code\n", - "html": "
              \n
              code\n
              \n
              \n
              \n

              not code

              \n
              \n", - "example": 252, - "start_line": 4085, - "end_line": 4097, - "section": "Block quotes" - }, - { - "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", - "html": "

              A paragraph\nwith two lines.

              \n
              indented code\n
              \n
              \n

              A block quote.

              \n
              \n", - "example": 253, - "start_line": 4139, - "end_line": 4154, - "section": "List items" - }, - { - "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "
                \n
              1. \n

                A paragraph\nwith two lines.

                \n
                indented code\n
                \n
                \n

                A block quote.

                \n
                \n
              2. \n
              \n", - "example": 254, - "start_line": 4161, - "end_line": 4180, - "section": "List items" - }, - { - "markdown": "- one\n\n two\n", - "html": "
                \n
              • one
              • \n
              \n

              two

              \n", - "example": 255, - "start_line": 4194, - "end_line": 4203, - "section": "List items" - }, - { - "markdown": "- one\n\n two\n", - "html": "
                \n
              • \n

                one

                \n

                two

                \n
              • \n
              \n", - "example": 256, - "start_line": 4206, - "end_line": 4217, - "section": "List items" - }, - { - "markdown": " - one\n\n two\n", - "html": "
                \n
              • one
              • \n
              \n
               two\n
              \n", - "example": 257, - "start_line": 4220, - "end_line": 4230, - "section": "List items" - }, - { - "markdown": " - one\n\n two\n", - "html": "
                \n
              • \n

                one

                \n

                two

                \n
              • \n
              \n", - "example": 258, - "start_line": 4233, - "end_line": 4244, - "section": "List items" - }, - { - "markdown": " > > 1. one\n>>\n>> two\n", - "html": "
              \n
              \n
                \n
              1. \n

                one

                \n

                two

                \n
              2. \n
              \n
              \n
              \n", - "example": 259, - "start_line": 4255, - "end_line": 4270, - "section": "List items" - }, - { - "markdown": ">>- one\n>>\n > > two\n", - "html": "
              \n
              \n
                \n
              • one
              • \n
              \n

              two

              \n
              \n
              \n", - "example": 260, - "start_line": 4282, - "end_line": 4295, - "section": "List items" - }, - { - "markdown": "-one\n\n2.two\n", - "html": "

              -one

              \n

              2.two

              \n", - "example": 261, - "start_line": 4301, - "end_line": 4308, - "section": "List items" - }, - { - "markdown": "- foo\n\n\n bar\n", - "html": "
                \n
              • \n

                foo

                \n

                bar

                \n
              • \n
              \n", - "example": 262, - "start_line": 4314, - "end_line": 4326, - "section": "List items" - }, - { - "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", - "html": "
                \n
              1. \n

                foo

                \n
                bar\n
                \n

                baz

                \n
                \n

                bam

                \n
                \n
              2. \n
              \n", - "example": 263, - "start_line": 4331, - "end_line": 4353, - "section": "List items" - }, - { - "markdown": "- Foo\n\n bar\n\n\n baz\n", - "html": "
                \n
              • \n

                Foo

                \n
                bar\n\n\nbaz\n
                \n
              • \n
              \n", - "example": 264, - "start_line": 4359, - "end_line": 4377, - "section": "List items" - }, - { - "markdown": "123456789. ok\n", - "html": "
                \n
              1. ok
              2. \n
              \n", - "example": 265, - "start_line": 4381, - "end_line": 4387, - "section": "List items" - }, - { - "markdown": "1234567890. not ok\n", - "html": "

              1234567890. not ok

              \n", - "example": 266, - "start_line": 4390, - "end_line": 4394, - "section": "List items" - }, - { - "markdown": "0. ok\n", - "html": "
                \n
              1. ok
              2. \n
              \n", - "example": 267, - "start_line": 4399, - "end_line": 4405, - "section": "List items" - }, - { - "markdown": "003. ok\n", - "html": "
                \n
              1. ok
              2. \n
              \n", - "example": 268, - "start_line": 4408, - "end_line": 4414, - "section": "List items" - }, - { - "markdown": "-1. not ok\n", - "html": "

              -1. not ok

              \n", - "example": 269, - "start_line": 4419, - "end_line": 4423, - "section": "List items" - }, - { - "markdown": "- foo\n\n bar\n", - "html": "
                \n
              • \n

                foo

                \n
                bar\n
                \n
              • \n
              \n", - "example": 270, - "start_line": 4442, - "end_line": 4454, - "section": "List items" - }, - { - "markdown": " 10. foo\n\n bar\n", - "html": "
                \n
              1. \n

                foo

                \n
                bar\n
                \n
              2. \n
              \n", - "example": 271, - "start_line": 4459, - "end_line": 4471, - "section": "List items" - }, - { - "markdown": " indented code\n\nparagraph\n\n more code\n", - "html": "
              indented code\n
              \n

              paragraph

              \n
              more code\n
              \n", - "example": 272, - "start_line": 4478, - "end_line": 4490, - "section": "List items" - }, - { - "markdown": "1. indented code\n\n paragraph\n\n more code\n", - "html": "
                \n
              1. \n
                indented code\n
                \n

                paragraph

                \n
                more code\n
                \n
              2. \n
              \n", - "example": 273, - "start_line": 4493, - "end_line": 4509, - "section": "List items" - }, - { - "markdown": "1. indented code\n\n paragraph\n\n more code\n", - "html": "
                \n
              1. \n
                 indented code\n
                \n

                paragraph

                \n
                more code\n
                \n
              2. \n
              \n", - "example": 274, - "start_line": 4515, - "end_line": 4531, - "section": "List items" - }, - { - "markdown": " foo\n\nbar\n", - "html": "

              foo

              \n

              bar

              \n", - "example": 275, - "start_line": 4542, - "end_line": 4549, - "section": "List items" - }, - { - "markdown": "- foo\n\n bar\n", - "html": "
                \n
              • foo
              • \n
              \n

              bar

              \n", - "example": 276, - "start_line": 4552, - "end_line": 4561, - "section": "List items" - }, - { - "markdown": "- foo\n\n bar\n", - "html": "
                \n
              • \n

                foo

                \n

                bar

                \n
              • \n
              \n", - "example": 277, - "start_line": 4569, - "end_line": 4580, - "section": "List items" - }, - { - "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", - "html": "
                \n
              • foo
              • \n
              • \n
                bar\n
                \n
              • \n
              • \n
                baz\n
                \n
              • \n
              \n", - "example": 278, - "start_line": 4596, - "end_line": 4617, - "section": "List items" - }, - { - "markdown": "- \n foo\n", - "html": "
                \n
              • foo
              • \n
              \n", - "example": 279, - "start_line": 4622, - "end_line": 4629, - "section": "List items" - }, - { - "markdown": "-\n\n foo\n", - "html": "
                \n
              • \n
              \n

              foo

              \n", - "example": 280, - "start_line": 4636, - "end_line": 4645, - "section": "List items" - }, - { - "markdown": "- foo\n-\n- bar\n", - "html": "
                \n
              • foo
              • \n
              • \n
              • bar
              • \n
              \n", - "example": 281, - "start_line": 4650, - "end_line": 4660, - "section": "List items" - }, - { - "markdown": "- foo\n- \n- bar\n", - "html": "
                \n
              • foo
              • \n
              • \n
              • bar
              • \n
              \n", - "example": 282, - "start_line": 4665, - "end_line": 4675, - "section": "List items" - }, - { - "markdown": "1. foo\n2.\n3. bar\n", - "html": "
                \n
              1. foo
              2. \n
              3. \n
              4. bar
              5. \n
              \n", - "example": 283, - "start_line": 4680, - "end_line": 4690, - "section": "List items" - }, - { - "markdown": "*\n", - "html": "
                \n
              • \n
              \n", - "example": 284, - "start_line": 4695, - "end_line": 4701, - "section": "List items" - }, - { - "markdown": "foo\n*\n\nfoo\n1.\n", - "html": "

              foo\n*

              \n

              foo\n1.

              \n", - "example": 285, - "start_line": 4705, - "end_line": 4716, - "section": "List items" - }, - { - "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "
                \n
              1. \n

                A paragraph\nwith two lines.

                \n
                indented code\n
                \n
                \n

                A block quote.

                \n
                \n
              2. \n
              \n", - "example": 286, - "start_line": 4727, - "end_line": 4746, - "section": "List items" - }, - { - "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "
                \n
              1. \n

                A paragraph\nwith two lines.

                \n
                indented code\n
                \n
                \n

                A block quote.

                \n
                \n
              2. \n
              \n", - "example": 287, - "start_line": 4751, - "end_line": 4770, - "section": "List items" - }, - { - "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "
                \n
              1. \n

                A paragraph\nwith two lines.

                \n
                indented code\n
                \n
                \n

                A block quote.

                \n
                \n
              2. \n
              \n", - "example": 288, - "start_line": 4775, - "end_line": 4794, - "section": "List items" - }, - { - "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "
              1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
              \n", - "example": 289, - "start_line": 4799, - "end_line": 4814, - "section": "List items" - }, - { - "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", - "html": "
                \n
              1. \n

                A paragraph\nwith two lines.

                \n
                indented code\n
                \n
                \n

                A block quote.

                \n
                \n
              2. \n
              \n", - "example": 290, - "start_line": 4829, - "end_line": 4848, - "section": "List items" - }, - { - "markdown": " 1. A paragraph\n with two lines.\n", - "html": "
                \n
              1. A paragraph\nwith two lines.
              2. \n
              \n", - "example": 291, - "start_line": 4853, - "end_line": 4861, - "section": "List items" - }, - { - "markdown": "> 1. > Blockquote\ncontinued here.\n", - "html": "
              \n
                \n
              1. \n
                \n

                Blockquote\ncontinued here.

                \n
                \n
              2. \n
              \n
              \n", - "example": 292, - "start_line": 4866, - "end_line": 4880, - "section": "List items" - }, - { - "markdown": "> 1. > Blockquote\n> continued here.\n", - "html": "
              \n
                \n
              1. \n
                \n

                Blockquote\ncontinued here.

                \n
                \n
              2. \n
              \n
              \n", - "example": 293, - "start_line": 4883, - "end_line": 4897, - "section": "List items" - }, - { - "markdown": "- foo\n - bar\n - baz\n - boo\n", - "html": "
                \n
              • foo\n
                  \n
                • bar\n
                    \n
                  • baz\n
                      \n
                    • boo
                    • \n
                    \n
                  • \n
                  \n
                • \n
                \n
              • \n
              \n", - "example": 294, - "start_line": 4911, - "end_line": 4932, - "section": "List items" - }, - { - "markdown": "- foo\n - bar\n - baz\n - boo\n", - "html": "
                \n
              • foo
              • \n
              • bar
              • \n
              • baz
              • \n
              • boo
              • \n
              \n", - "example": 295, - "start_line": 4937, - "end_line": 4949, - "section": "List items" - }, - { - "markdown": "10) foo\n - bar\n", - "html": "
                \n
              1. foo\n
                  \n
                • bar
                • \n
                \n
              2. \n
              \n", - "example": 296, - "start_line": 4954, - "end_line": 4965, - "section": "List items" - }, - { - "markdown": "10) foo\n - bar\n", - "html": "
                \n
              1. foo
              2. \n
              \n
                \n
              • bar
              • \n
              \n", - "example": 297, - "start_line": 4970, - "end_line": 4980, - "section": "List items" - }, - { - "markdown": "- - foo\n", - "html": "
                \n
              • \n
                  \n
                • foo
                • \n
                \n
              • \n
              \n", - "example": 298, - "start_line": 4985, - "end_line": 4995, - "section": "List items" - }, - { - "markdown": "1. - 2. foo\n", - "html": "
                \n
              1. \n
                  \n
                • \n
                    \n
                  1. foo
                  2. \n
                  \n
                • \n
                \n
              2. \n
              \n", - "example": 299, - "start_line": 4998, - "end_line": 5012, - "section": "List items" - }, - { - "markdown": "- # Foo\n- Bar\n ---\n baz\n", - "html": "
                \n
              • \n

                Foo

                \n
              • \n
              • \n

                Bar

                \nbaz
              • \n
              \n", - "example": 300, - "start_line": 5017, - "end_line": 5031, - "section": "List items" - }, - { - "markdown": "- foo\n- bar\n+ baz\n", - "html": "
                \n
              • foo
              • \n
              • bar
              • \n
              \n
                \n
              • baz
              • \n
              \n", - "example": 301, - "start_line": 5253, - "end_line": 5265, - "section": "Lists" - }, - { - "markdown": "1. foo\n2. bar\n3) baz\n", - "html": "
                \n
              1. foo
              2. \n
              3. bar
              4. \n
              \n
                \n
              1. baz
              2. \n
              \n", - "example": 302, - "start_line": 5268, - "end_line": 5280, - "section": "Lists" - }, - { - "markdown": "Foo\n- bar\n- baz\n", - "html": "

              Foo

              \n
                \n
              • bar
              • \n
              • baz
              • \n
              \n", - "example": 303, - "start_line": 5287, - "end_line": 5297, - "section": "Lists" - }, - { - "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", - "html": "

              The number of windows in my house is\n14. The number of doors is 6.

              \n", - "example": 304, - "start_line": 5364, - "end_line": 5370, - "section": "Lists" - }, - { - "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", - "html": "

              The number of windows in my house is

              \n
                \n
              1. The number of doors is 6.
              2. \n
              \n", - "example": 305, - "start_line": 5374, - "end_line": 5382, - "section": "Lists" - }, - { - "markdown": "- foo\n\n- bar\n\n\n- baz\n", - "html": "
                \n
              • \n

                foo

                \n
              • \n
              • \n

                bar

                \n
              • \n
              • \n

                baz

                \n
              • \n
              \n", - "example": 306, - "start_line": 5388, - "end_line": 5407, - "section": "Lists" - }, - { - "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", - "html": "
                \n
              • foo\n
                  \n
                • bar\n
                    \n
                  • \n

                    baz

                    \n

                    bim

                    \n
                  • \n
                  \n
                • \n
                \n
              • \n
              \n", - "example": 307, - "start_line": 5409, - "end_line": 5431, - "section": "Lists" - }, - { - "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", - "html": "
                \n
              • foo
              • \n
              • bar
              • \n
              \n\n
                \n
              • baz
              • \n
              • bim
              • \n
              \n", - "example": 308, - "start_line": 5439, - "end_line": 5457, - "section": "Lists" - }, - { - "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", - "html": "
                \n
              • \n

                foo

                \n

                notcode

                \n
              • \n
              • \n

                foo

                \n
              • \n
              \n\n
              code\n
              \n", - "example": 309, - "start_line": 5460, - "end_line": 5483, - "section": "Lists" - }, - { - "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n", - "html": "
                \n
              • a
              • \n
              • b
              • \n
              • c
              • \n
              • d
              • \n
              • e
              • \n
              • f
              • \n
              • g
              • \n
              \n", - "example": 310, - "start_line": 5491, - "end_line": 5509, - "section": "Lists" - }, - { - "markdown": "1. a\n\n 2. b\n\n 3. c\n", - "html": "
                \n
              1. \n

                a

                \n
              2. \n
              3. \n

                b

                \n
              4. \n
              5. \n

                c

                \n
              6. \n
              \n", - "example": 311, - "start_line": 5512, - "end_line": 5530, - "section": "Lists" - }, - { - "markdown": "- a\n - b\n - c\n - d\n - e\n", - "html": "
                \n
              • a
              • \n
              • b
              • \n
              • c
              • \n
              • d\n- e
              • \n
              \n", - "example": 312, - "start_line": 5536, - "end_line": 5550, - "section": "Lists" - }, - { - "markdown": "1. a\n\n 2. b\n\n 3. c\n", - "html": "
                \n
              1. \n

                a

                \n
              2. \n
              3. \n

                b

                \n
              4. \n
              \n
              3. c\n
              \n", - "example": 313, - "start_line": 5556, - "end_line": 5573, - "section": "Lists" - }, - { - "markdown": "- a\n- b\n\n- c\n", - "html": "
                \n
              • \n

                a

                \n
              • \n
              • \n

                b

                \n
              • \n
              • \n

                c

                \n
              • \n
              \n", - "example": 314, - "start_line": 5579, - "end_line": 5596, - "section": "Lists" - }, - { - "markdown": "* a\n*\n\n* c\n", - "html": "
                \n
              • \n

                a

                \n
              • \n
              • \n
              • \n

                c

                \n
              • \n
              \n", - "example": 315, - "start_line": 5601, - "end_line": 5616, - "section": "Lists" - }, - { - "markdown": "- a\n- b\n\n c\n- d\n", - "html": "
                \n
              • \n

                a

                \n
              • \n
              • \n

                b

                \n

                c

                \n
              • \n
              • \n

                d

                \n
              • \n
              \n", - "example": 316, - "start_line": 5623, - "end_line": 5642, - "section": "Lists" - }, - { - "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", - "html": "
                \n
              • \n

                a

                \n
              • \n
              • \n

                b

                \n
              • \n
              • \n

                d

                \n
              • \n
              \n", - "example": 317, - "start_line": 5645, - "end_line": 5663, - "section": "Lists" - }, - { - "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", - "html": "
                \n
              • a
              • \n
              • \n
                b\n\n\n
                \n
              • \n
              • c
              • \n
              \n", - "example": 318, - "start_line": 5668, - "end_line": 5687, - "section": "Lists" - }, - { - "markdown": "- a\n - b\n\n c\n- d\n", - "html": "
                \n
              • a\n
                  \n
                • \n

                  b

                  \n

                  c

                  \n
                • \n
                \n
              • \n
              • d
              • \n
              \n", - "example": 319, - "start_line": 5694, - "end_line": 5712, - "section": "Lists" - }, - { - "markdown": "* a\n > b\n >\n* c\n", - "html": "
                \n
              • a\n
                \n

                b

                \n
                \n
              • \n
              • c
              • \n
              \n", - "example": 320, - "start_line": 5718, - "end_line": 5732, - "section": "Lists" - }, - { - "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", - "html": "
                \n
              • a\n
                \n

                b

                \n
                \n
                c\n
                \n
              • \n
              • d
              • \n
              \n", - "example": 321, - "start_line": 5738, - "end_line": 5756, - "section": "Lists" - }, - { - "markdown": "- a\n", - "html": "
                \n
              • a
              • \n
              \n", - "example": 322, - "start_line": 5761, - "end_line": 5767, - "section": "Lists" - }, - { - "markdown": "- a\n - b\n", - "html": "
                \n
              • a\n
                  \n
                • b
                • \n
                \n
              • \n
              \n", - "example": 323, - "start_line": 5770, - "end_line": 5781, - "section": "Lists" - }, - { - "markdown": "1. ```\n foo\n ```\n\n bar\n", - "html": "
                \n
              1. \n
                foo\n
                \n

                bar

                \n
              2. \n
              \n", - "example": 324, - "start_line": 5787, - "end_line": 5801, - "section": "Lists" - }, - { - "markdown": "* foo\n * bar\n\n baz\n", - "html": "
                \n
              • \n

                foo

                \n
                  \n
                • bar
                • \n
                \n

                baz

                \n
              • \n
              \n", - "example": 325, - "start_line": 5806, - "end_line": 5821, - "section": "Lists" - }, - { - "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", - "html": "
                \n
              • \n

                a

                \n
                  \n
                • b
                • \n
                • c
                • \n
                \n
              • \n
              • \n

                d

                \n
                  \n
                • e
                • \n
                • f
                • \n
                \n
              • \n
              \n", - "example": 326, - "start_line": 5824, - "end_line": 5849, - "section": "Lists" - }, - { - "markdown": "`hi`lo`\n", - "html": "

              hilo`

              \n", - "example": 327, - "start_line": 5858, - "end_line": 5862, - "section": "Inlines" - }, - { - "markdown": "`foo`\n", - "html": "

              foo

              \n", - "example": 328, - "start_line": 5890, - "end_line": 5894, - "section": "Code spans" - }, - { - "markdown": "`` foo ` bar ``\n", - "html": "

              foo ` bar

              \n", - "example": 329, - "start_line": 5901, - "end_line": 5905, - "section": "Code spans" - }, - { - "markdown": "` `` `\n", - "html": "

              ``

              \n", - "example": 330, - "start_line": 5911, - "end_line": 5915, - "section": "Code spans" - }, - { - "markdown": "` `` `\n", - "html": "

              ``

              \n", - "example": 331, - "start_line": 5919, - "end_line": 5923, - "section": "Code spans" - }, - { - "markdown": "` a`\n", - "html": "

              a

              \n", - "example": 332, - "start_line": 5928, - "end_line": 5932, - "section": "Code spans" - }, - { - "markdown": "` b `\n", - "html": "

               b 

              \n", - "example": 333, - "start_line": 5937, - "end_line": 5941, - "section": "Code spans" - }, - { - "markdown": "` `\n` `\n", - "html": "

               \n

              \n", - "example": 334, - "start_line": 5945, - "end_line": 5951, - "section": "Code spans" - }, - { - "markdown": "``\nfoo\nbar \nbaz\n``\n", - "html": "

              foo bar baz

              \n", - "example": 335, - "start_line": 5956, - "end_line": 5964, - "section": "Code spans" - }, - { - "markdown": "``\nfoo \n``\n", - "html": "

              foo

              \n", - "example": 336, - "start_line": 5966, - "end_line": 5972, - "section": "Code spans" - }, - { - "markdown": "`foo bar \nbaz`\n", - "html": "

              foo bar baz

              \n", - "example": 337, - "start_line": 5977, - "end_line": 5982, - "section": "Code spans" - }, - { - "markdown": "`foo\\`bar`\n", - "html": "

              foo\\bar`

              \n", - "example": 338, - "start_line": 5994, - "end_line": 5998, - "section": "Code spans" - }, - { - "markdown": "``foo`bar``\n", - "html": "

              foo`bar

              \n", - "example": 339, - "start_line": 6005, - "end_line": 6009, - "section": "Code spans" - }, - { - "markdown": "` foo `` bar `\n", - "html": "

              foo `` bar

              \n", - "example": 340, - "start_line": 6011, - "end_line": 6015, - "section": "Code spans" - }, - { - "markdown": "*foo`*`\n", - "html": "

              *foo*

              \n", - "example": 341, - "start_line": 6023, - "end_line": 6027, - "section": "Code spans" - }, - { - "markdown": "[not a `link](/foo`)\n", - "html": "

              [not a link](/foo)

              \n", - "example": 342, - "start_line": 6032, - "end_line": 6036, - "section": "Code spans" - }, - { - "markdown": "``\n", - "html": "

              <a href="">`

              \n", - "example": 343, - "start_line": 6042, - "end_line": 6046, - "section": "Code spans" - }, - { - "markdown": "
              `\n", - "html": "

              `

              \n", - "example": 344, - "start_line": 6051, - "end_line": 6055, - "section": "Code spans" - }, - { - "markdown": "``\n", - "html": "

              <http://foo.bar.baz>`

              \n", - "example": 345, - "start_line": 6060, - "end_line": 6064, - "section": "Code spans" - }, - { - "markdown": "`\n", - "html": "

              http://foo.bar.`baz`

              \n", - "example": 346, - "start_line": 6069, - "end_line": 6073, - "section": "Code spans" - }, - { - "markdown": "```foo``\n", - "html": "

              ```foo``

              \n", - "example": 347, - "start_line": 6079, - "end_line": 6083, - "section": "Code spans" - }, - { - "markdown": "`foo\n", - "html": "

              `foo

              \n", - "example": 348, - "start_line": 6086, - "end_line": 6090, - "section": "Code spans" - }, - { - "markdown": "`foo``bar``\n", - "html": "

              `foobar

              \n", - "example": 349, - "start_line": 6095, - "end_line": 6099, - "section": "Code spans" - }, - { - "markdown": "*foo bar*\n", - "html": "

              foo bar

              \n", - "example": 350, - "start_line": 6312, - "end_line": 6316, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "a * foo bar*\n", - "html": "

              a * foo bar*

              \n", - "example": 351, - "start_line": 6322, - "end_line": 6326, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "a*\"foo\"*\n", - "html": "

              a*"foo"*

              \n", - "example": 352, - "start_line": 6333, - "end_line": 6337, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "* a *\n", - "html": "

              * a *

              \n", - "example": 353, - "start_line": 6342, - "end_line": 6346, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo*bar*\n", - "html": "

              foobar

              \n", - "example": 354, - "start_line": 6351, - "end_line": 6355, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "5*6*78\n", - "html": "

              5678

              \n", - "example": 355, - "start_line": 6358, - "end_line": 6362, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo bar_\n", - "html": "

              foo bar

              \n", - "example": 356, - "start_line": 6367, - "end_line": 6371, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_ foo bar_\n", - "html": "

              _ foo bar_

              \n", - "example": 357, - "start_line": 6377, - "end_line": 6381, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "a_\"foo\"_\n", - "html": "

              a_"foo"_

              \n", - "example": 358, - "start_line": 6387, - "end_line": 6391, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo_bar_\n", - "html": "

              foo_bar_

              \n", - "example": 359, - "start_line": 6396, - "end_line": 6400, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "5_6_78\n", - "html": "

              5_6_78

              \n", - "example": 360, - "start_line": 6403, - "end_line": 6407, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "пристаням_стремятся_\n", - "html": "

              пристаням_стремятся_

              \n", - "example": 361, - "start_line": 6410, - "end_line": 6414, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "aa_\"bb\"_cc\n", - "html": "

              aa_"bb"_cc

              \n", - "example": 362, - "start_line": 6420, - "end_line": 6424, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo-_(bar)_\n", - "html": "

              foo-(bar)

              \n", - "example": 363, - "start_line": 6431, - "end_line": 6435, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo*\n", - "html": "

              _foo*

              \n", - "example": 364, - "start_line": 6443, - "end_line": 6447, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo bar *\n", - "html": "

              *foo bar *

              \n", - "example": 365, - "start_line": 6453, - "end_line": 6457, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo bar\n*\n", - "html": "

              *foo bar\n*

              \n", - "example": 366, - "start_line": 6462, - "end_line": 6468, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*(*foo)\n", - "html": "

              *(*foo)

              \n", - "example": 367, - "start_line": 6475, - "end_line": 6479, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*(*foo*)*\n", - "html": "

              (foo)

              \n", - "example": 368, - "start_line": 6485, - "end_line": 6489, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo*bar\n", - "html": "

              foobar

              \n", - "example": 369, - "start_line": 6494, - "end_line": 6498, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo bar _\n", - "html": "

              _foo bar _

              \n", - "example": 370, - "start_line": 6507, - "end_line": 6511, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_(_foo)\n", - "html": "

              _(_foo)

              \n", - "example": 371, - "start_line": 6517, - "end_line": 6521, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_(_foo_)_\n", - "html": "

              (foo)

              \n", - "example": 372, - "start_line": 6526, - "end_line": 6530, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo_bar\n", - "html": "

              _foo_bar

              \n", - "example": 373, - "start_line": 6535, - "end_line": 6539, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_пристаням_стремятся\n", - "html": "

              _пристаням_стремятся

              \n", - "example": 374, - "start_line": 6542, - "end_line": 6546, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo_bar_baz_\n", - "html": "

              foo_bar_baz

              \n", - "example": 375, - "start_line": 6549, - "end_line": 6553, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_(bar)_.\n", - "html": "

              (bar).

              \n", - "example": 376, - "start_line": 6560, - "end_line": 6564, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo bar**\n", - "html": "

              foo bar

              \n", - "example": 377, - "start_line": 6569, - "end_line": 6573, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "** foo bar**\n", - "html": "

              ** foo bar**

              \n", - "example": 378, - "start_line": 6579, - "end_line": 6583, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "a**\"foo\"**\n", - "html": "

              a**"foo"**

              \n", - "example": 379, - "start_line": 6590, - "end_line": 6594, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo**bar**\n", - "html": "

              foobar

              \n", - "example": 380, - "start_line": 6599, - "end_line": 6603, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo bar__\n", - "html": "

              foo bar

              \n", - "example": 381, - "start_line": 6608, - "end_line": 6612, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__ foo bar__\n", - "html": "

              __ foo bar__

              \n", - "example": 382, - "start_line": 6618, - "end_line": 6622, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__\nfoo bar__\n", - "html": "

              __\nfoo bar__

              \n", - "example": 383, - "start_line": 6626, - "end_line": 6632, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "a__\"foo\"__\n", - "html": "

              a__"foo"__

              \n", - "example": 384, - "start_line": 6638, - "end_line": 6642, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo__bar__\n", - "html": "

              foo__bar__

              \n", - "example": 385, - "start_line": 6647, - "end_line": 6651, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "5__6__78\n", - "html": "

              5__6__78

              \n", - "example": 386, - "start_line": 6654, - "end_line": 6658, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "пристаням__стремятся__\n", - "html": "

              пристаням__стремятся__

              \n", - "example": 387, - "start_line": 6661, - "end_line": 6665, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo, __bar__, baz__\n", - "html": "

              foo, bar, baz

              \n", - "example": 388, - "start_line": 6668, - "end_line": 6672, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo-__(bar)__\n", - "html": "

              foo-(bar)

              \n", - "example": 389, - "start_line": 6679, - "end_line": 6683, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo bar **\n", - "html": "

              **foo bar **

              \n", - "example": 390, - "start_line": 6692, - "end_line": 6696, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**(**foo)\n", - "html": "

              **(**foo)

              \n", - "example": 391, - "start_line": 6705, - "end_line": 6709, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*(**foo**)*\n", - "html": "

              (foo)

              \n", - "example": 392, - "start_line": 6715, - "end_line": 6719, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", - "html": "

              Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

              \n", - "example": 393, - "start_line": 6722, - "end_line": 6728, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo \"*bar*\" foo**\n", - "html": "

              foo "bar" foo

              \n", - "example": 394, - "start_line": 6731, - "end_line": 6735, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo**bar\n", - "html": "

              foobar

              \n", - "example": 395, - "start_line": 6740, - "end_line": 6744, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo bar __\n", - "html": "

              __foo bar __

              \n", - "example": 396, - "start_line": 6752, - "end_line": 6756, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__(__foo)\n", - "html": "

              __(__foo)

              \n", - "example": 397, - "start_line": 6762, - "end_line": 6766, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_(__foo__)_\n", - "html": "

              (foo)

              \n", - "example": 398, - "start_line": 6772, - "end_line": 6776, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo__bar\n", - "html": "

              __foo__bar

              \n", - "example": 399, - "start_line": 6781, - "end_line": 6785, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__пристаням__стремятся\n", - "html": "

              __пристаням__стремятся

              \n", - "example": 400, - "start_line": 6788, - "end_line": 6792, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo__bar__baz__\n", - "html": "

              foo__bar__baz

              \n", - "example": 401, - "start_line": 6795, - "end_line": 6799, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__(bar)__.\n", - "html": "

              (bar).

              \n", - "example": 402, - "start_line": 6806, - "end_line": 6810, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo [bar](/url)*\n", - "html": "

              foo bar

              \n", - "example": 403, - "start_line": 6818, - "end_line": 6822, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo\nbar*\n", - "html": "

              foo\nbar

              \n", - "example": 404, - "start_line": 6825, - "end_line": 6831, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo __bar__ baz_\n", - "html": "

              foo bar baz

              \n", - "example": 405, - "start_line": 6837, - "end_line": 6841, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo _bar_ baz_\n", - "html": "

              foo bar baz

              \n", - "example": 406, - "start_line": 6844, - "end_line": 6848, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo_ bar_\n", - "html": "

              foo bar

              \n", - "example": 407, - "start_line": 6851, - "end_line": 6855, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo *bar**\n", - "html": "

              foo bar

              \n", - "example": 408, - "start_line": 6858, - "end_line": 6862, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo **bar** baz*\n", - "html": "

              foo bar baz

              \n", - "example": 409, - "start_line": 6865, - "end_line": 6869, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo**bar**baz*\n", - "html": "

              foobarbaz

              \n", - "example": 410, - "start_line": 6871, - "end_line": 6875, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo**bar*\n", - "html": "

              foo**bar

              \n", - "example": 411, - "start_line": 6895, - "end_line": 6899, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "***foo** bar*\n", - "html": "

              foo bar

              \n", - "example": 412, - "start_line": 6908, - "end_line": 6912, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo **bar***\n", - "html": "

              foo bar

              \n", - "example": 413, - "start_line": 6915, - "end_line": 6919, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo**bar***\n", - "html": "

              foobar

              \n", - "example": 414, - "start_line": 6922, - "end_line": 6926, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo***bar***baz\n", - "html": "

              foobarbaz

              \n", - "example": 415, - "start_line": 6933, - "end_line": 6937, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo******bar*********baz\n", - "html": "

              foobar***baz

              \n", - "example": 416, - "start_line": 6939, - "end_line": 6943, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo **bar *baz* bim** bop*\n", - "html": "

              foo bar baz bim bop

              \n", - "example": 417, - "start_line": 6948, - "end_line": 6952, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo [*bar*](/url)*\n", - "html": "

              foo bar

              \n", - "example": 418, - "start_line": 6955, - "end_line": 6959, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "** is not an empty emphasis\n", - "html": "

              ** is not an empty emphasis

              \n", - "example": 419, - "start_line": 6964, - "end_line": 6968, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**** is not an empty strong emphasis\n", - "html": "

              **** is not an empty strong emphasis

              \n", - "example": 420, - "start_line": 6971, - "end_line": 6975, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo [bar](/url)**\n", - "html": "

              foo bar

              \n", - "example": 421, - "start_line": 6984, - "end_line": 6988, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo\nbar**\n", - "html": "

              foo\nbar

              \n", - "example": 422, - "start_line": 6991, - "end_line": 6997, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo _bar_ baz__\n", - "html": "

              foo bar baz

              \n", - "example": 423, - "start_line": 7003, - "end_line": 7007, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo __bar__ baz__\n", - "html": "

              foo bar baz

              \n", - "example": 424, - "start_line": 7010, - "end_line": 7014, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "____foo__ bar__\n", - "html": "

              foo bar

              \n", - "example": 425, - "start_line": 7017, - "end_line": 7021, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo **bar****\n", - "html": "

              foo bar

              \n", - "example": 426, - "start_line": 7024, - "end_line": 7028, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo *bar* baz**\n", - "html": "

              foo bar baz

              \n", - "example": 427, - "start_line": 7031, - "end_line": 7035, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo*bar*baz**\n", - "html": "

              foobarbaz

              \n", - "example": 428, - "start_line": 7038, - "end_line": 7042, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "***foo* bar**\n", - "html": "

              foo bar

              \n", - "example": 429, - "start_line": 7045, - "end_line": 7049, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo *bar***\n", - "html": "

              foo bar

              \n", - "example": 430, - "start_line": 7052, - "end_line": 7056, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo *bar **baz**\nbim* bop**\n", - "html": "

              foo bar baz\nbim bop

              \n", - "example": 431, - "start_line": 7061, - "end_line": 7067, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo [*bar*](/url)**\n", - "html": "

              foo bar

              \n", - "example": 432, - "start_line": 7070, - "end_line": 7074, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__ is not an empty emphasis\n", - "html": "

              __ is not an empty emphasis

              \n", - "example": 433, - "start_line": 7079, - "end_line": 7083, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "____ is not an empty strong emphasis\n", - "html": "

              ____ is not an empty strong emphasis

              \n", - "example": 434, - "start_line": 7086, - "end_line": 7090, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo ***\n", - "html": "

              foo ***

              \n", - "example": 435, - "start_line": 7096, - "end_line": 7100, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo *\\**\n", - "html": "

              foo *

              \n", - "example": 436, - "start_line": 7103, - "end_line": 7107, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo *_*\n", - "html": "

              foo _

              \n", - "example": 437, - "start_line": 7110, - "end_line": 7114, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo *****\n", - "html": "

              foo *****

              \n", - "example": 438, - "start_line": 7117, - "end_line": 7121, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo **\\***\n", - "html": "

              foo *

              \n", - "example": 439, - "start_line": 7124, - "end_line": 7128, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo **_**\n", - "html": "

              foo _

              \n", - "example": 440, - "start_line": 7131, - "end_line": 7135, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo*\n", - "html": "

              *foo

              \n", - "example": 441, - "start_line": 7142, - "end_line": 7146, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo**\n", - "html": "

              foo*

              \n", - "example": 442, - "start_line": 7149, - "end_line": 7153, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "***foo**\n", - "html": "

              *foo

              \n", - "example": 443, - "start_line": 7156, - "end_line": 7160, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "****foo*\n", - "html": "

              ***foo

              \n", - "example": 444, - "start_line": 7163, - "end_line": 7167, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo***\n", - "html": "

              foo*

              \n", - "example": 445, - "start_line": 7170, - "end_line": 7174, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo****\n", - "html": "

              foo***

              \n", - "example": 446, - "start_line": 7177, - "end_line": 7181, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo ___\n", - "html": "

              foo ___

              \n", - "example": 447, - "start_line": 7187, - "end_line": 7191, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo _\\__\n", - "html": "

              foo _

              \n", - "example": 448, - "start_line": 7194, - "end_line": 7198, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo _*_\n", - "html": "

              foo *

              \n", - "example": 449, - "start_line": 7201, - "end_line": 7205, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo _____\n", - "html": "

              foo _____

              \n", - "example": 450, - "start_line": 7208, - "end_line": 7212, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo __\\___\n", - "html": "

              foo _

              \n", - "example": 451, - "start_line": 7215, - "end_line": 7219, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "foo __*__\n", - "html": "

              foo *

              \n", - "example": 452, - "start_line": 7222, - "end_line": 7226, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo_\n", - "html": "

              _foo

              \n", - "example": 453, - "start_line": 7229, - "end_line": 7233, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo__\n", - "html": "

              foo_

              \n", - "example": 454, - "start_line": 7240, - "end_line": 7244, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "___foo__\n", - "html": "

              _foo

              \n", - "example": 455, - "start_line": 7247, - "end_line": 7251, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "____foo_\n", - "html": "

              ___foo

              \n", - "example": 456, - "start_line": 7254, - "end_line": 7258, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo___\n", - "html": "

              foo_

              \n", - "example": 457, - "start_line": 7261, - "end_line": 7265, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo____\n", - "html": "

              foo___

              \n", - "example": 458, - "start_line": 7268, - "end_line": 7272, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo**\n", - "html": "

              foo

              \n", - "example": 459, - "start_line": 7278, - "end_line": 7282, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*_foo_*\n", - "html": "

              foo

              \n", - "example": 460, - "start_line": 7285, - "end_line": 7289, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__foo__\n", - "html": "

              foo

              \n", - "example": 461, - "start_line": 7292, - "end_line": 7296, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_*foo*_\n", - "html": "

              foo

              \n", - "example": 462, - "start_line": 7299, - "end_line": 7303, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "****foo****\n", - "html": "

              foo

              \n", - "example": 463, - "start_line": 7309, - "end_line": 7313, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "____foo____\n", - "html": "

              foo

              \n", - "example": 464, - "start_line": 7316, - "end_line": 7320, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "******foo******\n", - "html": "

              foo

              \n", - "example": 465, - "start_line": 7327, - "end_line": 7331, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "***foo***\n", - "html": "

              foo

              \n", - "example": 466, - "start_line": 7336, - "end_line": 7340, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_____foo_____\n", - "html": "

              foo

              \n", - "example": 467, - "start_line": 7343, - "end_line": 7347, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo _bar* baz_\n", - "html": "

              foo _bar baz_

              \n", - "example": 468, - "start_line": 7352, - "end_line": 7356, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo __bar *baz bim__ bam*\n", - "html": "

              foo bar *baz bim bam

              \n", - "example": 469, - "start_line": 7359, - "end_line": 7363, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**foo **bar baz**\n", - "html": "

              **foo bar baz

              \n", - "example": 470, - "start_line": 7368, - "end_line": 7372, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*foo *bar baz*\n", - "html": "

              *foo bar baz

              \n", - "example": 471, - "start_line": 7375, - "end_line": 7379, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*[bar*](/url)\n", - "html": "

              *bar*

              \n", - "example": 472, - "start_line": 7384, - "end_line": 7388, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_foo [bar_](/url)\n", - "html": "

              _foo bar_

              \n", - "example": 473, - "start_line": 7391, - "end_line": 7395, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*\n", - "html": "

              *

              \n", - "example": 474, - "start_line": 7398, - "end_line": 7402, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**\n", - "html": "

              **

              \n", - "example": 475, - "start_line": 7405, - "end_line": 7409, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__\n", - "html": "

              __

              \n", - "example": 476, - "start_line": 7412, - "end_line": 7416, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "*a `*`*\n", - "html": "

              a *

              \n", - "example": 477, - "start_line": 7419, - "end_line": 7423, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "_a `_`_\n", - "html": "

              a _

              \n", - "example": 478, - "start_line": 7426, - "end_line": 7430, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "**a\n", - "html": "

              **ahttp://foo.bar/?q=**

              \n", - "example": 479, - "start_line": 7433, - "end_line": 7437, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "__a\n", - "html": "

              __ahttp://foo.bar/?q=__

              \n", - "example": 480, - "start_line": 7440, - "end_line": 7444, - "section": "Emphasis and strong emphasis" - }, - { - "markdown": "[link](/uri \"title\")\n", - "html": "

              link

              \n", - "example": 481, - "start_line": 7528, - "end_line": 7532, - "section": "Links" - }, - { - "markdown": "[link](/uri)\n", - "html": "

              link

              \n", - "example": 482, - "start_line": 7538, - "end_line": 7542, - "section": "Links" - }, - { - "markdown": "[](./target.md)\n", - "html": "

              \n", - "example": 483, - "start_line": 7544, - "end_line": 7548, - "section": "Links" - }, - { - "markdown": "[link]()\n", - "html": "

              link

              \n", - "example": 484, - "start_line": 7551, - "end_line": 7555, - "section": "Links" - }, - { - "markdown": "[link](<>)\n", - "html": "

              link

              \n", - "example": 485, - "start_line": 7558, - "end_line": 7562, - "section": "Links" - }, - { - "markdown": "[]()\n", - "html": "

              \n", - "example": 486, - "start_line": 7565, - "end_line": 7569, - "section": "Links" - }, - { - "markdown": "[link](/my uri)\n", - "html": "

              [link](/my uri)

              \n", - "example": 487, - "start_line": 7574, - "end_line": 7578, - "section": "Links" - }, - { - "markdown": "[link](
              )\n", - "html": "

              link

              \n", - "example": 488, - "start_line": 7580, - "end_line": 7584, - "section": "Links" - }, - { - "markdown": "[link](foo\nbar)\n", - "html": "

              [link](foo\nbar)

              \n", - "example": 489, - "start_line": 7589, - "end_line": 7595, - "section": "Links" - }, - { - "markdown": "[link]()\n", - "html": "

              [link]()

              \n", - "example": 490, - "start_line": 7597, - "end_line": 7603, - "section": "Links" - }, - { - "markdown": "[a]()\n", - "html": "

              a

              \n", - "example": 491, - "start_line": 7608, - "end_line": 7612, - "section": "Links" - }, - { - "markdown": "[link]()\n", - "html": "

              [link](<foo>)

              \n", - "example": 492, - "start_line": 7616, - "end_line": 7620, - "section": "Links" - }, - { - "markdown": "[a](\n[a](c)\n", - "html": "

              [a](<b)c\n[a](<b)c>\n[a](c)

              \n", - "example": 493, - "start_line": 7625, - "end_line": 7633, - "section": "Links" - }, - { - "markdown": "[link](\\(foo\\))\n", - "html": "

              link

              \n", - "example": 494, - "start_line": 7637, - "end_line": 7641, - "section": "Links" - }, - { - "markdown": "[link](foo(and(bar)))\n", - "html": "

              link

              \n", - "example": 495, - "start_line": 7646, - "end_line": 7650, - "section": "Links" - }, - { - "markdown": "[link](foo(and(bar))\n", - "html": "

              [link](foo(and(bar))

              \n", - "example": 496, - "start_line": 7655, - "end_line": 7659, - "section": "Links" - }, - { - "markdown": "[link](foo\\(and\\(bar\\))\n", - "html": "

              link

              \n", - "example": 497, - "start_line": 7662, - "end_line": 7666, - "section": "Links" - }, - { - "markdown": "[link]()\n", - "html": "

              link

              \n", - "example": 498, - "start_line": 7669, - "end_line": 7673, - "section": "Links" - }, - { - "markdown": "[link](foo\\)\\:)\n", - "html": "

              link

              \n", - "example": 499, - "start_line": 7679, - "end_line": 7683, - "section": "Links" - }, - { - "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n", - "html": "

              link

              \n

              link

              \n

              link

              \n", - "example": 500, - "start_line": 7688, - "end_line": 7698, - "section": "Links" - }, - { - "markdown": "[link](foo\\bar)\n", - "html": "

              link

              \n", - "example": 501, - "start_line": 7704, - "end_line": 7708, - "section": "Links" - }, - { - "markdown": "[link](foo%20bä)\n", - "html": "

              link

              \n", - "example": 502, - "start_line": 7720, - "end_line": 7724, - "section": "Links" - }, - { - "markdown": "[link](\"title\")\n", - "html": "

              link

              \n", - "example": 503, - "start_line": 7731, - "end_line": 7735, - "section": "Links" - }, - { - "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", - "html": "

              link\nlink\nlink

              \n", - "example": 504, - "start_line": 7740, - "end_line": 7748, - "section": "Links" - }, - { - "markdown": "[link](/url \"title \\\""\")\n", - "html": "

              link

              \n", - "example": 505, - "start_line": 7754, - "end_line": 7758, - "section": "Links" - }, - { - "markdown": "[link](/url \"title\")\n", - "html": "

              link

              \n", - "example": 506, - "start_line": 7765, - "end_line": 7769, - "section": "Links" - }, - { - "markdown": "[link](/url \"title \"and\" title\")\n", - "html": "

              [link](/url "title "and" title")

              \n", - "example": 507, - "start_line": 7774, - "end_line": 7778, - "section": "Links" - }, - { - "markdown": "[link](/url 'title \"and\" title')\n", - "html": "

              link

              \n", - "example": 508, - "start_line": 7783, - "end_line": 7787, - "section": "Links" - }, - { - "markdown": "[link]( /uri\n \"title\" )\n", - "html": "

              link

              \n", - "example": 509, - "start_line": 7808, - "end_line": 7813, - "section": "Links" - }, - { - "markdown": "[link] (/uri)\n", - "html": "

              [link] (/uri)

              \n", - "example": 510, - "start_line": 7819, - "end_line": 7823, - "section": "Links" - }, - { - "markdown": "[link [foo [bar]]](/uri)\n", - "html": "

              link [foo [bar]]

              \n", - "example": 511, - "start_line": 7829, - "end_line": 7833, - "section": "Links" - }, - { - "markdown": "[link] bar](/uri)\n", - "html": "

              [link] bar](/uri)

              \n", - "example": 512, - "start_line": 7836, - "end_line": 7840, - "section": "Links" - }, - { - "markdown": "[link [bar](/uri)\n", - "html": "

              [link bar

              \n", - "example": 513, - "start_line": 7843, - "end_line": 7847, - "section": "Links" - }, - { - "markdown": "[link \\[bar](/uri)\n", - "html": "

              link [bar

              \n", - "example": 514, - "start_line": 7850, - "end_line": 7854, - "section": "Links" - }, - { - "markdown": "[link *foo **bar** `#`*](/uri)\n", - "html": "

              link foo bar #

              \n", - "example": 515, - "start_line": 7859, - "end_line": 7863, - "section": "Links" - }, - { - "markdown": "[![moon](moon.jpg)](/uri)\n", - "html": "

              \"moon\"

              \n", - "example": 516, - "start_line": 7866, - "end_line": 7870, - "section": "Links" - }, - { - "markdown": "[foo [bar](/uri)](/uri)\n", - "html": "

              [foo bar](/uri)

              \n", - "example": 517, - "start_line": 7875, - "end_line": 7879, - "section": "Links" - }, - { - "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", - "html": "

              [foo [bar baz](/uri)](/uri)

              \n", - "example": 518, - "start_line": 7882, - "end_line": 7886, - "section": "Links" - }, - { - "markdown": "![[[foo](uri1)](uri2)](uri3)\n", - "html": "

              \"[foo](uri2)\"

              \n", - "example": 519, - "start_line": 7889, - "end_line": 7893, - "section": "Links" - }, - { - "markdown": "*[foo*](/uri)\n", - "html": "

              *foo*

              \n", - "example": 520, - "start_line": 7899, - "end_line": 7903, - "section": "Links" - }, - { - "markdown": "[foo *bar](baz*)\n", - "html": "

              foo *bar

              \n", - "example": 521, - "start_line": 7906, - "end_line": 7910, - "section": "Links" - }, - { - "markdown": "*foo [bar* baz]\n", - "html": "

              foo [bar baz]

              \n", - "example": 522, - "start_line": 7916, - "end_line": 7920, - "section": "Links" - }, - { - "markdown": "[foo \n", - "html": "

              [foo

              \n", - "example": 523, - "start_line": 7926, - "end_line": 7930, - "section": "Links" - }, - { - "markdown": "[foo`](/uri)`\n", - "html": "

              [foo](/uri)

              \n", - "example": 524, - "start_line": 7933, - "end_line": 7937, - "section": "Links" - }, - { - "markdown": "[foo\n", - "html": "

              [foohttp://example.com/?search=](uri)

              \n", - "example": 525, - "start_line": 7940, - "end_line": 7944, - "section": "Links" - }, - { - "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", - "html": "

              foo

              \n", - "example": 526, - "start_line": 7978, - "end_line": 7984, - "section": "Links" - }, - { - "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", - "html": "

              link [foo [bar]]

              \n", - "example": 527, - "start_line": 7993, - "end_line": 7999, - "section": "Links" - }, - { - "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", - "html": "

              link [bar

              \n", - "example": 528, - "start_line": 8002, - "end_line": 8008, - "section": "Links" - }, - { - "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", - "html": "

              link foo bar #

              \n", - "example": 529, - "start_line": 8013, - "end_line": 8019, - "section": "Links" - }, - { - "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", - "html": "

              \"moon\"

              \n", - "example": 530, - "start_line": 8022, - "end_line": 8028, - "section": "Links" - }, - { - "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", - "html": "

              [foo bar]ref

              \n", - "example": 531, - "start_line": 8033, - "end_line": 8039, - "section": "Links" - }, - { - "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", - "html": "

              [foo bar baz]ref

              \n", - "example": 532, - "start_line": 8042, - "end_line": 8048, - "section": "Links" - }, - { - "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", - "html": "

              *foo*

              \n", - "example": 533, - "start_line": 8057, - "end_line": 8063, - "section": "Links" - }, - { - "markdown": "[foo *bar][ref]*\n\n[ref]: /uri\n", - "html": "

              foo *bar*

              \n", - "example": 534, - "start_line": 8066, - "end_line": 8072, - "section": "Links" - }, - { - "markdown": "[foo \n\n[ref]: /uri\n", - "html": "

              [foo

              \n", - "example": 535, - "start_line": 8078, - "end_line": 8084, - "section": "Links" - }, - { - "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", - "html": "

              [foo][ref]

              \n", - "example": 536, - "start_line": 8087, - "end_line": 8093, - "section": "Links" - }, - { - "markdown": "[foo\n\n[ref]: /uri\n", - "html": "

              [foohttp://example.com/?search=][ref]

              \n", - "example": 537, - "start_line": 8096, - "end_line": 8102, - "section": "Links" - }, - { - "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", - "html": "

              foo

              \n", - "example": 538, - "start_line": 8107, - "end_line": 8113, - "section": "Links" - }, - { - "markdown": "[ẞ]\n\n[SS]: /url\n", - "html": "

              \n", - "example": 539, - "start_line": 8118, - "end_line": 8124, - "section": "Links" - }, - { - "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", - "html": "

              Baz

              \n", - "example": 540, - "start_line": 8130, - "end_line": 8137, - "section": "Links" - }, - { - "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", - "html": "

              [foo] bar

              \n", - "example": 541, - "start_line": 8143, - "end_line": 8149, - "section": "Links" - }, - { - "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", - "html": "

              [foo]\nbar

              \n", - "example": 542, - "start_line": 8152, - "end_line": 8160, - "section": "Links" - }, - { - "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", - "html": "

              bar

              \n", - "example": 543, - "start_line": 8193, - "end_line": 8201, - "section": "Links" - }, - { - "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", - "html": "

              [bar][foo!]

              \n", - "example": 544, - "start_line": 8208, - "end_line": 8214, - "section": "Links" - }, - { - "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", - "html": "

              [foo][ref[]

              \n

              [ref[]: /uri

              \n", - "example": 545, - "start_line": 8220, - "end_line": 8227, - "section": "Links" - }, - { - "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", - "html": "

              [foo][ref[bar]]

              \n

              [ref[bar]]: /uri

              \n", - "example": 546, - "start_line": 8230, - "end_line": 8237, - "section": "Links" - }, - { - "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", - "html": "

              [[[foo]]]

              \n

              [[[foo]]]: /url

              \n", - "example": 547, - "start_line": 8240, - "end_line": 8247, - "section": "Links" - }, - { - "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", - "html": "

              foo

              \n", - "example": 548, - "start_line": 8250, - "end_line": 8256, - "section": "Links" - }, - { - "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", - "html": "

              bar\\

              \n", - "example": 549, - "start_line": 8261, - "end_line": 8267, - "section": "Links" - }, - { - "markdown": "[]\n\n[]: /uri\n", - "html": "

              []

              \n

              []: /uri

              \n", - "example": 550, - "start_line": 8273, - "end_line": 8280, - "section": "Links" - }, - { - "markdown": "[\n ]\n\n[\n ]: /uri\n", - "html": "

              [\n]

              \n

              [\n]: /uri

              \n", - "example": 551, - "start_line": 8283, - "end_line": 8294, - "section": "Links" - }, - { - "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", - "html": "

              foo

              \n", - "example": 552, - "start_line": 8306, - "end_line": 8312, - "section": "Links" - }, - { - "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", - "html": "

              foo bar

              \n", - "example": 553, - "start_line": 8315, - "end_line": 8321, - "section": "Links" - }, - { - "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", - "html": "

              Foo

              \n", - "example": 554, - "start_line": 8326, - "end_line": 8332, - "section": "Links" - }, - { - "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", - "html": "

              foo\n[]

              \n", - "example": 555, - "start_line": 8339, - "end_line": 8347, - "section": "Links" - }, - { - "markdown": "[foo]\n\n[foo]: /url \"title\"\n", - "html": "

              foo

              \n", - "example": 556, - "start_line": 8359, - "end_line": 8365, - "section": "Links" - }, - { - "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", - "html": "

              foo bar

              \n", - "example": 557, - "start_line": 8368, - "end_line": 8374, - "section": "Links" - }, - { - "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", - "html": "

              [foo bar]

              \n", - "example": 558, - "start_line": 8377, - "end_line": 8383, - "section": "Links" - }, - { - "markdown": "[[bar [foo]\n\n[foo]: /url\n", - "html": "

              [[bar foo

              \n", - "example": 559, - "start_line": 8386, - "end_line": 8392, - "section": "Links" - }, - { - "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", - "html": "

              Foo

              \n", - "example": 560, - "start_line": 8397, - "end_line": 8403, - "section": "Links" - }, - { - "markdown": "[foo] bar\n\n[foo]: /url\n", - "html": "

              foo bar

              \n", - "example": 561, - "start_line": 8408, - "end_line": 8414, - "section": "Links" - }, - { - "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", - "html": "

              [foo]

              \n", - "example": 562, - "start_line": 8420, - "end_line": 8426, - "section": "Links" - }, - { - "markdown": "[foo*]: /url\n\n*[foo*]\n", - "html": "

              *foo*

              \n", - "example": 563, - "start_line": 8432, - "end_line": 8438, - "section": "Links" - }, - { - "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", - "html": "

              foo

              \n", - "example": 564, - "start_line": 8444, - "end_line": 8451, - "section": "Links" - }, - { - "markdown": "[foo][]\n\n[foo]: /url1\n", - "html": "

              foo

              \n", - "example": 565, - "start_line": 8453, - "end_line": 8459, - "section": "Links" - }, - { - "markdown": "[foo]()\n\n[foo]: /url1\n", - "html": "

              foo

              \n", - "example": 566, - "start_line": 8463, - "end_line": 8469, - "section": "Links" - }, - { - "markdown": "[foo](not a link)\n\n[foo]: /url1\n", - "html": "

              foo(not a link)

              \n", - "example": 567, - "start_line": 8471, - "end_line": 8477, - "section": "Links" - }, - { - "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", - "html": "

              [foo]bar

              \n", - "example": 568, - "start_line": 8482, - "end_line": 8488, - "section": "Links" - }, - { - "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", - "html": "

              foobaz

              \n", - "example": 569, - "start_line": 8494, - "end_line": 8501, - "section": "Links" - }, - { - "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", - "html": "

              [foo]bar

              \n", - "example": 570, - "start_line": 8507, - "end_line": 8514, - "section": "Links" - }, - { - "markdown": "![foo](/url \"title\")\n", - "html": "

              \"foo\"

              \n", - "example": 571, - "start_line": 8530, - "end_line": 8534, - "section": "Images" - }, - { - "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", - "html": "

              \"foo

              \n", - "example": 572, - "start_line": 8537, - "end_line": 8543, - "section": "Images" - }, - { - "markdown": "![foo ![bar](/url)](/url2)\n", - "html": "

              \"foo

              \n", - "example": 573, - "start_line": 8546, - "end_line": 8550, - "section": "Images" - }, - { - "markdown": "![foo [bar](/url)](/url2)\n", - "html": "

              \"foo

              \n", - "example": 574, - "start_line": 8553, - "end_line": 8557, - "section": "Images" - }, - { - "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", - "html": "

              \"foo

              \n", - "example": 575, - "start_line": 8567, - "end_line": 8573, - "section": "Images" - }, - { - "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", - "html": "

              \"foo

              \n", - "example": 576, - "start_line": 8576, - "end_line": 8582, - "section": "Images" - }, - { - "markdown": "![foo](train.jpg)\n", - "html": "

              \"foo\"

              \n", - "example": 577, - "start_line": 8585, - "end_line": 8589, - "section": "Images" - }, - { - "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", - "html": "

              My \"foo

              \n", - "example": 578, - "start_line": 8592, - "end_line": 8596, - "section": "Images" - }, - { - "markdown": "![foo]()\n", - "html": "

              \"foo\"

              \n", - "example": 579, - "start_line": 8599, - "end_line": 8603, - "section": "Images" - }, - { - "markdown": "![](/url)\n", - "html": "

              \"\"

              \n", - "example": 580, - "start_line": 8606, - "end_line": 8610, - "section": "Images" - }, - { - "markdown": "![foo][bar]\n\n[bar]: /url\n", - "html": "

              \"foo\"

              \n", - "example": 581, - "start_line": 8615, - "end_line": 8621, - "section": "Images" - }, - { - "markdown": "![foo][bar]\n\n[BAR]: /url\n", - "html": "

              \"foo\"

              \n", - "example": 582, - "start_line": 8624, - "end_line": 8630, - "section": "Images" - }, - { - "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", - "html": "

              \"foo\"

              \n", - "example": 583, - "start_line": 8635, - "end_line": 8641, - "section": "Images" - }, - { - "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", - "html": "

              \"foo

              \n", - "example": 584, - "start_line": 8644, - "end_line": 8650, - "section": "Images" - }, - { - "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", - "html": "

              \"Foo\"

              \n", - "example": 585, - "start_line": 8655, - "end_line": 8661, - "section": "Images" - }, - { - "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", - "html": "

              \"foo\"\n[]

              \n", - "example": 586, - "start_line": 8667, - "end_line": 8675, - "section": "Images" - }, - { - "markdown": "![foo]\n\n[foo]: /url \"title\"\n", - "html": "

              \"foo\"

              \n", - "example": 587, - "start_line": 8680, - "end_line": 8686, - "section": "Images" - }, - { - "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", - "html": "

              \"foo

              \n", - "example": 588, - "start_line": 8689, - "end_line": 8695, - "section": "Images" - }, - { - "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", - "html": "

              ![[foo]]

              \n

              [[foo]]: /url "title"

              \n", - "example": 589, - "start_line": 8700, - "end_line": 8707, - "section": "Images" - }, - { - "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", - "html": "

              \"Foo\"

              \n", - "example": 590, - "start_line": 8712, - "end_line": 8718, - "section": "Images" - }, - { - "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", - "html": "

              ![foo]

              \n", - "example": 591, - "start_line": 8724, - "end_line": 8730, - "section": "Images" - }, - { - "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", - "html": "

              !foo

              \n", - "example": 592, - "start_line": 8736, - "end_line": 8742, - "section": "Images" - }, - { - "markdown": "\n", - "html": "

              http://foo.bar.baz

              \n", - "example": 593, - "start_line": 8769, - "end_line": 8773, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              http://foo.bar.baz/test?q=hello&id=22&boolean

              \n", - "example": 594, - "start_line": 8776, - "end_line": 8780, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              irc://foo.bar:2233/baz

              \n", - "example": 595, - "start_line": 8783, - "end_line": 8787, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              MAILTO:FOO@BAR.BAZ

              \n", - "example": 596, - "start_line": 8792, - "end_line": 8796, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              a+b+c:d

              \n", - "example": 597, - "start_line": 8804, - "end_line": 8808, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              made-up-scheme://foo,bar

              \n", - "example": 598, - "start_line": 8811, - "end_line": 8815, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              http://../

              \n", - "example": 599, - "start_line": 8818, - "end_line": 8822, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              localhost:5001/foo

              \n", - "example": 600, - "start_line": 8825, - "end_line": 8829, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              <http://foo.bar/baz bim>

              \n", - "example": 601, - "start_line": 8834, - "end_line": 8838, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              http://example.com/\\[\\

              \n", - "example": 602, - "start_line": 8843, - "end_line": 8847, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              foo@bar.example.com

              \n", - "example": 603, - "start_line": 8865, - "end_line": 8869, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              foo+special@Bar.baz-bar0.com

              \n", - "example": 604, - "start_line": 8872, - "end_line": 8876, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              <foo+@bar.example.com>

              \n", - "example": 605, - "start_line": 8881, - "end_line": 8885, - "section": "Autolinks" - }, - { - "markdown": "<>\n", - "html": "

              <>

              \n", - "example": 606, - "start_line": 8890, - "end_line": 8894, - "section": "Autolinks" - }, - { - "markdown": "< http://foo.bar >\n", - "html": "

              < http://foo.bar >

              \n", - "example": 607, - "start_line": 8897, - "end_line": 8901, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              <m:abc>

              \n", - "example": 608, - "start_line": 8904, - "end_line": 8908, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              <foo.bar.baz>

              \n", - "example": 609, - "start_line": 8911, - "end_line": 8915, - "section": "Autolinks" - }, - { - "markdown": "http://example.com\n", - "html": "

              http://example.com

              \n", - "example": 610, - "start_line": 8918, - "end_line": 8922, - "section": "Autolinks" - }, - { - "markdown": "foo@bar.example.com\n", - "html": "

              foo@bar.example.com

              \n", - "example": 611, - "start_line": 8925, - "end_line": 8929, - "section": "Autolinks" - }, - { - "markdown": "\n", - "html": "

              \n", - "example": 612, - "start_line": 9006, - "end_line": 9010, - "section": "Raw HTML" - }, - { - "markdown": "\n", - "html": "

              \n", - "example": 613, - "start_line": 9015, - "end_line": 9019, - "section": "Raw HTML" - }, - { - "markdown": "\n", - "html": "

              \n", - "example": 614, - "start_line": 9024, - "end_line": 9030, - "section": "Raw HTML" - }, - { - "markdown": "\n", - "html": "

              \n", - "example": 615, - "start_line": 9035, - "end_line": 9041, - "section": "Raw HTML" - }, - { - "markdown": "Foo \n", - "html": "

              Foo

              \n", - "example": 616, - "start_line": 9046, - "end_line": 9050, - "section": "Raw HTML" - }, - { - "markdown": "<33> <__>\n", - "html": "

              <33> <__>

              \n", - "example": 617, - "start_line": 9055, - "end_line": 9059, - "section": "Raw HTML" - }, - { - "markdown": "
              \n", - "html": "

              <a h*#ref="hi">

              \n", - "example": 618, - "start_line": 9064, - "end_line": 9068, - "section": "Raw HTML" - }, - { - "markdown": "
              \n", - "html": "

              <a href="hi'> <a href=hi'>

              \n", - "example": 619, - "start_line": 9073, - "end_line": 9077, - "section": "Raw HTML" - }, - { - "markdown": "< a><\nfoo>\n\n", - "html": "

              < a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />

              \n", - "example": 620, - "start_line": 9082, - "end_line": 9092, - "section": "Raw HTML" - }, - { - "markdown": "
              \n", - "html": "

              <a href='bar'title=title>

              \n", - "example": 621, - "start_line": 9097, - "end_line": 9101, - "section": "Raw HTML" - }, - { - "markdown": "
              \n", - "html": "

              \n", - "example": 622, - "start_line": 9106, - "end_line": 9110, - "section": "Raw HTML" - }, - { - "markdown": "\n", - "html": "

              </a href="foo">

              \n", - "example": 623, - "start_line": 9115, - "end_line": 9119, - "section": "Raw HTML" - }, - { - "markdown": "foo \n", - "html": "

              foo

              \n", - "example": 624, - "start_line": 9124, - "end_line": 9130, - "section": "Raw HTML" - }, - { - "markdown": "foo \n", - "html": "

              foo <!-- not a comment -- two hyphens -->

              \n", - "example": 625, - "start_line": 9133, - "end_line": 9137, - "section": "Raw HTML" - }, - { - "markdown": "foo foo -->\n\nfoo \n", - "html": "

              foo <!--> foo -->

              \n

              foo <!-- foo--->

              \n", - "example": 626, - "start_line": 9142, - "end_line": 9149, - "section": "Raw HTML" - }, - { - "markdown": "foo \n", - "html": "

              foo

              \n", - "example": 627, - "start_line": 9154, - "end_line": 9158, - "section": "Raw HTML" - }, - { - "markdown": "foo \n", - "html": "

              foo

              \n", - "example": 628, - "start_line": 9163, - "end_line": 9167, - "section": "Raw HTML" - }, - { - "markdown": "foo &<]]>\n", - "html": "

              foo &<]]>

              \n", - "example": 629, - "start_line": 9172, - "end_line": 9176, - "section": "Raw HTML" - }, - { - "markdown": "foo \n", - "html": "

              foo

              \n", - "example": 630, - "start_line": 9182, - "end_line": 9186, - "section": "Raw HTML" - }, - { - "markdown": "foo \n", - "html": "

              foo

              \n", - "example": 631, - "start_line": 9191, - "end_line": 9195, - "section": "Raw HTML" - }, - { - "markdown": "\n", - "html": "

              <a href=""">

              \n", - "example": 632, - "start_line": 9198, - "end_line": 9202, - "section": "Raw HTML" - }, - { - "markdown": "foo \nbaz\n", - "html": "

              foo
              \nbaz

              \n", - "example": 633, - "start_line": 9212, - "end_line": 9218, - "section": "Hard line breaks" - }, - { - "markdown": "foo\\\nbaz\n", - "html": "

              foo
              \nbaz

              \n", - "example": 634, - "start_line": 9224, - "end_line": 9230, - "section": "Hard line breaks" - }, - { - "markdown": "foo \nbaz\n", - "html": "

              foo
              \nbaz

              \n", - "example": 635, - "start_line": 9235, - "end_line": 9241, - "section": "Hard line breaks" - }, - { - "markdown": "foo \n bar\n", - "html": "

              foo
              \nbar

              \n", - "example": 636, - "start_line": 9246, - "end_line": 9252, - "section": "Hard line breaks" - }, - { - "markdown": "foo\\\n bar\n", - "html": "

              foo
              \nbar

              \n", - "example": 637, - "start_line": 9255, - "end_line": 9261, - "section": "Hard line breaks" - }, - { - "markdown": "*foo \nbar*\n", - "html": "

              foo
              \nbar

              \n", - "example": 638, - "start_line": 9267, - "end_line": 9273, - "section": "Hard line breaks" - }, - { - "markdown": "*foo\\\nbar*\n", - "html": "

              foo
              \nbar

              \n", - "example": 639, - "start_line": 9276, - "end_line": 9282, - "section": "Hard line breaks" - }, - { - "markdown": "`code \nspan`\n", - "html": "

              code span

              \n", - "example": 640, - "start_line": 9287, - "end_line": 9292, - "section": "Hard line breaks" - }, - { - "markdown": "`code\\\nspan`\n", - "html": "

              code\\ span

              \n", - "example": 641, - "start_line": 9295, - "end_line": 9300, - "section": "Hard line breaks" - }, - { - "markdown": "
              \n", - "html": "

              \n", - "example": 642, - "start_line": 9305, - "end_line": 9311, - "section": "Hard line breaks" - }, - { - "markdown": "\n", - "html": "

              \n", - "example": 643, - "start_line": 9314, - "end_line": 9320, - "section": "Hard line breaks" - }, - { - "markdown": "foo\\\n", - "html": "

              foo\\

              \n", - "example": 644, - "start_line": 9327, - "end_line": 9331, - "section": "Hard line breaks" - }, - { - "markdown": "foo \n", - "html": "

              foo

              \n", - "example": 645, - "start_line": 9334, - "end_line": 9338, - "section": "Hard line breaks" - }, - { - "markdown": "### foo\\\n", - "html": "

              foo\\

              \n", - "example": 646, - "start_line": 9341, - "end_line": 9345, - "section": "Hard line breaks" - }, - { - "markdown": "### foo \n", - "html": "

              foo

              \n", - "example": 647, - "start_line": 9348, - "end_line": 9352, - "section": "Hard line breaks" - }, - { - "markdown": "foo\nbaz\n", - "html": "

              foo\nbaz

              \n", - "example": 648, - "start_line": 9363, - "end_line": 9369, - "section": "Soft line breaks" - }, - { - "markdown": "foo \n baz\n", - "html": "

              foo\nbaz

              \n", - "example": 649, - "start_line": 9375, - "end_line": 9381, - "section": "Soft line breaks" - }, - { - "markdown": "hello $.;'there\n", - "html": "

              hello $.;'there

              \n", - "example": 650, - "start_line": 9395, - "end_line": 9399, - "section": "Textual content" - }, - { - "markdown": "Foo χρῆν\n", - "html": "

              Foo χρῆν

              \n", - "example": 651, - "start_line": 9402, - "end_line": 9406, - "section": "Textual content" - }, - { - "markdown": "Multiple spaces\n", - "html": "

              Multiple spaces

              \n", - "example": 652, - "start_line": 9411, - "end_line": 9415, - "section": "Textual content" - } -] \ No newline at end of file diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_tools/gen-unicode-case-folding-map.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/_tools/gen-unicode-case-folding-map.go deleted file mode 100644 index a94b93a3b..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/_tools/gen-unicode-case-folding-map.go +++ /dev/null @@ -1,73 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "fmt" - "io/ioutil" - "net/http" - "os" - "strconv" - "strings" -) - -const outPath = "../util/unicode_case_folding.go" - -type caseFolding struct { - Class byte - From rune - To []rune -} - -func main() { - url := "http://www.unicode.org/Public/12.1.0/ucd/CaseFolding.txt" - - resp, err := http.Get(url) - if err != nil { - fmt.Printf("Failed to get CaseFolding.txt: %v\n", err) - os.Exit(1) - } - defer resp.Body.Close() - - bs, err := ioutil.ReadAll(resp.Body) - if err != nil { - fmt.Printf("Failed to get CaseFolding.txt: %v\n", err) - os.Exit(1) - } - - buf := bytes.NewBuffer(bs) - scanner := bufio.NewScanner(buf) - f, err := os.Create(outPath) - if err != nil { - fmt.Printf("Failed to open %s: %v\n", outPath, err) - os.Exit(1) - } - defer f.Close() - _, _ = f.WriteString("package util\n\n") - _, _ = f.WriteString("var unicodeCaseFoldings = map[rune][]rune {\n") - - for scanner.Scan() { - line := scanner.Text() - if strings.HasPrefix(line, "#") || len(strings.TrimSpace(line)) == 0 { - continue - } - line = strings.Split(line, "#")[0] - parts := strings.Split(line, ";") - for i, p := range parts { - parts[i] = strings.TrimSpace(p) - } - cf := caseFolding{} - v, _ := strconv.ParseInt(parts[0], 16, 32) - cf.From = rune(int32(v)) - cf.Class = parts[1][0] - for _, v := range strings.Split(parts[2], " ") { - c, _ := strconv.ParseInt(v, 16, 32) - cf.To = append(cf.To, rune(int32(c))) - } - if cf.Class != 'C' && cf.Class != 'F' { - continue - } - fmt.Fprintf(f, " %#x : %#v,\n", cf.From, cf.To) - } - fmt.Fprintf(f, "}\n") -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/ast.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/ast.go deleted file mode 100644 index 3719ebbd8..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/ast.go +++ /dev/null @@ -1,508 +0,0 @@ -// Package ast defines AST nodes that represent markdown elements. -package ast - -import ( - "bytes" - "fmt" - "strings" - - textm "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -// A NodeType indicates what type a node belongs to. -type NodeType int - -const ( - // TypeBlock indicates that a node is kind of block nodes. - TypeBlock NodeType = iota + 1 - // TypeInline indicates that a node is kind of inline nodes. - TypeInline - // TypeDocument indicates that a node is kind of document nodes. - TypeDocument -) - -// NodeKind indicates more specific type than NodeType. -type NodeKind int - -func (k NodeKind) String() string { - return kindNames[k] -} - -var kindMax NodeKind -var kindNames = []string{""} - -// NewNodeKind returns a new Kind value. -func NewNodeKind(name string) NodeKind { - kindMax++ - kindNames = append(kindNames, name) - return kindMax -} - -// An Attribute is an attribute of the Node -type Attribute struct { - Name []byte - Value interface{} -} - -// A Node interface defines basic AST node functionalities. -type Node interface { - // Type returns a type of this node. - Type() NodeType - - // Kind returns a kind of this node. - Kind() NodeKind - - // NextSibling returns a next sibling node of this node. - NextSibling() Node - - // PreviousSibling returns a previous sibling node of this node. - PreviousSibling() Node - - // Parent returns a parent node of this node. - Parent() Node - - // SetParent sets a parent node to this node. - SetParent(Node) - - // SetPreviousSibling sets a previous sibling node to this node. - SetPreviousSibling(Node) - - // SetNextSibling sets a next sibling node to this node. - SetNextSibling(Node) - - // HasChildren returns true if this node has any children, otherwise false. - HasChildren() bool - - // ChildCount returns a total number of children. - ChildCount() int - - // FirstChild returns a first child of this node. - FirstChild() Node - - // LastChild returns a last child of this node. - LastChild() Node - - // AppendChild append a node child to the tail of the children. - AppendChild(self, child Node) - - // RemoveChild removes a node child from this node. - // If a node child is not children of this node, RemoveChild nothing to do. - RemoveChild(self, child Node) - - // RemoveChildren removes all children from this node. - RemoveChildren(self Node) - - // SortChildren sorts childrens by comparator. - SortChildren(comparator func(n1, n2 Node) int) - - // ReplaceChild replace a node v1 with a node insertee. - // If v1 is not children of this node, ReplaceChild append a insetee to the - // tail of the children. - ReplaceChild(self, v1, insertee Node) - - // InsertBefore inserts a node insertee before a node v1. - // If v1 is not children of this node, InsertBefore append a insetee to the - // tail of the children. - InsertBefore(self, v1, insertee Node) - - // InsertAfterinserts a node insertee after a node v1. - // If v1 is not children of this node, InsertBefore append a insetee to the - // tail of the children. - InsertAfter(self, v1, insertee Node) - - // OwnerDocument returns this node's owner document. - // If this node is not a child of the Document node, OwnerDocument - // returns nil. - OwnerDocument() *Document - - // Dump dumps an AST tree structure to stdout. - // This function completely aimed for debugging. - // level is a indent level. Implementer should indent informations with - // 2 * level spaces. - Dump(source []byte, level int) - - // Text returns text values of this node. - Text(source []byte) []byte - - // HasBlankPreviousLines returns true if the row before this node is blank, - // otherwise false. - // This method is valid only for block nodes. - HasBlankPreviousLines() bool - - // SetBlankPreviousLines sets whether the row before this node is blank. - // This method is valid only for block nodes. - SetBlankPreviousLines(v bool) - - // Lines returns text segments that hold positions in a source. - // This method is valid only for block nodes. - Lines() *textm.Segments - - // SetLines sets text segments that hold positions in a source. - // This method is valid only for block nodes. - SetLines(*textm.Segments) - - // IsRaw returns true if contents should be rendered as 'raw' contents. - IsRaw() bool - - // SetAttribute sets the given value to the attributes. - SetAttribute(name []byte, value interface{}) - - // SetAttributeString sets the given value to the attributes. - SetAttributeString(name string, value interface{}) - - // Attribute returns a (attribute value, true) if an attribute - // associated with the given name is found, otherwise - // (nil, false) - Attribute(name []byte) (interface{}, bool) - - // AttributeString returns a (attribute value, true) if an attribute - // associated with the given name is found, otherwise - // (nil, false) - AttributeString(name string) (interface{}, bool) - - // Attributes returns a list of attributes. - // This may be a nil if there are no attributes. - Attributes() []Attribute - - // RemoveAttributes removes all attributes from this node. - RemoveAttributes() -} - -// A BaseNode struct implements the Node interface partialliy. -type BaseNode struct { - firstChild Node - lastChild Node - parent Node - next Node - prev Node - childCount int - attributes []Attribute -} - -func ensureIsolated(v Node) { - if p := v.Parent(); p != nil { - p.RemoveChild(p, v) - } -} - -// HasChildren implements Node.HasChildren . -func (n *BaseNode) HasChildren() bool { - return n.firstChild != nil -} - -// SetPreviousSibling implements Node.SetPreviousSibling . -func (n *BaseNode) SetPreviousSibling(v Node) { - n.prev = v -} - -// SetNextSibling implements Node.SetNextSibling . -func (n *BaseNode) SetNextSibling(v Node) { - n.next = v -} - -// PreviousSibling implements Node.PreviousSibling . -func (n *BaseNode) PreviousSibling() Node { - return n.prev -} - -// NextSibling implements Node.NextSibling . -func (n *BaseNode) NextSibling() Node { - return n.next -} - -// RemoveChild implements Node.RemoveChild . -func (n *BaseNode) RemoveChild(self, v Node) { - if v.Parent() != self { - return - } - n.childCount-- - prev := v.PreviousSibling() - next := v.NextSibling() - if prev != nil { - prev.SetNextSibling(next) - } else { - n.firstChild = next - } - if next != nil { - next.SetPreviousSibling(prev) - } else { - n.lastChild = prev - } - v.SetParent(nil) - v.SetPreviousSibling(nil) - v.SetNextSibling(nil) -} - -// RemoveChildren implements Node.RemoveChildren . -func (n *BaseNode) RemoveChildren(self Node) { - for c := n.firstChild; c != nil; { - c.SetParent(nil) - c.SetPreviousSibling(nil) - next := c.NextSibling() - c.SetNextSibling(nil) - c = next - } - n.firstChild = nil - n.lastChild = nil - n.childCount = 0 -} - -// SortChildren implements Node.SortChildren -func (n *BaseNode) SortChildren(comparator func(n1, n2 Node) int) { - var sorted Node - current := n.firstChild - for current != nil { - next := current.NextSibling() - if sorted == nil || comparator(sorted, current) >= 0 { - current.SetNextSibling(sorted) - if sorted != nil { - sorted.SetPreviousSibling(current) - } - sorted = current - sorted.SetPreviousSibling(nil) - } else { - c := sorted - for c.NextSibling() != nil && comparator(c.NextSibling(), current) < 0 { - c = c.NextSibling() - } - current.SetNextSibling(c.NextSibling()) - current.SetPreviousSibling(c) - if c.NextSibling() != nil { - c.NextSibling().SetPreviousSibling(current) - } - c.SetNextSibling(current) - } - current = next - } - n.firstChild = sorted - for c := n.firstChild; c != nil; c = c.NextSibling() { - n.lastChild = c - } -} - -// FirstChild implements Node.FirstChild . -func (n *BaseNode) FirstChild() Node { - return n.firstChild -} - -// LastChild implements Node.LastChild . -func (n *BaseNode) LastChild() Node { - return n.lastChild -} - -// ChildCount implements Node.ChildCount . -func (n *BaseNode) ChildCount() int { - return n.childCount -} - -// Parent implements Node.Parent . -func (n *BaseNode) Parent() Node { - return n.parent -} - -// SetParent implements Node.SetParent . -func (n *BaseNode) SetParent(v Node) { - n.parent = v -} - -// AppendChild implements Node.AppendChild . -func (n *BaseNode) AppendChild(self, v Node) { - ensureIsolated(v) - if n.firstChild == nil { - n.firstChild = v - v.SetNextSibling(nil) - v.SetPreviousSibling(nil) - } else { - last := n.lastChild - last.SetNextSibling(v) - v.SetPreviousSibling(last) - } - v.SetParent(self) - n.lastChild = v - n.childCount++ -} - -// ReplaceChild implements Node.ReplaceChild . -func (n *BaseNode) ReplaceChild(self, v1, insertee Node) { - n.InsertBefore(self, v1, insertee) - n.RemoveChild(self, v1) -} - -// InsertAfter implements Node.InsertAfter . -func (n *BaseNode) InsertAfter(self, v1, insertee Node) { - n.InsertBefore(self, v1.NextSibling(), insertee) -} - -// InsertBefore implements Node.InsertBefore . -func (n *BaseNode) InsertBefore(self, v1, insertee Node) { - n.childCount++ - if v1 == nil { - n.AppendChild(self, insertee) - return - } - ensureIsolated(insertee) - if v1.Parent() == self { - c := v1 - prev := c.PreviousSibling() - if prev != nil { - prev.SetNextSibling(insertee) - insertee.SetPreviousSibling(prev) - } else { - n.firstChild = insertee - insertee.SetPreviousSibling(nil) - } - insertee.SetNextSibling(c) - c.SetPreviousSibling(insertee) - insertee.SetParent(self) - } -} - -// OwnerDocument implements Node.OwnerDocument -func (n *BaseNode) OwnerDocument() *Document { - d := n.Parent() - for { - p := d.Parent() - if p == nil { - if v, ok := d.(*Document); ok { - return v - } - break - } - d = p - } - return nil -} - -// Text implements Node.Text . -func (n *BaseNode) Text(source []byte) []byte { - var buf bytes.Buffer - for c := n.firstChild; c != nil; c = c.NextSibling() { - buf.Write(c.Text(source)) - } - return buf.Bytes() -} - -// SetAttribute implements Node.SetAttribute. -func (n *BaseNode) SetAttribute(name []byte, value interface{}) { - if n.attributes == nil { - n.attributes = make([]Attribute, 0, 10) - } else { - for i, a := range n.attributes { - if bytes.Equal(a.Name, name) { - n.attributes[i].Name = name - n.attributes[i].Value = value - return - } - } - } - n.attributes = append(n.attributes, Attribute{name, value}) -} - -// SetAttributeString implements Node.SetAttributeString -func (n *BaseNode) SetAttributeString(name string, value interface{}) { - n.SetAttribute(util.StringToReadOnlyBytes(name), value) -} - -// Attribute implements Node.Attribute. -func (n *BaseNode) Attribute(name []byte) (interface{}, bool) { - if n.attributes == nil { - return nil, false - } - for i, a := range n.attributes { - if bytes.Equal(a.Name, name) { - return n.attributes[i].Value, true - } - } - return nil, false -} - -// AttributeString implements Node.AttributeString. -func (n *BaseNode) AttributeString(s string) (interface{}, bool) { - return n.Attribute(util.StringToReadOnlyBytes(s)) -} - -// Attributes implements Node.Attributes -func (n *BaseNode) Attributes() []Attribute { - return n.attributes -} - -// RemoveAttributes implements Node.RemoveAttributes -func (n *BaseNode) RemoveAttributes() { - n.attributes = nil -} - -// DumpHelper is a helper function to implement Node.Dump. -// kv is pairs of an attribute name and an attribute value. -// cb is a function called after wrote a name and attributes. -func DumpHelper(v Node, source []byte, level int, kv map[string]string, cb func(int)) { - name := v.Kind().String() - indent := strings.Repeat(" ", level) - fmt.Printf("%s%s {\n", indent, name) - indent2 := strings.Repeat(" ", level+1) - if v.Type() == TypeBlock { - fmt.Printf("%sRawText: \"", indent2) - for i := 0; i < v.Lines().Len(); i++ { - line := v.Lines().At(i) - fmt.Printf("%s", line.Value(source)) - } - fmt.Printf("\"\n") - fmt.Printf("%sHasBlankPreviousLines: %v\n", indent2, v.HasBlankPreviousLines()) - } - for name, value := range kv { - fmt.Printf("%s%s: %s\n", indent2, name, value) - } - if cb != nil { - cb(level + 1) - } - for c := v.FirstChild(); c != nil; c = c.NextSibling() { - c.Dump(source, level+1) - } - fmt.Printf("%s}\n", indent) -} - -// WalkStatus represents a current status of the Walk function. -type WalkStatus int - -const ( - // WalkStop indicates no more walking needed. - WalkStop WalkStatus = iota + 1 - - // WalkSkipChildren indicates that Walk wont walk on children of current - // node. - WalkSkipChildren - - // WalkContinue indicates that Walk can continue to walk. - WalkContinue -) - -// Walker is a function that will be called when Walk find a -// new node. -// entering is set true before walks children, false after walked children. -// If Walker returns error, Walk function immediately stop walking. -type Walker func(n Node, entering bool) (WalkStatus, error) - -// Walk walks a AST tree by the depth first search algorithm. -func Walk(n Node, walker Walker) error { - _, err := walkHelper(n, walker) - return err -} - -func walkHelper(n Node, walker Walker) (WalkStatus, error) { - status, err := walker(n, true) - if err != nil || status == WalkStop { - return status, err - } - if status != WalkSkipChildren { - for c := n.FirstChild(); c != nil; c = c.NextSibling() { - if st, err := walkHelper(c, walker); err != nil || st == WalkStop { - return WalkStop, err - } - } - } - status, err = walker(n, false) - if err != nil || status == WalkStop { - return WalkStop, err - } - return WalkContinue, nil -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/ast_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/ast_test.go deleted file mode 100644 index 684fbc3dc..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/ast_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package ast - -import ( - "reflect" - "testing" -) - -func TestRemoveChildren(t *testing.T) { - root := NewDocument() - - node1 := NewDocument() - - node2 := NewDocument() - - root.AppendChild(root, node1) - root.AppendChild(root, node2) - - root.RemoveChildren(root) - - t.Logf("%+v", node2.PreviousSibling()) -} - -func TestWalk(t *testing.T) { - tests := []struct { - name string - node Node - want []NodeKind - action map[NodeKind]WalkStatus - }{ - { - "visits all in depth first order", - node(NewDocument(), node(NewHeading(1), NewText()), NewLink()), - []NodeKind{KindDocument, KindHeading, KindText, KindLink}, - map[NodeKind]WalkStatus{}, - }, - { - "stops after heading", - node(NewDocument(), node(NewHeading(1), NewText()), NewLink()), - []NodeKind{KindDocument, KindHeading}, - map[NodeKind]WalkStatus{KindHeading: WalkStop}, - }, - { - "skip children", - node(NewDocument(), node(NewHeading(1), NewText()), NewLink()), - []NodeKind{KindDocument, KindHeading, KindLink}, - map[NodeKind]WalkStatus{KindHeading: WalkSkipChildren}, - }, - } - for _, tt := range tests { - var kinds []NodeKind - collectKinds := func(n Node, entering bool) (WalkStatus, error) { - if entering { - kinds = append(kinds, n.Kind()) - } - if status, ok := tt.action[n.Kind()]; ok { - return status, nil - } - return WalkContinue, nil - } - t.Run(tt.name, func(t *testing.T) { - if err := Walk(tt.node, collectKinds); err != nil { - t.Errorf("Walk() error = %v", err) - } else if !reflect.DeepEqual(kinds, tt.want) { - t.Errorf("Walk() expected = %v, got = %v", tt.want, kinds) - } - }) - } -} - -func node(n Node, children ...Node) Node { - for _, c := range children { - n.AppendChild(n, c) - } - return n -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/block.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/block.go deleted file mode 100644 index 4a504a810..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/block.go +++ /dev/null @@ -1,495 +0,0 @@ -package ast - -import ( - "fmt" - "strings" - - textm "github.com/yuin/goldmark/text" -) - -// A BaseBlock struct implements the Node interface partialliy. -type BaseBlock struct { - BaseNode - blankPreviousLines bool - lines *textm.Segments -} - -// Type implements Node.Type -func (b *BaseBlock) Type() NodeType { - return TypeBlock -} - -// IsRaw implements Node.IsRaw -func (b *BaseBlock) IsRaw() bool { - return false -} - -// HasBlankPreviousLines implements Node.HasBlankPreviousLines. -func (b *BaseBlock) HasBlankPreviousLines() bool { - return b.blankPreviousLines -} - -// SetBlankPreviousLines implements Node.SetBlankPreviousLines. -func (b *BaseBlock) SetBlankPreviousLines(v bool) { - b.blankPreviousLines = v -} - -// Lines implements Node.Lines -func (b *BaseBlock) Lines() *textm.Segments { - if b.lines == nil { - b.lines = textm.NewSegments() - } - return b.lines -} - -// SetLines implements Node.SetLines -func (b *BaseBlock) SetLines(v *textm.Segments) { - b.lines = v -} - -// A Document struct is a root node of Markdown text. -type Document struct { - BaseBlock - - meta map[string]interface{} -} - -// KindDocument is a NodeKind of the Document node. -var KindDocument = NewNodeKind("Document") - -// Dump implements Node.Dump . -func (n *Document) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// Type implements Node.Type . -func (n *Document) Type() NodeType { - return TypeDocument -} - -// Kind implements Node.Kind. -func (n *Document) Kind() NodeKind { - return KindDocument -} - -// OwnerDocument implements Node.OwnerDocument -func (n *Document) OwnerDocument() *Document { - return n -} - -// Meta returns metadata of this document. -func (n *Document) Meta() map[string]interface{} { - if n.meta == nil { - n.meta = map[string]interface{}{} - } - return n.meta -} - -// SetMeta sets given metadata to this document. -func (n *Document) SetMeta(meta map[string]interface{}) { - n.meta = meta -} - -// NewDocument returns a new Document node. -func NewDocument() *Document { - return &Document{ - BaseBlock: BaseBlock{}, - meta: nil, - } -} - -// A TextBlock struct is a node whose lines -// should be rendered without any containers. -type TextBlock struct { - BaseBlock -} - -// Dump implements Node.Dump . -func (n *TextBlock) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// KindTextBlock is a NodeKind of the TextBlock node. -var KindTextBlock = NewNodeKind("TextBlock") - -// Kind implements Node.Kind. -func (n *TextBlock) Kind() NodeKind { - return KindTextBlock -} - -// NewTextBlock returns a new TextBlock node. -func NewTextBlock() *TextBlock { - return &TextBlock{ - BaseBlock: BaseBlock{}, - } -} - -// A Paragraph struct represents a paragraph of Markdown text. -type Paragraph struct { - BaseBlock -} - -// Dump implements Node.Dump . -func (n *Paragraph) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// KindParagraph is a NodeKind of the Paragraph node. -var KindParagraph = NewNodeKind("Paragraph") - -// Kind implements Node.Kind. -func (n *Paragraph) Kind() NodeKind { - return KindParagraph -} - -// NewParagraph returns a new Paragraph node. -func NewParagraph() *Paragraph { - return &Paragraph{ - BaseBlock: BaseBlock{}, - } -} - -// IsParagraph returns true if the given node implements the Paragraph interface, -// otherwise false. -func IsParagraph(node Node) bool { - _, ok := node.(*Paragraph) - return ok -} - -// A Heading struct represents headings like SetextHeading and ATXHeading. -type Heading struct { - BaseBlock - // Level returns a level of this heading. - // This value is between 1 and 6. - Level int -} - -// Dump implements Node.Dump . -func (n *Heading) Dump(source []byte, level int) { - m := map[string]string{ - "Level": fmt.Sprintf("%d", n.Level), - } - DumpHelper(n, source, level, m, nil) -} - -// KindHeading is a NodeKind of the Heading node. -var KindHeading = NewNodeKind("Heading") - -// Kind implements Node.Kind. -func (n *Heading) Kind() NodeKind { - return KindHeading -} - -// NewHeading returns a new Heading node. -func NewHeading(level int) *Heading { - return &Heading{ - BaseBlock: BaseBlock{}, - Level: level, - } -} - -// A ThematicBreak struct represents a thematic break of Markdown text. -type ThematicBreak struct { - BaseBlock -} - -// Dump implements Node.Dump . -func (n *ThematicBreak) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// KindThematicBreak is a NodeKind of the ThematicBreak node. -var KindThematicBreak = NewNodeKind("ThematicBreak") - -// Kind implements Node.Kind. -func (n *ThematicBreak) Kind() NodeKind { - return KindThematicBreak -} - -// NewThematicBreak returns a new ThematicBreak node. -func NewThematicBreak() *ThematicBreak { - return &ThematicBreak{ - BaseBlock: BaseBlock{}, - } -} - -// A CodeBlock interface represents an indented code block of Markdown text. -type CodeBlock struct { - BaseBlock -} - -// IsRaw implements Node.IsRaw. -func (n *CodeBlock) IsRaw() bool { - return true -} - -// Dump implements Node.Dump . -func (n *CodeBlock) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// KindCodeBlock is a NodeKind of the CodeBlock node. -var KindCodeBlock = NewNodeKind("CodeBlock") - -// Kind implements Node.Kind. -func (n *CodeBlock) Kind() NodeKind { - return KindCodeBlock -} - -// NewCodeBlock returns a new CodeBlock node. -func NewCodeBlock() *CodeBlock { - return &CodeBlock{ - BaseBlock: BaseBlock{}, - } -} - -// A FencedCodeBlock struct represents a fenced code block of Markdown text. -type FencedCodeBlock struct { - BaseBlock - // Info returns a info text of this fenced code block. - Info *Text - - language []byte -} - -// Language returns an language in an info string. -// Language returns nil if this node does not have an info string. -func (n *FencedCodeBlock) Language(source []byte) []byte { - if n.language == nil && n.Info != nil { - segment := n.Info.Segment - info := segment.Value(source) - i := 0 - for ; i < len(info); i++ { - if info[i] == ' ' { - break - } - } - n.language = info[:i] - } - return n.language -} - -// IsRaw implements Node.IsRaw. -func (n *FencedCodeBlock) IsRaw() bool { - return true -} - -// Dump implements Node.Dump . -func (n *FencedCodeBlock) Dump(source []byte, level int) { - m := map[string]string{} - if n.Info != nil { - m["Info"] = fmt.Sprintf("\"%s\"", n.Info.Text(source)) - } - DumpHelper(n, source, level, m, nil) -} - -// KindFencedCodeBlock is a NodeKind of the FencedCodeBlock node. -var KindFencedCodeBlock = NewNodeKind("FencedCodeBlock") - -// Kind implements Node.Kind. -func (n *FencedCodeBlock) Kind() NodeKind { - return KindFencedCodeBlock -} - -// NewFencedCodeBlock return a new FencedCodeBlock node. -func NewFencedCodeBlock(info *Text) *FencedCodeBlock { - return &FencedCodeBlock{ - BaseBlock: BaseBlock{}, - Info: info, - } -} - -// A Blockquote struct represents an blockquote block of Markdown text. -type Blockquote struct { - BaseBlock -} - -// Dump implements Node.Dump . -func (n *Blockquote) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// KindBlockquote is a NodeKind of the Blockquote node. -var KindBlockquote = NewNodeKind("Blockquote") - -// Kind implements Node.Kind. -func (n *Blockquote) Kind() NodeKind { - return KindBlockquote -} - -// NewBlockquote returns a new Blockquote node. -func NewBlockquote() *Blockquote { - return &Blockquote{ - BaseBlock: BaseBlock{}, - } -} - -// A List struct represents a list of Markdown text. -type List struct { - BaseBlock - - // Marker is a marker character like '-', '+', ')' and '.'. - Marker byte - - // IsTight is a true if this list is a 'tight' list. - // See https://spec.commonmark.org/0.30/#loose for details. - IsTight bool - - // Start is an initial number of this ordered list. - // If this list is not an ordered list, Start is 0. - Start int -} - -// IsOrdered returns true if this list is an ordered list, otherwise false. -func (l *List) IsOrdered() bool { - return l.Marker == '.' || l.Marker == ')' -} - -// CanContinue returns true if this list can continue with -// the given mark and a list type, otherwise false. -func (l *List) CanContinue(marker byte, isOrdered bool) bool { - return marker == l.Marker && isOrdered == l.IsOrdered() -} - -// Dump implements Node.Dump. -func (l *List) Dump(source []byte, level int) { - m := map[string]string{ - "Ordered": fmt.Sprintf("%v", l.IsOrdered()), - "Marker": fmt.Sprintf("%c", l.Marker), - "Tight": fmt.Sprintf("%v", l.IsTight), - } - if l.IsOrdered() { - m["Start"] = fmt.Sprintf("%d", l.Start) - } - DumpHelper(l, source, level, m, nil) -} - -// KindList is a NodeKind of the List node. -var KindList = NewNodeKind("List") - -// Kind implements Node.Kind. -func (l *List) Kind() NodeKind { - return KindList -} - -// NewList returns a new List node. -func NewList(marker byte) *List { - return &List{ - BaseBlock: BaseBlock{}, - Marker: marker, - IsTight: true, - } -} - -// A ListItem struct represents a list item of Markdown text. -type ListItem struct { - BaseBlock - - // Offset is an offset position of this item. - Offset int -} - -// Dump implements Node.Dump. -func (n *ListItem) Dump(source []byte, level int) { - m := map[string]string{ - "Offset": fmt.Sprintf("%d", n.Offset), - } - DumpHelper(n, source, level, m, nil) -} - -// KindListItem is a NodeKind of the ListItem node. -var KindListItem = NewNodeKind("ListItem") - -// Kind implements Node.Kind. -func (n *ListItem) Kind() NodeKind { - return KindListItem -} - -// NewListItem returns a new ListItem node. -func NewListItem(offset int) *ListItem { - return &ListItem{ - BaseBlock: BaseBlock{}, - Offset: offset, - } -} - -// HTMLBlockType represents kinds of an html blocks. -// See https://spec.commonmark.org/0.30/#html-blocks -type HTMLBlockType int - -const ( - // HTMLBlockType1 represents type 1 html blocks - HTMLBlockType1 HTMLBlockType = iota + 1 - // HTMLBlockType2 represents type 2 html blocks - HTMLBlockType2 - // HTMLBlockType3 represents type 3 html blocks - HTMLBlockType3 - // HTMLBlockType4 represents type 4 html blocks - HTMLBlockType4 - // HTMLBlockType5 represents type 5 html blocks - HTMLBlockType5 - // HTMLBlockType6 represents type 6 html blocks - HTMLBlockType6 - // HTMLBlockType7 represents type 7 html blocks - HTMLBlockType7 -) - -// An HTMLBlock struct represents an html block of Markdown text. -type HTMLBlock struct { - BaseBlock - - // Type is a type of this html block. - HTMLBlockType HTMLBlockType - - // ClosureLine is a line that closes this html block. - ClosureLine textm.Segment -} - -// IsRaw implements Node.IsRaw. -func (n *HTMLBlock) IsRaw() bool { - return true -} - -// HasClosure returns true if this html block has a closure line, -// otherwise false. -func (n *HTMLBlock) HasClosure() bool { - return n.ClosureLine.Start >= 0 -} - -// Dump implements Node.Dump. -func (n *HTMLBlock) Dump(source []byte, level int) { - indent := strings.Repeat(" ", level) - fmt.Printf("%s%s {\n", indent, "HTMLBlock") - indent2 := strings.Repeat(" ", level+1) - fmt.Printf("%sRawText: \"", indent2) - for i := 0; i < n.Lines().Len(); i++ { - s := n.Lines().At(i) - fmt.Print(string(source[s.Start:s.Stop])) - } - fmt.Printf("\"\n") - for c := n.FirstChild(); c != nil; c = c.NextSibling() { - c.Dump(source, level+1) - } - if n.HasClosure() { - cl := n.ClosureLine - fmt.Printf("%sClosure: \"%s\"\n", indent2, string(cl.Value(source))) - } - fmt.Printf("%s}\n", indent) -} - -// KindHTMLBlock is a NodeKind of the HTMLBlock node. -var KindHTMLBlock = NewNodeKind("HTMLBlock") - -// Kind implements Node.Kind. -func (n *HTMLBlock) Kind() NodeKind { - return KindHTMLBlock -} - -// NewHTMLBlock returns a new HTMLBlock node. -func NewHTMLBlock(typ HTMLBlockType) *HTMLBlock { - return &HTMLBlock{ - BaseBlock: BaseBlock{}, - HTMLBlockType: typ, - ClosureLine: textm.NewSegment(-1, -1), - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/inline.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/inline.go deleted file mode 100644 index fa6fc34f9..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/ast/inline.go +++ /dev/null @@ -1,548 +0,0 @@ -package ast - -import ( - "fmt" - "strings" - - textm "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -// A BaseInline struct implements the Node interface partialliy. -type BaseInline struct { - BaseNode -} - -// Type implements Node.Type -func (b *BaseInline) Type() NodeType { - return TypeInline -} - -// IsRaw implements Node.IsRaw -func (b *BaseInline) IsRaw() bool { - return false -} - -// HasBlankPreviousLines implements Node.HasBlankPreviousLines. -func (b *BaseInline) HasBlankPreviousLines() bool { - panic("can not call with inline nodes.") -} - -// SetBlankPreviousLines implements Node.SetBlankPreviousLines. -func (b *BaseInline) SetBlankPreviousLines(v bool) { - panic("can not call with inline nodes.") -} - -// Lines implements Node.Lines -func (b *BaseInline) Lines() *textm.Segments { - panic("can not call with inline nodes.") -} - -// SetLines implements Node.SetLines -func (b *BaseInline) SetLines(v *textm.Segments) { - panic("can not call with inline nodes.") -} - -// A Text struct represents a textual content of the Markdown text. -type Text struct { - BaseInline - // Segment is a position in a source text. - Segment textm.Segment - - flags uint8 -} - -const ( - textSoftLineBreak = 1 << iota - textHardLineBreak - textRaw - textCode -) - -func textFlagsString(flags uint8) string { - buf := []string{} - if flags&textSoftLineBreak != 0 { - buf = append(buf, "SoftLineBreak") - } - if flags&textHardLineBreak != 0 { - buf = append(buf, "HardLineBreak") - } - if flags&textRaw != 0 { - buf = append(buf, "Raw") - } - if flags&textCode != 0 { - buf = append(buf, "Code") - } - return strings.Join(buf, ", ") -} - -// Inline implements Inline.Inline. -func (n *Text) Inline() { -} - -// SoftLineBreak returns true if this node ends with a new line, -// otherwise false. -func (n *Text) SoftLineBreak() bool { - return n.flags&textSoftLineBreak != 0 -} - -// SetSoftLineBreak sets whether this node ends with a new line. -func (n *Text) SetSoftLineBreak(v bool) { - if v { - n.flags |= textSoftLineBreak - } else { - n.flags = n.flags &^ textHardLineBreak - } -} - -// IsRaw returns true if this text should be rendered without unescaping -// back slash escapes and resolving references. -func (n *Text) IsRaw() bool { - return n.flags&textRaw != 0 -} - -// SetRaw sets whether this text should be rendered as raw contents. -func (n *Text) SetRaw(v bool) { - if v { - n.flags |= textRaw - } else { - n.flags = n.flags &^ textRaw - } -} - -// HardLineBreak returns true if this node ends with a hard line break. -// See https://spec.commonmark.org/0.30/#hard-line-breaks for details. -func (n *Text) HardLineBreak() bool { - return n.flags&textHardLineBreak != 0 -} - -// SetHardLineBreak sets whether this node ends with a hard line break. -func (n *Text) SetHardLineBreak(v bool) { - if v { - n.flags |= textHardLineBreak - } else { - n.flags = n.flags &^ textHardLineBreak - } -} - -// Merge merges a Node n into this node. -// Merge returns true if the given node has been merged, otherwise false. -func (n *Text) Merge(node Node, source []byte) bool { - t, ok := node.(*Text) - if !ok { - return false - } - if n.Segment.Stop != t.Segment.Start || t.Segment.Padding != 0 || source[n.Segment.Stop-1] == '\n' || t.IsRaw() != n.IsRaw() { - return false - } - n.Segment.Stop = t.Segment.Stop - n.SetSoftLineBreak(t.SoftLineBreak()) - n.SetHardLineBreak(t.HardLineBreak()) - return true -} - -// Text implements Node.Text. -func (n *Text) Text(source []byte) []byte { - return n.Segment.Value(source) -} - -// Dump implements Node.Dump. -func (n *Text) Dump(source []byte, level int) { - fs := textFlagsString(n.flags) - if len(fs) != 0 { - fs = "(" + fs + ")" - } - fmt.Printf("%sText%s: \"%s\"\n", strings.Repeat(" ", level), fs, strings.TrimRight(string(n.Text(source)), "\n")) -} - -// KindText is a NodeKind of the Text node. -var KindText = NewNodeKind("Text") - -// Kind implements Node.Kind. -func (n *Text) Kind() NodeKind { - return KindText -} - -// NewText returns a new Text node. -func NewText() *Text { - return &Text{ - BaseInline: BaseInline{}, - } -} - -// NewTextSegment returns a new Text node with the given source position. -func NewTextSegment(v textm.Segment) *Text { - return &Text{ - BaseInline: BaseInline{}, - Segment: v, - } -} - -// NewRawTextSegment returns a new Text node with the given source position. -// The new node should be rendered as raw contents. -func NewRawTextSegment(v textm.Segment) *Text { - t := &Text{ - BaseInline: BaseInline{}, - Segment: v, - } - t.SetRaw(true) - return t -} - -// MergeOrAppendTextSegment merges a given s into the last child of the parent if -// it can be merged, otherwise creates a new Text node and appends it to after current -// last child. -func MergeOrAppendTextSegment(parent Node, s textm.Segment) { - last := parent.LastChild() - t, ok := last.(*Text) - if ok && t.Segment.Stop == s.Start && !t.SoftLineBreak() { - t.Segment = t.Segment.WithStop(s.Stop) - } else { - parent.AppendChild(parent, NewTextSegment(s)) - } -} - -// MergeOrReplaceTextSegment merges a given s into a previous sibling of the node n -// if a previous sibling of the node n is *Text, otherwise replaces Node n with s. -func MergeOrReplaceTextSegment(parent Node, n Node, s textm.Segment) { - prev := n.PreviousSibling() - if t, ok := prev.(*Text); ok && t.Segment.Stop == s.Start && !t.SoftLineBreak() { - t.Segment = t.Segment.WithStop(s.Stop) - parent.RemoveChild(parent, n) - } else { - parent.ReplaceChild(parent, n, NewTextSegment(s)) - } -} - -// A String struct is a textual content that has a concrete value -type String struct { - BaseInline - - Value []byte - flags uint8 -} - -// Inline implements Inline.Inline. -func (n *String) Inline() { -} - -// IsRaw returns true if this text should be rendered without unescaping -// back slash escapes and resolving references. -func (n *String) IsRaw() bool { - return n.flags&textRaw != 0 -} - -// SetRaw sets whether this text should be rendered as raw contents. -func (n *String) SetRaw(v bool) { - if v { - n.flags |= textRaw - } else { - n.flags = n.flags &^ textRaw - } -} - -// IsCode returns true if this text should be rendered without any -// modifications. -func (n *String) IsCode() bool { - return n.flags&textCode != 0 -} - -// SetCode sets whether this text should be rendered without any modifications. -func (n *String) SetCode(v bool) { - if v { - n.flags |= textCode - } else { - n.flags = n.flags &^ textCode - } -} - -// Text implements Node.Text. -func (n *String) Text(source []byte) []byte { - return n.Value -} - -// Dump implements Node.Dump. -func (n *String) Dump(source []byte, level int) { - fs := textFlagsString(n.flags) - if len(fs) != 0 { - fs = "(" + fs + ")" - } - fmt.Printf("%sString%s: \"%s\"\n", strings.Repeat(" ", level), fs, strings.TrimRight(string(n.Value), "\n")) -} - -// KindString is a NodeKind of the String node. -var KindString = NewNodeKind("String") - -// Kind implements Node.Kind. -func (n *String) Kind() NodeKind { - return KindString -} - -// NewString returns a new String node. -func NewString(v []byte) *String { - return &String{ - Value: v, - } -} - -// A CodeSpan struct represents a code span of Markdown text. -type CodeSpan struct { - BaseInline -} - -// Inline implements Inline.Inline . -func (n *CodeSpan) Inline() { -} - -// IsBlank returns true if this node consists of spaces, otherwise false. -func (n *CodeSpan) IsBlank(source []byte) bool { - for c := n.FirstChild(); c != nil; c = c.NextSibling() { - text := c.(*Text).Segment - if !util.IsBlank(text.Value(source)) { - return false - } - } - return true -} - -// Dump implements Node.Dump -func (n *CodeSpan) Dump(source []byte, level int) { - DumpHelper(n, source, level, nil, nil) -} - -// KindCodeSpan is a NodeKind of the CodeSpan node. -var KindCodeSpan = NewNodeKind("CodeSpan") - -// Kind implements Node.Kind. -func (n *CodeSpan) Kind() NodeKind { - return KindCodeSpan -} - -// NewCodeSpan returns a new CodeSpan node. -func NewCodeSpan() *CodeSpan { - return &CodeSpan{ - BaseInline: BaseInline{}, - } -} - -// An Emphasis struct represents an emphasis of Markdown text. -type Emphasis struct { - BaseInline - - // Level is a level of the emphasis. - Level int -} - -// Dump implements Node.Dump. -func (n *Emphasis) Dump(source []byte, level int) { - m := map[string]string{ - "Level": fmt.Sprintf("%v", n.Level), - } - DumpHelper(n, source, level, m, nil) -} - -// KindEmphasis is a NodeKind of the Emphasis node. -var KindEmphasis = NewNodeKind("Emphasis") - -// Kind implements Node.Kind. -func (n *Emphasis) Kind() NodeKind { - return KindEmphasis -} - -// NewEmphasis returns a new Emphasis node with the given level. -func NewEmphasis(level int) *Emphasis { - return &Emphasis{ - BaseInline: BaseInline{}, - Level: level, - } -} - -type baseLink struct { - BaseInline - - // Destination is a destination(URL) of this link. - Destination []byte - - // Title is a title of this link. - Title []byte -} - -// Inline implements Inline.Inline. -func (n *baseLink) Inline() { -} - -// A Link struct represents a link of the Markdown text. -type Link struct { - baseLink -} - -// Dump implements Node.Dump. -func (n *Link) Dump(source []byte, level int) { - m := map[string]string{} - m["Destination"] = string(n.Destination) - m["Title"] = string(n.Title) - DumpHelper(n, source, level, m, nil) -} - -// KindLink is a NodeKind of the Link node. -var KindLink = NewNodeKind("Link") - -// Kind implements Node.Kind. -func (n *Link) Kind() NodeKind { - return KindLink -} - -// NewLink returns a new Link node. -func NewLink() *Link { - c := &Link{ - baseLink: baseLink{ - BaseInline: BaseInline{}, - }, - } - return c -} - -// An Image struct represents an image of the Markdown text. -type Image struct { - baseLink -} - -// Dump implements Node.Dump. -func (n *Image) Dump(source []byte, level int) { - m := map[string]string{} - m["Destination"] = string(n.Destination) - m["Title"] = string(n.Title) - DumpHelper(n, source, level, m, nil) -} - -// KindImage is a NodeKind of the Image node. -var KindImage = NewNodeKind("Image") - -// Kind implements Node.Kind. -func (n *Image) Kind() NodeKind { - return KindImage -} - -// NewImage returns a new Image node. -func NewImage(link *Link) *Image { - c := &Image{ - baseLink: baseLink{ - BaseInline: BaseInline{}, - }, - } - c.Destination = link.Destination - c.Title = link.Title - for n := link.FirstChild(); n != nil; { - next := n.NextSibling() - link.RemoveChild(link, n) - c.AppendChild(c, n) - n = next - } - - return c -} - -// AutoLinkType defines kind of auto links. -type AutoLinkType int - -const ( - // AutoLinkEmail indicates that an autolink is an email address. - AutoLinkEmail AutoLinkType = iota + 1 - // AutoLinkURL indicates that an autolink is a generic URL. - AutoLinkURL -) - -// An AutoLink struct represents an autolink of the Markdown text. -type AutoLink struct { - BaseInline - // Type is a type of this autolink. - AutoLinkType AutoLinkType - - // Protocol specified a protocol of the link. - Protocol []byte - - value *Text -} - -// Inline implements Inline.Inline. -func (n *AutoLink) Inline() {} - -// Dump implements Node.Dump -func (n *AutoLink) Dump(source []byte, level int) { - segment := n.value.Segment - m := map[string]string{ - "Value": string(segment.Value(source)), - } - DumpHelper(n, source, level, m, nil) -} - -// KindAutoLink is a NodeKind of the AutoLink node. -var KindAutoLink = NewNodeKind("AutoLink") - -// Kind implements Node.Kind. -func (n *AutoLink) Kind() NodeKind { - return KindAutoLink -} - -// URL returns an url of this node. -func (n *AutoLink) URL(source []byte) []byte { - if n.Protocol != nil { - s := n.value.Segment - ret := make([]byte, 0, len(n.Protocol)+s.Len()+3) - ret = append(ret, n.Protocol...) - ret = append(ret, ':', '/', '/') - ret = append(ret, n.value.Text(source)...) - return ret - } - return n.value.Text(source) -} - -// Label returns a label of this node. -func (n *AutoLink) Label(source []byte) []byte { - return n.value.Text(source) -} - -// NewAutoLink returns a new AutoLink node. -func NewAutoLink(typ AutoLinkType, value *Text) *AutoLink { - return &AutoLink{ - BaseInline: BaseInline{}, - value: value, - AutoLinkType: typ, - } -} - -// A RawHTML struct represents an inline raw HTML of the Markdown text. -type RawHTML struct { - BaseInline - Segments *textm.Segments -} - -// Inline implements Inline.Inline. -func (n *RawHTML) Inline() {} - -// Dump implements Node.Dump. -func (n *RawHTML) Dump(source []byte, level int) { - m := map[string]string{} - t := []string{} - for i := 0; i < n.Segments.Len(); i++ { - segment := n.Segments.At(i) - t = append(t, string(segment.Value(source))) - } - m["RawText"] = strings.Join(t, "") - DumpHelper(n, source, level, m, nil) -} - -// KindRawHTML is a NodeKind of the RawHTML node. -var KindRawHTML = NewNodeKind("RawHTML") - -// Kind implements Node.Kind. -func (n *RawHTML) Kind() NodeKind { - return KindRawHTML -} - -// NewRawHTML returns a new RawHTML node. -func NewRawHTML() *RawHTML { - return &RawHTML{ - Segments: textm.NewSegments(), - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/commonmark_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/commonmark_test.go deleted file mode 100644 index 7482ff1da..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/commonmark_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package goldmark_test - -import ( - "encoding/json" - "io/ioutil" - "testing" - - . "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -type commonmarkSpecTestCase struct { - Markdown string `json:"markdown"` - HTML string `json:"html"` - Example int `json:"example"` - StartLine int `json:"start_line"` - EndLine int `json:"end_line"` - Section string `json:"section"` -} - -func TestSpec(t *testing.T) { - bs, err := ioutil.ReadFile("_test/spec.json") - if err != nil { - panic(err) - } - var testCases []commonmarkSpecTestCase - if err := json.Unmarshal(bs, &testCases); err != nil { - panic(err) - } - cases := []testutil.MarkdownTestCase{} - nos := testutil.ParseCliCaseArg() - for _, c := range testCases { - shouldAdd := len(nos) == 0 - if !shouldAdd { - for _, no := range nos { - if c.Example == no { - shouldAdd = true - break - } - } - } - - if shouldAdd { - cases = append(cases, testutil.MarkdownTestCase{ - No: c.Example, - Markdown: c.Markdown, - Expected: c.HTML, - }) - } - } - markdown := New(WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - )) - testutil.DoTestCases(markdown, cases, t) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/definition_list.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/definition_list.txt deleted file mode 100644 index a6c1c8773..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/definition_list.txt +++ /dev/null @@ -1,156 +0,0 @@ -1 -//- - - - - - - - -// -Apple -: Pomaceous fruit of plants of the genus Malus in -the family Rosaceae. - -Orange -: The fruit of an evergreen tree of the genus Citrus. -//- - - - - - - - -// -
              -
              Apple
              -
              Pomaceous fruit of plants of the genus Malus in -the family Rosaceae.
              -
              Orange
              -
              The fruit of an evergreen tree of the genus Citrus.
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -2 -//- - - - - - - - -// -Apple -: Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. -: An American computer company. - -Orange -: The fruit of an evergreen tree of the genus Citrus. -//- - - - - - - - -// -
              -
              Apple
              -
              Pomaceous fruit of plants of the genus Malus in -the family Rosaceae.
              -
              An American computer company.
              -
              Orange
              -
              The fruit of an evergreen tree of the genus Citrus.
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -3 -//- - - - - - - - -// -Term 1 -Term 2 -: Definition a - -Term 3 -: Definition b -//- - - - - - - - -// -
              -
              Term 1
              -
              Term 2
              -
              Definition a
              -
              Term 3
              -
              Definition b
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -4 -//- - - - - - - - -// -Apple - -: Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - -Orange - -: The fruit of an evergreen tree of the genus Citrus. -//- - - - - - - - -// -
              -
              Apple
              -
              -

              Pomaceous fruit of plants of the genus Malus in -the family Rosaceae.

              -
              -
              Orange
              -
              -

              The fruit of an evergreen tree of the genus Citrus.

              -
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -5 -//- - - - - - - - -// -Term 1 - -: This is a definition with two paragraphs. Lorem ipsum - dolor sit amet, consectetuer adipiscing elit. Aliquam - hendrerit mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. - -: Second definition for term 1, also wrapped in a paragraph - because of the blank line preceding it. - -Term 2 - -: This definition has a code block, a blockquote and a list. - - code block. - - > block quote - > on two lines. - - 1. first list item - 2. second list item -//- - - - - - - - -// -
              -
              Term 1
              -
              -

              This is a definition with two paragraphs. Lorem ipsum -dolor sit amet, consectetuer adipiscing elit. Aliquam -hendrerit mi posuere lectus.

              -

              Vestibulum enim wisi, viverra nec, fringilla in, laoreet -vitae, risus.

              -
              -
              -

              Second definition for term 1, also wrapped in a paragraph -because of the blank line preceding it.

              -
              -
              Term 2
              -
              -

              This definition has a code block, a blockquote and a list.

              -
              code block.
              -
              -
              -

              block quote -on two lines.

              -
              -
                -
              1. first list item
              2. -
              3. second list item
              4. -
              -
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -6: Definition lists indented with tabs -//- - - - - - - - -// -0 -: ``` - 0 -//- - - - - - - - -// -
              -
              0
              -
              	0
              -
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/footnote.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/footnote.txt deleted file mode 100644 index 48e3a58fc..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/footnote.txt +++ /dev/null @@ -1,68 +0,0 @@ -1 -//- - - - - - - - -// -That's some text with a footnote.[^1] - -[^1]: And that's the footnote. - - That's the second paragraph. -//- - - - - - - - -// -

              That's some text with a footnote.1

              -
              -
              -
                -
              1. -

                And that's the footnote.

                -

                That's the second paragraph. ↩︎

                -
              2. -
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -3 -//- - - - - - - - -// -[^000]:0 [^]: -//- - - - - - - - -// -//= = = = = = = = = = = = = = = = = = = = = = = =// - -4 -//- - - - - - - - -// -This[^3] is[^1] text with footnotes[^2]. - -[^1]: Footnote one -[^2]: Footnote two -[^3]: Footnote three -//- - - - - - - - -// -

              This1 is2 text with footnotes3.

              -
              -
              -
                -
              1. -

                Footnote three ↩︎

                -
              2. -
              3. -

                Footnote one ↩︎

                -
              4. -
              5. -

                Footnote two ↩︎

                -
              6. -
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -5 -//- - - - - - - - -// -test![^1] - -[^1]: footnote -//- - - - - - - - -// -

              test!1

              -
              -
              -
                -
              1. -

                footnote ↩︎

                -
              2. -
              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/linkify.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/linkify.txt deleted file mode 100644 index 4791f3cfc..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/linkify.txt +++ /dev/null @@ -1,193 +0,0 @@ -1 -//- - - - - - - - -// -www.commonmark.org -//- - - - - - - - -// -

              www.commonmark.org

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -2 -//- - - - - - - - -// -Visit www.commonmark.org/help for more information. -//- - - - - - - - -// -

              Visit www.commonmark.org/help for more information.

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -3 -//- - - - - - - - -// -www.google.com/search?q=Markup+(business) - -www.google.com/search?q=Markup+(business))) - -(www.google.com/search?q=Markup+(business)) - -(www.google.com/search?q=Markup+(business) -//- - - - - - - - -// -

              www.google.com/search?q=Markup+(business)

              -

              www.google.com/search?q=Markup+(business)))

              -

              (www.google.com/search?q=Markup+(business))

              -

              (www.google.com/search?q=Markup+(business)

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -4 -//- - - - - - - - -// -www.google.com/search?q=(business))+ok -//- - - - - - - - -// -

              www.google.com/search?q=(business))+ok

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -5 -//- - - - - - - - -// -www.google.com/search?q=commonmark&hl=en - -www.google.com/search?q=commonmark&hl; -//- - - - - - - - -// -

              www.google.com/search?q=commonmark&hl=en

              -

              www.google.com/search?q=commonmark&hl;

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -6 -//- - - - - - - - -// -www.commonmark.org/hewww.commonmark.org/he<lp

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -7 -//- - - - - - - - -// -http://commonmark.org - -(Visit https://encrypted.google.com/search?q=Markup+(business)) - -Anonymous FTP is available at ftp://foo.bar.baz. -//- - - - - - - - -// -

              http://commonmark.org

              -

              (Visit https://encrypted.google.com/search?q=Markup+(business))

              -

              Anonymous FTP is available at ftp://foo.bar.baz.

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -8 -//- - - - - - - - -// -foo@bar.baz -//- - - - - - - - -// -

              foo@bar.baz

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -9 -//- - - - - - - - -// -hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. -//- - - - - - - - -// -

              hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -10 -//- - - - - - - - -// -a.b-c_d@a.b - -a.b-c_d@a.b. - -a.b-c_d@a.b- - -a.b-c_d@a.b_ -//- - - - - - - - -// -

              a.b-c_d@a.b

              -

              a.b-c_d@a.b.

              -

              a.b-c_d@a.b-

              -

              a.b-c_d@a.b_

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -11 -//- - - - - - - - -// -https://github.com#sun,mon -//- - - - - - - - -// -

              https://github.com#sun,mon

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -12 -//- - - - - - - - -// -https://github.com/sunday's -//- - - - - - - - -// -

              https://github.com/sunday's

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -13 -//- - - - - - - - -// -https://github.com?q=stars:>1 -//- - - - - - - - -// -

              https://github.com?q=stars:>1

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -14 -//- - - - - - - - -// -[https://google.com](https://google.com) -//- - - - - - - - -// -

              https://google.com

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -15 -//- - - - - - - - -// -This is a `git@github.com:vim/vim` -//- - - - - - - - -// -

              This is a git@github.com:vim/vim

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -16 -//- - - - - - - - -// -https://nic.college -//- - - - - - - - -// -

              https://nic.college

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -17 -//- - - - - - - - -// -http://server.intranet.acme.com:1313 -//- - - - - - - - -// -

              http://server.intranet.acme.com:1313

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -18 -//- - - - - - - - -// -https://g.page/foo -//- - - - - - - - -// -

              https://g.page/foo

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -19: Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not be considered part of the autolink -//- - - - - - - - -// -__http://test.com/~/a__ -__http://test.com/~/__ -__http://test.com/~__ -__http://test.com/a/~__ -//- - - - - - - - -// -

              http://test.com/~/a -http://test.com/~/ -http://test.com/~ -http://test.com/a/~

              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/strikethrough.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/strikethrough.txt deleted file mode 100644 index dbb48f651..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/strikethrough.txt +++ /dev/null @@ -1,18 +0,0 @@ -1 -//- - - - - - - - -// -~~Hi~~ Hello, world! -//- - - - - - - - -// -

              Hi Hello, world!

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -2 -//- - - - - - - - -// -This ~~has a - -new paragraph~~. -//- - - - - - - - -// -

              This ~~has a

              -

              new paragraph~~.

              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/table.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/table.txt deleted file mode 100644 index 2dc26f2b6..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/table.txt +++ /dev/null @@ -1,255 +0,0 @@ -1 -//- - - - - - - - -// -| foo | bar | -| --- | --- | -| baz | bim | -//- - - - - - - - -// - - - - - - - - - - - - - -
              foobar
              bazbim
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -2 -//- - - - - - - - -// -| abc | defghi | -:-: | -----------: -bar | baz -//- - - - - - - - -// - - - - - - - - - - - - - -
              abcdefghi
              barbaz
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -3 -//- - - - - - - - -// -| f\|oo | -| ------ | -| b `\|` az | -| b **\|** im | -//- - - - - - - - -// - - - - - - - - - - - - - - -
              f|oo
              b | az
              b | im
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -4 -//- - - - - - - - -// -| abc | def | -| --- | --- | -| bar | baz | -> bar -//- - - - - - - - -// - - - - - - - - - - - - - -
              abcdef
              barbaz
              -
              -

              bar

              -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -5 -//- - - - - - - - -// -| abc | def | -| --- | --- | -| bar | baz | -bar - -bar -//- - - - - - - - -// - - - - - - - - - - - - - - - - - -
              abcdef
              barbaz
              bar
              -

              bar

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -6 -//- - - - - - - - -// -| abc | def | -| --- | -| bar | -//- - - - - - - - -// -

              | abc | def | -| --- | -| bar |

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -7 -//- - - - - - - - -// -| abc | def | -| --- | --- | -| bar | -| bar | baz | boo | -//- - - - - - - - -// - - - - - - - - - - - - - - - - - -
              abcdef
              bar
              barbaz
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -8 -//- - - - - - - - -// -| abc | def | -| --- | --- | -//- - - - - - - - -// - - - - - - - -
              abcdef
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -9 -//- - - - - - - - -// -Foo|Bar ----|--- -`Yoyo`|Dyne -//- - - - - - - - -// - - - - - - - - - - - - - -
              FooBar
              YoyoDyne
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -10 -//- - - - - - - - -// -foo|bar ----|--- -`\` | second column -//- - - - - - - - -// - - - - - - - - - - - - - -
              foobar
              \second column
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - -11: Tables can interrupt paragraph -//- - - - - - - - -// -**xxx** -| hello | hi | -| :----: | :----:| -//- - - - - - - - -// -

              xxx

              - - - - - - - -
              hellohi
              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/tasklist.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/tasklist.txt deleted file mode 100644 index dad65c62b..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/tasklist.txt +++ /dev/null @@ -1,30 +0,0 @@ -1 -//- - - - - - - - -// -- [ ] foo -- [x] bar -//- - - - - - - - -// -
                -
              • foo
              • -
              • bar
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// - - - -2 -//- - - - - - - - -// -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim -//- - - - - - - - -// -
                -
              • foo -
                  -
                • bar
                • -
                • baz
                • -
                -
              • -
              • bim
              • -
              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/typographer.txt b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/typographer.txt deleted file mode 100644 index ef90bce34..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/_test/typographer.txt +++ /dev/null @@ -1,66 +0,0 @@ -1 -//- - - - - - - - -// -This should 'be' replaced -//- - - - - - - - -// -

              This should ‘be’ replaced

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -2 -//- - - - - - - - -// -This should "be" replaced -//- - - - - - - - -// -

              This should “be” replaced

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -3 -//- - - - - - - - -// -**--** *---* a...<< b>> -//- - - - - - - - -// -

              a…« b»

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -4 -//- - - - - - - - -// -Some say '90s, others say 90's, but I can't say which is best. -//- - - - - - - - -// -

              Some say ’90s, others say 90’s, but I can’t say which is best.

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -5: contractions -//- - - - - - - - -// -Alice's, I'm ,Don't, You'd - -I've, I'll, You're - -[Cat][]'s Pajamas - -Yahoo!'s - -[Cat]: http://example.com -//- - - - - - - - -// -

              Alice’s, I’m ,Don’t, You’d

              -

              I’ve, I’ll, You’re

              -

              Cat’s Pajamas

              -

              Yahoo!’s

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -6: "" after digits are an inch -//- - - - - - - - -// -My height is 5'6"". -//- - - - - - - - -// -

              My height is 5'6"".

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -7: quote followed by ,.?! and spaces maybe a closer -//- - - - - - - - -// -reported "issue 1 (IE-only)", "issue 2", 'issue3 (FF-only)', 'issue4' -//- - - - - - - - -// -

              reported “issue 1 (IE-only)”, “issue 2”, ‘issue3 (FF-only)’, ‘issue4’

              -//= = = = = = = = = = = = = = = = = = = = = = = =// - -8: handle inches in qoutes -//- - - - - - - - -// -"Monitor 21"" and "Monitor"" -//- - - - - - - - -// -

              “Monitor 21"” and “Monitor”"

              -//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/definition_list.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/definition_list.go deleted file mode 100644 index 1beffb3aa..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/definition_list.go +++ /dev/null @@ -1,83 +0,0 @@ -package ast - -import ( - gast "github.com/yuin/goldmark/ast" -) - -// A DefinitionList struct represents a definition list of Markdown -// (PHPMarkdownExtra) text. -type DefinitionList struct { - gast.BaseBlock - Offset int - TemporaryParagraph *gast.Paragraph -} - -// Dump implements Node.Dump. -func (n *DefinitionList) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// KindDefinitionList is a NodeKind of the DefinitionList node. -var KindDefinitionList = gast.NewNodeKind("DefinitionList") - -// Kind implements Node.Kind. -func (n *DefinitionList) Kind() gast.NodeKind { - return KindDefinitionList -} - -// NewDefinitionList returns a new DefinitionList node. -func NewDefinitionList(offset int, para *gast.Paragraph) *DefinitionList { - return &DefinitionList{ - Offset: offset, - TemporaryParagraph: para, - } -} - -// A DefinitionTerm struct represents a definition list term of Markdown -// (PHPMarkdownExtra) text. -type DefinitionTerm struct { - gast.BaseBlock -} - -// Dump implements Node.Dump. -func (n *DefinitionTerm) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// KindDefinitionTerm is a NodeKind of the DefinitionTerm node. -var KindDefinitionTerm = gast.NewNodeKind("DefinitionTerm") - -// Kind implements Node.Kind. -func (n *DefinitionTerm) Kind() gast.NodeKind { - return KindDefinitionTerm -} - -// NewDefinitionTerm returns a new DefinitionTerm node. -func NewDefinitionTerm() *DefinitionTerm { - return &DefinitionTerm{} -} - -// A DefinitionDescription struct represents a definition list description of Markdown -// (PHPMarkdownExtra) text. -type DefinitionDescription struct { - gast.BaseBlock - IsTight bool -} - -// Dump implements Node.Dump. -func (n *DefinitionDescription) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// KindDefinitionDescription is a NodeKind of the DefinitionDescription node. -var KindDefinitionDescription = gast.NewNodeKind("DefinitionDescription") - -// Kind implements Node.Kind. -func (n *DefinitionDescription) Kind() gast.NodeKind { - return KindDefinitionDescription -} - -// NewDefinitionDescription returns a new DefinitionDescription node. -func NewDefinitionDescription() *DefinitionDescription { - return &DefinitionDescription{} -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/footnote.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/footnote.go deleted file mode 100644 index dedbab4f8..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/footnote.go +++ /dev/null @@ -1,132 +0,0 @@ -package ast - -import ( - "fmt" - - gast "github.com/yuin/goldmark/ast" -) - -// A FootnoteLink struct represents a link to a footnote of Markdown -// (PHP Markdown Extra) text. -type FootnoteLink struct { - gast.BaseInline - Index int - RefCount int -} - -// Dump implements Node.Dump. -func (n *FootnoteLink) Dump(source []byte, level int) { - m := map[string]string{} - m["Index"] = fmt.Sprintf("%v", n.Index) - m["RefCount"] = fmt.Sprintf("%v", n.RefCount) - gast.DumpHelper(n, source, level, m, nil) -} - -// KindFootnoteLink is a NodeKind of the FootnoteLink node. -var KindFootnoteLink = gast.NewNodeKind("FootnoteLink") - -// Kind implements Node.Kind. -func (n *FootnoteLink) Kind() gast.NodeKind { - return KindFootnoteLink -} - -// NewFootnoteLink returns a new FootnoteLink node. -func NewFootnoteLink(index int) *FootnoteLink { - return &FootnoteLink{ - Index: index, - RefCount: 0, - } -} - -// A FootnoteBacklink struct represents a link to a footnote of Markdown -// (PHP Markdown Extra) text. -type FootnoteBacklink struct { - gast.BaseInline - Index int - RefCount int -} - -// Dump implements Node.Dump. -func (n *FootnoteBacklink) Dump(source []byte, level int) { - m := map[string]string{} - m["Index"] = fmt.Sprintf("%v", n.Index) - m["RefCount"] = fmt.Sprintf("%v", n.RefCount) - gast.DumpHelper(n, source, level, m, nil) -} - -// KindFootnoteBacklink is a NodeKind of the FootnoteBacklink node. -var KindFootnoteBacklink = gast.NewNodeKind("FootnoteBacklink") - -// Kind implements Node.Kind. -func (n *FootnoteBacklink) Kind() gast.NodeKind { - return KindFootnoteBacklink -} - -// NewFootnoteBacklink returns a new FootnoteBacklink node. -func NewFootnoteBacklink(index int) *FootnoteBacklink { - return &FootnoteBacklink{ - Index: index, - RefCount: 0, - } -} - -// A Footnote struct represents a footnote of Markdown -// (PHP Markdown Extra) text. -type Footnote struct { - gast.BaseBlock - Ref []byte - Index int -} - -// Dump implements Node.Dump. -func (n *Footnote) Dump(source []byte, level int) { - m := map[string]string{} - m["Index"] = fmt.Sprintf("%v", n.Index) - m["Ref"] = fmt.Sprintf("%s", n.Ref) - gast.DumpHelper(n, source, level, m, nil) -} - -// KindFootnote is a NodeKind of the Footnote node. -var KindFootnote = gast.NewNodeKind("Footnote") - -// Kind implements Node.Kind. -func (n *Footnote) Kind() gast.NodeKind { - return KindFootnote -} - -// NewFootnote returns a new Footnote node. -func NewFootnote(ref []byte) *Footnote { - return &Footnote{ - Ref: ref, - Index: -1, - } -} - -// A FootnoteList struct represents footnotes of Markdown -// (PHP Markdown Extra) text. -type FootnoteList struct { - gast.BaseBlock - Count int -} - -// Dump implements Node.Dump. -func (n *FootnoteList) Dump(source []byte, level int) { - m := map[string]string{} - m["Count"] = fmt.Sprintf("%v", n.Count) - gast.DumpHelper(n, source, level, m, nil) -} - -// KindFootnoteList is a NodeKind of the FootnoteList node. -var KindFootnoteList = gast.NewNodeKind("FootnoteList") - -// Kind implements Node.Kind. -func (n *FootnoteList) Kind() gast.NodeKind { - return KindFootnoteList -} - -// NewFootnoteList returns a new FootnoteList node. -func NewFootnoteList() *FootnoteList { - return &FootnoteList{ - Count: 0, - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/strikethrough.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/strikethrough.go deleted file mode 100644 index a9216b72e..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/strikethrough.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package ast defines AST nodes that represents extension's elements -package ast - -import ( - gast "github.com/yuin/goldmark/ast" -) - -// A Strikethrough struct represents a strikethrough of GFM text. -type Strikethrough struct { - gast.BaseInline -} - -// Dump implements Node.Dump. -func (n *Strikethrough) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// KindStrikethrough is a NodeKind of the Strikethrough node. -var KindStrikethrough = gast.NewNodeKind("Strikethrough") - -// Kind implements Node.Kind. -func (n *Strikethrough) Kind() gast.NodeKind { - return KindStrikethrough -} - -// NewStrikethrough returns a new Strikethrough node. -func NewStrikethrough() *Strikethrough { - return &Strikethrough{} -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/table.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/table.go deleted file mode 100644 index 1d8890b5e..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/table.go +++ /dev/null @@ -1,157 +0,0 @@ -package ast - -import ( - "fmt" - gast "github.com/yuin/goldmark/ast" - "strings" -) - -// Alignment is a text alignment of table cells. -type Alignment int - -const ( - // AlignLeft indicates text should be left justified. - AlignLeft Alignment = iota + 1 - - // AlignRight indicates text should be right justified. - AlignRight - - // AlignCenter indicates text should be centered. - AlignCenter - - // AlignNone indicates text should be aligned by default manner. - AlignNone -) - -func (a Alignment) String() string { - switch a { - case AlignLeft: - return "left" - case AlignRight: - return "right" - case AlignCenter: - return "center" - case AlignNone: - return "none" - } - return "" -} - -// A Table struct represents a table of Markdown(GFM) text. -type Table struct { - gast.BaseBlock - - // Alignments returns alignments of the columns. - Alignments []Alignment -} - -// Dump implements Node.Dump -func (n *Table) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, func(level int) { - indent := strings.Repeat(" ", level) - fmt.Printf("%sAlignments {\n", indent) - for i, alignment := range n.Alignments { - indent2 := strings.Repeat(" ", level+1) - fmt.Printf("%s%s", indent2, alignment.String()) - if i != len(n.Alignments)-1 { - fmt.Println("") - } - } - fmt.Printf("\n%s}\n", indent) - }) -} - -// KindTable is a NodeKind of the Table node. -var KindTable = gast.NewNodeKind("Table") - -// Kind implements Node.Kind. -func (n *Table) Kind() gast.NodeKind { - return KindTable -} - -// NewTable returns a new Table node. -func NewTable() *Table { - return &Table{ - Alignments: []Alignment{}, - } -} - -// A TableRow struct represents a table row of Markdown(GFM) text. -type TableRow struct { - gast.BaseBlock - Alignments []Alignment -} - -// Dump implements Node.Dump. -func (n *TableRow) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// KindTableRow is a NodeKind of the TableRow node. -var KindTableRow = gast.NewNodeKind("TableRow") - -// Kind implements Node.Kind. -func (n *TableRow) Kind() gast.NodeKind { - return KindTableRow -} - -// NewTableRow returns a new TableRow node. -func NewTableRow(alignments []Alignment) *TableRow { - return &TableRow{} -} - -// A TableHeader struct represents a table header of Markdown(GFM) text. -type TableHeader struct { - gast.BaseBlock - Alignments []Alignment -} - -// KindTableHeader is a NodeKind of the TableHeader node. -var KindTableHeader = gast.NewNodeKind("TableHeader") - -// Kind implements Node.Kind. -func (n *TableHeader) Kind() gast.NodeKind { - return KindTableHeader -} - -// Dump implements Node.Dump. -func (n *TableHeader) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// NewTableHeader returns a new TableHeader node. -func NewTableHeader(row *TableRow) *TableHeader { - n := &TableHeader{} - for c := row.FirstChild(); c != nil; { - next := c.NextSibling() - n.AppendChild(n, c) - c = next - } - return n -} - -// A TableCell struct represents a table cell of a Markdown(GFM) text. -type TableCell struct { - gast.BaseBlock - Alignment Alignment -} - -// Dump implements Node.Dump. -func (n *TableCell) Dump(source []byte, level int) { - gast.DumpHelper(n, source, level, nil, nil) -} - -// KindTableCell is a NodeKind of the TableCell node. -var KindTableCell = gast.NewNodeKind("TableCell") - -// Kind implements Node.Kind. -func (n *TableCell) Kind() gast.NodeKind { - return KindTableCell -} - -// NewTableCell returns a new TableCell node. -func NewTableCell() *TableCell { - return &TableCell{ - Alignment: AlignNone, - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/tasklist.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/tasklist.go deleted file mode 100644 index 670cc1495..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/ast/tasklist.go +++ /dev/null @@ -1,35 +0,0 @@ -package ast - -import ( - "fmt" - gast "github.com/yuin/goldmark/ast" -) - -// A TaskCheckBox struct represents a checkbox of a task list. -type TaskCheckBox struct { - gast.BaseInline - IsChecked bool -} - -// Dump implements Node.Dump. -func (n *TaskCheckBox) Dump(source []byte, level int) { - m := map[string]string{ - "Checked": fmt.Sprintf("%v", n.IsChecked), - } - gast.DumpHelper(n, source, level, m, nil) -} - -// KindTaskCheckBox is a NodeKind of the TaskCheckBox node. -var KindTaskCheckBox = gast.NewNodeKind("TaskCheckBox") - -// Kind implements Node.Kind. -func (n *TaskCheckBox) Kind() gast.NodeKind { - return KindTaskCheckBox -} - -// NewTaskCheckBox returns a new TaskCheckBox node. -func NewTaskCheckBox(checked bool) *TaskCheckBox { - return &TaskCheckBox{ - IsChecked: checked, - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/definition_list.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/definition_list.go deleted file mode 100644 index d2f5fecbe..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/definition_list.go +++ /dev/null @@ -1,270 +0,0 @@ -package extension - -import ( - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type definitionListParser struct { -} - -var defaultDefinitionListParser = &definitionListParser{} - -// NewDefinitionListParser return a new parser.BlockParser that -// can parse PHP Markdown Extra Definition lists. -func NewDefinitionListParser() parser.BlockParser { - return defaultDefinitionListParser -} - -func (b *definitionListParser) Trigger() []byte { - return []byte{':'} -} - -func (b *definitionListParser) Open(parent gast.Node, reader text.Reader, pc parser.Context) (gast.Node, parser.State) { - if _, ok := parent.(*ast.DefinitionList); ok { - return nil, parser.NoChildren - } - line, _ := reader.PeekLine() - pos := pc.BlockOffset() - indent := pc.BlockIndent() - if pos < 0 || line[pos] != ':' || indent != 0 { - return nil, parser.NoChildren - } - - last := parent.LastChild() - // need 1 or more spaces after ':' - w, _ := util.IndentWidth(line[pos+1:], pos+1) - if w < 1 { - return nil, parser.NoChildren - } - if w >= 8 { // starts with indented code - w = 5 - } - w += pos + 1 /* 1 = ':' */ - - para, lastIsParagraph := last.(*gast.Paragraph) - var list *ast.DefinitionList - status := parser.HasChildren - var ok bool - if lastIsParagraph { - list, ok = last.PreviousSibling().(*ast.DefinitionList) - if ok { // is not first item - list.Offset = w - list.TemporaryParagraph = para - } else { // is first item - list = ast.NewDefinitionList(w, para) - status |= parser.RequireParagraph - } - } else if list, ok = last.(*ast.DefinitionList); ok { // multiple description - list.Offset = w - list.TemporaryParagraph = nil - } else { - return nil, parser.NoChildren - } - - return list, status -} - -func (b *definitionListParser) Continue(node gast.Node, reader text.Reader, pc parser.Context) parser.State { - line, _ := reader.PeekLine() - if util.IsBlank(line) { - return parser.Continue | parser.HasChildren - } - list, _ := node.(*ast.DefinitionList) - w, _ := util.IndentWidth(line, reader.LineOffset()) - if w < list.Offset { - return parser.Close - } - pos, padding := util.IndentPosition(line, reader.LineOffset(), list.Offset) - reader.AdvanceAndSetPadding(pos, padding) - return parser.Continue | parser.HasChildren -} - -func (b *definitionListParser) Close(node gast.Node, reader text.Reader, pc parser.Context) { - // nothing to do -} - -func (b *definitionListParser) CanInterruptParagraph() bool { - return true -} - -func (b *definitionListParser) CanAcceptIndentedLine() bool { - return false -} - -type definitionDescriptionParser struct { -} - -var defaultDefinitionDescriptionParser = &definitionDescriptionParser{} - -// NewDefinitionDescriptionParser return a new parser.BlockParser that -// can parse definition description starts with ':'. -func NewDefinitionDescriptionParser() parser.BlockParser { - return defaultDefinitionDescriptionParser -} - -func (b *definitionDescriptionParser) Trigger() []byte { - return []byte{':'} -} - -func (b *definitionDescriptionParser) Open(parent gast.Node, reader text.Reader, pc parser.Context) (gast.Node, parser.State) { - line, _ := reader.PeekLine() - pos := pc.BlockOffset() - indent := pc.BlockIndent() - if pos < 0 || line[pos] != ':' || indent != 0 { - return nil, parser.NoChildren - } - list, _ := parent.(*ast.DefinitionList) - if list == nil { - return nil, parser.NoChildren - } - para := list.TemporaryParagraph - list.TemporaryParagraph = nil - if para != nil { - lines := para.Lines() - l := lines.Len() - for i := 0; i < l; i++ { - term := ast.NewDefinitionTerm() - segment := lines.At(i) - term.Lines().Append(segment.TrimRightSpace(reader.Source())) - list.AppendChild(list, term) - } - para.Parent().RemoveChild(para.Parent(), para) - } - cpos, padding := util.IndentPosition(line[pos+1:], pos+1, list.Offset-pos-1) - reader.AdvanceAndSetPadding(cpos+1, padding) - - return ast.NewDefinitionDescription(), parser.HasChildren -} - -func (b *definitionDescriptionParser) Continue(node gast.Node, reader text.Reader, pc parser.Context) parser.State { - // definitionListParser detects end of the description. - // so this method will never be called. - return parser.Continue | parser.HasChildren -} - -func (b *definitionDescriptionParser) Close(node gast.Node, reader text.Reader, pc parser.Context) { - desc := node.(*ast.DefinitionDescription) - desc.IsTight = !desc.HasBlankPreviousLines() - if desc.IsTight { - for gc := desc.FirstChild(); gc != nil; gc = gc.NextSibling() { - paragraph, ok := gc.(*gast.Paragraph) - if ok { - textBlock := gast.NewTextBlock() - textBlock.SetLines(paragraph.Lines()) - desc.ReplaceChild(desc, paragraph, textBlock) - } - } - } -} - -func (b *definitionDescriptionParser) CanInterruptParagraph() bool { - return true -} - -func (b *definitionDescriptionParser) CanAcceptIndentedLine() bool { - return false -} - -// DefinitionListHTMLRenderer is a renderer.NodeRenderer implementation that -// renders DefinitionList nodes. -type DefinitionListHTMLRenderer struct { - html.Config -} - -// NewDefinitionListHTMLRenderer returns a new DefinitionListHTMLRenderer. -func NewDefinitionListHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { - r := &DefinitionListHTMLRenderer{ - Config: html.NewConfig(), - } - for _, opt := range opts { - opt.SetHTMLOption(&r.Config) - } - return r -} - -// RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. -func (r *DefinitionListHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - reg.Register(ast.KindDefinitionList, r.renderDefinitionList) - reg.Register(ast.KindDefinitionTerm, r.renderDefinitionTerm) - reg.Register(ast.KindDefinitionDescription, r.renderDefinitionDescription) -} - -// DefinitionListAttributeFilter defines attribute names which dl elements can have. -var DefinitionListAttributeFilter = html.GlobalAttributeFilter - -func (r *DefinitionListHTMLRenderer) renderDefinitionList(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("\n") - } else { - _, _ = w.WriteString("
              \n") - } - } else { - _, _ = w.WriteString("
              \n") - } - return gast.WalkContinue, nil -} - -// DefinitionTermAttributeFilter defines attribute names which dd elements can have. -var DefinitionTermAttributeFilter = html.GlobalAttributeFilter - -func (r *DefinitionListHTMLRenderer) renderDefinitionTerm(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("
              ") - } - } else { - _, _ = w.WriteString("
              \n") - } - return gast.WalkContinue, nil -} - -// DefinitionDescriptionAttributeFilter defines attribute names which dd elements can have. -var DefinitionDescriptionAttributeFilter = html.GlobalAttributeFilter - -func (r *DefinitionListHTMLRenderer) renderDefinitionDescription(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - n := node.(*ast.DefinitionDescription) - _, _ = w.WriteString("") - } else { - _, _ = w.WriteString(">\n") - } - } else { - _, _ = w.WriteString("\n") - } - return gast.WalkContinue, nil -} - -type definitionList struct { -} - -// DefinitionList is an extension that allow you to use PHP Markdown Extra Definition lists. -var DefinitionList = &definitionList{} - -func (e *definitionList) Extend(m goldmark.Markdown) { - m.Parser().AddOptions(parser.WithBlockParsers( - util.Prioritized(NewDefinitionListParser(), 101), - util.Prioritized(NewDefinitionDescriptionParser(), 102), - )) - m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewDefinitionListHTMLRenderer(), 500), - )) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/definition_list_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/definition_list_test.go deleted file mode 100644 index d9dfa6cd8..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/definition_list_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package extension - -import ( - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -func TestDefinitionList(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - DefinitionList, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/definition_list.txt", t, testutil.ParseCliCaseArg()...) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/footnote.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/footnote.go deleted file mode 100644 index d4552e5a4..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/footnote.go +++ /dev/null @@ -1,670 +0,0 @@ -package extension - -import ( - "bytes" - "strconv" - - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var footnoteListKey = parser.NewContextKey() -var footnoteLinkListKey = parser.NewContextKey() - -type footnoteBlockParser struct { -} - -var defaultFootnoteBlockParser = &footnoteBlockParser{} - -// NewFootnoteBlockParser returns a new parser.BlockParser that can parse -// footnotes of the Markdown(PHP Markdown Extra) text. -func NewFootnoteBlockParser() parser.BlockParser { - return defaultFootnoteBlockParser -} - -func (b *footnoteBlockParser) Trigger() []byte { - return []byte{'['} -} - -func (b *footnoteBlockParser) Open(parent gast.Node, reader text.Reader, pc parser.Context) (gast.Node, parser.State) { - line, segment := reader.PeekLine() - pos := pc.BlockOffset() - if pos < 0 || line[pos] != '[' { - return nil, parser.NoChildren - } - pos++ - if pos > len(line)-1 || line[pos] != '^' { - return nil, parser.NoChildren - } - open := pos + 1 - closes := 0 - closure := util.FindClosure(line[pos+1:], '[', ']', false, false) - closes = pos + 1 + closure - next := closes + 1 - if closure > -1 { - if next >= len(line) || line[next] != ':' { - return nil, parser.NoChildren - } - } else { - return nil, parser.NoChildren - } - padding := segment.Padding - label := reader.Value(text.NewSegment(segment.Start+open-padding, segment.Start+closes-padding)) - if util.IsBlank(label) { - return nil, parser.NoChildren - } - item := ast.NewFootnote(label) - - pos = next + 1 - padding - if pos >= len(line) { - reader.Advance(pos) - return item, parser.NoChildren - } - reader.AdvanceAndSetPadding(pos, padding) - return item, parser.HasChildren -} - -func (b *footnoteBlockParser) Continue(node gast.Node, reader text.Reader, pc parser.Context) parser.State { - line, _ := reader.PeekLine() - if util.IsBlank(line) { - return parser.Continue | parser.HasChildren - } - childpos, padding := util.IndentPosition(line, reader.LineOffset(), 4) - if childpos < 0 { - return parser.Close - } - reader.AdvanceAndSetPadding(childpos, padding) - return parser.Continue | parser.HasChildren -} - -func (b *footnoteBlockParser) Close(node gast.Node, reader text.Reader, pc parser.Context) { - var list *ast.FootnoteList - if tlist := pc.Get(footnoteListKey); tlist != nil { - list = tlist.(*ast.FootnoteList) - } else { - list = ast.NewFootnoteList() - pc.Set(footnoteListKey, list) - node.Parent().InsertBefore(node.Parent(), node, list) - } - node.Parent().RemoveChild(node.Parent(), node) - list.AppendChild(list, node) -} - -func (b *footnoteBlockParser) CanInterruptParagraph() bool { - return true -} - -func (b *footnoteBlockParser) CanAcceptIndentedLine() bool { - return false -} - -type footnoteParser struct { -} - -var defaultFootnoteParser = &footnoteParser{} - -// NewFootnoteParser returns a new parser.InlineParser that can parse -// footnote links of the Markdown(PHP Markdown Extra) text. -func NewFootnoteParser() parser.InlineParser { - return defaultFootnoteParser -} - -func (s *footnoteParser) Trigger() []byte { - // footnote syntax probably conflict with the image syntax. - // So we need trigger this parser with '!'. - return []byte{'!', '['} -} - -func (s *footnoteParser) Parse(parent gast.Node, block text.Reader, pc parser.Context) gast.Node { - line, segment := block.PeekLine() - pos := 1 - if len(line) > 0 && line[0] == '!' { - pos++ - } - if pos >= len(line) || line[pos] != '^' { - return nil - } - pos++ - if pos >= len(line) { - return nil - } - open := pos - closure := util.FindClosure(line[pos:], '[', ']', false, false) - if closure < 0 { - return nil - } - closes := pos + closure - value := block.Value(text.NewSegment(segment.Start+open, segment.Start+closes)) - block.Advance(closes + 1) - - var list *ast.FootnoteList - if tlist := pc.Get(footnoteListKey); tlist != nil { - list = tlist.(*ast.FootnoteList) - } - if list == nil { - return nil - } - index := 0 - for def := list.FirstChild(); def != nil; def = def.NextSibling() { - d := def.(*ast.Footnote) - if bytes.Equal(d.Ref, value) { - if d.Index < 0 { - list.Count += 1 - d.Index = list.Count - } - index = d.Index - break - } - } - if index == 0 { - return nil - } - - fnlink := ast.NewFootnoteLink(index) - var fnlist []*ast.FootnoteLink - if tmp := pc.Get(footnoteLinkListKey); tmp != nil { - fnlist = tmp.([]*ast.FootnoteLink) - } else { - fnlist = []*ast.FootnoteLink{} - pc.Set(footnoteLinkListKey, fnlist) - } - pc.Set(footnoteLinkListKey, append(fnlist, fnlink)) - if line[0] == '!' { - parent.AppendChild(parent, gast.NewTextSegment(text.NewSegment(segment.Start, segment.Start+1))) - } - - return fnlink -} - -type footnoteASTTransformer struct { -} - -var defaultFootnoteASTTransformer = &footnoteASTTransformer{} - -// NewFootnoteASTTransformer returns a new parser.ASTTransformer that -// insert a footnote list to the last of the document. -func NewFootnoteASTTransformer() parser.ASTTransformer { - return defaultFootnoteASTTransformer -} - -func (a *footnoteASTTransformer) Transform(node *gast.Document, reader text.Reader, pc parser.Context) { - var list *ast.FootnoteList - var fnlist []*ast.FootnoteLink - if tmp := pc.Get(footnoteListKey); tmp != nil { - list = tmp.(*ast.FootnoteList) - } - if tmp := pc.Get(footnoteLinkListKey); tmp != nil { - fnlist = tmp.([]*ast.FootnoteLink) - } - - pc.Set(footnoteListKey, nil) - pc.Set(footnoteLinkListKey, nil) - - if list == nil { - return - } - - counter := map[int]int{} - if fnlist != nil { - for _, fnlink := range fnlist { - if fnlink.Index >= 0 { - counter[fnlink.Index]++ - } - } - for _, fnlink := range fnlist { - fnlink.RefCount = counter[fnlink.Index] - } - } - for footnote := list.FirstChild(); footnote != nil; { - var container gast.Node = footnote - next := footnote.NextSibling() - if fc := container.LastChild(); fc != nil && gast.IsParagraph(fc) { - container = fc - } - fn := footnote.(*ast.Footnote) - index := fn.Index - if index < 0 { - list.RemoveChild(list, footnote) - } else { - backLink := ast.NewFootnoteBacklink(index) - backLink.RefCount = counter[index] - container.AppendChild(container, backLink) - } - footnote = next - } - list.SortChildren(func(n1, n2 gast.Node) int { - if n1.(*ast.Footnote).Index < n2.(*ast.Footnote).Index { - return -1 - } - return 1 - }) - if list.Count <= 0 { - list.Parent().RemoveChild(list.Parent(), list) - return - } - - node.AppendChild(node, list) -} - -// FootnoteConfig holds configuration values for the footnote extension. -// -// Link* and Backlink* configurations have some variables: -// Occurrances of “^^” in the string will be replaced by the -// corresponding footnote number in the HTML output. -// Occurrances of “%%” will be replaced by a number for the -// reference (footnotes can have multiple references). -type FootnoteConfig struct { - html.Config - - // IDPrefix is a prefix for the id attributes generated by footnotes. - IDPrefix []byte - - // IDPrefix is a function that determines the id attribute for given Node. - IDPrefixFunction func(gast.Node) []byte - - // LinkTitle is an optional title attribute for footnote links. - LinkTitle []byte - - // BacklinkTitle is an optional title attribute for footnote backlinks. - BacklinkTitle []byte - - // LinkClass is a class for footnote links. - LinkClass []byte - - // BacklinkClass is a class for footnote backlinks. - BacklinkClass []byte - - // BacklinkHTML is an HTML content for footnote backlinks. - BacklinkHTML []byte -} - -// FootnoteOption interface is a functional option interface for the extension. -type FootnoteOption interface { - renderer.Option - // SetFootnoteOption sets given option to the extension. - SetFootnoteOption(*FootnoteConfig) -} - -// NewFootnoteConfig returns a new Config with defaults. -func NewFootnoteConfig() FootnoteConfig { - return FootnoteConfig{ - Config: html.NewConfig(), - LinkTitle: []byte(""), - BacklinkTitle: []byte(""), - LinkClass: []byte("footnote-ref"), - BacklinkClass: []byte("footnote-backref"), - BacklinkHTML: []byte("↩︎"), - } -} - -// SetOption implements renderer.SetOptioner. -func (c *FootnoteConfig) SetOption(name renderer.OptionName, value interface{}) { - switch name { - case optFootnoteIDPrefixFunction: - c.IDPrefixFunction = value.(func(gast.Node) []byte) - case optFootnoteIDPrefix: - c.IDPrefix = value.([]byte) - case optFootnoteLinkTitle: - c.LinkTitle = value.([]byte) - case optFootnoteBacklinkTitle: - c.BacklinkTitle = value.([]byte) - case optFootnoteLinkClass: - c.LinkClass = value.([]byte) - case optFootnoteBacklinkClass: - c.BacklinkClass = value.([]byte) - case optFootnoteBacklinkHTML: - c.BacklinkHTML = value.([]byte) - default: - c.Config.SetOption(name, value) - } -} - -type withFootnoteHTMLOptions struct { - value []html.Option -} - -func (o *withFootnoteHTMLOptions) SetConfig(c *renderer.Config) { - if o.value != nil { - for _, v := range o.value { - v.(renderer.Option).SetConfig(c) - } - } -} - -func (o *withFootnoteHTMLOptions) SetFootnoteOption(c *FootnoteConfig) { - if o.value != nil { - for _, v := range o.value { - v.SetHTMLOption(&c.Config) - } - } -} - -// WithFootnoteHTMLOptions is functional option that wraps goldmark HTMLRenderer options. -func WithFootnoteHTMLOptions(opts ...html.Option) FootnoteOption { - return &withFootnoteHTMLOptions{opts} -} - -const optFootnoteIDPrefix renderer.OptionName = "FootnoteIDPrefix" - -type withFootnoteIDPrefix struct { - value []byte -} - -func (o *withFootnoteIDPrefix) SetConfig(c *renderer.Config) { - c.Options[optFootnoteIDPrefix] = o.value -} - -func (o *withFootnoteIDPrefix) SetFootnoteOption(c *FootnoteConfig) { - c.IDPrefix = o.value -} - -// WithFootnoteIDPrefix is a functional option that is a prefix for the id attributes generated by footnotes. -func WithFootnoteIDPrefix(a []byte) FootnoteOption { - return &withFootnoteIDPrefix{a} -} - -const optFootnoteIDPrefixFunction renderer.OptionName = "FootnoteIDPrefixFunction" - -type withFootnoteIDPrefixFunction struct { - value func(gast.Node) []byte -} - -func (o *withFootnoteIDPrefixFunction) SetConfig(c *renderer.Config) { - c.Options[optFootnoteIDPrefixFunction] = o.value -} - -func (o *withFootnoteIDPrefixFunction) SetFootnoteOption(c *FootnoteConfig) { - c.IDPrefixFunction = o.value -} - -// WithFootnoteIDPrefixFunction is a functional option that is a prefix for the id attributes generated by footnotes. -func WithFootnoteIDPrefixFunction(a func(gast.Node) []byte) FootnoteOption { - return &withFootnoteIDPrefixFunction{a} -} - -const optFootnoteLinkTitle renderer.OptionName = "FootnoteLinkTitle" - -type withFootnoteLinkTitle struct { - value []byte -} - -func (o *withFootnoteLinkTitle) SetConfig(c *renderer.Config) { - c.Options[optFootnoteLinkTitle] = o.value -} - -func (o *withFootnoteLinkTitle) SetFootnoteOption(c *FootnoteConfig) { - c.LinkTitle = o.value -} - -// WithFootnoteLinkTitle is a functional option that is an optional title attribute for footnote links. -func WithFootnoteLinkTitle(a []byte) FootnoteOption { - return &withFootnoteLinkTitle{a} -} - -const optFootnoteBacklinkTitle renderer.OptionName = "FootnoteBacklinkTitle" - -type withFootnoteBacklinkTitle struct { - value []byte -} - -func (o *withFootnoteBacklinkTitle) SetConfig(c *renderer.Config) { - c.Options[optFootnoteBacklinkTitle] = o.value -} - -func (o *withFootnoteBacklinkTitle) SetFootnoteOption(c *FootnoteConfig) { - c.BacklinkTitle = o.value -} - -// WithFootnoteBacklinkTitle is a functional option that is an optional title attribute for footnote backlinks. -func WithFootnoteBacklinkTitle(a []byte) FootnoteOption { - return &withFootnoteBacklinkTitle{a} -} - -const optFootnoteLinkClass renderer.OptionName = "FootnoteLinkClass" - -type withFootnoteLinkClass struct { - value []byte -} - -func (o *withFootnoteLinkClass) SetConfig(c *renderer.Config) { - c.Options[optFootnoteLinkClass] = o.value -} - -func (o *withFootnoteLinkClass) SetFootnoteOption(c *FootnoteConfig) { - c.LinkClass = o.value -} - -// WithFootnoteLinkClass is a functional option that is a class for footnote links. -func WithFootnoteLinkClass(a []byte) FootnoteOption { - return &withFootnoteLinkClass{a} -} - -const optFootnoteBacklinkClass renderer.OptionName = "FootnoteBacklinkClass" - -type withFootnoteBacklinkClass struct { - value []byte -} - -func (o *withFootnoteBacklinkClass) SetConfig(c *renderer.Config) { - c.Options[optFootnoteBacklinkClass] = o.value -} - -func (o *withFootnoteBacklinkClass) SetFootnoteOption(c *FootnoteConfig) { - c.BacklinkClass = o.value -} - -// WithFootnoteBacklinkClass is a functional option that is a class for footnote backlinks. -func WithFootnoteBacklinkClass(a []byte) FootnoteOption { - return &withFootnoteBacklinkClass{a} -} - -const optFootnoteBacklinkHTML renderer.OptionName = "FootnoteBacklinkHTML" - -type withFootnoteBacklinkHTML struct { - value []byte -} - -func (o *withFootnoteBacklinkHTML) SetConfig(c *renderer.Config) { - c.Options[optFootnoteBacklinkHTML] = o.value -} - -func (o *withFootnoteBacklinkHTML) SetFootnoteOption(c *FootnoteConfig) { - c.BacklinkHTML = o.value -} - -// WithFootnoteBacklinkHTML is an HTML content for footnote backlinks. -func WithFootnoteBacklinkHTML(a []byte) FootnoteOption { - return &withFootnoteBacklinkHTML{a} -} - -// FootnoteHTMLRenderer is a renderer.NodeRenderer implementation that -// renders FootnoteLink nodes. -type FootnoteHTMLRenderer struct { - FootnoteConfig -} - -// NewFootnoteHTMLRenderer returns a new FootnoteHTMLRenderer. -func NewFootnoteHTMLRenderer(opts ...FootnoteOption) renderer.NodeRenderer { - r := &FootnoteHTMLRenderer{ - FootnoteConfig: NewFootnoteConfig(), - } - for _, opt := range opts { - opt.SetFootnoteOption(&r.FootnoteConfig) - } - return r -} - -// RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. -func (r *FootnoteHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - reg.Register(ast.KindFootnoteLink, r.renderFootnoteLink) - reg.Register(ast.KindFootnoteBacklink, r.renderFootnoteBacklink) - reg.Register(ast.KindFootnote, r.renderFootnote) - reg.Register(ast.KindFootnoteList, r.renderFootnoteList) -} - -func (r *FootnoteHTMLRenderer) renderFootnoteLink(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - n := node.(*ast.FootnoteLink) - is := strconv.Itoa(n.Index) - _, _ = w.WriteString(``) - - _, _ = w.WriteString(is) - _, _ = w.WriteString(``) - } - return gast.WalkContinue, nil -} - -func (r *FootnoteHTMLRenderer) renderFootnoteBacklink(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - n := node.(*ast.FootnoteBacklink) - is := strconv.Itoa(n.Index) - _, _ = w.WriteString(` `) - _, _ = w.Write(applyFootnoteTemplate(r.FootnoteConfig.BacklinkHTML, n.Index, n.RefCount)) - _, _ = w.WriteString(``) - } - return gast.WalkContinue, nil -} - -func (r *FootnoteHTMLRenderer) renderFootnote(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - n := node.(*ast.Footnote) - is := strconv.Itoa(n.Index) - if entering { - _, _ = w.WriteString(`
            • \n") - } else { - _, _ = w.WriteString("
            • \n") - } - return gast.WalkContinue, nil -} - -func (r *FootnoteHTMLRenderer) renderFootnoteList(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - tag := "section" - if r.Config.XHTML { - tag = "div" - } - if entering { - _, _ = w.WriteString("<") - _, _ = w.WriteString(tag) - _, _ = w.WriteString(` class="footnotes" role="doc-endnotes"`) - if node.Attributes() != nil { - html.RenderAttributes(w, node, html.GlobalAttributeFilter) - } - _ = w.WriteByte('>') - if r.Config.XHTML { - _, _ = w.WriteString("\n
              \n") - } else { - _, _ = w.WriteString("\n
              \n") - } - _, _ = w.WriteString("
                \n") - } else { - _, _ = w.WriteString("
              \n") - _, _ = w.WriteString("\n") - } - return gast.WalkContinue, nil -} - -func (r *FootnoteHTMLRenderer) idPrefix(node gast.Node) []byte { - if r.FootnoteConfig.IDPrefix != nil { - return r.FootnoteConfig.IDPrefix - } - if r.FootnoteConfig.IDPrefixFunction != nil { - return r.FootnoteConfig.IDPrefixFunction(node) - } - return []byte("") -} - -func applyFootnoteTemplate(b []byte, index, refCount int) []byte { - fast := true - for i, c := range b { - if i != 0 { - if b[i-1] == '^' && c == '^' { - fast = false - break - } - if b[i-1] == '%' && c == '%' { - fast = false - break - } - } - } - if fast { - return b - } - is := []byte(strconv.Itoa(index)) - rs := []byte(strconv.Itoa(refCount)) - ret := bytes.Replace(b, []byte("^^"), is, -1) - return bytes.Replace(ret, []byte("%%"), rs, -1) -} - -type footnote struct { - options []FootnoteOption -} - -// Footnote is an extension that allow you to use PHP Markdown Extra Footnotes. -var Footnote = &footnote{ - options: []FootnoteOption{}, -} - -// NewFootnote returns a new extension with given options. -func NewFootnote(opts ...FootnoteOption) goldmark.Extender { - return &footnote{ - options: opts, - } -} - -func (e *footnote) Extend(m goldmark.Markdown) { - m.Parser().AddOptions( - parser.WithBlockParsers( - util.Prioritized(NewFootnoteBlockParser(), 999), - ), - parser.WithInlineParsers( - util.Prioritized(NewFootnoteParser(), 101), - ), - parser.WithASTTransformers( - util.Prioritized(NewFootnoteASTTransformer(), 999), - ), - ) - m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewFootnoteHTMLRenderer(e.options...), 500), - )) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/footnote_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/footnote_test.go deleted file mode 100644 index c3f477066..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/footnote_test.go +++ /dev/null @@ -1,143 +0,0 @@ -package extension - -import ( - "testing" - - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -func TestFootnote(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - Footnote, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/footnote.txt", t, testutil.ParseCliCaseArg()...) -} - -type footnoteID struct { -} - -func (a *footnoteID) Transform(node *gast.Document, reader text.Reader, pc parser.Context) { - node.Meta()["footnote-prefix"] = "article12-" -} - -func TestFootnoteOptions(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewFootnote( - WithFootnoteIDPrefix([]byte("article12-")), - WithFootnoteLinkClass([]byte("link-class")), - WithFootnoteBacklinkClass([]byte("backlink-class")), - WithFootnoteLinkTitle([]byte("link-title-%%-^^")), - WithFootnoteBacklinkTitle([]byte("backlink-title")), - WithFootnoteBacklinkHTML([]byte("^")), - ), - ), - ) - - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Description: "Footnote with options", - Markdown: `That's some text with a footnote.[^1] - -Same footnote.[^1] - -Another one.[^2] - -[^1]: And that's the footnote. -[^2]: Another footnote. -`, - Expected: `

              That's some text with a footnote.1

              -

              Same footnote.1

              -

              Another one.2

              -
              -
              -
                -
              1. -

                And that's the footnote. ^

                -
              2. -
              3. -

                Another footnote. ^

                -
              4. -
              -
              -`, - }, - t, - ) - - markdown = goldmark.New( - goldmark.WithParserOptions( - parser.WithASTTransformers( - util.Prioritized(&footnoteID{}, 100), - ), - ), - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewFootnote( - WithFootnoteIDPrefixFunction(func(n gast.Node) []byte { - v, ok := n.OwnerDocument().Meta()["footnote-prefix"] - if ok { - return util.StringToReadOnlyBytes(v.(string)) - } - return nil - }), - WithFootnoteLinkClass([]byte("link-class")), - WithFootnoteBacklinkClass([]byte("backlink-class")), - WithFootnoteLinkTitle([]byte("link-title-%%-^^")), - WithFootnoteBacklinkTitle([]byte("backlink-title")), - WithFootnoteBacklinkHTML([]byte("^")), - ), - ), - ) - - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 2, - Description: "Footnote with an id prefix function", - Markdown: `That's some text with a footnote.[^1] - -Same footnote.[^1] - -Another one.[^2] - -[^1]: And that's the footnote. -[^2]: Another footnote. -`, - Expected: `

              That's some text with a footnote.1

              -

              Same footnote.1

              -

              Another one.2

              -
              -
              -
                -
              1. -

                And that's the footnote. ^

                -
              2. -
              3. -

                Another footnote. ^

                -
              4. -
              -
              -`, - }, - t, - ) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/gfm.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/gfm.go deleted file mode 100644 index a570fbdb3..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/gfm.go +++ /dev/null @@ -1,18 +0,0 @@ -package extension - -import ( - "github.com/yuin/goldmark" -) - -type gfm struct { -} - -// GFM is an extension that provides Github Flavored markdown functionalities. -var GFM = &gfm{} - -func (e *gfm) Extend(m goldmark.Markdown) { - Linkify.Extend(m) - Table.Extend(m) - Strikethrough.Extend(m) - TaskList.Extend(m) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/linkify.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/linkify.go deleted file mode 100644 index 2f046eb54..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/linkify.go +++ /dev/null @@ -1,318 +0,0 @@ -package extension - -import ( - "bytes" - "regexp" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]+(?:[/#?][-a-zA-Z0-9@:%_\+.~#!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) - -var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp)://[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]+(?::\d+)?(?:[/#?][-a-zA-Z0-9@:%_+.~#$!?&/=\(\);,'">\^{}\[\]` + "`" + `]*)?`) - -// An LinkifyConfig struct is a data structure that holds configuration of the -// Linkify extension. -type LinkifyConfig struct { - AllowedProtocols [][]byte - URLRegexp *regexp.Regexp - WWWRegexp *regexp.Regexp - EmailRegexp *regexp.Regexp -} - -const ( - optLinkifyAllowedProtocols parser.OptionName = "LinkifyAllowedProtocols" - optLinkifyURLRegexp parser.OptionName = "LinkifyURLRegexp" - optLinkifyWWWRegexp parser.OptionName = "LinkifyWWWRegexp" - optLinkifyEmailRegexp parser.OptionName = "LinkifyEmailRegexp" -) - -// SetOption implements SetOptioner. -func (c *LinkifyConfig) SetOption(name parser.OptionName, value interface{}) { - switch name { - case optLinkifyAllowedProtocols: - c.AllowedProtocols = value.([][]byte) - case optLinkifyURLRegexp: - c.URLRegexp = value.(*regexp.Regexp) - case optLinkifyWWWRegexp: - c.WWWRegexp = value.(*regexp.Regexp) - case optLinkifyEmailRegexp: - c.EmailRegexp = value.(*regexp.Regexp) - } -} - -// A LinkifyOption interface sets options for the LinkifyOption. -type LinkifyOption interface { - parser.Option - SetLinkifyOption(*LinkifyConfig) -} - -type withLinkifyAllowedProtocols struct { - value [][]byte -} - -func (o *withLinkifyAllowedProtocols) SetParserOption(c *parser.Config) { - c.Options[optLinkifyAllowedProtocols] = o.value -} - -func (o *withLinkifyAllowedProtocols) SetLinkifyOption(p *LinkifyConfig) { - p.AllowedProtocols = o.value -} - -// WithLinkifyAllowedProtocols is a functional option that specify allowed -// protocols in autolinks. Each protocol must end with ':' like -// 'http:' . -func WithLinkifyAllowedProtocols(value [][]byte) LinkifyOption { - return &withLinkifyAllowedProtocols{ - value: value, - } -} - -type withLinkifyURLRegexp struct { - value *regexp.Regexp -} - -func (o *withLinkifyURLRegexp) SetParserOption(c *parser.Config) { - c.Options[optLinkifyURLRegexp] = o.value -} - -func (o *withLinkifyURLRegexp) SetLinkifyOption(p *LinkifyConfig) { - p.URLRegexp = o.value -} - -// WithLinkifyURLRegexp is a functional option that specify -// a pattern of the URL including a protocol. -func WithLinkifyURLRegexp(value *regexp.Regexp) LinkifyOption { - return &withLinkifyURLRegexp{ - value: value, - } -} - -// WithLinkifyWWWRegexp is a functional option that specify -// a pattern of the URL without a protocol. -// This pattern must start with 'www.' . -type withLinkifyWWWRegexp struct { - value *regexp.Regexp -} - -func (o *withLinkifyWWWRegexp) SetParserOption(c *parser.Config) { - c.Options[optLinkifyWWWRegexp] = o.value -} - -func (o *withLinkifyWWWRegexp) SetLinkifyOption(p *LinkifyConfig) { - p.WWWRegexp = o.value -} - -func WithLinkifyWWWRegexp(value *regexp.Regexp) LinkifyOption { - return &withLinkifyWWWRegexp{ - value: value, - } -} - -// WithLinkifyWWWRegexp is a functional otpion that specify -// a pattern of the email address. -type withLinkifyEmailRegexp struct { - value *regexp.Regexp -} - -func (o *withLinkifyEmailRegexp) SetParserOption(c *parser.Config) { - c.Options[optLinkifyEmailRegexp] = o.value -} - -func (o *withLinkifyEmailRegexp) SetLinkifyOption(p *LinkifyConfig) { - p.EmailRegexp = o.value -} - -func WithLinkifyEmailRegexp(value *regexp.Regexp) LinkifyOption { - return &withLinkifyEmailRegexp{ - value: value, - } -} - -type linkifyParser struct { - LinkifyConfig -} - -// NewLinkifyParser return a new InlineParser can parse -// text that seems like a URL. -func NewLinkifyParser(opts ...LinkifyOption) parser.InlineParser { - p := &linkifyParser{ - LinkifyConfig: LinkifyConfig{ - AllowedProtocols: nil, - URLRegexp: urlRegexp, - WWWRegexp: wwwURLRegxp, - }, - } - for _, o := range opts { - o.SetLinkifyOption(&p.LinkifyConfig) - } - return p -} - -func (s *linkifyParser) Trigger() []byte { - // ' ' indicates any white spaces and a line head - return []byte{' ', '*', '_', '~', '('} -} - -var ( - protoHTTP = []byte("http:") - protoHTTPS = []byte("https:") - protoFTP = []byte("ftp:") - domainWWW = []byte("www.") -) - -func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Context) ast.Node { - if pc.IsInLinkLabel() { - return nil - } - line, segment := block.PeekLine() - consumes := 0 - start := segment.Start - c := line[0] - // advance if current position is not a line head. - if c == ' ' || c == '*' || c == '_' || c == '~' || c == '(' { - consumes++ - start++ - line = line[1:] - } - - var m []int - var protocol []byte - var typ ast.AutoLinkType = ast.AutoLinkURL - if s.LinkifyConfig.AllowedProtocols == nil { - if bytes.HasPrefix(line, protoHTTP) || bytes.HasPrefix(line, protoHTTPS) || bytes.HasPrefix(line, protoFTP) { - m = s.LinkifyConfig.URLRegexp.FindSubmatchIndex(line) - } - } else { - for _, prefix := range s.LinkifyConfig.AllowedProtocols { - if bytes.HasPrefix(line, prefix) { - m = s.LinkifyConfig.URLRegexp.FindSubmatchIndex(line) - break - } - } - } - if m == nil && bytes.HasPrefix(line, domainWWW) { - m = s.LinkifyConfig.WWWRegexp.FindSubmatchIndex(line) - protocol = []byte("http") - } - if m != nil && m[0] != 0 { - m = nil - } - if m != nil && m[0] == 0 { - lastChar := line[m[1]-1] - if lastChar == '.' { - m[1]-- - } else if lastChar == ')' { - closing := 0 - for i := m[1] - 1; i >= m[0]; i-- { - if line[i] == ')' { - closing++ - } else if line[i] == '(' { - closing-- - } - } - if closing > 0 { - m[1] -= closing - } - } else if lastChar == ';' { - i := m[1] - 2 - for ; i >= m[0]; i-- { - if util.IsAlphaNumeric(line[i]) { - continue - } - break - } - if i != m[1]-2 { - if line[i] == '&' { - m[1] -= m[1] - i - } - } - } - } - if m == nil { - if len(line) > 0 && util.IsPunct(line[0]) { - return nil - } - typ = ast.AutoLinkEmail - stop := -1 - if s.LinkifyConfig.EmailRegexp == nil { - stop = util.FindEmailIndex(line) - } else { - m := s.LinkifyConfig.EmailRegexp.FindSubmatchIndex(line) - if m != nil && m[0] == 0 { - stop = m[1] - } - } - if stop < 0 { - return nil - } - at := bytes.IndexByte(line, '@') - m = []int{0, stop, at, stop - 1} - if m == nil || bytes.IndexByte(line[m[2]:m[3]], '.') < 0 { - return nil - } - lastChar := line[m[1]-1] - if lastChar == '.' { - m[1]-- - } - if m[1] < len(line) { - nextChar := line[m[1]] - if nextChar == '-' || nextChar == '_' { - return nil - } - } - } - if m == nil { - return nil - } - if consumes != 0 { - s := segment.WithStop(segment.Start + 1) - ast.MergeOrAppendTextSegment(parent, s) - } - i := m[1] - 1 - for ; i > 0; i-- { - c := line[i] - switch c { - case '?', '!', '.', ',', ':', '*', '_', '~': - default: - goto endfor - } - } -endfor: - i++ - consumes += i - block.Advance(consumes) - n := ast.NewTextSegment(text.NewSegment(start, start+i)) - link := ast.NewAutoLink(typ, n) - link.Protocol = protocol - return link -} - -func (s *linkifyParser) CloseBlock(parent ast.Node, pc parser.Context) { - // nothing to do -} - -type linkify struct { - options []LinkifyOption -} - -// Linkify is an extension that allow you to parse text that seems like a URL. -var Linkify = &linkify{} - -func NewLinkify(opts ...LinkifyOption) goldmark.Extender { - return &linkify{ - options: opts, - } -} - -func (e *linkify) Extend(m goldmark.Markdown) { - m.Parser().AddOptions( - parser.WithInlineParsers( - util.Prioritized(NewLinkifyParser(e.options...), 999), - ), - ) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/linkify_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/linkify_test.go deleted file mode 100644 index d096acabc..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/linkify_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package extension - -import ( - "regexp" - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -func TestLinkify(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - Linkify, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/linkify.txt", t, testutil.ParseCliCaseArg()...) -} - -func TestLinkifyWithAllowedProtocols(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewLinkify( - WithLinkifyAllowedProtocols([][]byte{ - []byte("ssh:"), - }), - WithLinkifyURLRegexp( - regexp.MustCompile(`\w+://[^\s]+`), - ), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Markdown: `hoge ssh://user@hoge.com. http://example.com/`, - Expected: `

              hoge ssh://user@hoge.com. http://example.com/

              `, - }, - t, - ) -} - -func TestLinkifyWithWWWRegexp(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewLinkify( - WithLinkifyWWWRegexp( - regexp.MustCompile(`www\.example\.com`), - ), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Markdown: `www.google.com www.example.com`, - Expected: `

              www.google.com www.example.com

              `, - }, - t, - ) -} - -func TestLinkifyWithEmailRegexp(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewLinkify( - WithLinkifyEmailRegexp( - regexp.MustCompile(`user@example\.com`), - ), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Markdown: `hoge@example.com user@example.com`, - Expected: `

              hoge@example.com user@example.com

              `, - }, - t, - ) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/strikethrough.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/strikethrough.go deleted file mode 100644 index 1b629ad8f..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/strikethrough.go +++ /dev/null @@ -1,116 +0,0 @@ -package extension - -import ( - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type strikethroughDelimiterProcessor struct { -} - -func (p *strikethroughDelimiterProcessor) IsDelimiter(b byte) bool { - return b == '~' -} - -func (p *strikethroughDelimiterProcessor) CanOpenCloser(opener, closer *parser.Delimiter) bool { - return opener.Char == closer.Char -} - -func (p *strikethroughDelimiterProcessor) OnMatch(consumes int) gast.Node { - return ast.NewStrikethrough() -} - -var defaultStrikethroughDelimiterProcessor = &strikethroughDelimiterProcessor{} - -type strikethroughParser struct { -} - -var defaultStrikethroughParser = &strikethroughParser{} - -// NewStrikethroughParser return a new InlineParser that parses -// strikethrough expressions. -func NewStrikethroughParser() parser.InlineParser { - return defaultStrikethroughParser -} - -func (s *strikethroughParser) Trigger() []byte { - return []byte{'~'} -} - -func (s *strikethroughParser) Parse(parent gast.Node, block text.Reader, pc parser.Context) gast.Node { - before := block.PrecendingCharacter() - line, segment := block.PeekLine() - node := parser.ScanDelimiter(line, before, 2, defaultStrikethroughDelimiterProcessor) - if node == nil { - return nil - } - node.Segment = segment.WithStop(segment.Start + node.OriginalLength) - block.Advance(node.OriginalLength) - pc.PushDelimiter(node) - return node -} - -func (s *strikethroughParser) CloseBlock(parent gast.Node, pc parser.Context) { - // nothing to do -} - -// StrikethroughHTMLRenderer is a renderer.NodeRenderer implementation that -// renders Strikethrough nodes. -type StrikethroughHTMLRenderer struct { - html.Config -} - -// NewStrikethroughHTMLRenderer returns a new StrikethroughHTMLRenderer. -func NewStrikethroughHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { - r := &StrikethroughHTMLRenderer{ - Config: html.NewConfig(), - } - for _, opt := range opts { - opt.SetHTMLOption(&r.Config) - } - return r -} - -// RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. -func (r *StrikethroughHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - reg.Register(ast.KindStrikethrough, r.renderStrikethrough) -} - -// StrikethroughAttributeFilter defines attribute names which dd elements can have. -var StrikethroughAttributeFilter = html.GlobalAttributeFilter - -func (r *StrikethroughHTMLRenderer) renderStrikethrough(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("") - } - } else { - _, _ = w.WriteString("") - } - return gast.WalkContinue, nil -} - -type strikethrough struct { -} - -// Strikethrough is an extension that allow you to use strikethrough expression like '~~text~~' . -var Strikethrough = &strikethrough{} - -func (e *strikethrough) Extend(m goldmark.Markdown) { - m.Parser().AddOptions(parser.WithInlineParsers( - util.Prioritized(NewStrikethroughParser(), 500), - )) - m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewStrikethroughHTMLRenderer(), 500), - )) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/strikethrough_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/strikethrough_test.go deleted file mode 100644 index 3274c0e04..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/strikethrough_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package extension - -import ( - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -func TestStrikethrough(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - Strikethrough, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/strikethrough.txt", t, testutil.ParseCliCaseArg()...) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/table.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/table.go deleted file mode 100644 index c637b99f0..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/table.go +++ /dev/null @@ -1,552 +0,0 @@ -package extension - -import ( - "bytes" - "fmt" - "regexp" - - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var escapedPipeCellListKey = parser.NewContextKey() - -type escapedPipeCell struct { - Cell *ast.TableCell - Pos []int - Transformed bool -} - -// TableCellAlignMethod indicates how are table cells aligned in HTML format.indicates how are table cells aligned in HTML format. -type TableCellAlignMethod int - -const ( - // TableCellAlignDefault renders alignments by default method. - // With XHTML, alignments are rendered as an align attribute. - // With HTML5, alignments are rendered as a style attribute. - TableCellAlignDefault TableCellAlignMethod = iota - - // TableCellAlignAttribute renders alignments as an align attribute. - TableCellAlignAttribute - - // TableCellAlignStyle renders alignments as a style attribute. - TableCellAlignStyle - - // TableCellAlignNone does not care about alignments. - // If you using classes or other styles, you can add these attributes - // in an ASTTransformer. - TableCellAlignNone -) - -// TableConfig struct holds options for the extension. -type TableConfig struct { - html.Config - - // TableCellAlignMethod indicates how are table celss aligned. - TableCellAlignMethod TableCellAlignMethod -} - -// TableOption interface is a functional option interface for the extension. -type TableOption interface { - renderer.Option - // SetTableOption sets given option to the extension. - SetTableOption(*TableConfig) -} - -// NewTableConfig returns a new Config with defaults. -func NewTableConfig() TableConfig { - return TableConfig{ - Config: html.NewConfig(), - TableCellAlignMethod: TableCellAlignDefault, - } -} - -// SetOption implements renderer.SetOptioner. -func (c *TableConfig) SetOption(name renderer.OptionName, value interface{}) { - switch name { - case optTableCellAlignMethod: - c.TableCellAlignMethod = value.(TableCellAlignMethod) - default: - c.Config.SetOption(name, value) - } -} - -type withTableHTMLOptions struct { - value []html.Option -} - -func (o *withTableHTMLOptions) SetConfig(c *renderer.Config) { - if o.value != nil { - for _, v := range o.value { - v.(renderer.Option).SetConfig(c) - } - } -} - -func (o *withTableHTMLOptions) SetTableOption(c *TableConfig) { - if o.value != nil { - for _, v := range o.value { - v.SetHTMLOption(&c.Config) - } - } -} - -// WithTableHTMLOptions is functional option that wraps goldmark HTMLRenderer options. -func WithTableHTMLOptions(opts ...html.Option) TableOption { - return &withTableHTMLOptions{opts} -} - -const optTableCellAlignMethod renderer.OptionName = "TableTableCellAlignMethod" - -type withTableCellAlignMethod struct { - value TableCellAlignMethod -} - -func (o *withTableCellAlignMethod) SetConfig(c *renderer.Config) { - c.Options[optTableCellAlignMethod] = o.value -} - -func (o *withTableCellAlignMethod) SetTableOption(c *TableConfig) { - c.TableCellAlignMethod = o.value -} - -// WithTableCellAlignMethod is a functional option that indicates how are table cells aligned in HTML format. -func WithTableCellAlignMethod(a TableCellAlignMethod) TableOption { - return &withTableCellAlignMethod{a} -} - -func isTableDelim(bs []byte) bool { - for _, b := range bs { - if !(util.IsSpace(b) || b == '-' || b == '|' || b == ':') { - return false - } - } - return true -} - -var tableDelimLeft = regexp.MustCompile(`^\s*\:\-+\s*$`) -var tableDelimRight = regexp.MustCompile(`^\s*\-+\:\s*$`) -var tableDelimCenter = regexp.MustCompile(`^\s*\:\-+\:\s*$`) -var tableDelimNone = regexp.MustCompile(`^\s*\-+\s*$`) - -type tableParagraphTransformer struct { -} - -var defaultTableParagraphTransformer = &tableParagraphTransformer{} - -// NewTableParagraphTransformer returns a new ParagraphTransformer -// that can transform paragraphs into tables. -func NewTableParagraphTransformer() parser.ParagraphTransformer { - return defaultTableParagraphTransformer -} - -func (b *tableParagraphTransformer) Transform(node *gast.Paragraph, reader text.Reader, pc parser.Context) { - lines := node.Lines() - if lines.Len() < 2 { - return - } - for i := 1; i < lines.Len(); i++ { - alignments := b.parseDelimiter(lines.At(i), reader) - if alignments == nil { - continue - } - header := b.parseRow(lines.At(i-1), alignments, true, reader, pc) - if header == nil || len(alignments) != header.ChildCount() { - return - } - table := ast.NewTable() - table.Alignments = alignments - table.AppendChild(table, ast.NewTableHeader(header)) - for j := i + 1; j < lines.Len(); j++ { - table.AppendChild(table, b.parseRow(lines.At(j), alignments, false, reader, pc)) - } - node.Lines().SetSliced(0, i-1) - node.Parent().InsertAfter(node.Parent(), node, table) - if node.Lines().Len() == 0 { - node.Parent().RemoveChild(node.Parent(), node) - } else { - last := node.Lines().At(i - 2) - last.Stop = last.Stop - 1 // trim last newline(\n) - node.Lines().Set(i-2, last) - } - } -} - -func (b *tableParagraphTransformer) parseRow(segment text.Segment, alignments []ast.Alignment, isHeader bool, reader text.Reader, pc parser.Context) *ast.TableRow { - source := reader.Source() - line := segment.Value(source) - pos := 0 - pos += util.TrimLeftSpaceLength(line) - limit := len(line) - limit -= util.TrimRightSpaceLength(line) - row := ast.NewTableRow(alignments) - if len(line) > 0 && line[pos] == '|' { - pos++ - } - if len(line) > 0 && line[limit-1] == '|' { - limit-- - } - i := 0 - for ; pos < limit; i++ { - alignment := ast.AlignNone - if i >= len(alignments) { - if !isHeader { - return row - } - } else { - alignment = alignments[i] - } - - var escapedCell *escapedPipeCell - node := ast.NewTableCell() - node.Alignment = alignment - hasBacktick := false - closure := pos - for ; closure < limit; closure++ { - if line[closure] == '`' { - hasBacktick = true - } - if line[closure] == '|' { - if closure == 0 || line[closure-1] != '\\' { - break - } else if hasBacktick { - if escapedCell == nil { - escapedCell = &escapedPipeCell{node, []int{}, false} - escapedList := pc.ComputeIfAbsent(escapedPipeCellListKey, - func() interface{} { - return []*escapedPipeCell{} - }).([]*escapedPipeCell) - escapedList = append(escapedList, escapedCell) - pc.Set(escapedPipeCellListKey, escapedList) - } - escapedCell.Pos = append(escapedCell.Pos, segment.Start+closure-1) - } - } - } - seg := text.NewSegment(segment.Start+pos, segment.Start+closure) - seg = seg.TrimLeftSpace(source) - seg = seg.TrimRightSpace(source) - node.Lines().Append(seg) - row.AppendChild(row, node) - pos = closure + 1 - } - for ; i < len(alignments); i++ { - row.AppendChild(row, ast.NewTableCell()) - } - return row -} - -func (b *tableParagraphTransformer) parseDelimiter(segment text.Segment, reader text.Reader) []ast.Alignment { - line := segment.Value(reader.Source()) - if !isTableDelim(line) { - return nil - } - cols := bytes.Split(line, []byte{'|'}) - if util.IsBlank(cols[0]) { - cols = cols[1:] - } - if len(cols) > 0 && util.IsBlank(cols[len(cols)-1]) { - cols = cols[:len(cols)-1] - } - - var alignments []ast.Alignment - for _, col := range cols { - if tableDelimLeft.Match(col) { - alignments = append(alignments, ast.AlignLeft) - } else if tableDelimRight.Match(col) { - alignments = append(alignments, ast.AlignRight) - } else if tableDelimCenter.Match(col) { - alignments = append(alignments, ast.AlignCenter) - } else if tableDelimNone.Match(col) { - alignments = append(alignments, ast.AlignNone) - } else { - return nil - } - } - return alignments -} - -type tableASTTransformer struct { -} - -var defaultTableASTTransformer = &tableASTTransformer{} - -// NewTableASTTransformer returns a parser.ASTTransformer for tables. -func NewTableASTTransformer() parser.ASTTransformer { - return defaultTableASTTransformer -} - -func (a *tableASTTransformer) Transform(node *gast.Document, reader text.Reader, pc parser.Context) { - lst := pc.Get(escapedPipeCellListKey) - if lst == nil { - return - } - pc.Set(escapedPipeCellListKey, nil) - for _, v := range lst.([]*escapedPipeCell) { - if v.Transformed { - continue - } - _ = gast.Walk(v.Cell, func(n gast.Node, entering bool) (gast.WalkStatus, error) { - if !entering || n.Kind() != gast.KindCodeSpan { - return gast.WalkContinue, nil - } - - for c := n.FirstChild(); c != nil; { - next := c.NextSibling() - if c.Kind() != gast.KindText { - c = next - continue - } - parent := c.Parent() - ts := &c.(*gast.Text).Segment - n := c - for _, v := range lst.([]*escapedPipeCell) { - for _, pos := range v.Pos { - if ts.Start <= pos && pos < ts.Stop { - segment := n.(*gast.Text).Segment - n1 := gast.NewRawTextSegment(segment.WithStop(pos)) - n2 := gast.NewRawTextSegment(segment.WithStart(pos + 1)) - parent.InsertAfter(parent, n, n1) - parent.InsertAfter(parent, n1, n2) - parent.RemoveChild(parent, n) - n = n2 - v.Transformed = true - } - } - } - c = next - } - return gast.WalkContinue, nil - }) - } -} - -// TableHTMLRenderer is a renderer.NodeRenderer implementation that -// renders Table nodes. -type TableHTMLRenderer struct { - TableConfig -} - -// NewTableHTMLRenderer returns a new TableHTMLRenderer. -func NewTableHTMLRenderer(opts ...TableOption) renderer.NodeRenderer { - r := &TableHTMLRenderer{ - TableConfig: NewTableConfig(), - } - for _, opt := range opts { - opt.SetTableOption(&r.TableConfig) - } - return r -} - -// RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. -func (r *TableHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - reg.Register(ast.KindTable, r.renderTable) - reg.Register(ast.KindTableHeader, r.renderTableHeader) - reg.Register(ast.KindTableRow, r.renderTableRow) - reg.Register(ast.KindTableCell, r.renderTableCell) -} - -// TableAttributeFilter defines attribute names which table elements can have. -var TableAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("align"), // [Deprecated] - []byte("bgcolor"), // [Deprecated] - []byte("border"), // [Deprecated] - []byte("cellpadding"), // [Deprecated] - []byte("cellspacing"), // [Deprecated] - []byte("frame"), // [Deprecated] - []byte("rules"), // [Deprecated] - []byte("summary"), // [Deprecated] - []byte("width"), // [Deprecated] -) - -func (r *TableHTMLRenderer) renderTable(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - _, _ = w.WriteString("\n") - } else { - _, _ = w.WriteString("\n") - } - return gast.WalkContinue, nil -} - -// TableHeaderAttributeFilter defines attribute names which elements can have. -var TableHeaderAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("align"), // [Deprecated since HTML4] [Obsolete since HTML5] - []byte("bgcolor"), // [Not Standardized] - []byte("char"), // [Deprecated since HTML4] [Obsolete since HTML5] - []byte("charoff"), // [Deprecated since HTML4] [Obsolete since HTML5] - []byte("valign"), // [Deprecated since HTML4] [Obsolete since HTML5] -) - -func (r *TableHTMLRenderer) renderTableHeader(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - _, _ = w.WriteString("\n") - _, _ = w.WriteString("\n") // Header has no separate handle - } else { - _, _ = w.WriteString("\n") - _, _ = w.WriteString("\n") - if n.NextSibling() != nil { - _, _ = w.WriteString("\n") - } - } - return gast.WalkContinue, nil -} - -// TableRowAttributeFilter defines attribute names which elements can have. -var TableRowAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("align"), // [Obsolete since HTML5] - []byte("bgcolor"), // [Obsolete since HTML5] - []byte("char"), // [Obsolete since HTML5] - []byte("charoff"), // [Obsolete since HTML5] - []byte("valign"), // [Obsolete since HTML5] -) - -func (r *TableHTMLRenderer) renderTableRow(w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { - if entering { - _, _ = w.WriteString("\n") - } else { - _, _ = w.WriteString("\n") - if n.Parent().LastChild() == n { - _, _ = w.WriteString("\n") - } - } - return gast.WalkContinue, nil -} - -// TableThCellAttributeFilter defines attribute names which table cells can have. -var TableThCellAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("abbr"), // [OK] Contains a short abbreviated description of the cell's content [NOT OK in ] - - []byte("align"), // [Obsolete since HTML5] - []byte("axis"), // [Obsolete since HTML5] - []byte("bgcolor"), // [Not Standardized] - []byte("char"), // [Obsolete since HTML5] - []byte("charoff"), // [Obsolete since HTML5] - - []byte("colspan"), // [OK] Number of columns that the cell is to span - []byte("headers"), // [OK] This attribute contains a list of space-separated strings, each corresponding to the id attribute of the elements that apply to this element - - []byte("height"), // [Deprecated since HTML4] [Obsolete since HTML5] - - []byte("rowspan"), // [OK] Number of rows that the cell is to span - []byte("scope"), // [OK] This enumerated attribute defines the cells that the header (defined in the ) element relates to [NOT OK in ] - - []byte("valign"), // [Obsolete since HTML5] - []byte("width"), // [Deprecated since HTML4] [Obsolete since HTML5] -) - -// TableTdCellAttributeFilter defines attribute names which table cells can have. -var TableTdCellAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("abbr"), // [Obsolete since HTML5] [OK in ] - []byte("align"), // [Obsolete since HTML5] - []byte("axis"), // [Obsolete since HTML5] - []byte("bgcolor"), // [Not Standardized] - []byte("char"), // [Obsolete since HTML5] - []byte("charoff"), // [Obsolete since HTML5] - - []byte("colspan"), // [OK] Number of columns that the cell is to span - []byte("headers"), // [OK] This attribute contains a list of space-separated strings, each corresponding to the id attribute of the elements that apply to this element - - []byte("height"), // [Deprecated since HTML4] [Obsolete since HTML5] - - []byte("rowspan"), // [OK] Number of rows that the cell is to span - - []byte("scope"), // [Obsolete since HTML5] [OK in ] - []byte("valign"), // [Obsolete since HTML5] - []byte("width"), // [Deprecated since HTML4] [Obsolete since HTML5] -) - -func (r *TableHTMLRenderer) renderTableCell(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - n := node.(*ast.TableCell) - tag := "td" - if n.Parent().Kind() == ast.KindTableHeader { - tag = "th" - } - if entering { - fmt.Fprintf(w, "<%s", tag) - if n.Alignment != ast.AlignNone { - amethod := r.TableConfig.TableCellAlignMethod - if amethod == TableCellAlignDefault { - if r.Config.XHTML { - amethod = TableCellAlignAttribute - } else { - amethod = TableCellAlignStyle - } - } - switch amethod { - case TableCellAlignAttribute: - if _, ok := n.AttributeString("align"); !ok { // Skip align render if overridden - fmt.Fprintf(w, ` align="%s"`, n.Alignment.String()) - } - case TableCellAlignStyle: - v, ok := n.AttributeString("style") - var cob util.CopyOnWriteBuffer - if ok { - cob = util.NewCopyOnWriteBuffer(v.([]byte)) - cob.AppendByte(';') - } - style := fmt.Sprintf("text-align:%s", n.Alignment.String()) - cob.AppendString(style) - n.SetAttributeString("style", cob.Bytes()) - } - } - if n.Attributes() != nil { - if tag == "td" { - html.RenderAttributes(w, n, TableTdCellAttributeFilter) // - } else { - html.RenderAttributes(w, n, TableThCellAttributeFilter) // - } - } - _ = w.WriteByte('>') - } else { - fmt.Fprintf(w, "\n", tag) - } - return gast.WalkContinue, nil -} - -type table struct { - options []TableOption -} - -// Table is an extension that allow you to use GFM tables . -var Table = &table{ - options: []TableOption{}, -} - -// NewTable returns a new extension with given options. -func NewTable(opts ...TableOption) goldmark.Extender { - return &table{ - options: opts, - } -} - -func (e *table) Extend(m goldmark.Markdown) { - m.Parser().AddOptions( - parser.WithParagraphTransformers( - util.Prioritized(NewTableParagraphTransformer(), 200), - ), - parser.WithASTTransformers( - util.Prioritized(defaultTableASTTransformer, 0), - ), - ) - m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewTableHTMLRenderer(e.options...), 500), - )) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/table_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/table_test.go deleted file mode 100644 index 5ee23e935..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/table_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package extension - -import ( - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/ast" - east "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -func TestTable(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - html.WithXHTML(), - ), - goldmark.WithExtensions( - Table, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/table.txt", t, testutil.ParseCliCaseArg()...) -} - -func TestTableWithAlignDefault(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignDefault), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Description: "Cell with TableCellAlignDefault and XHTML should be rendered as an align attribute", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) - - markdown = goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignDefault), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 2, - Description: "Cell with TableCellAlignDefault and HTML5 should be rendered as a style attribute", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) -} - -func TestTableWithAlignAttribute(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignAttribute), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Description: "Cell with TableCellAlignAttribute and XHTML should be rendered as an align attribute", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) - - markdown = goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignAttribute), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 2, - Description: "Cell with TableCellAlignAttribute and HTML5 should be rendered as an align attribute", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) -} - -type tableStyleTransformer struct { -} - -func (a *tableStyleTransformer) Transform(node *ast.Document, reader text.Reader, pc parser.Context) { - cell := node.FirstChild().FirstChild().FirstChild().(*east.TableCell) - cell.SetAttributeString("style", []byte("font-size:1em")) -} - -func TestTableWithAlignStyle(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignStyle), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Description: "Cell with TableCellAlignStyle and XHTML should be rendered as a style attribute", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) - - markdown = goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignStyle), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 2, - Description: "Cell with TableCellAlignStyle and HTML5 should be rendered as a style attribute", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) - - markdown = goldmark.New( - goldmark.WithParserOptions( - parser.WithASTTransformers( - util.Prioritized(&tableStyleTransformer{}, 0), - ), - ), - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignStyle), - ), - ), - ) - - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 3, - Description: "Styled cell should not be broken the style by the alignments", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) -} - -func TestTableWithAlignNone(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - ), - goldmark.WithExtensions( - NewTable( - WithTableCellAlignMethod(TableCellAlignNone), - ), - ), - ) - testutil.DoTestCase( - markdown, - testutil.MarkdownTestCase{ - No: 1, - Description: "Cell with TableCellAlignStyle and XHTML should not be rendered", - Markdown: ` -| abc | defghi | -:-: | -----------: -bar | baz -`, - Expected: ` - - - - - - - - - - - - -
              abcdefghi
              barbaz
              `, - }, - t, - ) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/tasklist.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/tasklist.go deleted file mode 100644 index 1f3e52c20..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/tasklist.go +++ /dev/null @@ -1,115 +0,0 @@ -package extension - -import ( - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" - "regexp" -) - -var taskListRegexp = regexp.MustCompile(`^\[([\sxX])\]\s*`) - -type taskCheckBoxParser struct { -} - -var defaultTaskCheckBoxParser = &taskCheckBoxParser{} - -// NewTaskCheckBoxParser returns a new InlineParser that can parse -// checkboxes in list items. -// This parser must take precedence over the parser.LinkParser. -func NewTaskCheckBoxParser() parser.InlineParser { - return defaultTaskCheckBoxParser -} - -func (s *taskCheckBoxParser) Trigger() []byte { - return []byte{'['} -} - -func (s *taskCheckBoxParser) Parse(parent gast.Node, block text.Reader, pc parser.Context) gast.Node { - // Given AST structure must be like - // - List - // - ListItem : parent.Parent - // - TextBlock : parent - // (current line) - if parent.Parent() == nil || parent.Parent().FirstChild() != parent { - return nil - } - - if _, ok := parent.Parent().(*gast.ListItem); !ok { - return nil - } - line, _ := block.PeekLine() - m := taskListRegexp.FindSubmatchIndex(line) - if m == nil { - return nil - } - value := line[m[2]:m[3]][0] - block.Advance(m[1]) - checked := value == 'x' || value == 'X' - return ast.NewTaskCheckBox(checked) -} - -func (s *taskCheckBoxParser) CloseBlock(parent gast.Node, pc parser.Context) { - // nothing to do -} - -// TaskCheckBoxHTMLRenderer is a renderer.NodeRenderer implementation that -// renders checkboxes in list items. -type TaskCheckBoxHTMLRenderer struct { - html.Config -} - -// NewTaskCheckBoxHTMLRenderer returns a new TaskCheckBoxHTMLRenderer. -func NewTaskCheckBoxHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { - r := &TaskCheckBoxHTMLRenderer{ - Config: html.NewConfig(), - } - for _, opt := range opts { - opt.SetHTMLOption(&r.Config) - } - return r -} - -// RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs. -func (r *TaskCheckBoxHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - reg.Register(ast.KindTaskCheckBox, r.renderTaskCheckBox) -} - -func (r *TaskCheckBoxHTMLRenderer) renderTaskCheckBox(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - if !entering { - return gast.WalkContinue, nil - } - n := node.(*ast.TaskCheckBox) - - if n.IsChecked { - w.WriteString(` ") - } else { - w.WriteString("> ") - } - return gast.WalkContinue, nil -} - -type taskList struct { -} - -// TaskList is an extension that allow you to use GFM task lists. -var TaskList = &taskList{} - -func (e *taskList) Extend(m goldmark.Markdown) { - m.Parser().AddOptions(parser.WithInlineParsers( - util.Prioritized(NewTaskCheckBoxParser(), 0), - )) - m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewTaskCheckBoxHTMLRenderer(), 500), - )) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/tasklist_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/tasklist_test.go deleted file mode 100644 index e3762270f..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/tasklist_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package extension - -import ( - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -func TestTaskList(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - TaskList, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/tasklist.txt", t, testutil.ParseCliCaseArg()...) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/typographer.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/typographer.go deleted file mode 100644 index 2c3473094..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/typographer.go +++ /dev/null @@ -1,323 +0,0 @@ -package extension - -import ( - "unicode" - - "github.com/yuin/goldmark" - gast "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var uncloseCounterKey = parser.NewContextKey() - -type unclosedCounter struct { - Single int - Double int -} - -func (u *unclosedCounter) Reset() { - u.Single = 0 - u.Double = 0 -} - -func getUnclosedCounter(pc parser.Context) *unclosedCounter { - v := pc.Get(uncloseCounterKey) - if v == nil { - v = &unclosedCounter{} - pc.Set(uncloseCounterKey, v) - } - return v.(*unclosedCounter) -} - -// TypographicPunctuation is a key of the punctuations that can be replaced with -// typographic entities. -type TypographicPunctuation int - -const ( - // LeftSingleQuote is ' - LeftSingleQuote TypographicPunctuation = iota + 1 - // RightSingleQuote is ' - RightSingleQuote - // LeftDoubleQuote is " - LeftDoubleQuote - // RightDoubleQuote is " - RightDoubleQuote - // EnDash is -- - EnDash - // EmDash is --- - EmDash - // Ellipsis is ... - Ellipsis - // LeftAngleQuote is << - LeftAngleQuote - // RightAngleQuote is >> - RightAngleQuote - // Apostrophe is ' - Apostrophe - - typographicPunctuationMax -) - -// An TypographerConfig struct is a data structure that holds configuration of the -// Typographer extension. -type TypographerConfig struct { - Substitutions [][]byte -} - -func newDefaultSubstitutions() [][]byte { - replacements := make([][]byte, typographicPunctuationMax) - replacements[LeftSingleQuote] = []byte("‘") - replacements[RightSingleQuote] = []byte("’") - replacements[LeftDoubleQuote] = []byte("“") - replacements[RightDoubleQuote] = []byte("”") - replacements[EnDash] = []byte("–") - replacements[EmDash] = []byte("—") - replacements[Ellipsis] = []byte("…") - replacements[LeftAngleQuote] = []byte("«") - replacements[RightAngleQuote] = []byte("»") - replacements[Apostrophe] = []byte("’") - - return replacements -} - -// SetOption implements SetOptioner. -func (b *TypographerConfig) SetOption(name parser.OptionName, value interface{}) { - switch name { - case optTypographicSubstitutions: - b.Substitutions = value.([][]byte) - } -} - -// A TypographerOption interface sets options for the TypographerParser. -type TypographerOption interface { - parser.Option - SetTypographerOption(*TypographerConfig) -} - -const optTypographicSubstitutions parser.OptionName = "TypographicSubstitutions" - -// TypographicSubstitutions is a list of the substitutions for the Typographer extension. -type TypographicSubstitutions map[TypographicPunctuation][]byte - -type withTypographicSubstitutions struct { - value [][]byte -} - -func (o *withTypographicSubstitutions) SetParserOption(c *parser.Config) { - c.Options[optTypographicSubstitutions] = o.value -} - -func (o *withTypographicSubstitutions) SetTypographerOption(p *TypographerConfig) { - p.Substitutions = o.value -} - -// WithTypographicSubstitutions is a functional otpion that specify replacement text -// for punctuations. -func WithTypographicSubstitutions(values map[TypographicPunctuation][]byte) TypographerOption { - replacements := newDefaultSubstitutions() - for k, v := range values { - replacements[k] = v - } - - return &withTypographicSubstitutions{replacements} -} - -type typographerDelimiterProcessor struct { -} - -func (p *typographerDelimiterProcessor) IsDelimiter(b byte) bool { - return b == '\'' || b == '"' -} - -func (p *typographerDelimiterProcessor) CanOpenCloser(opener, closer *parser.Delimiter) bool { - return opener.Char == closer.Char -} - -func (p *typographerDelimiterProcessor) OnMatch(consumes int) gast.Node { - return nil -} - -var defaultTypographerDelimiterProcessor = &typographerDelimiterProcessor{} - -type typographerParser struct { - TypographerConfig -} - -// NewTypographerParser return a new InlineParser that parses -// typographer expressions. -func NewTypographerParser(opts ...TypographerOption) parser.InlineParser { - p := &typographerParser{ - TypographerConfig: TypographerConfig{ - Substitutions: newDefaultSubstitutions(), - }, - } - for _, o := range opts { - o.SetTypographerOption(&p.TypographerConfig) - } - return p -} - -func (s *typographerParser) Trigger() []byte { - return []byte{'\'', '"', '-', '.', '<', '>'} -} - -func (s *typographerParser) Parse(parent gast.Node, block text.Reader, pc parser.Context) gast.Node { - line, _ := block.PeekLine() - c := line[0] - if len(line) > 2 { - if c == '-' { - if s.Substitutions[EmDash] != nil && line[1] == '-' && line[2] == '-' { // --- - node := gast.NewString(s.Substitutions[EmDash]) - node.SetCode(true) - block.Advance(3) - return node - } - } else if c == '.' { - if s.Substitutions[Ellipsis] != nil && line[1] == '.' && line[2] == '.' { // ... - node := gast.NewString(s.Substitutions[Ellipsis]) - node.SetCode(true) - block.Advance(3) - return node - } - return nil - } - } - if len(line) > 1 { - if c == '<' { - if s.Substitutions[LeftAngleQuote] != nil && line[1] == '<' { // << - node := gast.NewString(s.Substitutions[LeftAngleQuote]) - node.SetCode(true) - block.Advance(2) - return node - } - return nil - } else if c == '>' { - if s.Substitutions[RightAngleQuote] != nil && line[1] == '>' { // >> - node := gast.NewString(s.Substitutions[RightAngleQuote]) - node.SetCode(true) - block.Advance(2) - return node - } - return nil - } else if s.Substitutions[EnDash] != nil && c == '-' && line[1] == '-' { // -- - node := gast.NewString(s.Substitutions[EnDash]) - node.SetCode(true) - block.Advance(2) - return node - } - } - if c == '\'' || c == '"' { - before := block.PrecendingCharacter() - d := parser.ScanDelimiter(line, before, 1, defaultTypographerDelimiterProcessor) - if d == nil { - return nil - } - counter := getUnclosedCounter(pc) - if c == '\'' { - if s.Substitutions[Apostrophe] != nil { - // Handle decade abbrevations such as '90s - if d.CanOpen && !d.CanClose && len(line) > 3 && util.IsNumeric(line[1]) && util.IsNumeric(line[2]) && line[3] == 's' { - after := rune(' ') - if len(line) > 4 { - after = util.ToRune(line, 4) - } - if len(line) == 3 || util.IsSpaceRune(after) || util.IsPunctRune(after) { - node := gast.NewString(s.Substitutions[Apostrophe]) - node.SetCode(true) - block.Advance(1) - return node - } - } - // Convert normal apostrophes. This is probably more flexible than necessary but - // converts any apostrophe in between two alphanumerics. - if len(line) > 1 && (unicode.IsDigit(before) || unicode.IsLetter(before)) && (unicode.IsLetter(util.ToRune(line, 1))) { - node := gast.NewString(s.Substitutions[Apostrophe]) - node.SetCode(true) - block.Advance(1) - return node - } - } - if s.Substitutions[LeftSingleQuote] != nil && d.CanOpen && !d.CanClose { - nt := LeftSingleQuote - // special cases: Alice's, I'm ,Don't, You'd - if len(line) > 1 && (line[1] == 's' || line[1] == 'm' || line[1] == 't' || line[1] == 'd') && (len(line) < 3 || util.IsPunct(line[2]) || util.IsSpace(line[2])) { - nt = RightSingleQuote - } - // special cases: I've, I'll, You're - if len(line) > 2 && ((line[1] == 'v' && line[2] == 'e') || (line[1] == 'l' && line[2] == 'l') || (line[1] == 'r' && line[2] == 'e')) && (len(line) < 4 || util.IsPunct(line[3]) || util.IsSpace(line[3])) { - nt = RightSingleQuote - } - if nt == LeftSingleQuote { - counter.Single++ - } - - node := gast.NewString(s.Substitutions[nt]) - node.SetCode(true) - block.Advance(1) - return node - } - if s.Substitutions[RightSingleQuote] != nil && counter.Single > 0 { - isClose := d.CanClose && !d.CanOpen - maybeClose := d.CanClose && d.CanOpen && len(line) > 1 && (line[1] == ',' || line[1] == '.' || line[1] == '!' || line[1] == '?') && (len(line) == 2 || (len(line) > 2 && util.IsPunct(line[2]) || util.IsSpace(line[2]))) - if isClose || maybeClose { - node := gast.NewString(s.Substitutions[RightSingleQuote]) - node.SetCode(true) - block.Advance(1) - counter.Single-- - return node - } - } - } - if c == '"' { - if s.Substitutions[LeftDoubleQuote] != nil && d.CanOpen && !d.CanClose { - node := gast.NewString(s.Substitutions[LeftDoubleQuote]) - node.SetCode(true) - block.Advance(1) - counter.Double++ - return node - } - if s.Substitutions[RightDoubleQuote] != nil && counter.Double > 0 { - isClose := d.CanClose && !d.CanOpen - maybeClose := d.CanClose && d.CanOpen && len(line) > 1 && (line[1] == ',' || line[1] == '.' || line[1] == '!' || line[1] == '?') && (len(line) == 2 || (len(line) > 2 && util.IsPunct(line[2]) || util.IsSpace(line[2]))) - if isClose || maybeClose { - // special case: "Monitor 21"" - if len(line) > 1 && line[1] == '"' && unicode.IsDigit(before) { - return nil - } - node := gast.NewString(s.Substitutions[RightDoubleQuote]) - node.SetCode(true) - block.Advance(1) - counter.Double-- - return node - } - } - } - } - return nil -} - -func (s *typographerParser) CloseBlock(parent gast.Node, pc parser.Context) { - getUnclosedCounter(pc).Reset() -} - -type typographer struct { - options []TypographerOption -} - -// Typographer is an extension that replaces punctuations with typographic entities. -var Typographer = &typographer{} - -// NewTypographer returns a new Extender that replaces punctuations with typographic entities. -func NewTypographer(opts ...TypographerOption) goldmark.Extender { - return &typographer{ - options: opts, - } -} - -func (e *typographer) Extend(m goldmark.Markdown) { - m.Parser().AddOptions(parser.WithInlineParsers( - util.Prioritized(NewTypographerParser(e.options...), 9999), - )) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/typographer_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/typographer_test.go deleted file mode 100644 index f8eded105..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extension/typographer_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package extension - -import ( - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -func TestTypographer(t *testing.T) { - markdown := goldmark.New( - goldmark.WithRendererOptions( - html.WithUnsafe(), - ), - goldmark.WithExtensions( - Typographer, - ), - ) - testutil.DoTestCaseFile(markdown, "_test/typographer.txt", t, testutil.ParseCliCaseArg()...) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extra_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/extra_test.go deleted file mode 100644 index 892848e15..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/extra_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package goldmark_test - -import ( - "bytes" - "testing" - - . "github.com/yuin/goldmark" - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/testutil" -) - -func TestExtras(t *testing.T) { - markdown := New(WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - )) - testutil.DoTestCaseFile(markdown, "_test/extra.txt", t, testutil.ParseCliCaseArg()...) -} - -func TestEndsWithNonSpaceCharacters(t *testing.T) { - markdown := New(WithRendererOptions( - html.WithXHTML(), - html.WithUnsafe(), - )) - source := []byte("```\na\n```") - var b bytes.Buffer - err := markdown.Convert(source, &b) - if err != nil { - t.Error(err.Error()) - } - if b.String() != "
              a\n
              \n" { - t.Errorf("%s \n---------\n %s", source, b.String()) - } -} - -func TestWindowsNewLine(t *testing.T) { - markdown := New(WithRendererOptions( - html.WithXHTML(), - )) - source := []byte("a \r\nb\n") - var b bytes.Buffer - err := markdown.Convert(source, &b) - if err != nil { - t.Error(err.Error()) - } - if b.String() != "

              a
              \nb

              \n" { - t.Errorf("%s\n---------\n%s", source, b.String()) - } - - source = []byte("a\\\r\nb\r\n") - var b2 bytes.Buffer - err = markdown.Convert(source, &b2) - if err != nil { - t.Error(err.Error()) - } - if b2.String() != "

              a
              \nb

              \n" { - t.Errorf("\n%s\n---------\n%s", source, b2.String()) - } -} - -type myIDs struct { -} - -func (s *myIDs) Generate(value []byte, kind ast.NodeKind) []byte { - return []byte("my-id") -} - -func (s *myIDs) Put(value []byte) { -} - -func TestAutogeneratedIDs(t *testing.T) { - ctx := parser.NewContext(parser.WithIDs(&myIDs{})) - markdown := New(WithParserOptions(parser.WithAutoHeadingID())) - source := []byte("# Title1\n## Title2") - var b bytes.Buffer - err := markdown.Convert(source, &b, parser.WithContext(ctx)) - if err != nil { - t.Error(err.Error()) - } - if b.String() != `

              Title1

              -

              Title2

              -` { - t.Errorf("%s\n---------\n%s", source, b.String()) - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/fuzz/fuzz.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/fuzz/fuzz.go deleted file mode 100644 index 5e72d16c5..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/fuzz/fuzz.go +++ /dev/null @@ -1,39 +0,0 @@ -package fuzz - -import ( - "bytes" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/extension" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer/html" -) - -// Fuzz runs automated fuzzing against goldmark. -func Fuzz(data []byte) int { - markdown := goldmark.New( - goldmark.WithParserOptions( - parser.WithAutoHeadingID(), - parser.WithAttribute(), - ), - goldmark.WithRendererOptions( - html.WithUnsafe(), - html.WithXHTML(), - ), - goldmark.WithExtensions( - extension.DefinitionList, - extension.Footnote, - extension.GFM, - extension.Linkify, - extension.Table, - extension.TaskList, - extension.Typographer, - ), - ) - var b bytes.Buffer - if err := markdown.Convert(data, &b); err != nil { - return 0 - } - - return 1 -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/fuzz/fuzz_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/fuzz/fuzz_test.go deleted file mode 100644 index c7bfadaa9..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/fuzz/fuzz_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package fuzz - -import ( - "bytes" - "fmt" - "io/ioutil" - "testing" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/extension" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/util" -) - -var _ = fmt.Printf - -func TestFuzz(t *testing.T) { - crasher := "6dff3d03167cb144d4e2891edac76ee740a77bc7" - data, err := ioutil.ReadFile("crashers/" + crasher) - if err != nil { - return - } - fmt.Printf("%s\n", util.VisualizeSpaces(data)) - fmt.Println("||||||||||||||||||||||") - markdown := goldmark.New( - goldmark.WithParserOptions( - parser.WithAutoHeadingID(), - parser.WithAttribute(), - ), - goldmark.WithRendererOptions( - html.WithUnsafe(), - html.WithXHTML(), - ), - goldmark.WithExtensions( - extension.DefinitionList, - extension.Footnote, - extension.GFM, - extension.Typographer, - extension.Linkify, - extension.Table, - extension.TaskList, - ), - ) - var b bytes.Buffer - if err := markdown.Convert(data, &b); err != nil { - panic(err) - } - fmt.Println(b.String()) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/go.mod b/pkg/mod/github.com/yuin/goldmark@v1.4.4/go.mod deleted file mode 100644 index 27712f225..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/yuin/goldmark - -go 1.16 diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/go.sum b/pkg/mod/github.com/yuin/goldmark@v1.4.4/go.sum deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/markdown.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/markdown.go deleted file mode 100644 index 86d12e225..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/markdown.go +++ /dev/null @@ -1,140 +0,0 @@ -// Package goldmark implements functions to convert markdown text to a desired format. -package goldmark - -import ( - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/renderer/html" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" - "io" -) - -// DefaultParser returns a new Parser that is configured by default values. -func DefaultParser() parser.Parser { - return parser.NewParser(parser.WithBlockParsers(parser.DefaultBlockParsers()...), - parser.WithInlineParsers(parser.DefaultInlineParsers()...), - parser.WithParagraphTransformers(parser.DefaultParagraphTransformers()...), - ) -} - -// DefaultRenderer returns a new Renderer that is configured by default values. -func DefaultRenderer() renderer.Renderer { - return renderer.NewRenderer(renderer.WithNodeRenderers(util.Prioritized(html.NewRenderer(), 1000))) -} - -var defaultMarkdown = New() - -// Convert interprets a UTF-8 bytes source in Markdown and -// write rendered contents to a writer w. -func Convert(source []byte, w io.Writer, opts ...parser.ParseOption) error { - return defaultMarkdown.Convert(source, w, opts...) -} - -// A Markdown interface offers functions to convert Markdown text to -// a desired format. -type Markdown interface { - // Convert interprets a UTF-8 bytes source in Markdown and write rendered - // contents to a writer w. - Convert(source []byte, writer io.Writer, opts ...parser.ParseOption) error - - // Parser returns a Parser that will be used for conversion. - Parser() parser.Parser - - // SetParser sets a Parser to this object. - SetParser(parser.Parser) - - // Parser returns a Renderer that will be used for conversion. - Renderer() renderer.Renderer - - // SetRenderer sets a Renderer to this object. - SetRenderer(renderer.Renderer) -} - -// Option is a functional option type for Markdown objects. -type Option func(*markdown) - -// WithExtensions adds extensions. -func WithExtensions(ext ...Extender) Option { - return func(m *markdown) { - m.extensions = append(m.extensions, ext...) - } -} - -// WithParser allows you to override the default parser. -func WithParser(p parser.Parser) Option { - return func(m *markdown) { - m.parser = p - } -} - -// WithParserOptions applies options for the parser. -func WithParserOptions(opts ...parser.Option) Option { - return func(m *markdown) { - m.parser.AddOptions(opts...) - } -} - -// WithRenderer allows you to override the default renderer. -func WithRenderer(r renderer.Renderer) Option { - return func(m *markdown) { - m.renderer = r - } -} - -// WithRendererOptions applies options for the renderer. -func WithRendererOptions(opts ...renderer.Option) Option { - return func(m *markdown) { - m.renderer.AddOptions(opts...) - } -} - -type markdown struct { - parser parser.Parser - renderer renderer.Renderer - extensions []Extender -} - -// New returns a new Markdown with given options. -func New(options ...Option) Markdown { - md := &markdown{ - parser: DefaultParser(), - renderer: DefaultRenderer(), - extensions: []Extender{}, - } - for _, opt := range options { - opt(md) - } - for _, e := range md.extensions { - e.Extend(md) - } - return md -} - -func (m *markdown) Convert(source []byte, writer io.Writer, opts ...parser.ParseOption) error { - reader := text.NewReader(source) - doc := m.parser.Parse(reader, opts...) - return m.renderer.Render(writer, source, doc) -} - -func (m *markdown) Parser() parser.Parser { - return m.parser -} - -func (m *markdown) SetParser(v parser.Parser) { - m.parser = v -} - -func (m *markdown) Renderer() renderer.Renderer { - return m.renderer -} - -func (m *markdown) SetRenderer(v renderer.Renderer) { - m.renderer = v -} - -// An Extender interface is used for extending Markdown. -type Extender interface { - // Extend extends the Markdown. - Extend(Markdown) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/options_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/options_test.go deleted file mode 100644 index 9607eb326..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/options_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package goldmark_test - -import ( - "testing" - - . "github.com/yuin/goldmark" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/testutil" -) - -func TestAttributeAndAutoHeadingID(t *testing.T) { - markdown := New( - WithParserOptions( - parser.WithAttribute(), - parser.WithAutoHeadingID(), - ), - ) - testutil.DoTestCaseFile(markdown, "_test/options.txt", t, testutil.ParseCliCaseArg()...) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/attribute.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/attribute.go deleted file mode 100644 index f86c83610..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/attribute.go +++ /dev/null @@ -1,328 +0,0 @@ -package parser - -import ( - "bytes" - "io" - "strconv" - - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var attrNameID = []byte("id") -var attrNameClass = []byte("class") - -// An Attribute is an attribute of the markdown elements -type Attribute struct { - Name []byte - Value interface{} -} - -// An Attributes is a collection of attributes. -type Attributes []Attribute - -// Find returns a (value, true) if an attribute correspond with given name is found, otherwise (nil, false). -func (as Attributes) Find(name []byte) (interface{}, bool) { - for _, a := range as { - if bytes.Equal(a.Name, name) { - return a.Value, true - } - } - return nil, false -} - -func (as Attributes) findUpdate(name []byte, cb func(v interface{}) interface{}) bool { - for i, a := range as { - if bytes.Equal(a.Name, name) { - as[i].Value = cb(a.Value) - return true - } - } - return false -} - -// ParseAttributes parses attributes into a map. -// ParseAttributes returns a parsed attributes and true if could parse -// attributes, otherwise nil and false. -func ParseAttributes(reader text.Reader) (Attributes, bool) { - savedLine, savedPosition := reader.Position() - reader.SkipSpaces() - if reader.Peek() != '{' { - reader.SetPosition(savedLine, savedPosition) - return nil, false - } - reader.Advance(1) - attrs := Attributes{} - for { - if reader.Peek() == '}' { - reader.Advance(1) - return attrs, true - } - attr, ok := parseAttribute(reader) - if !ok { - reader.SetPosition(savedLine, savedPosition) - return nil, false - } - if bytes.Equal(attr.Name, attrNameClass) { - if !attrs.findUpdate(attrNameClass, func(v interface{}) interface{} { - ret := make([]byte, 0, len(v.([]byte))+1+len(attr.Value.([]byte))) - ret = append(ret, v.([]byte)...) - return append(append(ret, ' '), attr.Value.([]byte)...) - }) { - attrs = append(attrs, attr) - } - } else { - attrs = append(attrs, attr) - } - reader.SkipSpaces() - if reader.Peek() == ',' { - reader.Advance(1) - reader.SkipSpaces() - } - } -} - -func parseAttribute(reader text.Reader) (Attribute, bool) { - reader.SkipSpaces() - c := reader.Peek() - if c == '#' || c == '.' { - reader.Advance(1) - line, _ := reader.PeekLine() - i := 0 - // HTML5 allows any kind of characters as id, but XHTML restricts characters for id. - // CommonMark is basically defined for XHTML(even though it is legacy). - // So we restrict id characters. - for ; i < len(line) && !util.IsSpace(line[i]) && - (!util.IsPunct(line[i]) || line[i] == '_' || line[i] == '-' || line[i] == ':' || line[i] == '.'); i++ { - } - name := attrNameClass - if c == '#' { - name = attrNameID - } - reader.Advance(i) - return Attribute{Name: name, Value: line[0:i]}, true - } - line, _ := reader.PeekLine() - if len(line) == 0 { - return Attribute{}, false - } - c = line[0] - if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || - c == '_' || c == ':') { - return Attribute{}, false - } - i := 0 - for ; i < len(line); i++ { - c = line[i] - if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - c == '_' || c == ':' || c == '.' || c == '-') { - break - } - } - name := line[:i] - reader.Advance(i) - reader.SkipSpaces() - c = reader.Peek() - if c != '=' { - return Attribute{}, false - } - reader.Advance(1) - reader.SkipSpaces() - value, ok := parseAttributeValue(reader) - if !ok { - return Attribute{}, false - } - if bytes.Equal(name, attrNameClass) { - if _, ok = value.([]byte); !ok { - return Attribute{}, false - } - } - return Attribute{Name: name, Value: value}, true -} - -func parseAttributeValue(reader text.Reader) (interface{}, bool) { - reader.SkipSpaces() - c := reader.Peek() - var value interface{} - ok := false - switch c { - case text.EOF: - return Attribute{}, false - case '{': - value, ok = ParseAttributes(reader) - case '[': - value, ok = parseAttributeArray(reader) - case '"': - value, ok = parseAttributeString(reader) - default: - if c == '-' || c == '+' || util.IsNumeric(c) { - value, ok = parseAttributeNumber(reader) - } else { - value, ok = parseAttributeOthers(reader) - } - } - if !ok { - return nil, false - } - return value, true -} - -func parseAttributeArray(reader text.Reader) ([]interface{}, bool) { - reader.Advance(1) // skip [ - ret := []interface{}{} - for i := 0; ; i++ { - c := reader.Peek() - comma := false - if i != 0 && c == ',' { - reader.Advance(1) - comma = true - } - if c == ']' { - if !comma { - reader.Advance(1) - return ret, true - } - return nil, false - } - reader.SkipSpaces() - value, ok := parseAttributeValue(reader) - if !ok { - return nil, false - } - ret = append(ret, value) - reader.SkipSpaces() - } -} - -func parseAttributeString(reader text.Reader) ([]byte, bool) { - reader.Advance(1) // skip " - line, _ := reader.PeekLine() - i := 0 - l := len(line) - var buf bytes.Buffer - for i < l { - c := line[i] - if c == '\\' && i != l-1 { - n := line[i+1] - switch n { - case '"', '/', '\\': - buf.WriteByte(n) - i += 2 - case 'b': - buf.WriteString("\b") - i += 2 - case 'f': - buf.WriteString("\f") - i += 2 - case 'n': - buf.WriteString("\n") - i += 2 - case 'r': - buf.WriteString("\r") - i += 2 - case 't': - buf.WriteString("\t") - i += 2 - default: - buf.WriteByte('\\') - i++ - } - continue - } - if c == '"' { - reader.Advance(i + 1) - return buf.Bytes(), true - } - buf.WriteByte(c) - i++ - } - return nil, false -} - -func scanAttributeDecimal(reader text.Reader, w io.ByteWriter) { - for { - c := reader.Peek() - if util.IsNumeric(c) { - w.WriteByte(c) - } else { - return - } - reader.Advance(1) - } -} - -func parseAttributeNumber(reader text.Reader) (float64, bool) { - sign := 1 - c := reader.Peek() - if c == '-' { - sign = -1 - reader.Advance(1) - } else if c == '+' { - reader.Advance(1) - } - var buf bytes.Buffer - if !util.IsNumeric(reader.Peek()) { - return 0, false - } - scanAttributeDecimal(reader, &buf) - if buf.Len() == 0 { - return 0, false - } - c = reader.Peek() - if c == '.' { - buf.WriteByte(c) - reader.Advance(1) - scanAttributeDecimal(reader, &buf) - } - c = reader.Peek() - if c == 'e' || c == 'E' { - buf.WriteByte(c) - reader.Advance(1) - c = reader.Peek() - if c == '-' || c == '+' { - buf.WriteByte(c) - reader.Advance(1) - } - scanAttributeDecimal(reader, &buf) - } - f, err := strconv.ParseFloat(buf.String(), 10) - if err != nil { - return 0, false - } - return float64(sign) * f, true -} - -var bytesTrue = []byte("true") -var bytesFalse = []byte("false") -var bytesNull = []byte("null") - -func parseAttributeOthers(reader text.Reader) (interface{}, bool) { - line, _ := reader.PeekLine() - c := line[0] - if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || - c == '_' || c == ':') { - return nil, false - } - i := 0 - for ; i < len(line); i++ { - c := line[i] - if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - c == '_' || c == ':' || c == '.' || c == '-') { - break - } - } - value := line[:i] - reader.Advance(i) - if bytes.Equal(value, bytesTrue) { - return true, true - } - if bytes.Equal(value, bytesFalse) { - return false, true - } - if bytes.Equal(value, bytesNull) { - return nil, true - } - return value, true -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/atx_heading.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/atx_heading.go deleted file mode 100644 index 13a198b52..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/atx_heading.go +++ /dev/null @@ -1,246 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -// A HeadingConfig struct is a data structure that holds configuration of the renderers related to headings. -type HeadingConfig struct { - AutoHeadingID bool - Attribute bool -} - -// SetOption implements SetOptioner. -func (b *HeadingConfig) SetOption(name OptionName, value interface{}) { - switch name { - case optAutoHeadingID: - b.AutoHeadingID = true - case optAttribute: - b.Attribute = true - } -} - -// A HeadingOption interface sets options for heading parsers. -type HeadingOption interface { - Option - SetHeadingOption(*HeadingConfig) -} - -// AutoHeadingID is an option name that enables auto IDs for headings. -const optAutoHeadingID OptionName = "AutoHeadingID" - -type withAutoHeadingID struct { -} - -func (o *withAutoHeadingID) SetParserOption(c *Config) { - c.Options[optAutoHeadingID] = true -} - -func (o *withAutoHeadingID) SetHeadingOption(p *HeadingConfig) { - p.AutoHeadingID = true -} - -// WithAutoHeadingID is a functional option that enables custom heading ids and -// auto generated heading ids. -func WithAutoHeadingID() HeadingOption { - return &withAutoHeadingID{} -} - -type withHeadingAttribute struct { - Option -} - -func (o *withHeadingAttribute) SetHeadingOption(p *HeadingConfig) { - p.Attribute = true -} - -// WithHeadingAttribute is a functional option that enables custom heading attributes. -func WithHeadingAttribute() HeadingOption { - return &withHeadingAttribute{WithAttribute()} -} - -type atxHeadingParser struct { - HeadingConfig -} - -// NewATXHeadingParser return a new BlockParser that can parse ATX headings. -func NewATXHeadingParser(opts ...HeadingOption) BlockParser { - p := &atxHeadingParser{} - for _, o := range opts { - o.SetHeadingOption(&p.HeadingConfig) - } - return p -} - -func (b *atxHeadingParser) Trigger() []byte { - return []byte{'#'} -} - -func (b *atxHeadingParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - line, segment := reader.PeekLine() - pos := pc.BlockOffset() - if pos < 0 { - return nil, NoChildren - } - i := pos - for ; i < len(line) && line[i] == '#'; i++ { - } - level := i - pos - if i == pos || level > 6 { - return nil, NoChildren - } - if i == len(line) { // alone '#' (without a new line character) - return ast.NewHeading(level), NoChildren - } - l := util.TrimLeftSpaceLength(line[i:]) - if l == 0 { - return nil, NoChildren - } - start := i + l - if start >= len(line) { - start = len(line) - 1 - } - origstart := start - stop := len(line) - util.TrimRightSpaceLength(line) - - node := ast.NewHeading(level) - parsed := false - if b.Attribute { // handles special case like ### heading ### {#id} - start-- - closureClose := -1 - closureOpen := -1 - for j := start; j < stop; { - c := line[j] - if util.IsEscapedPunctuation(line, j) { - j += 2 - } else if util.IsSpace(c) && j < stop-1 && line[j+1] == '#' { - closureOpen = j + 1 - k := j + 1 - for ; k < stop && line[k] == '#'; k++ { - } - closureClose = k - break - } else { - j++ - } - } - if closureClose > 0 { - reader.Advance(closureClose) - attrs, ok := ParseAttributes(reader) - rest, _ := reader.PeekLine() - parsed = ok && util.IsBlank(rest) - if parsed { - for _, attr := range attrs { - node.SetAttribute(attr.Name, attr.Value) - } - node.Lines().Append(text.NewSegment(segment.Start+start+1-segment.Padding, segment.Start+closureOpen-segment.Padding)) - } - } - } - if !parsed { - start = origstart - stop := len(line) - util.TrimRightSpaceLength(line) - if stop <= start { // empty headings like '##[space]' - stop = start - } else { - i = stop - 1 - for ; line[i] == '#' && i >= start; i-- { - } - if i != stop-1 && !util.IsSpace(line[i]) { - i = stop - 1 - } - i++ - stop = i - } - - if len(util.TrimRight(line[start:stop], []byte{'#'})) != 0 { // empty heading like '### ###' - node.Lines().Append(text.NewSegment(segment.Start+start-segment.Padding, segment.Start+stop-segment.Padding)) - } - } - return node, NoChildren -} - -func (b *atxHeadingParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - return Close -} - -func (b *atxHeadingParser) Close(node ast.Node, reader text.Reader, pc Context) { - if b.Attribute { - _, ok := node.AttributeString("id") - if !ok { - parseLastLineAttributes(node, reader, pc) - } - } - - if b.AutoHeadingID { - id, ok := node.AttributeString("id") - if !ok { - generateAutoHeadingID(node.(*ast.Heading), reader, pc) - } else { - pc.IDs().Put(id.([]byte)) - } - } -} - -func (b *atxHeadingParser) CanInterruptParagraph() bool { - return true -} - -func (b *atxHeadingParser) CanAcceptIndentedLine() bool { - return false -} - -func generateAutoHeadingID(node *ast.Heading, reader text.Reader, pc Context) { - var line []byte - lastIndex := node.Lines().Len() - 1 - if lastIndex > -1 { - lastLine := node.Lines().At(lastIndex) - line = lastLine.Value(reader.Source()) - } - headingID := pc.IDs().Generate(line, ast.KindHeading) - node.SetAttribute(attrNameID, headingID) -} - -func parseLastLineAttributes(node ast.Node, reader text.Reader, pc Context) { - lastIndex := node.Lines().Len() - 1 - if lastIndex < 0 { // empty headings - return - } - lastLine := node.Lines().At(lastIndex) - line := lastLine.Value(reader.Source()) - lr := text.NewReader(line) - var attrs Attributes - var ok bool - var start text.Segment - var sl int - var end text.Segment - for { - c := lr.Peek() - if c == text.EOF { - break - } - if c == '\\' { - lr.Advance(1) - if lr.Peek() == '{' { - lr.Advance(1) - } - continue - } - if c == '{' { - sl, start = lr.Position() - attrs, ok = ParseAttributes(lr) - _, end = lr.Position() - lr.SetPosition(sl, start) - } - lr.Advance(1) - } - if ok && util.IsBlank(line[end.Start:]) { - for _, attr := range attrs { - node.SetAttribute(attr.Name, attr.Value) - } - lastLine.Stop = lastLine.Start + start.Start - node.Lines().Set(lastIndex, lastLine) - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/auto_link.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/auto_link.go deleted file mode 100644 index 726a50571..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/auto_link.go +++ /dev/null @@ -1,42 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type autoLinkParser struct { -} - -var defaultAutoLinkParser = &autoLinkParser{} - -// NewAutoLinkParser returns a new InlineParser that parses autolinks -// surrounded by '<' and '>' . -func NewAutoLinkParser() InlineParser { - return defaultAutoLinkParser -} - -func (s *autoLinkParser) Trigger() []byte { - return []byte{'<'} -} - -func (s *autoLinkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { - line, segment := block.PeekLine() - stop := util.FindEmailIndex(line[1:]) - typ := ast.AutoLinkType(ast.AutoLinkEmail) - if stop < 0 { - stop = util.FindURLIndex(line[1:]) - typ = ast.AutoLinkURL - } - if stop < 0 { - return nil - } - stop++ - if stop >= len(line) || line[stop] != '>' { - return nil - } - value := ast.NewTextSegment(text.NewSegment(segment.Start+1, segment.Start+stop)) - block.Advance(stop + 1) - return ast.NewAutoLink(typ, value) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/blockquote.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/blockquote.go deleted file mode 100644 index e7778dca7..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/blockquote.go +++ /dev/null @@ -1,69 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type blockquoteParser struct { -} - -var defaultBlockquoteParser = &blockquoteParser{} - -// NewBlockquoteParser returns a new BlockParser that -// parses blockquotes. -func NewBlockquoteParser() BlockParser { - return defaultBlockquoteParser -} - -func (b *blockquoteParser) process(reader text.Reader) bool { - line, _ := reader.PeekLine() - w, pos := util.IndentWidth(line, reader.LineOffset()) - if w > 3 || pos >= len(line) || line[pos] != '>' { - return false - } - pos++ - if pos >= len(line) || line[pos] == '\n' { - reader.Advance(pos) - return true - } - if line[pos] == ' ' || line[pos] == '\t' { - pos++ - } - reader.Advance(pos) - if line[pos-1] == '\t' { - reader.SetPadding(2) - } - return true -} - -func (b *blockquoteParser) Trigger() []byte { - return []byte{'>'} -} - -func (b *blockquoteParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - if b.process(reader) { - return ast.NewBlockquote(), HasChildren - } - return nil, NoChildren -} - -func (b *blockquoteParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - if b.process(reader) { - return Continue | HasChildren - } - return Close -} - -func (b *blockquoteParser) Close(node ast.Node, reader text.Reader, pc Context) { - // nothing to do -} - -func (b *blockquoteParser) CanInterruptParagraph() bool { - return true -} - -func (b *blockquoteParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/code_block.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/code_block.go deleted file mode 100644 index 732f18c65..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/code_block.go +++ /dev/null @@ -1,100 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type codeBlockParser struct { -} - -// CodeBlockParser is a BlockParser implementation that parses indented code blocks. -var defaultCodeBlockParser = &codeBlockParser{} - -// NewCodeBlockParser returns a new BlockParser that -// parses code blocks. -func NewCodeBlockParser() BlockParser { - return defaultCodeBlockParser -} - -func (b *codeBlockParser) Trigger() []byte { - return nil -} - -func (b *codeBlockParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - line, segment := reader.PeekLine() - pos, padding := util.IndentPosition(line, reader.LineOffset(), 4) - if pos < 0 || util.IsBlank(line) { - return nil, NoChildren - } - node := ast.NewCodeBlock() - reader.AdvanceAndSetPadding(pos, padding) - _, segment = reader.PeekLine() - // if code block line starts with a tab, keep a tab as it is. - if segment.Padding != 0 { - preserveLeadingTabInCodeBlock(&segment, reader, 0) - } - node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) - return node, NoChildren - -} - -func (b *codeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - line, segment := reader.PeekLine() - if util.IsBlank(line) { - node.Lines().Append(segment.TrimLeftSpaceWidth(4, reader.Source())) - return Continue | NoChildren - } - pos, padding := util.IndentPosition(line, reader.LineOffset(), 4) - if pos < 0 { - return Close - } - reader.AdvanceAndSetPadding(pos, padding) - _, segment = reader.PeekLine() - - // if code block line starts with a tab, keep a tab as it is. - if segment.Padding != 0 { - preserveLeadingTabInCodeBlock(&segment, reader, 0) - } - - node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) - return Continue | NoChildren -} - -func (b *codeBlockParser) Close(node ast.Node, reader text.Reader, pc Context) { - // trim trailing blank lines - lines := node.Lines() - length := lines.Len() - 1 - source := reader.Source() - for length >= 0 { - line := lines.At(length) - if util.IsBlank(line.Value(source)) { - length-- - } else { - break - } - } - lines.SetSliced(0, length+1) -} - -func (b *codeBlockParser) CanInterruptParagraph() bool { - return false -} - -func (b *codeBlockParser) CanAcceptIndentedLine() bool { - return true -} - -func preserveLeadingTabInCodeBlock(segment *text.Segment, reader text.Reader, indent int) { - offsetWithPadding := reader.LineOffset() + indent - sl, ss := reader.Position() - reader.SetPosition(sl, text.NewSegment(ss.Start-1, ss.Stop)) - if offsetWithPadding == reader.LineOffset() { - segment.Padding = 0 - segment.Start-- - } - reader.SetPosition(sl, ss) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/code_span.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/code_span.go deleted file mode 100644 index a74b09bc4..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/code_span.go +++ /dev/null @@ -1,84 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" -) - -type codeSpanParser struct { -} - -var defaultCodeSpanParser = &codeSpanParser{} - -// NewCodeSpanParser return a new InlineParser that parses inline codes -// surrounded by '`' . -func NewCodeSpanParser() InlineParser { - return defaultCodeSpanParser -} - -func (s *codeSpanParser) Trigger() []byte { - return []byte{'`'} -} - -func (s *codeSpanParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { - line, startSegment := block.PeekLine() - opener := 0 - for ; opener < len(line) && line[opener] == '`'; opener++ { - } - block.Advance(opener) - l, pos := block.Position() - node := ast.NewCodeSpan() - for { - line, segment := block.PeekLine() - if line == nil { - block.SetPosition(l, pos) - return ast.NewTextSegment(startSegment.WithStop(startSegment.Start + opener)) - } - for i := 0; i < len(line); i++ { - c := line[i] - if c == '`' { - oldi := i - for ; i < len(line) && line[i] == '`'; i++ { - } - closure := i - oldi - if closure == opener && (i >= len(line) || line[i] != '`') { - segment = segment.WithStop(segment.Start + i - closure) - if !segment.IsEmpty() { - node.AppendChild(node, ast.NewRawTextSegment(segment)) - } - block.Advance(i) - goto end - } - } - } - node.AppendChild(node, ast.NewRawTextSegment(segment)) - block.AdvanceLine() - } -end: - if !node.IsBlank(block.Source()) { - // trim first halfspace and last halfspace - segment := node.FirstChild().(*ast.Text).Segment - shouldTrimmed := true - if !(!segment.IsEmpty() && isSpaceOrNewline(block.Source()[segment.Start])) { - shouldTrimmed = false - } - segment = node.LastChild().(*ast.Text).Segment - if !(!segment.IsEmpty() && isSpaceOrNewline(block.Source()[segment.Stop-1])) { - shouldTrimmed = false - } - if shouldTrimmed { - t := node.FirstChild().(*ast.Text) - segment := t.Segment - t.Segment = segment.WithStart(segment.Start + 1) - t = node.LastChild().(*ast.Text) - segment = node.LastChild().(*ast.Text).Segment - t.Segment = segment.WithStop(segment.Stop - 1) - } - - } - return node -} - -func isSpaceOrNewline(c byte) bool { - return c == ' ' || c == '\n' -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/delimiter.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/delimiter.go deleted file mode 100644 index eb843af44..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/delimiter.go +++ /dev/null @@ -1,238 +0,0 @@ -package parser - -import ( - "fmt" - "strings" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -// A DelimiterProcessor interface provides a set of functions about -// Delimiter nodes. -type DelimiterProcessor interface { - // IsDelimiter returns true if given character is a delimiter, otherwise false. - IsDelimiter(byte) bool - - // CanOpenCloser returns true if given opener can close given closer, otherwise false. - CanOpenCloser(opener, closer *Delimiter) bool - - // OnMatch will be called when new matched delimiter found. - // OnMatch should return a new Node correspond to the matched delimiter. - OnMatch(consumes int) ast.Node -} - -// A Delimiter struct represents a delimiter like '*' of the Markdown text. -type Delimiter struct { - ast.BaseInline - - Segment text.Segment - - // CanOpen is set true if this delimiter can open a span for a new node. - // See https://spec.commonmark.org/0.30/#can-open-emphasis for details. - CanOpen bool - - // CanClose is set true if this delimiter can close a span for a new node. - // See https://spec.commonmark.org/0.30/#can-open-emphasis for details. - CanClose bool - - // Length is a remaining length of this delimiter. - Length int - - // OriginalLength is a original length of this delimiter. - OriginalLength int - - // Char is a character of this delimiter. - Char byte - - // PreviousDelimiter is a previous sibling delimiter node of this delimiter. - PreviousDelimiter *Delimiter - - // NextDelimiter is a next sibling delimiter node of this delimiter. - NextDelimiter *Delimiter - - // Processor is a DelimiterProcessor associated with this delimiter. - Processor DelimiterProcessor -} - -// Inline implements Inline.Inline. -func (d *Delimiter) Inline() {} - -// Dump implements Node.Dump. -func (d *Delimiter) Dump(source []byte, level int) { - fmt.Printf("%sDelimiter: \"%s\"\n", strings.Repeat(" ", level), string(d.Text(source))) -} - -var kindDelimiter = ast.NewNodeKind("Delimiter") - -// Kind implements Node.Kind -func (d *Delimiter) Kind() ast.NodeKind { - return kindDelimiter -} - -// Text implements Node.Text -func (d *Delimiter) Text(source []byte) []byte { - return d.Segment.Value(source) -} - -// ConsumeCharacters consumes delimiters. -func (d *Delimiter) ConsumeCharacters(n int) { - d.Length -= n - d.Segment = d.Segment.WithStop(d.Segment.Start + d.Length) -} - -// CalcComsumption calculates how many characters should be used for opening -// a new span correspond to given closer. -func (d *Delimiter) CalcComsumption(closer *Delimiter) int { - if (d.CanClose || closer.CanOpen) && (d.OriginalLength+closer.OriginalLength)%3 == 0 && closer.OriginalLength%3 != 0 { - return 0 - } - if d.Length >= 2 && closer.Length >= 2 { - return 2 - } - return 1 -} - -// NewDelimiter returns a new Delimiter node. -func NewDelimiter(canOpen, canClose bool, length int, char byte, processor DelimiterProcessor) *Delimiter { - c := &Delimiter{ - BaseInline: ast.BaseInline{}, - CanOpen: canOpen, - CanClose: canClose, - Length: length, - OriginalLength: length, - Char: char, - PreviousDelimiter: nil, - NextDelimiter: nil, - Processor: processor, - } - return c -} - -// ScanDelimiter scans a delimiter by given DelimiterProcessor. -func ScanDelimiter(line []byte, before rune, min int, processor DelimiterProcessor) *Delimiter { - i := 0 - c := line[i] - j := i - if !processor.IsDelimiter(c) { - return nil - } - for ; j < len(line) && c == line[j]; j++ { - } - if (j - i) >= min { - after := rune(' ') - if j != len(line) { - after = util.ToRune(line, j) - } - - canOpen, canClose := false, false - beforeIsPunctuation := util.IsPunctRune(before) - beforeIsWhitespace := util.IsSpaceRune(before) - afterIsPunctuation := util.IsPunctRune(after) - afterIsWhitespace := util.IsSpaceRune(after) - - isLeft := !afterIsWhitespace && - (!afterIsPunctuation || beforeIsWhitespace || beforeIsPunctuation) - isRight := !beforeIsWhitespace && - (!beforeIsPunctuation || afterIsWhitespace || afterIsPunctuation) - - if line[i] == '_' { - canOpen = isLeft && (!isRight || beforeIsPunctuation) - canClose = isRight && (!isLeft || afterIsPunctuation) - } else { - canOpen = isLeft - canClose = isRight - } - return NewDelimiter(canOpen, canClose, j-i, c, processor) - } - return nil -} - -// ProcessDelimiters processes the delimiter list in the context. -// Processing will be stop when reaching the bottom. -// -// If you implement an inline parser that can have other inline nodes as -// children, you should call this function when nesting span has closed. -func ProcessDelimiters(bottom ast.Node, pc Context) { - lastDelimiter := pc.LastDelimiter() - if lastDelimiter == nil { - return - } - var closer *Delimiter - if bottom != nil { - if bottom != lastDelimiter { - for c := lastDelimiter.PreviousSibling(); c != nil && c != bottom; { - if d, ok := c.(*Delimiter); ok { - closer = d - } - c = c.PreviousSibling() - } - } - } else { - closer = pc.FirstDelimiter() - } - if closer == nil { - pc.ClearDelimiters(bottom) - return - } - for closer != nil { - if !closer.CanClose { - closer = closer.NextDelimiter - continue - } - consume := 0 - found := false - maybeOpener := false - var opener *Delimiter - for opener = closer.PreviousDelimiter; opener != nil && opener != bottom; opener = opener.PreviousDelimiter { - if opener.CanOpen && opener.Processor.CanOpenCloser(opener, closer) { - maybeOpener = true - consume = opener.CalcComsumption(closer) - if consume > 0 { - found = true - break - } - } - } - if !found { - next := closer.NextDelimiter - if !maybeOpener && !closer.CanOpen { - pc.RemoveDelimiter(closer) - } - closer = next - continue - } - opener.ConsumeCharacters(consume) - closer.ConsumeCharacters(consume) - - node := opener.Processor.OnMatch(consume) - - parent := opener.Parent() - child := opener.NextSibling() - - for child != nil && child != closer { - next := child.NextSibling() - node.AppendChild(node, child) - child = next - } - parent.InsertAfter(parent, opener, node) - - for c := opener.NextDelimiter; c != nil && c != closer; { - next := c.NextDelimiter - pc.RemoveDelimiter(c) - c = next - } - - if opener.Length == 0 { - pc.RemoveDelimiter(opener) - } - - if closer.Length == 0 { - next := closer.NextDelimiter - pc.RemoveDelimiter(closer) - closer = next - } - } - pc.ClearDelimiters(bottom) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/emphasis.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/emphasis.go deleted file mode 100644 index 488647117..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/emphasis.go +++ /dev/null @@ -1,50 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" -) - -type emphasisDelimiterProcessor struct { -} - -func (p *emphasisDelimiterProcessor) IsDelimiter(b byte) bool { - return b == '*' || b == '_' -} - -func (p *emphasisDelimiterProcessor) CanOpenCloser(opener, closer *Delimiter) bool { - return opener.Char == closer.Char -} - -func (p *emphasisDelimiterProcessor) OnMatch(consumes int) ast.Node { - return ast.NewEmphasis(consumes) -} - -var defaultEmphasisDelimiterProcessor = &emphasisDelimiterProcessor{} - -type emphasisParser struct { -} - -var defaultEmphasisParser = &emphasisParser{} - -// NewEmphasisParser return a new InlineParser that parses emphasises. -func NewEmphasisParser() InlineParser { - return defaultEmphasisParser -} - -func (s *emphasisParser) Trigger() []byte { - return []byte{'*', '_'} -} - -func (s *emphasisParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { - before := block.PrecendingCharacter() - line, segment := block.PeekLine() - node := ScanDelimiter(line, before, 1, defaultEmphasisDelimiterProcessor) - if node == nil { - return nil - } - node.Segment = segment.WithStop(segment.Start + node.OriginalLength) - block.Advance(node.OriginalLength) - pc.PushDelimiter(node) - return node -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/fcode_block.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/fcode_block.go deleted file mode 100644 index 5914138d3..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/fcode_block.go +++ /dev/null @@ -1,121 +0,0 @@ -package parser - -import ( - "bytes" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type fencedCodeBlockParser struct { -} - -var defaultFencedCodeBlockParser = &fencedCodeBlockParser{} - -// NewFencedCodeBlockParser returns a new BlockParser that -// parses fenced code blocks. -func NewFencedCodeBlockParser() BlockParser { - return defaultFencedCodeBlockParser -} - -type fenceData struct { - char byte - indent int - length int - node ast.Node -} - -var fencedCodeBlockInfoKey = NewContextKey() - -func (b *fencedCodeBlockParser) Trigger() []byte { - return []byte{'~', '`'} -} - -func (b *fencedCodeBlockParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - line, segment := reader.PeekLine() - pos := pc.BlockOffset() - if pos < 0 || (line[pos] != '`' && line[pos] != '~') { - return nil, NoChildren - } - findent := pos - fenceChar := line[pos] - i := pos - for ; i < len(line) && line[i] == fenceChar; i++ { - } - oFenceLength := i - pos - if oFenceLength < 3 { - return nil, NoChildren - } - var info *ast.Text - if i < len(line)-1 { - rest := line[i:] - left := util.TrimLeftSpaceLength(rest) - right := util.TrimRightSpaceLength(rest) - if left < len(rest)-right { - infoStart, infoStop := segment.Start-segment.Padding+i+left, segment.Stop-right - value := rest[left : len(rest)-right] - if fenceChar == '`' && bytes.IndexByte(value, '`') > -1 { - return nil, NoChildren - } else if infoStart != infoStop { - info = ast.NewTextSegment(text.NewSegment(infoStart, infoStop)) - } - } - } - node := ast.NewFencedCodeBlock(info) - pc.Set(fencedCodeBlockInfoKey, &fenceData{fenceChar, findent, oFenceLength, node}) - return node, NoChildren - -} - -func (b *fencedCodeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - line, segment := reader.PeekLine() - fdata := pc.Get(fencedCodeBlockInfoKey).(*fenceData) - - w, pos := util.IndentWidth(line, reader.LineOffset()) - if w < 4 { - i := pos - for ; i < len(line) && line[i] == fdata.char; i++ { - } - length := i - pos - if length >= fdata.length && util.IsBlank(line[i:]) { - newline := 1 - if line[len(line)-1] != '\n' { - newline = 0 - } - reader.Advance(segment.Stop - segment.Start - newline - segment.Padding) - return Close - } - } - pos, padding := util.IndentPositionPadding(line, reader.LineOffset(), segment.Padding, fdata.indent) - if pos < 0 { - pos = util.FirstNonSpacePosition(line) - if pos < 0 { - pos = 0 - } - padding = 0 - } - seg := text.NewSegmentPadding(segment.Start+pos, segment.Stop, padding) - // if code block line starts with a tab, keep a tab as it is. - if padding != 0 { - preserveLeadingTabInCodeBlock(&seg, reader, fdata.indent) - } - node.Lines().Append(seg) - reader.AdvanceAndSetPadding(segment.Stop-segment.Start-pos-1, padding) - return Continue | NoChildren -} - -func (b *fencedCodeBlockParser) Close(node ast.Node, reader text.Reader, pc Context) { - fdata := pc.Get(fencedCodeBlockInfoKey).(*fenceData) - if fdata.node == node { - pc.Set(fencedCodeBlockInfoKey, nil) - } -} - -func (b *fencedCodeBlockParser) CanInterruptParagraph() bool { - return true -} - -func (b *fencedCodeBlockParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/html_block.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/html_block.go deleted file mode 100644 index e6f5a3fd9..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/html_block.go +++ /dev/null @@ -1,228 +0,0 @@ -package parser - -import ( - "bytes" - "regexp" - "strings" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var allowedBlockTags = map[string]bool{ - "address": true, - "article": true, - "aside": true, - "base": true, - "basefont": true, - "blockquote": true, - "body": true, - "caption": true, - "center": true, - "col": true, - "colgroup": true, - "dd": true, - "details": true, - "dialog": true, - "dir": true, - "div": true, - "dl": true, - "dt": 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, - "hr": true, - "html": true, - "iframe": true, - "legend": true, - "li": true, - "link": true, - "main": true, - "menu": true, - "menuitem": true, - "meta": true, - "nav": true, - "noframes": true, - "ol": true, - "optgroup": true, - "option": true, - "p": true, - "param": true, - "section": true, - "source": true, - "summary": true, - "table": true, - "tbody": true, - "td": true, - "tfoot": true, - "th": true, - "thead": true, - "title": true, - "tr": true, - "track": true, - "ul": true, -} - -var htmlBlockType1OpenRegexp = regexp.MustCompile(`(?i)^[ ]{0,3}<(script|pre|style|textarea)(?:\s.*|>.*|/>.*|)(?:\r\n|\n)?$`) -var htmlBlockType1CloseRegexp = regexp.MustCompile(`(?i)^.*.*`) - -var htmlBlockType2OpenRegexp = regexp.MustCompile(`^[ ]{0,3}'} - -var htmlBlockType3OpenRegexp = regexp.MustCompile(`^[ ]{0,3}<\?`) -var htmlBlockType3Close = []byte{'?', '>'} - -var htmlBlockType4OpenRegexp = regexp.MustCompile(`^[ ]{0,3}'} - -var htmlBlockType5OpenRegexp = regexp.MustCompile(`^[ ]{0,3}<\!\[CDATA\[`) -var htmlBlockType5Close = []byte{']', ']', '>'} - -var htmlBlockType6Regexp = regexp.MustCompile(`^[ ]{0,3}<(?:/[ ]*)?([a-zA-Z]+[a-zA-Z0-9\-]*)(?:[ ].*|>.*|/>.*|)(?:\r\n|\n)?$`) - -var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/[ ]*)?([a-zA-Z]+[a-zA-Z0-9\-]*)(` + attributePattern + `*)[ ]*(?:>|/>)[ ]*(?:\r\n|\n)?$`) - -type htmlBlockParser struct { -} - -var defaultHTMLBlockParser = &htmlBlockParser{} - -// NewHTMLBlockParser return a new BlockParser that can parse html -// blocks. -func NewHTMLBlockParser() BlockParser { - return defaultHTMLBlockParser -} - -func (b *htmlBlockParser) Trigger() []byte { - return []byte{'<'} -} - -func (b *htmlBlockParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - var node *ast.HTMLBlock - line, segment := reader.PeekLine() - last := pc.LastOpenedBlock().Node - if pos := pc.BlockOffset(); pos < 0 || line[pos] != '<' { - return nil, NoChildren - } - - if m := htmlBlockType1OpenRegexp.FindSubmatchIndex(line); m != nil { - node = ast.NewHTMLBlock(ast.HTMLBlockType1) - } else if htmlBlockType2OpenRegexp.Match(line) { - node = ast.NewHTMLBlock(ast.HTMLBlockType2) - } else if htmlBlockType3OpenRegexp.Match(line) { - node = ast.NewHTMLBlock(ast.HTMLBlockType3) - } else if htmlBlockType4OpenRegexp.Match(line) { - node = ast.NewHTMLBlock(ast.HTMLBlockType4) - } else if htmlBlockType5OpenRegexp.Match(line) { - node = ast.NewHTMLBlock(ast.HTMLBlockType5) - } else if match := htmlBlockType7Regexp.FindSubmatchIndex(line); match != nil { - isCloseTag := match[2] > -1 && bytes.Equal(line[match[2]:match[3]], []byte("/")) - hasAttr := match[6] != match[7] - tagName := strings.ToLower(string(line[match[4]:match[5]])) - _, ok := allowedBlockTags[tagName] - if ok { - node = ast.NewHTMLBlock(ast.HTMLBlockType6) - } else if tagName != "script" && tagName != "style" && tagName != "pre" && !ast.IsParagraph(last) && !(isCloseTag && hasAttr) { // type 7 can not interrupt paragraph - node = ast.NewHTMLBlock(ast.HTMLBlockType7) - } - } - if node == nil { - if match := htmlBlockType6Regexp.FindSubmatchIndex(line); match != nil { - tagName := string(line[match[2]:match[3]]) - _, ok := allowedBlockTags[strings.ToLower(tagName)] - if ok { - node = ast.NewHTMLBlock(ast.HTMLBlockType6) - } - } - } - if node != nil { - reader.Advance(segment.Len() - 1) - node.Lines().Append(segment) - return node, NoChildren - } - return nil, NoChildren -} - -func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - htmlBlock := node.(*ast.HTMLBlock) - lines := htmlBlock.Lines() - line, segment := reader.PeekLine() - var closurePattern []byte - - switch htmlBlock.HTMLBlockType { - case ast.HTMLBlockType1: - if lines.Len() == 1 { - firstLine := lines.At(0) - if htmlBlockType1CloseRegexp.Match(firstLine.Value(reader.Source())) { - return Close - } - } - if htmlBlockType1CloseRegexp.Match(line) { - htmlBlock.ClosureLine = segment - reader.Advance(segment.Len() - 1) - return Close - } - case ast.HTMLBlockType2: - closurePattern = htmlBlockType2Close - fallthrough - case ast.HTMLBlockType3: - if closurePattern == nil { - closurePattern = htmlBlockType3Close - } - fallthrough - case ast.HTMLBlockType4: - if closurePattern == nil { - closurePattern = htmlBlockType4Close - } - fallthrough - case ast.HTMLBlockType5: - if closurePattern == nil { - closurePattern = htmlBlockType5Close - } - - if lines.Len() == 1 { - firstLine := lines.At(0) - if bytes.Contains(firstLine.Value(reader.Source()), closurePattern) { - return Close - } - } - if bytes.Contains(line, closurePattern) { - htmlBlock.ClosureLine = segment - reader.Advance(segment.Len() - 1) - return Close - } - - case ast.HTMLBlockType6, ast.HTMLBlockType7: - if util.IsBlank(line) { - return Close - } - } - node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) - return Continue | NoChildren -} - -func (b *htmlBlockParser) Close(node ast.Node, reader text.Reader, pc Context) { - // nothing to do -} - -func (b *htmlBlockParser) CanInterruptParagraph() bool { - return true -} - -func (b *htmlBlockParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/link.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/link.go deleted file mode 100644 index bd96dfb77..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/link.go +++ /dev/null @@ -1,382 +0,0 @@ -package parser - -import ( - "fmt" - "strings" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var linkLabelStateKey = NewContextKey() - -type linkLabelState struct { - ast.BaseInline - - Segment text.Segment - - IsImage bool - - Prev *linkLabelState - - Next *linkLabelState - - First *linkLabelState - - Last *linkLabelState -} - -func newLinkLabelState(segment text.Segment, isImage bool) *linkLabelState { - return &linkLabelState{ - Segment: segment, - IsImage: isImage, - } -} - -func (s *linkLabelState) Text(source []byte) []byte { - return s.Segment.Value(source) -} - -func (s *linkLabelState) Dump(source []byte, level int) { - fmt.Printf("%slinkLabelState: \"%s\"\n", strings.Repeat(" ", level), s.Text(source)) -} - -var kindLinkLabelState = ast.NewNodeKind("LinkLabelState") - -func (s *linkLabelState) Kind() ast.NodeKind { - return kindLinkLabelState -} - -func pushLinkLabelState(pc Context, v *linkLabelState) { - tlist := pc.Get(linkLabelStateKey) - var list *linkLabelState - if tlist == nil { - list = v - v.First = v - v.Last = v - pc.Set(linkLabelStateKey, list) - } else { - list = tlist.(*linkLabelState) - l := list.Last - list.Last = v - l.Next = v - v.Prev = l - } -} - -func removeLinkLabelState(pc Context, d *linkLabelState) { - tlist := pc.Get(linkLabelStateKey) - var list *linkLabelState - if tlist == nil { - return - } - list = tlist.(*linkLabelState) - - if d.Prev == nil { - list = d.Next - if list != nil { - list.First = d - list.Last = d.Last - list.Prev = nil - pc.Set(linkLabelStateKey, list) - } else { - pc.Set(linkLabelStateKey, nil) - } - } else { - d.Prev.Next = d.Next - if d.Next != nil { - d.Next.Prev = d.Prev - } - } - if list != nil && d.Next == nil { - list.Last = d.Prev - } - d.Next = nil - d.Prev = nil - d.First = nil - d.Last = nil -} - -type linkParser struct { -} - -var defaultLinkParser = &linkParser{} - -// NewLinkParser return a new InlineParser that parses links. -func NewLinkParser() InlineParser { - return defaultLinkParser -} - -func (s *linkParser) Trigger() []byte { - return []byte{'!', '[', ']'} -} - -var linkBottom = NewContextKey() - -func (s *linkParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { - line, segment := block.PeekLine() - if line[0] == '!' { - if len(line) > 1 && line[1] == '[' { - block.Advance(1) - pc.Set(linkBottom, pc.LastDelimiter()) - return processLinkLabelOpen(block, segment.Start+1, true, pc) - } - return nil - } - if line[0] == '[' { - pc.Set(linkBottom, pc.LastDelimiter()) - return processLinkLabelOpen(block, segment.Start, false, pc) - } - - // line[0] == ']' - tlist := pc.Get(linkLabelStateKey) - if tlist == nil { - return nil - } - last := tlist.(*linkLabelState).Last - if last == nil { - return nil - } - block.Advance(1) - removeLinkLabelState(pc, last) - if !last.IsImage && s.containsLink(last) { // a link in a link text is not allowed - ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) - return nil - } - - c := block.Peek() - l, pos := block.Position() - var link *ast.Link - var hasValue bool - if c == '(' { // normal link - link = s.parseLink(parent, last, block, pc) - } else if c == '[' { // reference link - link, hasValue = s.parseReferenceLink(parent, last, block, pc) - if link == nil && hasValue { - ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) - return nil - } - } - - if link == nil { - // maybe shortcut reference link - block.SetPosition(l, pos) - ssegment := text.NewSegment(last.Segment.Stop, segment.Start) - maybeReference := block.Value(ssegment) - ref, ok := pc.Reference(util.ToLinkReference(maybeReference)) - if !ok { - ast.MergeOrReplaceTextSegment(last.Parent(), last, last.Segment) - return nil - } - link = ast.NewLink() - s.processLinkLabel(parent, link, last, pc) - link.Title = ref.Title() - link.Destination = ref.Destination() - } - if last.IsImage { - last.Parent().RemoveChild(last.Parent(), last) - return ast.NewImage(link) - } - last.Parent().RemoveChild(last.Parent(), last) - return link -} - -func (s *linkParser) containsLink(n ast.Node) bool { - if n == nil { - return false - } - for c := n; c != nil; c = c.NextSibling() { - if _, ok := c.(*ast.Link); ok { - return true - } - if s.containsLink(c.FirstChild()) { - return true - } - } - return false -} - -func processLinkLabelOpen(block text.Reader, pos int, isImage bool, pc Context) *linkLabelState { - start := pos - if isImage { - start-- - } - state := newLinkLabelState(text.NewSegment(start, pos+1), isImage) - pushLinkLabelState(pc, state) - block.Advance(1) - return state -} - -func (s *linkParser) processLinkLabel(parent ast.Node, link *ast.Link, last *linkLabelState, pc Context) { - var bottom ast.Node - if v := pc.Get(linkBottom); v != nil { - bottom = v.(ast.Node) - } - pc.Set(linkBottom, nil) - ProcessDelimiters(bottom, pc) - for c := last.NextSibling(); c != nil; { - next := c.NextSibling() - parent.RemoveChild(parent, c) - link.AppendChild(link, c) - c = next - } -} - -var linkFindClosureOptions text.FindClosureOptions = text.FindClosureOptions{ - Nesting: false, - Newline: true, - Advance: true, -} - -func (s *linkParser) parseReferenceLink(parent ast.Node, last *linkLabelState, block text.Reader, pc Context) (*ast.Link, bool) { - _, orgpos := block.Position() - block.Advance(1) // skip '[' - segments, found := block.FindClosure('[', ']', linkFindClosureOptions) - if !found { - return nil, false - } - - var maybeReference []byte - if segments.Len() == 1 { // avoid allocate a new byte slice - maybeReference = block.Value(segments.At(0)) - } else { - maybeReference = []byte{} - for i := 0; i < segments.Len(); i++ { - s := segments.At(i) - maybeReference = append(maybeReference, block.Value(s)...) - } - } - if util.IsBlank(maybeReference) { // collapsed reference link - s := text.NewSegment(last.Segment.Stop, orgpos.Start-1) - maybeReference = block.Value(s) - } - - ref, ok := pc.Reference(util.ToLinkReference(maybeReference)) - if !ok { - return nil, true - } - - link := ast.NewLink() - s.processLinkLabel(parent, link, last, pc) - link.Title = ref.Title() - link.Destination = ref.Destination() - return link, true -} - -func (s *linkParser) parseLink(parent ast.Node, last *linkLabelState, block text.Reader, pc Context) *ast.Link { - block.Advance(1) // skip '(' - block.SkipSpaces() - var title []byte - var destination []byte - var ok bool - if block.Peek() == ')' { // empty link like '[link]()' - block.Advance(1) - } else { - destination, ok = parseLinkDestination(block) - if !ok { - return nil - } - block.SkipSpaces() - if block.Peek() == ')' { - block.Advance(1) - } else { - title, ok = parseLinkTitle(block) - if !ok { - return nil - } - block.SkipSpaces() - if block.Peek() == ')' { - block.Advance(1) - } else { - return nil - } - } - } - - link := ast.NewLink() - s.processLinkLabel(parent, link, last, pc) - link.Destination = destination - link.Title = title - return link -} - -func parseLinkDestination(block text.Reader) ([]byte, bool) { - block.SkipSpaces() - line, _ := block.PeekLine() - if block.Peek() == '<' { - i := 1 - for i < len(line) { - c := line[i] - if c == '\\' && i < len(line)-1 && util.IsPunct(line[i+1]) { - i += 2 - continue - } else if c == '>' { - block.Advance(i + 1) - return line[1:i], true - } - i++ - } - return nil, false - } - opened := 0 - i := 0 - for i < len(line) { - c := line[i] - if c == '\\' && i < len(line)-1 && util.IsPunct(line[i+1]) { - i += 2 - continue - } else if c == '(' { - opened++ - } else if c == ')' { - opened-- - if opened < 0 { - break - } - } else if util.IsSpace(c) { - break - } - i++ - } - block.Advance(i) - return line[:i], len(line[:i]) != 0 -} - -func parseLinkTitle(block text.Reader) ([]byte, bool) { - block.SkipSpaces() - opener := block.Peek() - if opener != '"' && opener != '\'' && opener != '(' { - return nil, false - } - closer := opener - if opener == '(' { - closer = ')' - } - block.Advance(1) - segments, found := block.FindClosure(opener, closer, linkFindClosureOptions) - if found { - if segments.Len() == 1 { - return block.Value(segments.At(0)), true - } - var title []byte - for i := 0; i < segments.Len(); i++ { - s := segments.At(i) - title = append(title, block.Value(s)...) - } - return title, true - } - return nil, false -} - -func (s *linkParser) CloseBlock(parent ast.Node, block text.Reader, pc Context) { - tlist := pc.Get(linkLabelStateKey) - if tlist == nil { - return - } - for s := tlist.(*linkLabelState); s != nil; { - next := s.Next - removeLinkLabelState(pc, s) - s.Parent().ReplaceChild(s.Parent(), s, ast.NewTextSegment(s.Segment)) - s = next - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/link_ref.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/link_ref.go deleted file mode 100644 index ea3f6544a..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/link_ref.go +++ /dev/null @@ -1,152 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type linkReferenceParagraphTransformer struct { -} - -// LinkReferenceParagraphTransformer is a ParagraphTransformer implementation -// that parses and extracts link reference from paragraphs. -var LinkReferenceParagraphTransformer = &linkReferenceParagraphTransformer{} - -func (p *linkReferenceParagraphTransformer) Transform(node *ast.Paragraph, reader text.Reader, pc Context) { - lines := node.Lines() - block := text.NewBlockReader(reader.Source(), lines) - removes := [][2]int{} - for { - start, end := parseLinkReferenceDefinition(block, pc) - if start > -1 { - if start == end { - end++ - } - removes = append(removes, [2]int{start, end}) - continue - } - break - } - - offset := 0 - for _, remove := range removes { - if lines.Len() == 0 { - break - } - s := lines.Sliced(remove[1]-offset, lines.Len()) - lines.SetSliced(0, remove[0]-offset) - lines.AppendAll(s) - offset = remove[1] - } - - if lines.Len() == 0 { - t := ast.NewTextBlock() - t.SetBlankPreviousLines(node.HasBlankPreviousLines()) - node.Parent().ReplaceChild(node.Parent(), node, t) - return - } - - node.SetLines(lines) -} - -func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) { - block.SkipSpaces() - line, _ := block.PeekLine() - if line == nil { - return -1, -1 - } - startLine, _ := block.Position() - width, pos := util.IndentWidth(line, 0) - if width > 3 { - return -1, -1 - } - if width != 0 { - pos++ - } - if line[pos] != '[' { - return -1, -1 - } - block.Advance(pos + 1) - segments, found := block.FindClosure('[', ']', linkFindClosureOptions) - if !found { - return -1, -1 - } - var label []byte - if segments.Len() == 1 { - label = block.Value(segments.At(0)) - } else { - for i := 0; i < segments.Len(); i++ { - s := segments.At(i) - label = append(label, block.Value(s)...) - } - } - if util.IsBlank(label) { - return -1, -1 - } - if block.Peek() != ':' { - return -1, -1 - } - block.Advance(1) - block.SkipSpaces() - destination, ok := parseLinkDestination(block) - if !ok { - return -1, -1 - } - line, _ = block.PeekLine() - isNewLine := line == nil || util.IsBlank(line) - - endLine, _ := block.Position() - _, spaces, _ := block.SkipSpaces() - opener := block.Peek() - if opener != '"' && opener != '\'' && opener != '(' { - if !isNewLine { - return -1, -1 - } - ref := NewReference(label, destination, nil) - pc.AddReference(ref) - return startLine, endLine + 1 - } - if spaces == 0 { - return -1, -1 - } - block.Advance(1) - closer := opener - if opener == '(' { - closer = ')' - } - segments, found = block.FindClosure(opener, closer, linkFindClosureOptions) - if !found { - if !isNewLine { - return -1, -1 - } - ref := NewReference(label, destination, nil) - pc.AddReference(ref) - block.AdvanceLine() - return startLine, endLine + 1 - } - var title []byte - if segments.Len() == 1 { - title = block.Value(segments.At(0)) - } else { - for i := 0; i < segments.Len(); i++ { - s := segments.At(i) - title = append(title, block.Value(s)...) - } - } - - line, _ = block.PeekLine() - if line != nil && !util.IsBlank(line) { - if !isNewLine { - return -1, -1 - } - ref := NewReference(label, destination, title) - pc.AddReference(ref) - return startLine, endLine - } - - endLine, _ = block.Position() - ref := NewReference(label, destination, title) - pc.AddReference(ref) - return startLine, endLine + 1 -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/list.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/list.go deleted file mode 100644 index 2a1c03a9f..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/list.go +++ /dev/null @@ -1,283 +0,0 @@ -package parser - -import ( - "strconv" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type listItemType int - -const ( - notList listItemType = iota - bulletList - orderedList -) - -var skipListParserKey = NewContextKey() -var emptyListItemWithBlankLines = NewContextKey() -var listItemFlagValue interface{} = true - -// Same as -// `^(([ ]*)([\-\*\+]))(\s+.*)?\n?$`.FindSubmatchIndex or -// `^(([ ]*)(\d{1,9}[\.\)]))(\s+.*)?\n?$`.FindSubmatchIndex -func parseListItem(line []byte) ([6]int, listItemType) { - i := 0 - l := len(line) - ret := [6]int{} - for ; i < l && line[i] == ' '; i++ { - c := line[i] - if c == '\t' { - return ret, notList - } - } - if i > 3 { - return ret, notList - } - ret[0] = 0 - ret[1] = i - ret[2] = i - var typ listItemType - if i < l && (line[i] == '-' || line[i] == '*' || line[i] == '+') { - i++ - ret[3] = i - typ = bulletList - } else if i < l { - for ; i < l && util.IsNumeric(line[i]); i++ { - } - ret[3] = i - if ret[3] == ret[2] || ret[3]-ret[2] > 9 { - return ret, notList - } - if i < l && (line[i] == '.' || line[i] == ')') { - i++ - ret[3] = i - } else { - return ret, notList - } - typ = orderedList - } else { - return ret, notList - } - if i < l && line[i] != '\n' { - w, _ := util.IndentWidth(line[i:], 0) - if w == 0 { - return ret, notList - } - } - if i >= l { - ret[4] = -1 - ret[5] = -1 - return ret, typ - } - ret[4] = i - ret[5] = len(line) - if line[ret[5]-1] == '\n' && line[i] != '\n' { - ret[5]-- - } - return ret, typ -} - -func matchesListItem(source []byte, strict bool) ([6]int, listItemType) { - m, typ := parseListItem(source) - if typ != notList && (!strict || strict && m[1] < 4) { - return m, typ - } - return m, notList -} - -func calcListOffset(source []byte, match [6]int) int { - offset := 0 - if match[4] < 0 || util.IsBlank(source[match[4]:]) { // list item starts with a blank line - offset = 1 - } else { - offset, _ = util.IndentWidth(source[match[4]:], match[4]) - if offset > 4 { // offseted codeblock - offset = 1 - } - } - return offset -} - -func lastOffset(node ast.Node) int { - lastChild := node.LastChild() - if lastChild != nil { - return lastChild.(*ast.ListItem).Offset - } - return 0 -} - -type listParser struct { -} - -var defaultListParser = &listParser{} - -// NewListParser returns a new BlockParser that -// parses lists. -// This parser must take precedence over the ListItemParser. -func NewListParser() BlockParser { - return defaultListParser -} - -func (b *listParser) Trigger() []byte { - return []byte{'-', '+', '*', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} -} - -func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - last := pc.LastOpenedBlock().Node - if _, lok := last.(*ast.List); lok || pc.Get(skipListParserKey) != nil { - pc.Set(skipListParserKey, nil) - return nil, NoChildren - } - line, _ := reader.PeekLine() - match, typ := matchesListItem(line, true) - if typ == notList { - return nil, NoChildren - } - start := -1 - if typ == orderedList { - number := line[match[2] : match[3]-1] - start, _ = strconv.Atoi(string(number)) - } - - if ast.IsParagraph(last) && last.Parent() == parent { - // we allow only lists starting with 1 to interrupt paragraphs. - if typ == orderedList && start != 1 { - return nil, NoChildren - } - //an empty list item cannot interrupt a paragraph: - if match[4] < 0 || util.IsBlank(line[match[4]:match[5]]) { - return nil, NoChildren - } - } - - marker := line[match[3]-1] - node := ast.NewList(marker) - if start > -1 { - node.Start = start - } - pc.Set(emptyListItemWithBlankLines, nil) - return node, HasChildren -} - -func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - list := node.(*ast.List) - line, _ := reader.PeekLine() - if util.IsBlank(line) { - if node.LastChild().ChildCount() == 0 { - pc.Set(emptyListItemWithBlankLines, listItemFlagValue) - } - return Continue | HasChildren - } - - // "offset" means a width that bar indicates. - // - aaaaaaaa - // |----| - // - // If the indent is less than the last offset like - // - a - // - b <--- current line - // it maybe a new child of the list. - // - // Empty list items can have multiple blanklines - // - // - <--- 1st item is an empty thus "offset" is unknown - // - // - // - <--- current line - // - // -> 1 list with 2 blank items - // - // So if the last item is an empty, it maybe a new child of the list. - // - offset := lastOffset(node) - lastIsEmpty := node.LastChild().ChildCount() == 0 - indent, _ := util.IndentWidth(line, reader.LineOffset()) - - if indent < offset || lastIsEmpty { - if indent < 4 { - match, typ := matchesListItem(line, false) // may have a leading spaces more than 3 - if typ != notList && match[1]-offset < 4 { - marker := line[match[3]-1] - if !list.CanContinue(marker, typ == orderedList) { - return Close - } - // Thematic Breaks take precedence over lists - if isThematicBreak(line[match[3]-1:], 0) { - isHeading := false - last := pc.LastOpenedBlock().Node - if ast.IsParagraph(last) { - c, ok := matchesSetextHeadingBar(line[match[3]-1:]) - if ok && c == '-' { - isHeading = true - } - } - if !isHeading { - return Close - } - } - return Continue | HasChildren - } - } - if !lastIsEmpty { - return Close - } - } - - // Non empty items can not exist next to an empty list item - // with blank lines. So we need to close the current list - // - // - - // - // foo - // - // -> 1 list with 1 blank items and 1 paragraph - if pc.Get(emptyListItemWithBlankLines) != nil { - return Close - } - return Continue | HasChildren -} - -func (b *listParser) Close(node ast.Node, reader text.Reader, pc Context) { - list := node.(*ast.List) - - for c := node.FirstChild(); c != nil && list.IsTight; c = c.NextSibling() { - if c.FirstChild() != nil && c.FirstChild() != c.LastChild() { - for c1 := c.FirstChild().NextSibling(); c1 != nil; c1 = c1.NextSibling() { - if bl, ok := c1.(ast.Node); ok && bl.HasBlankPreviousLines() { - list.IsTight = false - break - } - } - } - if c != node.FirstChild() { - if bl, ok := c.(ast.Node); ok && bl.HasBlankPreviousLines() { - list.IsTight = false - } - } - } - - if list.IsTight { - for child := node.FirstChild(); child != nil; child = child.NextSibling() { - for gc := child.FirstChild(); gc != nil; { - paragraph, ok := gc.(*ast.Paragraph) - gc = gc.NextSibling() - if ok { - textBlock := ast.NewTextBlock() - textBlock.SetLines(paragraph.Lines()) - child.ReplaceChild(child, paragraph, textBlock) - } - } - } - } -} - -func (b *listParser) CanInterruptParagraph() bool { - return true -} - -func (b *listParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/list_item.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/list_item.go deleted file mode 100644 index 81357a9ad..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/list_item.go +++ /dev/null @@ -1,90 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type listItemParser struct { -} - -var defaultListItemParser = &listItemParser{} - -// NewListItemParser returns a new BlockParser that -// parses list items. -func NewListItemParser() BlockParser { - return defaultListItemParser -} - -func (b *listItemParser) Trigger() []byte { - return []byte{'-', '+', '*', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} -} - -func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - list, lok := parent.(*ast.List) - if !lok { // list item must be a child of a list - return nil, NoChildren - } - offset := lastOffset(list) - line, _ := reader.PeekLine() - match, typ := matchesListItem(line, false) - if typ == notList { - return nil, NoChildren - } - if match[1]-offset > 3 { - return nil, NoChildren - } - - pc.Set(emptyListItemWithBlankLines, nil) - - itemOffset := calcListOffset(line, match) - node := ast.NewListItem(match[3] + itemOffset) - if match[4] < 0 || util.IsBlank(line[match[4]:match[5]]) { - return node, NoChildren - } - - pos, padding := util.IndentPosition(line[match[4]:], match[4], itemOffset) - child := match[3] + pos - reader.AdvanceAndSetPadding(child, padding) - return node, HasChildren -} - -func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - line, _ := reader.PeekLine() - if util.IsBlank(line) { - reader.Advance(len(line) - 1) - return Continue | HasChildren - } - - offset := lastOffset(node.Parent()) - isEmpty := node.ChildCount() == 0 - indent, _ := util.IndentWidth(line, reader.LineOffset()) - if (isEmpty || indent < offset) && indent < 4 { - _, typ := matchesListItem(line, true) - // new list item found - if typ != notList { - pc.Set(skipListParserKey, listItemFlagValue) - return Close - } - if !isEmpty { - return Close - } - } - pos, padding := util.IndentPosition(line, reader.LineOffset(), offset) - reader.AdvanceAndSetPadding(pos, padding) - - return Continue | HasChildren -} - -func (b *listItemParser) Close(node ast.Node, reader text.Reader, pc Context) { - // nothing to do -} - -func (b *listItemParser) CanInterruptParagraph() bool { - return true -} - -func (b *listItemParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/paragraph.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/paragraph.go deleted file mode 100644 index 2dd2b9a97..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/paragraph.go +++ /dev/null @@ -1,71 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" -) - -type paragraphParser struct { -} - -var defaultParagraphParser = ¶graphParser{} - -// NewParagraphParser returns a new BlockParser that -// parses paragraphs. -func NewParagraphParser() BlockParser { - return defaultParagraphParser -} - -func (b *paragraphParser) Trigger() []byte { - return nil -} - -func (b *paragraphParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - _, segment := reader.PeekLine() - segment = segment.TrimLeftSpace(reader.Source()) - if segment.IsEmpty() { - return nil, NoChildren - } - node := ast.NewParagraph() - node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) - return node, NoChildren -} - -func (b *paragraphParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - _, segment := reader.PeekLine() - segment = segment.TrimLeftSpace(reader.Source()) - if segment.IsEmpty() { - return Close - } - node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) - return Continue | NoChildren -} - -func (b *paragraphParser) Close(node ast.Node, reader text.Reader, pc Context) { - parent := node.Parent() - if parent == nil { - // paragraph has been transformed - return - } - lines := node.Lines() - if lines.Len() != 0 { - // trim trailing spaces - length := lines.Len() - lastLine := node.Lines().At(length - 1) - node.Lines().Set(length-1, lastLine.TrimRightSpace(reader.Source())) - } - if lines.Len() == 0 { - node.Parent().RemoveChild(node.Parent(), node) - return - } -} - -func (b *paragraphParser) CanInterruptParagraph() bool { - return false -} - -func (b *paragraphParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/parser.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/parser.go deleted file mode 100644 index bac070452..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/parser.go +++ /dev/null @@ -1,1236 +0,0 @@ -// Package parser contains stuff that are related to parsing a Markdown text. -package parser - -import ( - "fmt" - "strings" - "sync" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -// A Reference interface represents a link reference in Markdown text. -type Reference interface { - // String implements Stringer. - String() string - - // Label returns a label of the reference. - Label() []byte - - // Destination returns a destination(URL) of the reference. - Destination() []byte - - // Title returns a title of the reference. - Title() []byte -} - -type reference struct { - label []byte - destination []byte - title []byte -} - -// NewReference returns a new Reference. -func NewReference(label, destination, title []byte) Reference { - return &reference{label, destination, title} -} - -func (r *reference) Label() []byte { - return r.label -} - -func (r *reference) Destination() []byte { - return r.destination -} - -func (r *reference) Title() []byte { - return r.title -} - -func (r *reference) String() string { - return fmt.Sprintf("Reference{Label:%s, Destination:%s, Title:%s}", r.label, r.destination, r.title) -} - -// An IDs interface is a collection of the element ids. -type IDs interface { - // Generate generates a new element id. - Generate(value []byte, kind ast.NodeKind) []byte - - // Put puts a given element id to the used ids table. - Put(value []byte) -} - -type ids struct { - values map[string]bool -} - -func newIDs() IDs { - return &ids{ - values: map[string]bool{}, - } -} - -func (s *ids) Generate(value []byte, kind ast.NodeKind) []byte { - value = util.TrimLeftSpace(value) - value = util.TrimRightSpace(value) - result := []byte{} - for i := 0; i < len(value); { - v := value[i] - l := util.UTF8Len(v) - i += int(l) - if l != 1 { - continue - } - if util.IsAlphaNumeric(v) { - if 'A' <= v && v <= 'Z' { - v += 'a' - 'A' - } - result = append(result, v) - } else if util.IsSpace(v) || v == '-' || v == '_' { - result = append(result, '-') - } - } - if len(result) == 0 { - if kind == ast.KindHeading { - result = []byte("heading") - } else { - result = []byte("id") - } - } - if _, ok := s.values[util.BytesToReadOnlyString(result)]; !ok { - s.values[util.BytesToReadOnlyString(result)] = true - return result - } - for i := 1; ; i++ { - newResult := fmt.Sprintf("%s-%d", result, i) - if _, ok := s.values[newResult]; !ok { - s.values[newResult] = true - return []byte(newResult) - } - - } -} - -func (s *ids) Put(value []byte) { - s.values[util.BytesToReadOnlyString(value)] = true -} - -// ContextKey is a key that is used to set arbitrary values to the context. -type ContextKey int - -// ContextKeyMax is a maximum value of the ContextKey. -var ContextKeyMax ContextKey - -// NewContextKey return a new ContextKey value. -func NewContextKey() ContextKey { - ContextKeyMax++ - return ContextKeyMax -} - -// A Context interface holds a information that are necessary to parse -// Markdown text. -type Context interface { - // String implements Stringer. - String() string - - // Get returns a value associated with the given key. - Get(ContextKey) interface{} - - // ComputeIfAbsent computes a value if a value associated with the given key is absent and returns the value. - ComputeIfAbsent(ContextKey, func() interface{}) interface{} - - // Set sets the given value to the context. - Set(ContextKey, interface{}) - - // AddReference adds the given reference to this context. - AddReference(Reference) - - // Reference returns (a reference, true) if a reference associated with - // the given label exists, otherwise (nil, false). - Reference(label string) (Reference, bool) - - // References returns a list of references. - References() []Reference - - // IDs returns a collection of the element ids. - IDs() IDs - - // BlockOffset returns a first non-space character position on current line. - // This value is valid only for BlockParser.Open. - // BlockOffset returns -1 if current line is blank. - BlockOffset() int - - // BlockOffset sets a first non-space character position on current line. - // This value is valid only for BlockParser.Open. - SetBlockOffset(int) - - // BlockIndent returns an indent width on current line. - // This value is valid only for BlockParser.Open. - // BlockIndent returns -1 if current line is blank. - BlockIndent() int - - // BlockIndent sets an indent width on current line. - // This value is valid only for BlockParser.Open. - SetBlockIndent(int) - - // FirstDelimiter returns a first delimiter of the current delimiter list. - FirstDelimiter() *Delimiter - - // LastDelimiter returns a last delimiter of the current delimiter list. - LastDelimiter() *Delimiter - - // PushDelimiter appends the given delimiter to the tail of the current - // delimiter list. - PushDelimiter(delimiter *Delimiter) - - // RemoveDelimiter removes the given delimiter from the current delimiter list. - RemoveDelimiter(d *Delimiter) - - // ClearDelimiters clears the current delimiter list. - ClearDelimiters(bottom ast.Node) - - // OpenedBlocks returns a list of nodes that are currently in parsing. - OpenedBlocks() []Block - - // SetOpenedBlocks sets a list of nodes that are currently in parsing. - SetOpenedBlocks([]Block) - - // LastOpenedBlock returns a last node that is currently in parsing. - LastOpenedBlock() Block - - // IsInLinkLabel returns true if current position seems to be in link label. - IsInLinkLabel() bool -} - -// A ContextConfig struct is a data structure that holds configuration of the Context. -type ContextConfig struct { - IDs IDs -} - -// An ContextOption is a functional option type for the Context. -type ContextOption func(*ContextConfig) - -// WithIDs is a functional option for the Context. -func WithIDs(ids IDs) ContextOption { - return func(c *ContextConfig) { - c.IDs = ids - } -} - -type parseContext struct { - store []interface{} - ids IDs - refs map[string]Reference - blockOffset int - blockIndent int - delimiters *Delimiter - lastDelimiter *Delimiter - openedBlocks []Block -} - -// NewContext returns a new Context. -func NewContext(options ...ContextOption) Context { - cfg := &ContextConfig{ - IDs: newIDs(), - } - for _, option := range options { - option(cfg) - } - - return &parseContext{ - store: make([]interface{}, ContextKeyMax+1), - refs: map[string]Reference{}, - ids: cfg.IDs, - blockOffset: -1, - blockIndent: -1, - delimiters: nil, - lastDelimiter: nil, - openedBlocks: []Block{}, - } -} - -func (p *parseContext) Get(key ContextKey) interface{} { - return p.store[key] -} - -func (p *parseContext) ComputeIfAbsent(key ContextKey, f func() interface{}) interface{} { - v := p.store[key] - if v == nil { - v = f() - p.store[key] = v - } - return v -} - -func (p *parseContext) Set(key ContextKey, value interface{}) { - p.store[key] = value -} - -func (p *parseContext) IDs() IDs { - return p.ids -} - -func (p *parseContext) BlockOffset() int { - return p.blockOffset -} - -func (p *parseContext) SetBlockOffset(v int) { - p.blockOffset = v -} - -func (p *parseContext) BlockIndent() int { - return p.blockIndent -} - -func (p *parseContext) SetBlockIndent(v int) { - p.blockIndent = v -} - -func (p *parseContext) LastDelimiter() *Delimiter { - return p.lastDelimiter -} - -func (p *parseContext) FirstDelimiter() *Delimiter { - return p.delimiters -} - -func (p *parseContext) PushDelimiter(d *Delimiter) { - if p.delimiters == nil { - p.delimiters = d - p.lastDelimiter = d - } else { - l := p.lastDelimiter - p.lastDelimiter = d - l.NextDelimiter = d - d.PreviousDelimiter = l - } -} - -func (p *parseContext) RemoveDelimiter(d *Delimiter) { - if d.PreviousDelimiter == nil { - p.delimiters = d.NextDelimiter - } else { - d.PreviousDelimiter.NextDelimiter = d.NextDelimiter - if d.NextDelimiter != nil { - d.NextDelimiter.PreviousDelimiter = d.PreviousDelimiter - } - } - if d.NextDelimiter == nil { - p.lastDelimiter = d.PreviousDelimiter - } - if p.delimiters != nil { - p.delimiters.PreviousDelimiter = nil - } - if p.lastDelimiter != nil { - p.lastDelimiter.NextDelimiter = nil - } - d.NextDelimiter = nil - d.PreviousDelimiter = nil - if d.Length != 0 { - ast.MergeOrReplaceTextSegment(d.Parent(), d, d.Segment) - } else { - d.Parent().RemoveChild(d.Parent(), d) - } -} - -func (p *parseContext) ClearDelimiters(bottom ast.Node) { - if p.lastDelimiter == nil { - return - } - var c ast.Node - for c = p.lastDelimiter; c != nil && c != bottom; { - prev := c.PreviousSibling() - if d, ok := c.(*Delimiter); ok { - p.RemoveDelimiter(d) - } - c = prev - } -} - -func (p *parseContext) AddReference(ref Reference) { - key := util.ToLinkReference(ref.Label()) - if _, ok := p.refs[key]; !ok { - p.refs[key] = ref - } -} - -func (p *parseContext) Reference(label string) (Reference, bool) { - v, ok := p.refs[label] - return v, ok -} - -func (p *parseContext) References() []Reference { - ret := make([]Reference, 0, len(p.refs)) - for _, v := range p.refs { - ret = append(ret, v) - } - return ret -} - -func (p *parseContext) String() string { - refs := []string{} - for _, r := range p.refs { - refs = append(refs, r.String()) - } - - return fmt.Sprintf("Context{Store:%#v, Refs:%s}", p.store, strings.Join(refs, ",")) -} - -func (p *parseContext) OpenedBlocks() []Block { - return p.openedBlocks -} - -func (p *parseContext) SetOpenedBlocks(v []Block) { - p.openedBlocks = v -} - -func (p *parseContext) LastOpenedBlock() Block { - if l := len(p.openedBlocks); l != 0 { - return p.openedBlocks[l-1] - } - return Block{} -} - -func (p *parseContext) IsInLinkLabel() bool { - tlist := p.Get(linkLabelStateKey) - return tlist != nil -} - -// State represents parser's state. -// State is designed to use as a bit flag. -type State int - -const ( - none State = 1 << iota - - // Continue indicates parser can continue parsing. - Continue - - // Close indicates parser cannot parse anymore. - Close - - // HasChildren indicates parser may have child blocks. - HasChildren - - // NoChildren indicates parser does not have child blocks. - NoChildren - - // RequireParagraph indicates parser requires that the last node - // must be a paragraph and is not converted to other nodes by - // ParagraphTransformers. - RequireParagraph -) - -// A Config struct is a data structure that holds configuration of the Parser. -type Config struct { - Options map[OptionName]interface{} - BlockParsers util.PrioritizedSlice /**/ - InlineParsers util.PrioritizedSlice /**/ - ParagraphTransformers util.PrioritizedSlice /**/ - ASTTransformers util.PrioritizedSlice /**/ -} - -// NewConfig returns a new Config. -func NewConfig() *Config { - return &Config{ - Options: map[OptionName]interface{}{}, - BlockParsers: util.PrioritizedSlice{}, - InlineParsers: util.PrioritizedSlice{}, - ParagraphTransformers: util.PrioritizedSlice{}, - ASTTransformers: util.PrioritizedSlice{}, - } -} - -// An Option interface is a functional option type for the Parser. -type Option interface { - SetParserOption(*Config) -} - -// OptionName is a name of parser options. -type OptionName string - -// Attribute is an option name that spacify attributes of elements. -const optAttribute OptionName = "Attribute" - -type withAttribute struct { -} - -func (o *withAttribute) SetParserOption(c *Config) { - c.Options[optAttribute] = true -} - -// WithAttribute is a functional option that enables custom attributes. -func WithAttribute() Option { - return &withAttribute{} -} - -// A Parser interface parses Markdown text into AST nodes. -type Parser interface { - // Parse parses the given Markdown text into AST nodes. - Parse(reader text.Reader, opts ...ParseOption) ast.Node - - // AddOption adds the given option to this parser. - AddOptions(...Option) -} - -// A SetOptioner interface sets the given option to the object. -type SetOptioner interface { - // SetOption sets the given option to the object. - // Unacceptable options may be passed. - // Thus implementations must ignore unacceptable options. - SetOption(name OptionName, value interface{}) -} - -// A BlockParser interface parses a block level element like Paragraph, List, -// Blockquote etc. -type BlockParser interface { - // Trigger returns a list of characters that triggers Parse method of - // this parser. - // If Trigger returns a nil, Open will be called with any lines. - Trigger() []byte - - // Open parses the current line and returns a result of parsing. - // - // Open must not parse beyond the current line. - // If Open has been able to parse the current line, Open must advance a reader - // position by consumed byte length. - // - // If Open has not been able to parse the current line, Open should returns - // (nil, NoChildren). If Open has been able to parse the current line, Open - // should returns a new Block node and returns HasChildren or NoChildren. - Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) - - // Continue parses the current line and returns a result of parsing. - // - // Continue must not parse beyond the current line. - // If Continue has been able to parse the current line, Continue must advance - // a reader position by consumed byte length. - // - // If Continue has not been able to parse the current line, Continue should - // returns Close. If Continue has been able to parse the current line, - // Continue should returns (Continue | NoChildren) or - // (Continue | HasChildren) - Continue(node ast.Node, reader text.Reader, pc Context) State - - // Close will be called when the parser returns Close. - Close(node ast.Node, reader text.Reader, pc Context) - - // CanInterruptParagraph returns true if the parser can interrupt paragraphs, - // otherwise false. - CanInterruptParagraph() bool - - // CanAcceptIndentedLine returns true if the parser can open new node when - // the given line is being indented more than 3 spaces. - CanAcceptIndentedLine() bool -} - -// An InlineParser interface parses an inline level element like CodeSpan, Link etc. -type InlineParser interface { - // Trigger returns a list of characters that triggers Parse method of - // this parser. - // Trigger characters must be a punctuation or a halfspace. - // Halfspaces triggers this parser when character is any spaces characters or - // a head of line - Trigger() []byte - - // Parse parse the given block into an inline node. - // - // Parse can parse beyond the current line. - // If Parse has been able to parse the current line, it must advance a reader - // position by consumed byte length. - Parse(parent ast.Node, block text.Reader, pc Context) ast.Node -} - -// A CloseBlocker interface is a callback function that will be -// called when block is closed in the inline parsing. -type CloseBlocker interface { - // CloseBlock will be called when a block is closed. - CloseBlock(parent ast.Node, block text.Reader, pc Context) -} - -// A ParagraphTransformer transforms parsed Paragraph nodes. -// For example, link references are searched in parsed Paragraphs. -type ParagraphTransformer interface { - // Transform transforms the given paragraph. - Transform(node *ast.Paragraph, reader text.Reader, pc Context) -} - -// ASTTransformer transforms entire Markdown document AST tree. -type ASTTransformer interface { - // Transform transforms the given AST tree. - Transform(node *ast.Document, reader text.Reader, pc Context) -} - -// DefaultBlockParsers returns a new list of default BlockParsers. -// Priorities of default BlockParsers are: -// -// SetextHeadingParser, 100 -// ThematicBreakParser, 200 -// ListParser, 300 -// ListItemParser, 400 -// CodeBlockParser, 500 -// ATXHeadingParser, 600 -// FencedCodeBlockParser, 700 -// BlockquoteParser, 800 -// HTMLBlockParser, 900 -// ParagraphParser, 1000 -func DefaultBlockParsers() []util.PrioritizedValue { - return []util.PrioritizedValue{ - util.Prioritized(NewSetextHeadingParser(), 100), - util.Prioritized(NewThematicBreakParser(), 200), - util.Prioritized(NewListParser(), 300), - util.Prioritized(NewListItemParser(), 400), - util.Prioritized(NewCodeBlockParser(), 500), - util.Prioritized(NewATXHeadingParser(), 600), - util.Prioritized(NewFencedCodeBlockParser(), 700), - util.Prioritized(NewBlockquoteParser(), 800), - util.Prioritized(NewHTMLBlockParser(), 900), - util.Prioritized(NewParagraphParser(), 1000), - } -} - -// DefaultInlineParsers returns a new list of default InlineParsers. -// Priorities of default InlineParsers are: -// -// CodeSpanParser, 100 -// LinkParser, 200 -// AutoLinkParser, 300 -// RawHTMLParser, 400 -// EmphasisParser, 500 -func DefaultInlineParsers() []util.PrioritizedValue { - return []util.PrioritizedValue{ - util.Prioritized(NewCodeSpanParser(), 100), - util.Prioritized(NewLinkParser(), 200), - util.Prioritized(NewAutoLinkParser(), 300), - util.Prioritized(NewRawHTMLParser(), 400), - util.Prioritized(NewEmphasisParser(), 500), - } -} - -// DefaultParagraphTransformers returns a new list of default ParagraphTransformers. -// Priorities of default ParagraphTransformers are: -// -// LinkReferenceParagraphTransformer, 100 -func DefaultParagraphTransformers() []util.PrioritizedValue { - return []util.PrioritizedValue{ - util.Prioritized(LinkReferenceParagraphTransformer, 100), - } -} - -// A Block struct holds a node and correspond parser pair. -type Block struct { - // Node is a BlockNode. - Node ast.Node - // Parser is a BlockParser. - Parser BlockParser -} - -type parser struct { - options map[OptionName]interface{} - blockParsers [256][]BlockParser - freeBlockParsers []BlockParser - inlineParsers [256][]InlineParser - closeBlockers []CloseBlocker - paragraphTransformers []ParagraphTransformer - astTransformers []ASTTransformer - config *Config - initSync sync.Once -} - -type withBlockParsers struct { - value []util.PrioritizedValue -} - -func (o *withBlockParsers) SetParserOption(c *Config) { - c.BlockParsers = append(c.BlockParsers, o.value...) -} - -// WithBlockParsers is a functional option that allow you to add -// BlockParsers to the parser. -func WithBlockParsers(bs ...util.PrioritizedValue) Option { - return &withBlockParsers{bs} -} - -type withInlineParsers struct { - value []util.PrioritizedValue -} - -func (o *withInlineParsers) SetParserOption(c *Config) { - c.InlineParsers = append(c.InlineParsers, o.value...) -} - -// WithInlineParsers is a functional option that allow you to add -// InlineParsers to the parser. -func WithInlineParsers(bs ...util.PrioritizedValue) Option { - return &withInlineParsers{bs} -} - -type withParagraphTransformers struct { - value []util.PrioritizedValue -} - -func (o *withParagraphTransformers) SetParserOption(c *Config) { - c.ParagraphTransformers = append(c.ParagraphTransformers, o.value...) -} - -// WithParagraphTransformers is a functional option that allow you to add -// ParagraphTransformers to the parser. -func WithParagraphTransformers(ps ...util.PrioritizedValue) Option { - return &withParagraphTransformers{ps} -} - -type withASTTransformers struct { - value []util.PrioritizedValue -} - -func (o *withASTTransformers) SetParserOption(c *Config) { - c.ASTTransformers = append(c.ASTTransformers, o.value...) -} - -// WithASTTransformers is a functional option that allow you to add -// ASTTransformers to the parser. -func WithASTTransformers(ps ...util.PrioritizedValue) Option { - return &withASTTransformers{ps} -} - -type withOption struct { - name OptionName - value interface{} -} - -func (o *withOption) SetParserOption(c *Config) { - c.Options[o.name] = o.value -} - -// WithOption is a functional option that allow you to set -// an arbitrary option to the parser. -func WithOption(name OptionName, value interface{}) Option { - return &withOption{name, value} -} - -// NewParser returns a new Parser with given options. -func NewParser(options ...Option) Parser { - config := NewConfig() - for _, opt := range options { - opt.SetParserOption(config) - } - - p := &parser{ - options: map[OptionName]interface{}{}, - config: config, - } - - return p -} - -func (p *parser) AddOptions(opts ...Option) { - for _, opt := range opts { - opt.SetParserOption(p.config) - } -} - -func (p *parser) addBlockParser(v util.PrioritizedValue, options map[OptionName]interface{}) { - bp, ok := v.Value.(BlockParser) - if !ok { - panic(fmt.Sprintf("%v is not a BlockParser", v.Value)) - } - tcs := bp.Trigger() - so, ok := v.Value.(SetOptioner) - if ok { - for oname, ovalue := range options { - so.SetOption(oname, ovalue) - } - } - if tcs == nil { - p.freeBlockParsers = append(p.freeBlockParsers, bp) - } else { - for _, tc := range tcs { - if p.blockParsers[tc] == nil { - p.blockParsers[tc] = []BlockParser{} - } - p.blockParsers[tc] = append(p.blockParsers[tc], bp) - } - } -} - -func (p *parser) addInlineParser(v util.PrioritizedValue, options map[OptionName]interface{}) { - ip, ok := v.Value.(InlineParser) - if !ok { - panic(fmt.Sprintf("%v is not a InlineParser", v.Value)) - } - tcs := ip.Trigger() - so, ok := v.Value.(SetOptioner) - if ok { - for oname, ovalue := range options { - so.SetOption(oname, ovalue) - } - } - if cb, ok := ip.(CloseBlocker); ok { - p.closeBlockers = append(p.closeBlockers, cb) - } - for _, tc := range tcs { - if p.inlineParsers[tc] == nil { - p.inlineParsers[tc] = []InlineParser{} - } - p.inlineParsers[tc] = append(p.inlineParsers[tc], ip) - } -} - -func (p *parser) addParagraphTransformer(v util.PrioritizedValue, options map[OptionName]interface{}) { - pt, ok := v.Value.(ParagraphTransformer) - if !ok { - panic(fmt.Sprintf("%v is not a ParagraphTransformer", v.Value)) - } - so, ok := v.Value.(SetOptioner) - if ok { - for oname, ovalue := range options { - so.SetOption(oname, ovalue) - } - } - p.paragraphTransformers = append(p.paragraphTransformers, pt) -} - -func (p *parser) addASTTransformer(v util.PrioritizedValue, options map[OptionName]interface{}) { - at, ok := v.Value.(ASTTransformer) - if !ok { - panic(fmt.Sprintf("%v is not a ASTTransformer", v.Value)) - } - so, ok := v.Value.(SetOptioner) - if ok { - for oname, ovalue := range options { - so.SetOption(oname, ovalue) - } - } - p.astTransformers = append(p.astTransformers, at) -} - -// A ParseConfig struct is a data structure that holds configuration of the Parser.Parse. -type ParseConfig struct { - Context Context -} - -// A ParseOption is a functional option type for the Parser.Parse. -type ParseOption func(c *ParseConfig) - -// WithContext is a functional option that allow you to override -// a default context. -func WithContext(context Context) ParseOption { - return func(c *ParseConfig) { - c.Context = context - } -} - -func (p *parser) Parse(reader text.Reader, opts ...ParseOption) ast.Node { - p.initSync.Do(func() { - p.config.BlockParsers.Sort() - for _, v := range p.config.BlockParsers { - p.addBlockParser(v, p.config.Options) - } - for i := range p.blockParsers { - if p.blockParsers[i] != nil { - p.blockParsers[i] = append(p.blockParsers[i], p.freeBlockParsers...) - } - } - - p.config.InlineParsers.Sort() - for _, v := range p.config.InlineParsers { - p.addInlineParser(v, p.config.Options) - } - p.config.ParagraphTransformers.Sort() - for _, v := range p.config.ParagraphTransformers { - p.addParagraphTransformer(v, p.config.Options) - } - p.config.ASTTransformers.Sort() - for _, v := range p.config.ASTTransformers { - p.addASTTransformer(v, p.config.Options) - } - p.config = nil - }) - c := &ParseConfig{} - for _, opt := range opts { - opt(c) - } - if c.Context == nil { - c.Context = NewContext() - } - pc := c.Context - root := ast.NewDocument() - p.parseBlocks(root, reader, pc) - - blockReader := text.NewBlockReader(reader.Source(), nil) - p.walkBlock(root, func(node ast.Node) { - p.parseBlock(blockReader, node, pc) - }) - for _, at := range p.astTransformers { - at.Transform(root, reader, pc) - } - // root.Dump(reader.Source(), 0) - return root -} - -func (p *parser) transformParagraph(node *ast.Paragraph, reader text.Reader, pc Context) bool { - for _, pt := range p.paragraphTransformers { - pt.Transform(node, reader, pc) - if node.Parent() == nil { - return true - } - } - return false -} - -func (p *parser) closeBlocks(from, to int, reader text.Reader, pc Context) { - blocks := pc.OpenedBlocks() - for i := from; i >= to; i-- { - node := blocks[i].Node - blocks[i].Parser.Close(blocks[i].Node, reader, pc) - paragraph, ok := node.(*ast.Paragraph) - if ok && node.Parent() != nil { - p.transformParagraph(paragraph, reader, pc) - } - } - if from == len(blocks)-1 { - blocks = blocks[0:to] - } else { - blocks = append(blocks[0:to], blocks[from+1:]...) - } - pc.SetOpenedBlocks(blocks) -} - -type blockOpenResult int - -const ( - paragraphContinuation blockOpenResult = iota + 1 - newBlocksOpened - noBlocksOpened -) - -func (p *parser) openBlocks(parent ast.Node, blankLine bool, reader text.Reader, pc Context) blockOpenResult { - result := blockOpenResult(noBlocksOpened) - continuable := false - lastBlock := pc.LastOpenedBlock() - if lastBlock.Node != nil { - continuable = ast.IsParagraph(lastBlock.Node) - } -retry: - var bps []BlockParser - line, _ := reader.PeekLine() - w, pos := util.IndentWidth(line, reader.LineOffset()) - if w >= len(line) { - pc.SetBlockOffset(-1) - pc.SetBlockIndent(-1) - } else { - pc.SetBlockOffset(pos) - pc.SetBlockIndent(w) - } - if line == nil || line[0] == '\n' { - goto continuable - } - bps = p.freeBlockParsers - if pos < len(line) { - bps = p.blockParsers[line[pos]] - if bps == nil { - bps = p.freeBlockParsers - } - } - if bps == nil { - goto continuable - } - - for _, bp := range bps { - if continuable && result == noBlocksOpened && !bp.CanInterruptParagraph() { - continue - } - if w > 3 && !bp.CanAcceptIndentedLine() { - continue - } - lastBlock = pc.LastOpenedBlock() - last := lastBlock.Node - node, state := bp.Open(parent, reader, pc) - if node != nil { - // Parser requires last node to be a paragraph. - // With table extension: - // - // 0 - // -: - // - - // - // '-' on 3rd line seems a Setext heading because 1st and 2nd lines - // are being paragraph when the Settext heading parser tries to parse the 3rd - // line. - // But 1st line and 2nd line are a table. Thus this paragraph will be transformed - // by a paragraph transformer. So this text should be converted to a table and - // an empty list. - if state&RequireParagraph != 0 { - if last == parent.LastChild() { - // Opened paragraph may be transformed by ParagraphTransformers in - // closeBlocks(). - lastBlock.Parser.Close(last, reader, pc) - blocks := pc.OpenedBlocks() - pc.SetOpenedBlocks(blocks[0 : len(blocks)-1]) - if p.transformParagraph(last.(*ast.Paragraph), reader, pc) { - // Paragraph has been transformed. - // So this parser is considered as failing. - continuable = false - goto retry - } - } - } - node.SetBlankPreviousLines(blankLine) - if last != nil && last.Parent() == nil { - lastPos := len(pc.OpenedBlocks()) - 1 - p.closeBlocks(lastPos, lastPos, reader, pc) - } - parent.AppendChild(parent, node) - result = newBlocksOpened - be := Block{node, bp} - pc.SetOpenedBlocks(append(pc.OpenedBlocks(), be)) - if state&HasChildren != 0 { - parent = node - goto retry // try child block - } - break // no children, can not open more blocks on this line - } - } - -continuable: - if result == noBlocksOpened && continuable { - state := lastBlock.Parser.Continue(lastBlock.Node, reader, pc) - if state&Continue != 0 { - result = paragraphContinuation - } - } - return result -} - -type lineStat struct { - lineNum int - level int - isBlank bool -} - -func isBlankLine(lineNum, level int, stats []lineStat) bool { - ret := true - for i := len(stats) - 1 - level; i >= 0; i-- { - ret = false - s := stats[i] - if s.lineNum == lineNum { - if s.level < level && s.isBlank { - return true - } else if s.level == level { - return s.isBlank - } - } - if s.lineNum < lineNum { - return ret - } - } - return ret -} - -func (p *parser) parseBlocks(parent ast.Node, reader text.Reader, pc Context) { - pc.SetOpenedBlocks([]Block{}) - blankLines := make([]lineStat, 0, 128) - isBlank := false - for { // process blocks separated by blank lines - _, lines, ok := reader.SkipBlankLines() - if !ok { - return - } - lineNum, _ := reader.Position() - if lines != 0 { - blankLines = blankLines[0:0] - l := len(pc.OpenedBlocks()) - for i := 0; i < l; i++ { - blankLines = append(blankLines, lineStat{lineNum - 1, i, lines != 0}) - } - } - isBlank = isBlankLine(lineNum-1, 0, blankLines) - // first, we try to open blocks - if p.openBlocks(parent, isBlank, reader, pc) != newBlocksOpened { - return - } - reader.AdvanceLine() - for { // process opened blocks line by line - openedBlocks := pc.OpenedBlocks() - l := len(openedBlocks) - if l == 0 { - break - } - lastIndex := l - 1 - for i := 0; i < l; i++ { - be := openedBlocks[i] - line, _ := reader.PeekLine() - if line == nil { - p.closeBlocks(lastIndex, 0, reader, pc) - reader.AdvanceLine() - return - } - lineNum, _ := reader.Position() - blankLines = append(blankLines, lineStat{lineNum, i, util.IsBlank(line)}) - // If node is a paragraph, p.openBlocks determines whether it is continuable. - // So we do not process paragraphs here. - if !ast.IsParagraph(be.Node) { - state := be.Parser.Continue(be.Node, reader, pc) - if state&Continue != 0 { - // When current node is a container block and has no children, - // we try to open new child nodes - if state&HasChildren != 0 && i == lastIndex { - isBlank = isBlankLine(lineNum-1, i, blankLines) - p.openBlocks(be.Node, isBlank, reader, pc) - break - } - continue - } - } - // current node may be closed or lazy continuation - isBlank = isBlankLine(lineNum-1, i, blankLines) - thisParent := parent - if i != 0 { - thisParent = openedBlocks[i-1].Node - } - lastNode := openedBlocks[lastIndex].Node - result := p.openBlocks(thisParent, isBlank, reader, pc) - if result != paragraphContinuation { - // lastNode is a paragraph and was transformed by the paragraph - // transformers. - if openedBlocks[lastIndex].Node != lastNode { - lastIndex-- - } - p.closeBlocks(lastIndex, i, reader, pc) - } - break - } - - reader.AdvanceLine() - } - } -} - -func (p *parser) walkBlock(block ast.Node, cb func(node ast.Node)) { - for c := block.FirstChild(); c != nil; c = c.NextSibling() { - p.walkBlock(c, cb) - } - cb(block) -} - -const ( - lineBreakHard uint8 = 1 << iota - lineBreakSoft - lineBreakVisible -) - -func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context) { - if parent.IsRaw() { - return - } - escaped := false - source := block.Source() - block.Reset(parent.Lines()) - for { - retry: - line, _ := block.PeekLine() - if line == nil { - break - } - lineLength := len(line) - var lineBreakFlags uint8 = 0 - hasNewLine := line[lineLength-1] == '\n' - if ((lineLength >= 3 && line[lineLength-2] == '\\' && line[lineLength-3] != '\\') || (lineLength == 2 && line[lineLength-2] == '\\')) && hasNewLine { // ends with \\n - lineLength -= 2 - lineBreakFlags |= lineBreakHard | lineBreakVisible - } else if ((lineLength >= 4 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && line[lineLength-4] != '\\') || (lineLength == 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r')) && hasNewLine { // ends with \\r\n - lineLength -= 3 - lineBreakFlags |= lineBreakHard | lineBreakVisible - } else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && hasNewLine { // ends with [space][space]\n - lineLength -= 3 - lineBreakFlags |= lineBreakHard - } else if lineLength >= 4 && line[lineLength-4] == ' ' && line[lineLength-3] == ' ' && line[lineLength-2] == '\r' && hasNewLine { // ends with [space][space]\r\n - lineLength -= 4 - lineBreakFlags |= lineBreakHard - } else if hasNewLine { - // If the line ends with a newline character, but it is not a hardlineBreak, then it is a softLinebreak - // If the line ends with a hardlineBreak, then it cannot end with a softLinebreak - // See https://spec.commonmark.org/0.30/#soft-line-breaks - lineBreakFlags |= lineBreakSoft - } - - l, startPosition := block.Position() - n := 0 - for i := 0; i < lineLength; i++ { - c := line[i] - if c == '\n' { - break - } - isSpace := util.IsSpace(c) - isPunct := util.IsPunct(c) - if (isPunct && !escaped) || isSpace || i == 0 { - parserChar := c - if isSpace || (i == 0 && !isPunct) { - parserChar = ' ' - } - ips := p.inlineParsers[parserChar] - if ips != nil { - block.Advance(n) - n = 0 - savedLine, savedPosition := block.Position() - if i != 0 { - _, currentPosition := block.Position() - ast.MergeOrAppendTextSegment(parent, startPosition.Between(currentPosition)) - _, startPosition = block.Position() - } - var inlineNode ast.Node - for _, ip := range ips { - inlineNode = ip.Parse(parent, block, pc) - if inlineNode != nil { - break - } - block.SetPosition(savedLine, savedPosition) - } - if inlineNode != nil { - parent.AppendChild(parent, inlineNode) - goto retry - } - } - } - if escaped { - escaped = false - n++ - continue - } - - if c == '\\' { - escaped = true - n++ - continue - } - - escaped = false - n++ - } - if n != 0 { - block.Advance(n) - } - currentL, currentPosition := block.Position() - if l != currentL { - continue - } - diff := startPosition.Between(currentPosition) - var text *ast.Text - if lineBreakFlags&(lineBreakHard|lineBreakVisible) == lineBreakHard|lineBreakVisible { - text = ast.NewTextSegment(diff) - } else { - text = ast.NewTextSegment(diff.TrimRightSpace(source)) - } - text.SetSoftLineBreak(lineBreakFlags&lineBreakSoft != 0) - text.SetHardLineBreak(lineBreakFlags&lineBreakHard != 0) - parent.AppendChild(parent, text) - block.AdvanceLine() - } - - ProcessDelimiters(nil, pc) - for _, ip := range p.closeBlockers { - ip.CloseBlock(parent, block, pc) - } -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/raw_html.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/raw_html.go deleted file mode 100644 index 1fb6c9748..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/raw_html.go +++ /dev/null @@ -1,104 +0,0 @@ -package parser - -import ( - "bytes" - "regexp" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type rawHTMLParser struct { -} - -var defaultRawHTMLParser = &rawHTMLParser{} - -// NewRawHTMLParser return a new InlineParser that can parse -// inline htmls -func NewRawHTMLParser() InlineParser { - return defaultRawHTMLParser -} - -func (s *rawHTMLParser) Trigger() []byte { - return []byte{'<'} -} - -func (s *rawHTMLParser) Parse(parent ast.Node, block text.Reader, pc Context) ast.Node { - line, _ := block.PeekLine() - if len(line) > 1 && util.IsAlphaNumeric(line[1]) { - return s.parseMultiLineRegexp(openTagRegexp, block, pc) - } - if len(line) > 2 && line[1] == '/' && util.IsAlphaNumeric(line[2]) { - return s.parseMultiLineRegexp(closeTagRegexp, block, pc) - } - if bytes.HasPrefix(line, []byte("|`) -var processingInstructionRegexp = regexp.MustCompile(`^(?:<\?).*?(?:\?>)`) -var declRegexp = regexp.MustCompile(`^]*>`) -var cdataRegexp = regexp.MustCompile(``) - -func (s *rawHTMLParser) parseSingleLineRegexp(reg *regexp.Regexp, block text.Reader, pc Context) ast.Node { - line, segment := block.PeekLine() - match := reg.FindSubmatchIndex(line) - if match == nil { - return nil - } - node := ast.NewRawHTML() - node.Segments.Append(segment.WithStop(segment.Start + match[1])) - block.Advance(match[1]) - return node -} - -func (s *rawHTMLParser) parseMultiLineRegexp(reg *regexp.Regexp, block text.Reader, pc Context) ast.Node { - sline, ssegment := block.Position() - if block.Match(reg) { - node := ast.NewRawHTML() - eline, esegment := block.Position() - block.SetPosition(sline, ssegment) - for { - line, segment := block.PeekLine() - if line == nil { - break - } - l, _ := block.Position() - start := segment.Start - if l == sline { - start = ssegment.Start - } - end := segment.Stop - if l == eline { - end = esegment.Start - } - - node.Segments.Append(text.NewSegment(start, end)) - if l == eline { - block.Advance(end - start) - break - } else { - block.AdvanceLine() - } - } - return node - } - return nil -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/setext_headings.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/setext_headings.go deleted file mode 100644 index 686efe179..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/setext_headings.go +++ /dev/null @@ -1,126 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -var temporaryParagraphKey = NewContextKey() - -type setextHeadingParser struct { - HeadingConfig -} - -func matchesSetextHeadingBar(line []byte) (byte, bool) { - start := 0 - end := len(line) - space := util.TrimLeftLength(line, []byte{' '}) - if space > 3 { - return 0, false - } - start += space - level1 := util.TrimLeftLength(line[start:end], []byte{'='}) - c := byte('=') - var level2 int - if level1 == 0 { - level2 = util.TrimLeftLength(line[start:end], []byte{'-'}) - c = '-' - } - if util.IsSpace(line[end-1]) { - end -= util.TrimRightSpaceLength(line[start:end]) - } - if !((level1 > 0 && start+level1 == end) || (level2 > 0 && start+level2 == end)) { - return 0, false - } - return c, true -} - -// NewSetextHeadingParser return a new BlockParser that can parse Setext headings. -func NewSetextHeadingParser(opts ...HeadingOption) BlockParser { - p := &setextHeadingParser{} - for _, o := range opts { - o.SetHeadingOption(&p.HeadingConfig) - } - return p -} - -func (b *setextHeadingParser) Trigger() []byte { - return []byte{'-', '='} -} - -func (b *setextHeadingParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - last := pc.LastOpenedBlock().Node - if last == nil { - return nil, NoChildren - } - paragraph, ok := last.(*ast.Paragraph) - if !ok || paragraph.Parent() != parent { - return nil, NoChildren - } - line, segment := reader.PeekLine() - c, ok := matchesSetextHeadingBar(line) - if !ok { - return nil, NoChildren - } - level := 1 - if c == '-' { - level = 2 - } - node := ast.NewHeading(level) - node.Lines().Append(segment) - pc.Set(temporaryParagraphKey, last) - return node, NoChildren | RequireParagraph -} - -func (b *setextHeadingParser) Continue(node ast.Node, reader text.Reader, pc Context) State { - return Close -} - -func (b *setextHeadingParser) Close(node ast.Node, reader text.Reader, pc Context) { - heading := node.(*ast.Heading) - segment := node.Lines().At(0) - heading.Lines().Clear() - tmp := pc.Get(temporaryParagraphKey).(*ast.Paragraph) - pc.Set(temporaryParagraphKey, nil) - if tmp.Lines().Len() == 0 { - next := heading.NextSibling() - segment = segment.TrimLeftSpace(reader.Source()) - if next == nil || !ast.IsParagraph(next) { - para := ast.NewParagraph() - para.Lines().Append(segment) - heading.Parent().InsertAfter(heading.Parent(), heading, para) - } else { - next.(ast.Node).Lines().Unshift(segment) - } - heading.Parent().RemoveChild(heading.Parent(), heading) - } else { - heading.SetLines(tmp.Lines()) - heading.SetBlankPreviousLines(tmp.HasBlankPreviousLines()) - tp := tmp.Parent() - if tp != nil { - tp.RemoveChild(tp, tmp) - } - } - - if b.Attribute { - parseLastLineAttributes(node, reader, pc) - } - - if b.AutoHeadingID { - id, ok := node.AttributeString("id") - if !ok { - generateAutoHeadingID(heading, reader, pc) - } else { - pc.IDs().Put(id.([]byte)) - } - } -} - -func (b *setextHeadingParser) CanInterruptParagraph() bool { - return true -} - -func (b *setextHeadingParser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/thematic_break.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/thematic_break.go deleted file mode 100644 index db20a1e7a..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/parser/thematic_break.go +++ /dev/null @@ -1,75 +0,0 @@ -package parser - -import ( - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" -) - -type thematicBreakPraser struct { -} - -var defaultThematicBreakPraser = &thematicBreakPraser{} - -// NewThematicBreakParser returns a new BlockParser that -// parses thematic breaks. -func NewThematicBreakParser() BlockParser { - return defaultThematicBreakPraser -} - -func isThematicBreak(line []byte, offset int) bool { - w, pos := util.IndentWidth(line, offset) - if w > 3 { - return false - } - mark := byte(0) - count := 0 - for i := pos; i < len(line); i++ { - c := line[i] - if util.IsSpace(c) { - continue - } - if mark == 0 { - mark = c - count = 1 - if mark == '*' || mark == '-' || mark == '_' { - continue - } - return false - } - if c != mark { - return false - } - count++ - } - return count > 2 -} - -func (b *thematicBreakPraser) Trigger() []byte { - return []byte{'-', '*', '_'} -} - -func (b *thematicBreakPraser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - line, segment := reader.PeekLine() - if isThematicBreak(line, reader.LineOffset()) { - reader.Advance(segment.Len() - 1) - return ast.NewThematicBreak(), NoChildren - } - return nil, NoChildren -} - -func (b *thematicBreakPraser) Continue(node ast.Node, reader text.Reader, pc Context) State { - return Close -} - -func (b *thematicBreakPraser) Close(node ast.Node, reader text.Reader, pc Context) { - // nothing to do -} - -func (b *thematicBreakPraser) CanInterruptParagraph() bool { - return true -} - -func (b *thematicBreakPraser) CanAcceptIndentedLine() bool { - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/renderer/html/html.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/renderer/html/html.go deleted file mode 100644 index 7f5b9fedc..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/renderer/html/html.go +++ /dev/null @@ -1,831 +0,0 @@ -package html - -import ( - "bytes" - "fmt" - "strconv" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/util" -) - -// A Config struct has configurations for the HTML based renderers. -type Config struct { - Writer Writer - HardWraps bool - XHTML bool - Unsafe bool -} - -// NewConfig returns a new Config with defaults. -func NewConfig() Config { - return Config{ - Writer: DefaultWriter, - HardWraps: false, - XHTML: false, - Unsafe: false, - } -} - -// SetOption implements renderer.NodeRenderer.SetOption. -func (c *Config) SetOption(name renderer.OptionName, value interface{}) { - switch name { - case optHardWraps: - c.HardWraps = value.(bool) - case optXHTML: - c.XHTML = value.(bool) - case optUnsafe: - c.Unsafe = value.(bool) - case optTextWriter: - c.Writer = value.(Writer) - } -} - -// An Option interface sets options for HTML based renderers. -type Option interface { - SetHTMLOption(*Config) -} - -// TextWriter is an option name used in WithWriter. -const optTextWriter renderer.OptionName = "Writer" - -type withWriter struct { - value Writer -} - -func (o *withWriter) SetConfig(c *renderer.Config) { - c.Options[optTextWriter] = o.value -} - -func (o *withWriter) SetHTMLOption(c *Config) { - c.Writer = o.value -} - -// WithWriter is a functional option that allow you to set the given writer to -// the renderer. -func WithWriter(writer Writer) interface { - renderer.Option - Option -} { - return &withWriter{writer} -} - -// HardWraps is an option name used in WithHardWraps. -const optHardWraps renderer.OptionName = "HardWraps" - -type withHardWraps struct { -} - -func (o *withHardWraps) SetConfig(c *renderer.Config) { - c.Options[optHardWraps] = true -} - -func (o *withHardWraps) SetHTMLOption(c *Config) { - c.HardWraps = true -} - -// WithHardWraps is a functional option that indicates whether softline breaks -// should be rendered as '
              '. -func WithHardWraps() interface { - renderer.Option - Option -} { - return &withHardWraps{} -} - -// XHTML is an option name used in WithXHTML. -const optXHTML renderer.OptionName = "XHTML" - -type withXHTML struct { -} - -func (o *withXHTML) SetConfig(c *renderer.Config) { - c.Options[optXHTML] = true -} - -func (o *withXHTML) SetHTMLOption(c *Config) { - c.XHTML = true -} - -// WithXHTML is a functional option indicates that nodes should be rendered in -// xhtml instead of HTML5. -func WithXHTML() interface { - Option - renderer.Option -} { - return &withXHTML{} -} - -// Unsafe is an option name used in WithUnsafe. -const optUnsafe renderer.OptionName = "Unsafe" - -type withUnsafe struct { -} - -func (o *withUnsafe) SetConfig(c *renderer.Config) { - c.Options[optUnsafe] = true -} - -func (o *withUnsafe) SetHTMLOption(c *Config) { - c.Unsafe = true -} - -// WithUnsafe is a functional option that renders dangerous contents -// (raw htmls and potentially dangerous links) as it is. -func WithUnsafe() interface { - renderer.Option - Option -} { - return &withUnsafe{} -} - -// A Renderer struct is an implementation of renderer.NodeRenderer that renders -// nodes as (X)HTML. -type Renderer struct { - Config -} - -// NewRenderer returns a new Renderer with given options. -func NewRenderer(opts ...Option) renderer.NodeRenderer { - r := &Renderer{ - Config: NewConfig(), - } - - for _, opt := range opts { - opt.SetHTMLOption(&r.Config) - } - return r -} - -// RegisterFuncs implements NodeRenderer.RegisterFuncs . -func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - // blocks - - reg.Register(ast.KindDocument, r.renderDocument) - reg.Register(ast.KindHeading, r.renderHeading) - reg.Register(ast.KindBlockquote, r.renderBlockquote) - reg.Register(ast.KindCodeBlock, r.renderCodeBlock) - reg.Register(ast.KindFencedCodeBlock, r.renderFencedCodeBlock) - reg.Register(ast.KindHTMLBlock, r.renderHTMLBlock) - reg.Register(ast.KindList, r.renderList) - reg.Register(ast.KindListItem, r.renderListItem) - reg.Register(ast.KindParagraph, r.renderParagraph) - reg.Register(ast.KindTextBlock, r.renderTextBlock) - reg.Register(ast.KindThematicBreak, r.renderThematicBreak) - - // inlines - - reg.Register(ast.KindAutoLink, r.renderAutoLink) - reg.Register(ast.KindCodeSpan, r.renderCodeSpan) - reg.Register(ast.KindEmphasis, r.renderEmphasis) - reg.Register(ast.KindImage, r.renderImage) - reg.Register(ast.KindLink, r.renderLink) - reg.Register(ast.KindRawHTML, r.renderRawHTML) - reg.Register(ast.KindText, r.renderText) - reg.Register(ast.KindString, r.renderString) -} - -func (r *Renderer) writeLines(w util.BufWriter, source []byte, n ast.Node) { - l := n.Lines().Len() - for i := 0; i < l; i++ { - line := n.Lines().At(i) - r.Writer.RawWrite(w, line.Value(source)) - } -} - -// GlobalAttributeFilter defines attribute names which any elements can have. -var GlobalAttributeFilter = util.NewBytesFilter( - []byte("accesskey"), - []byte("autocapitalize"), - []byte("class"), - []byte("contenteditable"), - []byte("contextmenu"), - []byte("dir"), - []byte("draggable"), - []byte("dropzone"), - []byte("hidden"), - []byte("id"), - []byte("itemprop"), - []byte("lang"), - []byte("slot"), - []byte("spellcheck"), - []byte("style"), - []byte("tabindex"), - []byte("title"), - []byte("translate"), -) - -func (r *Renderer) renderDocument(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - // nothing to do - return ast.WalkContinue, nil -} - -// HeadingAttributeFilter defines attribute names which heading elements can have -var HeadingAttributeFilter = GlobalAttributeFilter - -func (r *Renderer) renderHeading(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.Heading) - if entering { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("\n") - } - return ast.WalkContinue, nil -} - -// BlockquoteAttributeFilter defines attribute names which blockquote elements can have -var BlockquoteAttributeFilter = GlobalAttributeFilter.Extend( - []byte("cite"), -) - -func (r *Renderer) renderBlockquote(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("
              \n") - } - } else { - _, _ = w.WriteString("
              \n") - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderCodeBlock(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if entering { - _, _ = w.WriteString("
              ")
              -		r.writeLines(w, source, n)
              -	} else {
              -		_, _ = w.WriteString("
              \n") - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderFencedCodeBlock(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.FencedCodeBlock) - if entering { - _, _ = w.WriteString("
              \n") - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderHTMLBlock(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.HTMLBlock) - if entering { - if r.Unsafe { - l := n.Lines().Len() - for i := 0; i < l; i++ { - line := n.Lines().At(i) - r.Writer.SecureWrite(w, line.Value(source)) - } - } else { - _, _ = w.WriteString("\n") - } - } else { - if n.HasClosure() { - if r.Unsafe { - closure := n.ClosureLine - r.Writer.SecureWrite(w, closure.Value(source)) - } else { - _, _ = w.WriteString("\n") - } - } - } - return ast.WalkContinue, nil -} - -// ListAttributeFilter defines attribute names which list elements can have. -var ListAttributeFilter = GlobalAttributeFilter.Extend( - []byte("start"), - []byte("reversed"), - []byte("type"), -) - -func (r *Renderer) renderList(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.List) - tag := "ul" - if n.IsOrdered() { - tag = "ol" - } - if entering { - _ = w.WriteByte('<') - _, _ = w.WriteString(tag) - if n.IsOrdered() && n.Start != 1 { - fmt.Fprintf(w, " start=\"%d\"", n.Start) - } - if n.Attributes() != nil { - RenderAttributes(w, n, ListAttributeFilter) - } - _, _ = w.WriteString(">\n") - } else { - _, _ = w.WriteString("\n") - } - return ast.WalkContinue, nil -} - -// ListItemAttributeFilter defines attribute names which list item elements can have. -var ListItemAttributeFilter = GlobalAttributeFilter.Extend( - []byte("value"), -) - -func (r *Renderer) renderListItem(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("
            • ") - } - fc := n.FirstChild() - if fc != nil { - if _, ok := fc.(*ast.TextBlock); !ok { - _ = w.WriteByte('\n') - } - } - } else { - _, _ = w.WriteString("
            • \n") - } - return ast.WalkContinue, nil -} - -// ParagraphAttributeFilter defines attribute names which paragraph elements can have. -var ParagraphAttributeFilter = GlobalAttributeFilter - -func (r *Renderer) renderParagraph(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("

              ") - } - } else { - _, _ = w.WriteString("

              \n") - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderTextBlock(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - if _, ok := n.NextSibling().(ast.Node); ok && n.FirstChild() != nil { - _ = w.WriteByte('\n') - } - } - return ast.WalkContinue, nil -} - -// ThematicAttributeFilter defines attribute names which hr elements can have. -var ThematicAttributeFilter = GlobalAttributeFilter.Extend( - []byte("align"), // [Deprecated] - []byte("color"), // [Not Standardized] - []byte("noshade"), // [Deprecated] - []byte("size"), // [Deprecated] - []byte("width"), // [Deprecated] -) - -func (r *Renderer) renderThematicBreak(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkContinue, nil - } - _, _ = w.WriteString("\n") - } else { - _, _ = w.WriteString(">\n") - } - return ast.WalkContinue, nil -} - -// LinkAttributeFilter defines attribute names which link elements can have. -var LinkAttributeFilter = GlobalAttributeFilter.Extend( - []byte("download"), - // []byte("href"), - []byte("hreflang"), - []byte("media"), - []byte("ping"), - []byte("referrerpolicy"), - []byte("rel"), - []byte("shape"), - []byte("target"), -) - -func (r *Renderer) renderAutoLink(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.AutoLink) - if !entering { - return ast.WalkContinue, nil - } - _, _ = w.WriteString(`') - } else { - _, _ = w.WriteString(`">`) - } - _, _ = w.Write(util.EscapeHTML(label)) - _, _ = w.WriteString(``) - return ast.WalkContinue, nil -} - -// CodeAttributeFilter defines attribute names which code elements can have. -var CodeAttributeFilter = GlobalAttributeFilter - -func (r *Renderer) renderCodeSpan(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { - if entering { - if n.Attributes() != nil { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("") - } - for c := n.FirstChild(); c != nil; c = c.NextSibling() { - segment := c.(*ast.Text).Segment - value := segment.Value(source) - if bytes.HasSuffix(value, []byte("\n")) { - r.Writer.RawWrite(w, value[:len(value)-1]) - r.Writer.RawWrite(w, []byte(" ")) - } else { - r.Writer.RawWrite(w, value) - } - } - return ast.WalkSkipChildren, nil - } - _, _ = w.WriteString("") - return ast.WalkContinue, nil -} - -// EmphasisAttributeFilter defines attribute names which emphasis elements can have. -var EmphasisAttributeFilter = GlobalAttributeFilter - -func (r *Renderer) renderEmphasis(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.Emphasis) - tag := "em" - if n.Level == 2 { - tag = "strong" - } - if entering { - _ = w.WriteByte('<') - _, _ = w.WriteString(tag) - if n.Attributes() != nil { - RenderAttributes(w, n, EmphasisAttributeFilter) - } - _ = w.WriteByte('>') - } else { - _, _ = w.WriteString("') - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderLink(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - n := node.(*ast.Link) - if entering { - _, _ = w.WriteString("') - } else { - _, _ = w.WriteString("") - } - return ast.WalkContinue, nil -} - -// ImageAttributeFilter defines attribute names which image elements can have. -var ImageAttributeFilter = GlobalAttributeFilter.Extend( - []byte("align"), - []byte("border"), - []byte("crossorigin"), - []byte("decoding"), - []byte("height"), - []byte("importance"), - []byte("intrinsicsize"), - []byte("ismap"), - []byte("loading"), - []byte("referrerpolicy"), - []byte("sizes"), - []byte("srcset"), - []byte("usemap"), - []byte("width"), -) - -func (r *Renderer) renderImage(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkContinue, nil - } - n := node.(*ast.Image) - _, _ = w.WriteString("`)
-	_, _ = w.Write(util.EscapeHTML(n.Text(source)))
-	_ = w.WriteByte('") - } else { - _, _ = w.WriteString(">") - } - return ast.WalkSkipChildren, nil -} - -func (r *Renderer) renderRawHTML(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkSkipChildren, nil - } - if r.Unsafe { - n := node.(*ast.RawHTML) - l := n.Segments.Len() - for i := 0; i < l; i++ { - segment := n.Segments.At(i) - _, _ = w.Write(segment.Value(source)) - } - return ast.WalkSkipChildren, nil - } - _, _ = w.WriteString("") - return ast.WalkSkipChildren, nil -} - -func (r *Renderer) renderText(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkContinue, nil - } - n := node.(*ast.Text) - segment := n.Segment - if n.IsRaw() { - r.Writer.RawWrite(w, segment.Value(source)) - } else { - r.Writer.Write(w, segment.Value(source)) - if n.HardLineBreak() || (n.SoftLineBreak() && r.HardWraps) { - if r.XHTML { - _, _ = w.WriteString("
              \n") - } else { - _, _ = w.WriteString("
              \n") - } - } else if n.SoftLineBreak() { - _ = w.WriteByte('\n') - } - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderString(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkContinue, nil - } - n := node.(*ast.String) - if n.IsCode() { - _, _ = w.Write(n.Value) - } else { - if n.IsRaw() { - r.Writer.RawWrite(w, n.Value) - } else { - r.Writer.Write(w, n.Value) - } - } - return ast.WalkContinue, nil -} - -var dataPrefix = []byte("data-") - -// RenderAttributes renders given node's attributes. -// You can specify attribute names to render by the filter. -// If filter is nil, RenderAttributes renders all attributes. -func RenderAttributes(w util.BufWriter, node ast.Node, filter util.BytesFilter) { - for _, attr := range node.Attributes() { - if filter != nil && !filter.Contains(attr.Name) { - if !bytes.HasPrefix(attr.Name, dataPrefix) { - continue - } - } - _, _ = w.WriteString(" ") - _, _ = w.Write(attr.Name) - _, _ = w.WriteString(`="`) - // TODO: convert numeric values to strings - _, _ = w.Write(util.EscapeHTML(attr.Value.([]byte))) - _ = w.WriteByte('"') - } -} - -// A Writer interface writes textual contents to a writer. -type Writer interface { - // Write writes the given source to writer with resolving references and unescaping - // backslash escaped characters. - Write(writer util.BufWriter, source []byte) - - // RawWrite writes the given source to writer without resolving references and - // unescaping backslash escaped characters. - RawWrite(writer util.BufWriter, source []byte) - - // SecureWrite writes the given source to writer with replacing insecure characters. - SecureWrite(writer util.BufWriter, source []byte) -} - -var replacementCharacter = []byte("\ufffd") - -type defaultWriter struct { -} - -func escapeRune(writer util.BufWriter, r rune) { - if r < 256 { - v := util.EscapeHTMLByte(byte(r)) - if v != nil { - _, _ = writer.Write(v) - return - } - } - _, _ = writer.WriteRune(util.ToValidRune(r)) -} - -func (d *defaultWriter) SecureWrite(writer util.BufWriter, source []byte) { - n := 0 - l := len(source) - for i := 0; i < l; i++ { - if source[i] == '\u0000' { - _, _ = writer.Write(source[i-n : i]) - n = 0 - _, _ = writer.Write(replacementCharacter) - continue - } - n++ - } - if n != 0 { - _, _ = writer.Write(source[l-n:]) - } -} - -func (d *defaultWriter) RawWrite(writer util.BufWriter, source []byte) { - n := 0 - l := len(source) - for i := 0; i < l; i++ { - v := util.EscapeHTMLByte(source[i]) - if v != nil { - _, _ = writer.Write(source[i-n : i]) - n = 0 - _, _ = writer.Write(v) - continue - } - n++ - } - if n != 0 { - _, _ = writer.Write(source[l-n:]) - } -} - -func (d *defaultWriter) Write(writer util.BufWriter, source []byte) { - escaped := false - var ok bool - limit := len(source) - n := 0 - for i := 0; i < limit; i++ { - c := source[i] - if escaped { - if util.IsPunct(c) { - d.RawWrite(writer, source[n:i-1]) - n = i - escaped = false - continue - } - } - if c == '\x00' { - d.RawWrite(writer, source[n:i]) - d.RawWrite(writer, replacementCharacter) - n = i + 1 - continue - } - if c == '&' { - pos := i - next := i + 1 - if next < limit && source[next] == '#' { - nnext := next + 1 - if nnext < limit { - nc := source[nnext] - // code point like #x22; - if nnext < limit && nc == 'x' || nc == 'X' { - start := nnext + 1 - i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsHexDecimal) - if ok && i < limit && source[i] == ';' && i-start < 7 { - v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 16, 32) - d.RawWrite(writer, source[n:pos]) - n = i + 1 - escapeRune(writer, rune(v)) - continue - } - // code point like #1234; - } else if nc >= '0' && nc <= '9' { - start := nnext - i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsNumeric) - if ok && i < limit && i-start < 8 && source[i] == ';' { - v, _ := strconv.ParseUint(util.BytesToReadOnlyString(source[start:i]), 10, 32) - d.RawWrite(writer, source[n:pos]) - n = i + 1 - escapeRune(writer, rune(v)) - continue - } - } - } - } else { - start := next - i, ok = util.ReadWhile(source, [2]int{start, limit}, util.IsAlphaNumeric) - // entity reference - if ok && i < limit && source[i] == ';' { - name := util.BytesToReadOnlyString(source[start:i]) - entity, ok := util.LookUpHTML5EntityByName(name) - if ok { - d.RawWrite(writer, source[n:pos]) - n = i + 1 - d.RawWrite(writer, entity.Characters) - continue - } - } - } - i = next - 1 - } - if c == '\\' { - escaped = true - continue - } - escaped = false - } - d.RawWrite(writer, source[n:]) -} - -// DefaultWriter is a default implementation of the Writer. -var DefaultWriter = &defaultWriter{} - -var bDataImage = []byte("data:image/") -var bPng = []byte("png;") -var bGif = []byte("gif;") -var bJpeg = []byte("jpeg;") -var bWebp = []byte("webp;") -var bJs = []byte("javascript:") -var bVb = []byte("vbscript:") -var bFile = []byte("file:") -var bData = []byte("data:") - -// IsDangerousURL returns true if the given url seems a potentially dangerous url, -// otherwise false. -func IsDangerousURL(url []byte) bool { - if bytes.HasPrefix(url, bDataImage) && len(url) >= 11 { - v := url[11:] - if bytes.HasPrefix(v, bPng) || bytes.HasPrefix(v, bGif) || - bytes.HasPrefix(v, bJpeg) || bytes.HasPrefix(v, bWebp) { - return false - } - return true - } - return bytes.HasPrefix(url, bJs) || bytes.HasPrefix(url, bVb) || - bytes.HasPrefix(url, bFile) || bytes.HasPrefix(url, bData) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/renderer/renderer.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/renderer/renderer.go deleted file mode 100644 index 10f6d4010..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/renderer/renderer.go +++ /dev/null @@ -1,174 +0,0 @@ -// Package renderer renders the given AST to certain formats. -package renderer - -import ( - "bufio" - "io" - "sync" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/util" -) - -// A Config struct is a data structure that holds configuration of the Renderer. -type Config struct { - Options map[OptionName]interface{} - NodeRenderers util.PrioritizedSlice -} - -// NewConfig returns a new Config -func NewConfig() *Config { - return &Config{ - Options: map[OptionName]interface{}{}, - NodeRenderers: util.PrioritizedSlice{}, - } -} - -// An OptionName is a name of the option. -type OptionName string - -// An Option interface is a functional option type for the Renderer. -type Option interface { - SetConfig(*Config) -} - -type withNodeRenderers struct { - value []util.PrioritizedValue -} - -func (o *withNodeRenderers) SetConfig(c *Config) { - c.NodeRenderers = append(c.NodeRenderers, o.value...) -} - -// WithNodeRenderers is a functional option that allow you to add -// NodeRenderers to the renderer. -func WithNodeRenderers(ps ...util.PrioritizedValue) Option { - return &withNodeRenderers{ps} -} - -type withOption struct { - name OptionName - value interface{} -} - -func (o *withOption) SetConfig(c *Config) { - c.Options[o.name] = o.value -} - -// WithOption is a functional option that allow you to set -// an arbitrary option to the parser. -func WithOption(name OptionName, value interface{}) Option { - return &withOption{name, value} -} - -// A SetOptioner interface sets given option to the object. -type SetOptioner interface { - // SetOption sets given option to the object. - // Unacceptable options may be passed. - // Thus implementations must ignore unacceptable options. - SetOption(name OptionName, value interface{}) -} - -// NodeRendererFunc is a function that renders a given node. -type NodeRendererFunc func(writer util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) - -// A NodeRenderer interface offers NodeRendererFuncs. -type NodeRenderer interface { - // RendererFuncs registers NodeRendererFuncs to given NodeRendererFuncRegisterer. - RegisterFuncs(NodeRendererFuncRegisterer) -} - -// A NodeRendererFuncRegisterer registers -type NodeRendererFuncRegisterer interface { - // Register registers given NodeRendererFunc to this object. - Register(ast.NodeKind, NodeRendererFunc) -} - -// A Renderer interface renders given AST node to given -// writer with given Renderer. -type Renderer interface { - Render(w io.Writer, source []byte, n ast.Node) error - - // AddOptions adds given option to this renderer. - AddOptions(...Option) -} - -type renderer struct { - config *Config - options map[OptionName]interface{} - nodeRendererFuncsTmp map[ast.NodeKind]NodeRendererFunc - maxKind int - nodeRendererFuncs []NodeRendererFunc - initSync sync.Once -} - -// NewRenderer returns a new Renderer with given options. -func NewRenderer(options ...Option) Renderer { - config := NewConfig() - for _, opt := range options { - opt.SetConfig(config) - } - - r := &renderer{ - options: map[OptionName]interface{}{}, - config: config, - nodeRendererFuncsTmp: map[ast.NodeKind]NodeRendererFunc{}, - } - - return r -} - -func (r *renderer) AddOptions(opts ...Option) { - for _, opt := range opts { - opt.SetConfig(r.config) - } -} - -func (r *renderer) Register(kind ast.NodeKind, v NodeRendererFunc) { - r.nodeRendererFuncsTmp[kind] = v - if int(kind) > r.maxKind { - r.maxKind = int(kind) - } -} - -// Render renders the given AST node to the given writer with the given Renderer. -func (r *renderer) Render(w io.Writer, source []byte, n ast.Node) error { - r.initSync.Do(func() { - r.options = r.config.Options - r.config.NodeRenderers.Sort() - l := len(r.config.NodeRenderers) - for i := l - 1; i >= 0; i-- { - v := r.config.NodeRenderers[i] - nr, _ := v.Value.(NodeRenderer) - if se, ok := v.Value.(SetOptioner); ok { - for oname, ovalue := range r.options { - se.SetOption(oname, ovalue) - } - } - nr.RegisterFuncs(r) - } - r.nodeRendererFuncs = make([]NodeRendererFunc, r.maxKind+1) - for kind, nr := range r.nodeRendererFuncsTmp { - r.nodeRendererFuncs[kind] = nr - } - r.config = nil - r.nodeRendererFuncsTmp = nil - }) - writer, ok := w.(util.BufWriter) - if !ok { - writer = bufio.NewWriter(w) - } - err := ast.Walk(n, func(n ast.Node, entering bool) (ast.WalkStatus, error) { - s := ast.WalkStatus(ast.WalkContinue) - var err error - f := r.nodeRendererFuncs[n.Kind()] - if f != nil { - s, err = f(writer, source, n, entering) - } - return s, err - }) - if err != nil { - return err - } - return writer.Flush() -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/testutil/testutil.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/testutil/testutil.go deleted file mode 100644 index 4827f5e04..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/testutil/testutil.go +++ /dev/null @@ -1,397 +0,0 @@ -package testutil - -import ( - "bufio" - "bytes" - "encoding/hex" - "encoding/json" - "fmt" - "os" - "regexp" - "runtime/debug" - "strconv" - "strings" - - "github.com/yuin/goldmark" - "github.com/yuin/goldmark/parser" - "github.com/yuin/goldmark/util" -) - -// TestingT is a subset of the functionality provided by testing.T. -type TestingT interface { - Logf(string, ...interface{}) - Skipf(string, ...interface{}) - Errorf(string, ...interface{}) - FailNow() -} - -// MarkdownTestCase represents a test case. -type MarkdownTestCase struct { - No int - Description string - Options MarkdownTestCaseOptions - Markdown string - Expected string -} - -func source(t *MarkdownTestCase) string { - if t.Options.EnableEscape { - return string(applyEscapeSequence([]byte(t.Markdown))) - } - return t.Markdown -} - -func expected(t *MarkdownTestCase) string { - if t.Options.EnableEscape { - return string(applyEscapeSequence([]byte(t.Expected))) - } - return t.Expected -} - -// MarkdownTestCaseOptions represents options for each test case. -type MarkdownTestCaseOptions struct { - EnableEscape bool -} - -const attributeSeparator = "//- - - - - - - - -//" -const caseSeparator = "//= = = = = = = = = = = = = = = = = = = = = = = =//" - -var optionsRegexp *regexp.Regexp = regexp.MustCompile(`(?i)\s*options:(.*)`) - -// ParseCliCaseArg parses -case command line args. -func ParseCliCaseArg() []int { - ret := []int{} - for _, a := range os.Args { - if strings.HasPrefix(a, "case=") { - parts := strings.Split(a, "=") - for _, cas := range strings.Split(parts[1], ",") { - value, err := strconv.Atoi(strings.TrimSpace(cas)) - if err == nil { - ret = append(ret, value) - } - } - } - } - return ret -} - -// DoTestCaseFile runs test cases in a given file. -func DoTestCaseFile(m goldmark.Markdown, filename string, t TestingT, no ...int) { - fp, err := os.Open(filename) - if err != nil { - panic(err) - } - defer fp.Close() - - scanner := bufio.NewScanner(fp) - c := MarkdownTestCase{ - No: -1, - Description: "", - Options: MarkdownTestCaseOptions{}, - Markdown: "", - Expected: "", - } - cases := []MarkdownTestCase{} - line := 0 - for scanner.Scan() { - line++ - if util.IsBlank([]byte(scanner.Text())) { - continue - } - header := scanner.Text() - c.Description = "" - if strings.Contains(header, ":") { - parts := strings.Split(header, ":") - c.No, err = strconv.Atoi(strings.TrimSpace(parts[0])) - c.Description = strings.Join(parts[1:], ":") - } else { - c.No, err = strconv.Atoi(scanner.Text()) - } - if err != nil { - panic(fmt.Sprintf("%s: invalid case No at line %d", filename, line)) - } - if !scanner.Scan() { - panic(fmt.Sprintf("%s: invalid case at line %d", filename, line)) - } - line++ - matches := optionsRegexp.FindAllStringSubmatch(scanner.Text(), -1) - if len(matches) != 0 { - err = json.Unmarshal([]byte(matches[0][1]), &c.Options) - if err != nil { - panic(fmt.Sprintf("%s: invalid options at line %d", filename, line)) - } - scanner.Scan() - line++ - } - if scanner.Text() != attributeSeparator { - panic(fmt.Sprintf("%s: invalid separator '%s' at line %d", filename, scanner.Text(), line)) - } - buf := []string{} - for scanner.Scan() { - line++ - text := scanner.Text() - if text == attributeSeparator { - break - } - buf = append(buf, text) - } - c.Markdown = strings.Join(buf, "\n") - buf = []string{} - for scanner.Scan() { - line++ - text := scanner.Text() - if text == caseSeparator { - break - } - buf = append(buf, text) - } - c.Expected = strings.Join(buf, "\n") - if len(c.Expected) != 0 { - c.Expected = c.Expected + "\n" - } - shouldAdd := len(no) == 0 - if !shouldAdd { - for _, n := range no { - if n == c.No { - shouldAdd = true - break - } - } - } - if shouldAdd { - cases = append(cases, c) - } - } - DoTestCases(m, cases, t) -} - -// DoTestCases runs a set of test cases. -func DoTestCases(m goldmark.Markdown, cases []MarkdownTestCase, t TestingT, opts ...parser.ParseOption) { - for _, testCase := range cases { - DoTestCase(m, testCase, t, opts...) - } -} - -// DoTestCase runs a test case. -func DoTestCase(m goldmark.Markdown, testCase MarkdownTestCase, t TestingT, opts ...parser.ParseOption) { - var ok bool - var out bytes.Buffer - defer func() { - description := "" - if len(testCase.Description) != 0 { - description = ": " + testCase.Description - } - if err := recover(); err != nil { - format := `============= case %d%s ================ -Markdown: ------------ -%s - -Expected: ----------- -%s - -Actual ---------- -%v -%s -` - t.Errorf(format, testCase.No, description, source(&testCase), expected(&testCase), err, debug.Stack()) - } else if !ok { - format := `============= case %d%s ================ -Markdown: ------------ -%s - -Expected: ----------- -%s - -Actual ---------- -%s - -Diff ---------- -%s -` - t.Errorf(format, testCase.No, description, source(&testCase), expected(&testCase), out.Bytes(), - DiffPretty([]byte(expected(&testCase)), out.Bytes())) - } - }() - - if err := m.Convert([]byte(source(&testCase)), &out, opts...); err != nil { - panic(err) - } - ok = bytes.Equal(bytes.TrimSpace(out.Bytes()), bytes.TrimSpace([]byte(expected(&testCase)))) -} - -type diffType int - -const ( - diffRemoved diffType = iota - diffAdded - diffNone -) - -type diff struct { - Type diffType - Lines [][]byte -} - -func simpleDiff(v1, v2 []byte) []diff { - return simpleDiffAux( - bytes.Split(v1, []byte("\n")), - bytes.Split(v2, []byte("\n"))) -} - -func simpleDiffAux(v1lines, v2lines [][]byte) []diff { - v1index := map[string][]int{} - for i, line := range v1lines { - key := util.BytesToReadOnlyString(line) - if _, ok := v1index[key]; !ok { - v1index[key] = []int{} - } - v1index[key] = append(v1index[key], i) - } - overlap := map[int]int{} - v1start := 0 - v2start := 0 - length := 0 - for v2pos, line := range v2lines { - newOverlap := map[int]int{} - key := util.BytesToReadOnlyString(line) - if _, ok := v1index[key]; !ok { - v1index[key] = []int{} - } - for _, v1pos := range v1index[key] { - value := 0 - if v1pos != 0 { - if v, ok := overlap[v1pos-1]; ok { - value = v - } - } - newOverlap[v1pos] = value + 1 - if newOverlap[v1pos] > length { - length = newOverlap[v1pos] - v1start = v1pos - length + 1 - v2start = v2pos - length + 1 - } - } - overlap = newOverlap - } - if length == 0 { - diffs := []diff{} - if len(v1lines) != 0 { - diffs = append(diffs, diff{diffRemoved, v1lines}) - } - if len(v2lines) != 0 { - diffs = append(diffs, diff{diffAdded, v2lines}) - } - return diffs - } - diffs := simpleDiffAux(v1lines[:v1start], v2lines[:v2start]) - diffs = append(diffs, diff{diffNone, v2lines[v2start : v2start+length]}) - diffs = append(diffs, simpleDiffAux(v1lines[v1start+length:], - v2lines[v2start+length:])...) - return diffs -} - -// DiffPretty returns pretty formatted diff between given bytes. -func DiffPretty(v1, v2 []byte) []byte { - var b bytes.Buffer - diffs := simpleDiff(v1, v2) - for _, diff := range diffs { - c := " " - switch diff.Type { - case diffAdded: - c = "+" - case diffRemoved: - c = "-" - case diffNone: - c = " " - } - for _, line := range diff.Lines { - if c != " " { - b.WriteString(fmt.Sprintf("%s | %s\n", c, util.VisualizeSpaces(line))) - } else { - b.WriteString(fmt.Sprintf("%s | %s\n", c, line)) - } - } - } - return b.Bytes() -} - -func applyEscapeSequence(b []byte) []byte { - result := make([]byte, 0, len(b)) - for i := 0; i < len(b); i++ { - if b[i] == '\\' && i != len(b)-1 { - switch b[i+1] { - case 'a': - result = append(result, '\a') - i++ - continue - case 'b': - result = append(result, '\b') - i++ - continue - case 'f': - result = append(result, '\f') - i++ - continue - case 'n': - result = append(result, '\n') - i++ - continue - case 'r': - result = append(result, '\r') - i++ - continue - case 't': - result = append(result, '\t') - i++ - continue - case 'v': - result = append(result, '\v') - i++ - continue - case '\\': - result = append(result, '\\') - i++ - continue - case 'x': - if len(b) >= i+3 && util.IsHexDecimal(b[i+2]) && util.IsHexDecimal(b[i+3]) { - v, _ := hex.DecodeString(string(b[i+2 : i+4])) - result = append(result, v[0]) - i += 3 - continue - } - case 'u', 'U': - if len(b) > i+2 { - num := []byte{} - for j := i + 2; j < len(b); j++ { - if util.IsHexDecimal(b[j]) { - num = append(num, b[j]) - continue - } - break - } - if len(num) >= 4 && len(num) < 8 { - v, _ := strconv.ParseInt(string(num[:4]), 16, 32) - result = append(result, []byte(string(rune(v)))...) - i += 5 - continue - } - if len(num) >= 8 { - v, _ := strconv.ParseInt(string(num[:8]), 16, 32) - result = append(result, []byte(string(rune(v)))...) - i += 9 - continue - } - } - } - } - result = append(result, b[i]) - } - return result -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/testutil/testutil_test.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/testutil/testutil_test.go deleted file mode 100644 index 2000a00d0..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/testutil/testutil_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package testutil - -import "testing" - -// This will fail to compile if the TestingT interface is changed in a way -// that doesn't conform to testing.T. -var _ TestingT = (*testing.T)(nil) diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/text/reader.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/text/reader.go deleted file mode 100644 index 319f1c8b8..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/text/reader.go +++ /dev/null @@ -1,653 +0,0 @@ -package text - -import ( - "io" - "regexp" - "unicode/utf8" - - "github.com/yuin/goldmark/util" -) - -const invalidValue = -1 - -// EOF indicates the end of file. -const EOF = byte(0xff) - -// A Reader interface provides abstracted method for reading text. -type Reader interface { - io.RuneReader - - // Source returns a source of the reader. - Source() []byte - - // ResetPosition resets positions. - ResetPosition() - - // Peek returns a byte at current position without advancing the internal pointer. - Peek() byte - - // PeekLine returns the current line without advancing the internal pointer. - PeekLine() ([]byte, Segment) - - // PrecendingCharacter returns a character just before current internal pointer. - PrecendingCharacter() rune - - // Value returns a value of the given segment. - Value(Segment) []byte - - // LineOffset returns a distance from the line head to current position. - LineOffset() int - - // Position returns current line number and position. - Position() (int, Segment) - - // SetPosition sets current line number and position. - SetPosition(int, Segment) - - // SetPadding sets padding to the reader. - SetPadding(int) - - // Advance advances the internal pointer. - Advance(int) - - // AdvanceAndSetPadding advances the internal pointer and add padding to the - // reader. - AdvanceAndSetPadding(int, int) - - // AdvanceLine advances the internal pointer to the next line head. - AdvanceLine() - - // SkipSpaces skips space characters and returns a non-blank line. - // If it reaches EOF, returns false. - SkipSpaces() (Segment, int, bool) - - // SkipSpaces skips blank lines and returns a non-blank line. - // If it reaches EOF, returns false. - SkipBlankLines() (Segment, int, bool) - - // Match performs regular expression matching to current line. - Match(reg *regexp.Regexp) bool - - // Match performs regular expression searching to current line. - FindSubMatch(reg *regexp.Regexp) [][]byte - - // FindClosure finds corresponding closure. - FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool) -} - -// FindClosureOptions is options for Reader.FindClosure -type FindClosureOptions struct { - // CodeSpan is a flag for the FindClosure. If this is set to true, - // FindClosure ignores closers in codespans. - CodeSpan bool - - // Nesting is a flag for the FindClosure. If this is set to true, - // FindClosure allows nesting. - Nesting bool - - // Newline is a flag for the FindClosure. If this is set to true, - // FindClosure searches for a closer over multiple lines. - Newline bool - - // Advance is a flag for the FindClosure. If this is set to true, - // FindClosure advances pointers when closer is found. - Advance bool -} - -type reader struct { - source []byte - sourceLength int - line int - peekedLine []byte - pos Segment - head int - lineOffset int -} - -// NewReader return a new Reader that can read UTF-8 bytes . -func NewReader(source []byte) Reader { - r := &reader{ - source: source, - sourceLength: len(source), - } - r.ResetPosition() - return r -} - -func (r *reader) FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool) { - return findClosureReader(r, opener, closer, options) -} - -func (r *reader) ResetPosition() { - r.line = -1 - r.head = 0 - r.lineOffset = -1 - r.AdvanceLine() -} - -func (r *reader) Source() []byte { - return r.source -} - -func (r *reader) Value(seg Segment) []byte { - return seg.Value(r.source) -} - -func (r *reader) Peek() byte { - if r.pos.Start >= 0 && r.pos.Start < r.sourceLength { - if r.pos.Padding != 0 { - return space[0] - } - return r.source[r.pos.Start] - } - return EOF -} - -func (r *reader) PeekLine() ([]byte, Segment) { - if r.pos.Start >= 0 && r.pos.Start < r.sourceLength { - if r.peekedLine == nil { - r.peekedLine = r.pos.Value(r.Source()) - } - return r.peekedLine, r.pos - } - return nil, r.pos -} - -// io.RuneReader interface -func (r *reader) ReadRune() (rune, int, error) { - return readRuneReader(r) -} - -func (r *reader) LineOffset() int { - if r.lineOffset < 0 { - v := 0 - for i := r.head; i < r.pos.Start; i++ { - if r.source[i] == '\t' { - v += util.TabWidth(v) - } else { - v++ - } - } - r.lineOffset = v - r.pos.Padding - } - return r.lineOffset -} - -func (r *reader) PrecendingCharacter() rune { - if r.pos.Start <= 0 { - if r.pos.Padding != 0 { - return rune(' ') - } - return rune('\n') - } - i := r.pos.Start - 1 - for ; i >= 0; i-- { - if utf8.RuneStart(r.source[i]) { - break - } - } - rn, _ := utf8.DecodeRune(r.source[i:]) - return rn -} - -func (r *reader) Advance(n int) { - r.lineOffset = -1 - if n < len(r.peekedLine) && r.pos.Padding == 0 { - r.pos.Start += n - r.peekedLine = nil - return - } - r.peekedLine = nil - l := r.sourceLength - for ; n > 0 && r.pos.Start < l; n-- { - if r.pos.Padding != 0 { - r.pos.Padding-- - continue - } - if r.source[r.pos.Start] == '\n' { - r.AdvanceLine() - continue - } - r.pos.Start++ - } -} - -func (r *reader) AdvanceAndSetPadding(n, padding int) { - r.Advance(n) - if padding > r.pos.Padding { - r.SetPadding(padding) - } -} - -func (r *reader) AdvanceLine() { - r.lineOffset = -1 - r.peekedLine = nil - r.pos.Start = r.pos.Stop - r.head = r.pos.Start - if r.pos.Start < 0 { - return - } - r.pos.Stop = r.sourceLength - for i := r.pos.Start; i < r.sourceLength; i++ { - c := r.source[i] - if c == '\n' { - r.pos.Stop = i + 1 - break - } - } - r.line++ - r.pos.Padding = 0 -} - -func (r *reader) Position() (int, Segment) { - return r.line, r.pos -} - -func (r *reader) SetPosition(line int, pos Segment) { - r.lineOffset = -1 - r.line = line - r.pos = pos -} - -func (r *reader) SetPadding(v int) { - r.pos.Padding = v -} - -func (r *reader) SkipSpaces() (Segment, int, bool) { - return skipSpacesReader(r) -} - -func (r *reader) SkipBlankLines() (Segment, int, bool) { - return skipBlankLinesReader(r) -} - -func (r *reader) Match(reg *regexp.Regexp) bool { - return matchReader(r, reg) -} - -func (r *reader) FindSubMatch(reg *regexp.Regexp) [][]byte { - return findSubMatchReader(r, reg) -} - -// A BlockReader interface is a reader that is optimized for Blocks. -type BlockReader interface { - Reader - // Reset resets current state and sets new segments to the reader. - Reset(segment *Segments) -} - -type blockReader struct { - source []byte - segments *Segments - segmentsLength int - line int - pos Segment - head int - last int - lineOffset int -} - -// NewBlockReader returns a new BlockReader. -func NewBlockReader(source []byte, segments *Segments) BlockReader { - r := &blockReader{ - source: source, - } - if segments != nil { - r.Reset(segments) - } - return r -} - -func (r *blockReader) FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool) { - return findClosureReader(r, opener, closer, options) -} - -func (r *blockReader) ResetPosition() { - r.line = -1 - r.head = 0 - r.last = 0 - r.lineOffset = -1 - r.pos.Start = -1 - r.pos.Stop = -1 - r.pos.Padding = 0 - if r.segmentsLength > 0 { - last := r.segments.At(r.segmentsLength - 1) - r.last = last.Stop - } - r.AdvanceLine() -} - -func (r *blockReader) Reset(segments *Segments) { - r.segments = segments - r.segmentsLength = segments.Len() - r.ResetPosition() -} - -func (r *blockReader) Source() []byte { - return r.source -} - -func (r *blockReader) Value(seg Segment) []byte { - line := r.segmentsLength - 1 - ret := make([]byte, 0, seg.Stop-seg.Start+1) - for ; line >= 0; line-- { - if seg.Start >= r.segments.At(line).Start { - break - } - } - i := seg.Start - for ; line < r.segmentsLength; line++ { - s := r.segments.At(line) - if i < 0 { - i = s.Start - } - ret = s.ConcatPadding(ret) - for ; i < seg.Stop && i < s.Stop; i++ { - ret = append(ret, r.source[i]) - } - i = -1 - if s.Stop > seg.Stop { - break - } - } - return ret -} - -// io.RuneReader interface -func (r *blockReader) ReadRune() (rune, int, error) { - return readRuneReader(r) -} - -func (r *blockReader) PrecendingCharacter() rune { - if r.pos.Padding != 0 { - return rune(' ') - } - if r.segments.Len() < 1 { - return rune('\n') - } - firstSegment := r.segments.At(0) - if r.line == 0 && r.pos.Start <= firstSegment.Start { - return rune('\n') - } - l := len(r.source) - i := r.pos.Start - 1 - for ; i < l && i >= 0; i-- { - if utf8.RuneStart(r.source[i]) { - break - } - } - if i < 0 || i >= l { - return rune('\n') - } - rn, _ := utf8.DecodeRune(r.source[i:]) - return rn -} - -func (r *blockReader) LineOffset() int { - if r.lineOffset < 0 { - v := 0 - for i := r.head; i < r.pos.Start; i++ { - if r.source[i] == '\t' { - v += util.TabWidth(v) - } else { - v++ - } - } - r.lineOffset = v - r.pos.Padding - } - return r.lineOffset -} - -func (r *blockReader) Peek() byte { - if r.line < r.segmentsLength && r.pos.Start >= 0 && r.pos.Start < r.last { - if r.pos.Padding != 0 { - return space[0] - } - return r.source[r.pos.Start] - } - return EOF -} - -func (r *blockReader) PeekLine() ([]byte, Segment) { - if r.line < r.segmentsLength && r.pos.Start >= 0 && r.pos.Start < r.last { - return r.pos.Value(r.source), r.pos - } - return nil, r.pos -} - -func (r *blockReader) Advance(n int) { - r.lineOffset = -1 - - if n < r.pos.Stop-r.pos.Start && r.pos.Padding == 0 { - r.pos.Start += n - return - } - - for ; n > 0; n-- { - if r.pos.Padding != 0 { - r.pos.Padding-- - continue - } - if r.pos.Start >= r.pos.Stop-1 && r.pos.Stop < r.last { - r.AdvanceLine() - continue - } - r.pos.Start++ - } -} - -func (r *blockReader) AdvanceAndSetPadding(n, padding int) { - r.Advance(n) - if padding > r.pos.Padding { - r.SetPadding(padding) - } -} - -func (r *blockReader) AdvanceLine() { - r.SetPosition(r.line+1, NewSegment(invalidValue, invalidValue)) - r.head = r.pos.Start -} - -func (r *blockReader) Position() (int, Segment) { - return r.line, r.pos -} - -func (r *blockReader) SetPosition(line int, pos Segment) { - r.lineOffset = -1 - r.line = line - if pos.Start == invalidValue { - if r.line < r.segmentsLength { - s := r.segments.At(line) - r.head = s.Start - r.pos = s - } - } else { - r.pos = pos - if r.line < r.segmentsLength { - s := r.segments.At(line) - r.head = s.Start - } - } -} - -func (r *blockReader) SetPadding(v int) { - r.lineOffset = -1 - r.pos.Padding = v -} - -func (r *blockReader) SkipSpaces() (Segment, int, bool) { - return skipSpacesReader(r) -} - -func (r *blockReader) SkipBlankLines() (Segment, int, bool) { - return skipBlankLinesReader(r) -} - -func (r *blockReader) Match(reg *regexp.Regexp) bool { - return matchReader(r, reg) -} - -func (r *blockReader) FindSubMatch(reg *regexp.Regexp) [][]byte { - return findSubMatchReader(r, reg) -} - -func skipBlankLinesReader(r Reader) (Segment, int, bool) { - lines := 0 - for { - line, seg := r.PeekLine() - if line == nil { - return seg, lines, false - } - if util.IsBlank(line) { - lines++ - r.AdvanceLine() - } else { - return seg, lines, true - } - } -} - -func skipSpacesReader(r Reader) (Segment, int, bool) { - chars := 0 - for { - line, segment := r.PeekLine() - if line == nil { - return segment, chars, false - } - for i, c := range line { - if util.IsSpace(c) { - chars++ - r.Advance(1) - continue - } - return segment.WithStart(segment.Start + i + 1), chars, true - } - } -} - -func matchReader(r Reader, reg *regexp.Regexp) bool { - oldline, oldseg := r.Position() - match := reg.FindReaderSubmatchIndex(r) - r.SetPosition(oldline, oldseg) - if match == nil { - return false - } - r.Advance(match[1] - match[0]) - return true -} - -func findSubMatchReader(r Reader, reg *regexp.Regexp) [][]byte { - oldline, oldseg := r.Position() - match := reg.FindReaderSubmatchIndex(r) - r.SetPosition(oldline, oldseg) - if match == nil { - return nil - } - runes := make([]rune, 0, match[1]-match[0]) - for i := 0; i < match[1]; { - r, size, _ := readRuneReader(r) - i += size - runes = append(runes, r) - } - result := [][]byte{} - for i := 0; i < len(match); i += 2 { - result = append(result, []byte(string(runes[match[i]:match[i+1]]))) - } - - r.SetPosition(oldline, oldseg) - r.Advance(match[1] - match[0]) - return result -} - -func readRuneReader(r Reader) (rune, int, error) { - line, _ := r.PeekLine() - if line == nil { - return 0, 0, io.EOF - } - rn, size := utf8.DecodeRune(line) - if rn == utf8.RuneError { - return 0, 0, io.EOF - } - r.Advance(size) - return rn, size, nil -} - -func findClosureReader(r Reader, opener, closer byte, opts FindClosureOptions) (*Segments, bool) { - opened := 1 - codeSpanOpener := 0 - closed := false - orgline, orgpos := r.Position() - var ret *Segments - - for { - bs, seg := r.PeekLine() - if bs == nil { - goto end - } - i := 0 - for i < len(bs) { - c := bs[i] - if opts.CodeSpan && codeSpanOpener != 0 && c == '`' { - codeSpanCloser := 0 - for ; i < len(bs); i++ { - if bs[i] == '`' { - codeSpanCloser++ - } else { - i-- - break - } - } - if codeSpanCloser == codeSpanOpener { - codeSpanOpener = 0 - } - } else if codeSpanOpener == 0 && c == '\\' && i < len(bs)-1 && util.IsPunct(bs[i+1]) { - i += 2 - continue - } else if opts.CodeSpan && codeSpanOpener == 0 && c == '`' { - for ; i < len(bs); i++ { - if bs[i] == '`' { - codeSpanOpener++ - } else { - i-- - break - } - } - } else if (opts.CodeSpan && codeSpanOpener == 0) || !opts.CodeSpan { - if c == closer { - opened-- - if opened == 0 { - if ret == nil { - ret = NewSegments() - } - ret.Append(seg.WithStop(seg.Start + i)) - r.Advance(i + 1) - closed = true - goto end - } - } else if c == opener { - if !opts.Nesting { - goto end - } - opened++ - } - } - i++ - } - if !opts.Newline { - goto end - } - r.AdvanceLine() - if ret == nil { - ret = NewSegments() - } - ret.Append(seg) - } -end: - if !opts.Advance { - r.SetPosition(orgline, orgpos) - } - if closed { - return ret, true - } - return nil, false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/text/segment.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/text/segment.go deleted file mode 100644 index badd4bc8e..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/text/segment.go +++ /dev/null @@ -1,209 +0,0 @@ -package text - -import ( - "bytes" - "github.com/yuin/goldmark/util" -) - -var space = []byte(" ") - -// A Segment struct holds information about source positions. -type Segment struct { - // Start is a start position of the segment. - Start int - - // Stop is a stop position of the segment. - // This value should be excluded. - Stop int - - // Padding is a padding length of the segment. - Padding int -} - -// NewSegment return a new Segment. -func NewSegment(start, stop int) Segment { - return Segment{ - Start: start, - Stop: stop, - Padding: 0, - } -} - -// NewSegmentPadding returns a new Segment with the given padding. -func NewSegmentPadding(start, stop, n int) Segment { - return Segment{ - Start: start, - Stop: stop, - Padding: n, - } -} - -// Value returns a value of the segment. -func (t *Segment) Value(buffer []byte) []byte { - if t.Padding == 0 { - return buffer[t.Start:t.Stop] - } - result := make([]byte, 0, t.Padding+t.Stop-t.Start+1) - result = append(result, bytes.Repeat(space, t.Padding)...) - return append(result, buffer[t.Start:t.Stop]...) -} - -// Len returns a length of the segment. -func (t *Segment) Len() int { - return t.Stop - t.Start + t.Padding -} - -// Between returns a segment between this segment and the given segment. -func (t *Segment) Between(other Segment) Segment { - if t.Stop != other.Stop { - panic("invalid state") - } - return NewSegmentPadding( - t.Start, - other.Start, - t.Padding-other.Padding, - ) -} - -// IsEmpty returns true if this segment is empty, otherwise false. -func (t *Segment) IsEmpty() bool { - return t.Start >= t.Stop && t.Padding == 0 -} - -// TrimRightSpace returns a new segment by slicing off all trailing -// space characters. -func (t *Segment) TrimRightSpace(buffer []byte) Segment { - v := buffer[t.Start:t.Stop] - l := util.TrimRightSpaceLength(v) - if l == len(v) { - return NewSegment(t.Start, t.Start) - } - return NewSegmentPadding(t.Start, t.Stop-l, t.Padding) -} - -// TrimLeftSpace returns a new segment by slicing off all leading -// space characters including padding. -func (t *Segment) TrimLeftSpace(buffer []byte) Segment { - v := buffer[t.Start:t.Stop] - l := util.TrimLeftSpaceLength(v) - return NewSegment(t.Start+l, t.Stop) -} - -// TrimLeftSpaceWidth returns a new segment by slicing off leading space -// characters until the given width. -func (t *Segment) TrimLeftSpaceWidth(width int, buffer []byte) Segment { - padding := t.Padding - for ; width > 0; width-- { - if padding == 0 { - break - } - padding-- - } - if width == 0 { - return NewSegmentPadding(t.Start, t.Stop, padding) - } - text := buffer[t.Start:t.Stop] - start := t.Start - for _, c := range text { - if start >= t.Stop-1 || width <= 0 { - break - } - if c == ' ' { - width-- - } else if c == '\t' { - width -= 4 - } else { - break - } - start++ - } - if width < 0 { - padding = width * -1 - } - return NewSegmentPadding(start, t.Stop, padding) -} - -// WithStart returns a new Segment with same value except Start. -func (t *Segment) WithStart(v int) Segment { - return NewSegmentPadding(v, t.Stop, t.Padding) -} - -// WithStop returns a new Segment with same value except Stop. -func (t *Segment) WithStop(v int) Segment { - return NewSegmentPadding(t.Start, v, t.Padding) -} - -// ConcatPadding concats the padding to the given slice. -func (t *Segment) ConcatPadding(v []byte) []byte { - if t.Padding > 0 { - return append(v, bytes.Repeat(space, t.Padding)...) - } - return v -} - -// Segments is a collection of the Segment. -type Segments struct { - values []Segment -} - -// NewSegments return a new Segments. -func NewSegments() *Segments { - return &Segments{ - values: nil, - } -} - -// Append appends the given segment after the tail of the collection. -func (s *Segments) Append(t Segment) { - if s.values == nil { - s.values = make([]Segment, 0, 20) - } - s.values = append(s.values, t) -} - -// AppendAll appends all elements of given segments after the tail of the collection. -func (s *Segments) AppendAll(t []Segment) { - if s.values == nil { - s.values = make([]Segment, 0, 20) - } - s.values = append(s.values, t...) -} - -// Len returns the length of the collection. -func (s *Segments) Len() int { - if s.values == nil { - return 0 - } - return len(s.values) -} - -// At returns a segment at the given index. -func (s *Segments) At(i int) Segment { - return s.values[i] -} - -// Set sets the given Segment. -func (s *Segments) Set(i int, v Segment) { - s.values[i] = v -} - -// SetSliced replace the collection with a subsliced value. -func (s *Segments) SetSliced(lo, hi int) { - s.values = s.values[lo:hi] -} - -// Sliced returns a subslice of the collection. -func (s *Segments) Sliced(lo, hi int) []Segment { - return s.values[lo:hi] -} - -// Clear delete all element of the collection. -func (s *Segments) Clear() { - s.values = nil -} - -// Unshift insert the given Segment to head of the collection. -func (s *Segments) Unshift(v Segment) { - s.values = append(s.values[0:1], s.values[0:]...) - s.values[0] = v -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/html5entities.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/html5entities.go deleted file mode 100644 index b8e00a91b..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/html5entities.go +++ /dev/null @@ -1,2142 +0,0 @@ -package util - -// An HTML5Entity struct represents HTML5 entitites. -type HTML5Entity struct { - Name string - CodePoints []int - Characters []byte -} - -// LookUpHTML5EntityByName returns (an HTML5Entity, true) if an entity named -// given name is found, otherwise (nil, false) -func LookUpHTML5EntityByName(name string) (*HTML5Entity, bool) { - v, ok := html5entities[name] - return v, ok -} - -var html5entities = map[string]*HTML5Entity{ - "AElig": {Name: "AElig", CodePoints: []int{198}, Characters: []byte{0xc3, 0x86}}, - "AMP": {Name: "AMP", CodePoints: []int{38}, Characters: []byte{0x26}}, - "Aacute": {Name: "Aacute", CodePoints: []int{193}, Characters: []byte{0xc3, 0x81}}, - "Acirc": {Name: "Acirc", CodePoints: []int{194}, Characters: []byte{0xc3, 0x82}}, - "Acy": {Name: "Acy", CodePoints: []int{1040}, Characters: []byte{0xd0, 0x90}}, - "Afr": {Name: "Afr", CodePoints: []int{120068}, Characters: []byte{0xf0, 0x9d, 0x94, 0x84}}, - "Agrave": {Name: "Agrave", CodePoints: []int{192}, Characters: []byte{0xc3, 0x80}}, - "Alpha": {Name: "Alpha", CodePoints: []int{913}, Characters: []byte{0xce, 0x91}}, - "Amacr": {Name: "Amacr", CodePoints: []int{256}, Characters: []byte{0xc4, 0x80}}, - "And": {Name: "And", CodePoints: []int{10835}, Characters: []byte{0xe2, 0xa9, 0x93}}, - "Aogon": {Name: "Aogon", CodePoints: []int{260}, Characters: []byte{0xc4, 0x84}}, - "Aopf": {Name: "Aopf", CodePoints: []int{120120}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb8}}, - "ApplyFunction": {Name: "ApplyFunction", CodePoints: []int{8289}, Characters: []byte{0xe2, 0x81, 0xa1}}, - "Aring": {Name: "Aring", CodePoints: []int{197}, Characters: []byte{0xc3, 0x85}}, - "Ascr": {Name: "Ascr", CodePoints: []int{119964}, Characters: []byte{0xf0, 0x9d, 0x92, 0x9c}}, - "Assign": {Name: "Assign", CodePoints: []int{8788}, Characters: []byte{0xe2, 0x89, 0x94}}, - "Atilde": {Name: "Atilde", CodePoints: []int{195}, Characters: []byte{0xc3, 0x83}}, - "Auml": {Name: "Auml", CodePoints: []int{196}, Characters: []byte{0xc3, 0x84}}, - "Backslash": {Name: "Backslash", CodePoints: []int{8726}, Characters: []byte{0xe2, 0x88, 0x96}}, - "Barv": {Name: "Barv", CodePoints: []int{10983}, Characters: []byte{0xe2, 0xab, 0xa7}}, - "Barwed": {Name: "Barwed", CodePoints: []int{8966}, Characters: []byte{0xe2, 0x8c, 0x86}}, - "Bcy": {Name: "Bcy", CodePoints: []int{1041}, Characters: []byte{0xd0, 0x91}}, - "Because": {Name: "Because", CodePoints: []int{8757}, Characters: []byte{0xe2, 0x88, 0xb5}}, - "Bernoullis": {Name: "Bernoullis", CodePoints: []int{8492}, Characters: []byte{0xe2, 0x84, 0xac}}, - "Beta": {Name: "Beta", CodePoints: []int{914}, Characters: []byte{0xce, 0x92}}, - "Bfr": {Name: "Bfr", CodePoints: []int{120069}, Characters: []byte{0xf0, 0x9d, 0x94, 0x85}}, - "Bopf": {Name: "Bopf", CodePoints: []int{120121}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb9}}, - "Breve": {Name: "Breve", CodePoints: []int{728}, Characters: []byte{0xcb, 0x98}}, - "Bscr": {Name: "Bscr", CodePoints: []int{8492}, Characters: []byte{0xe2, 0x84, 0xac}}, - "Bumpeq": {Name: "Bumpeq", CodePoints: []int{8782}, Characters: []byte{0xe2, 0x89, 0x8e}}, - "CHcy": {Name: "CHcy", CodePoints: []int{1063}, Characters: []byte{0xd0, 0xa7}}, - "COPY": {Name: "COPY", CodePoints: []int{169}, Characters: []byte{0xc2, 0xa9}}, - "Cacute": {Name: "Cacute", CodePoints: []int{262}, Characters: []byte{0xc4, 0x86}}, - "Cap": {Name: "Cap", CodePoints: []int{8914}, Characters: []byte{0xe2, 0x8b, 0x92}}, - "CapitalDifferentialD": {Name: "CapitalDifferentialD", CodePoints: []int{8517}, Characters: []byte{0xe2, 0x85, 0x85}}, - "Cayleys": {Name: "Cayleys", CodePoints: []int{8493}, Characters: []byte{0xe2, 0x84, 0xad}}, - "Ccaron": {Name: "Ccaron", CodePoints: []int{268}, Characters: []byte{0xc4, 0x8c}}, - "Ccedil": {Name: "Ccedil", CodePoints: []int{199}, Characters: []byte{0xc3, 0x87}}, - "Ccirc": {Name: "Ccirc", CodePoints: []int{264}, Characters: []byte{0xc4, 0x88}}, - "Cconint": {Name: "Cconint", CodePoints: []int{8752}, Characters: []byte{0xe2, 0x88, 0xb0}}, - "Cdot": {Name: "Cdot", CodePoints: []int{266}, Characters: []byte{0xc4, 0x8a}}, - "Cedilla": {Name: "Cedilla", CodePoints: []int{184}, Characters: []byte{0xc2, 0xb8}}, - "CenterDot": {Name: "CenterDot", CodePoints: []int{183}, Characters: []byte{0xc2, 0xb7}}, - "Cfr": {Name: "Cfr", CodePoints: []int{8493}, Characters: []byte{0xe2, 0x84, 0xad}}, - "Chi": {Name: "Chi", CodePoints: []int{935}, Characters: []byte{0xce, 0xa7}}, - "CircleDot": {Name: "CircleDot", CodePoints: []int{8857}, Characters: []byte{0xe2, 0x8a, 0x99}}, - "CircleMinus": {Name: "CircleMinus", CodePoints: []int{8854}, Characters: []byte{0xe2, 0x8a, 0x96}}, - "CirclePlus": {Name: "CirclePlus", CodePoints: []int{8853}, Characters: []byte{0xe2, 0x8a, 0x95}}, - "CircleTimes": {Name: "CircleTimes", CodePoints: []int{8855}, Characters: []byte{0xe2, 0x8a, 0x97}}, - "ClockwiseContourIntegral": {Name: "ClockwiseContourIntegral", CodePoints: []int{8754}, Characters: []byte{0xe2, 0x88, 0xb2}}, - "CloseCurlyDoubleQuote": {Name: "CloseCurlyDoubleQuote", CodePoints: []int{8221}, Characters: []byte{0xe2, 0x80, 0x9d}}, - "CloseCurlyQuote": {Name: "CloseCurlyQuote", CodePoints: []int{8217}, Characters: []byte{0xe2, 0x80, 0x99}}, - "Colon": {Name: "Colon", CodePoints: []int{8759}, Characters: []byte{0xe2, 0x88, 0xb7}}, - "Colone": {Name: "Colone", CodePoints: []int{10868}, Characters: []byte{0xe2, 0xa9, 0xb4}}, - "Congruent": {Name: "Congruent", CodePoints: []int{8801}, Characters: []byte{0xe2, 0x89, 0xa1}}, - "Conint": {Name: "Conint", CodePoints: []int{8751}, Characters: []byte{0xe2, 0x88, 0xaf}}, - "ContourIntegral": {Name: "ContourIntegral", CodePoints: []int{8750}, Characters: []byte{0xe2, 0x88, 0xae}}, - "Copf": {Name: "Copf", CodePoints: []int{8450}, Characters: []byte{0xe2, 0x84, 0x82}}, - "Coproduct": {Name: "Coproduct", CodePoints: []int{8720}, Characters: []byte{0xe2, 0x88, 0x90}}, - "CounterClockwiseContourIntegral": {Name: "CounterClockwiseContourIntegral", CodePoints: []int{8755}, Characters: []byte{0xe2, 0x88, 0xb3}}, - "Cross": {Name: "Cross", CodePoints: []int{10799}, Characters: []byte{0xe2, 0xa8, 0xaf}}, - "Cscr": {Name: "Cscr", CodePoints: []int{119966}, Characters: []byte{0xf0, 0x9d, 0x92, 0x9e}}, - "Cup": {Name: "Cup", CodePoints: []int{8915}, Characters: []byte{0xe2, 0x8b, 0x93}}, - "CupCap": {Name: "CupCap", CodePoints: []int{8781}, Characters: []byte{0xe2, 0x89, 0x8d}}, - "DD": {Name: "DD", CodePoints: []int{8517}, Characters: []byte{0xe2, 0x85, 0x85}}, - "DDotrahd": {Name: "DDotrahd", CodePoints: []int{10513}, Characters: []byte{0xe2, 0xa4, 0x91}}, - "DJcy": {Name: "DJcy", CodePoints: []int{1026}, Characters: []byte{0xd0, 0x82}}, - "DScy": {Name: "DScy", CodePoints: []int{1029}, Characters: []byte{0xd0, 0x85}}, - "DZcy": {Name: "DZcy", CodePoints: []int{1039}, Characters: []byte{0xd0, 0x8f}}, - "Dagger": {Name: "Dagger", CodePoints: []int{8225}, Characters: []byte{0xe2, 0x80, 0xa1}}, - "Darr": {Name: "Darr", CodePoints: []int{8609}, Characters: []byte{0xe2, 0x86, 0xa1}}, - "Dashv": {Name: "Dashv", CodePoints: []int{10980}, Characters: []byte{0xe2, 0xab, 0xa4}}, - "Dcaron": {Name: "Dcaron", CodePoints: []int{270}, Characters: []byte{0xc4, 0x8e}}, - "Dcy": {Name: "Dcy", CodePoints: []int{1044}, Characters: []byte{0xd0, 0x94}}, - "Del": {Name: "Del", CodePoints: []int{8711}, Characters: []byte{0xe2, 0x88, 0x87}}, - "Delta": {Name: "Delta", CodePoints: []int{916}, Characters: []byte{0xce, 0x94}}, - "Dfr": {Name: "Dfr", CodePoints: []int{120071}, Characters: []byte{0xf0, 0x9d, 0x94, 0x87}}, - "DiacriticalAcute": {Name: "DiacriticalAcute", CodePoints: []int{180}, Characters: []byte{0xc2, 0xb4}}, - "DiacriticalDot": {Name: "DiacriticalDot", CodePoints: []int{729}, Characters: []byte{0xcb, 0x99}}, - "DiacriticalDoubleAcute": {Name: "DiacriticalDoubleAcute", CodePoints: []int{733}, Characters: []byte{0xcb, 0x9d}}, - "DiacriticalGrave": {Name: "DiacriticalGrave", CodePoints: []int{96}, Characters: []byte{0x60}}, - "DiacriticalTilde": {Name: "DiacriticalTilde", CodePoints: []int{732}, Characters: []byte{0xcb, 0x9c}}, - "Diamond": {Name: "Diamond", CodePoints: []int{8900}, Characters: []byte{0xe2, 0x8b, 0x84}}, - "DifferentialD": {Name: "DifferentialD", CodePoints: []int{8518}, Characters: []byte{0xe2, 0x85, 0x86}}, - "Dopf": {Name: "Dopf", CodePoints: []int{120123}, Characters: []byte{0xf0, 0x9d, 0x94, 0xbb}}, - "Dot": {Name: "Dot", CodePoints: []int{168}, Characters: []byte{0xc2, 0xa8}}, - "DotDot": {Name: "DotDot", CodePoints: []int{8412}, Characters: []byte{0xe2, 0x83, 0x9c}}, - "DotEqual": {Name: "DotEqual", CodePoints: []int{8784}, Characters: []byte{0xe2, 0x89, 0x90}}, - "DoubleContourIntegral": {Name: "DoubleContourIntegral", CodePoints: []int{8751}, Characters: []byte{0xe2, 0x88, 0xaf}}, - "DoubleDot": {Name: "DoubleDot", CodePoints: []int{168}, Characters: []byte{0xc2, 0xa8}}, - "DoubleDownArrow": {Name: "DoubleDownArrow", CodePoints: []int{8659}, Characters: []byte{0xe2, 0x87, 0x93}}, - "DoubleLeftArrow": {Name: "DoubleLeftArrow", CodePoints: []int{8656}, Characters: []byte{0xe2, 0x87, 0x90}}, - "DoubleLeftRightArrow": {Name: "DoubleLeftRightArrow", CodePoints: []int{8660}, Characters: []byte{0xe2, 0x87, 0x94}}, - "DoubleLeftTee": {Name: "DoubleLeftTee", CodePoints: []int{10980}, Characters: []byte{0xe2, 0xab, 0xa4}}, - "DoubleLongLeftArrow": {Name: "DoubleLongLeftArrow", CodePoints: []int{10232}, Characters: []byte{0xe2, 0x9f, 0xb8}}, - "DoubleLongLeftRightArrow": {Name: "DoubleLongLeftRightArrow", CodePoints: []int{10234}, Characters: []byte{0xe2, 0x9f, 0xba}}, - "DoubleLongRightArrow": {Name: "DoubleLongRightArrow", CodePoints: []int{10233}, Characters: []byte{0xe2, 0x9f, 0xb9}}, - "DoubleRightArrow": {Name: "DoubleRightArrow", CodePoints: []int{8658}, Characters: []byte{0xe2, 0x87, 0x92}}, - "DoubleRightTee": {Name: "DoubleRightTee", CodePoints: []int{8872}, Characters: []byte{0xe2, 0x8a, 0xa8}}, - "DoubleUpArrow": {Name: "DoubleUpArrow", CodePoints: []int{8657}, Characters: []byte{0xe2, 0x87, 0x91}}, - "DoubleUpDownArrow": {Name: "DoubleUpDownArrow", CodePoints: []int{8661}, Characters: []byte{0xe2, 0x87, 0x95}}, - "DoubleVerticalBar": {Name: "DoubleVerticalBar", CodePoints: []int{8741}, Characters: []byte{0xe2, 0x88, 0xa5}}, - "DownArrow": {Name: "DownArrow", CodePoints: []int{8595}, Characters: []byte{0xe2, 0x86, 0x93}}, - "DownArrowBar": {Name: "DownArrowBar", CodePoints: []int{10515}, Characters: []byte{0xe2, 0xa4, 0x93}}, - "DownArrowUpArrow": {Name: "DownArrowUpArrow", CodePoints: []int{8693}, Characters: []byte{0xe2, 0x87, 0xb5}}, - "DownBreve": {Name: "DownBreve", CodePoints: []int{785}, Characters: []byte{0xcc, 0x91}}, - "DownLeftRightVector": {Name: "DownLeftRightVector", CodePoints: []int{10576}, Characters: []byte{0xe2, 0xa5, 0x90}}, - "DownLeftTeeVector": {Name: "DownLeftTeeVector", CodePoints: []int{10590}, Characters: []byte{0xe2, 0xa5, 0x9e}}, - "DownLeftVector": {Name: "DownLeftVector", CodePoints: []int{8637}, Characters: []byte{0xe2, 0x86, 0xbd}}, - "DownLeftVectorBar": {Name: "DownLeftVectorBar", CodePoints: []int{10582}, Characters: []byte{0xe2, 0xa5, 0x96}}, - "DownRightTeeVector": {Name: "DownRightTeeVector", CodePoints: []int{10591}, Characters: []byte{0xe2, 0xa5, 0x9f}}, - "DownRightVector": {Name: "DownRightVector", CodePoints: []int{8641}, Characters: []byte{0xe2, 0x87, 0x81}}, - "DownRightVectorBar": {Name: "DownRightVectorBar", CodePoints: []int{10583}, Characters: []byte{0xe2, 0xa5, 0x97}}, - "DownTee": {Name: "DownTee", CodePoints: []int{8868}, Characters: []byte{0xe2, 0x8a, 0xa4}}, - "DownTeeArrow": {Name: "DownTeeArrow", CodePoints: []int{8615}, Characters: []byte{0xe2, 0x86, 0xa7}}, - "Downarrow": {Name: "Downarrow", CodePoints: []int{8659}, Characters: []byte{0xe2, 0x87, 0x93}}, - "Dscr": {Name: "Dscr", CodePoints: []int{119967}, Characters: []byte{0xf0, 0x9d, 0x92, 0x9f}}, - "Dstrok": {Name: "Dstrok", CodePoints: []int{272}, Characters: []byte{0xc4, 0x90}}, - "ENG": {Name: "ENG", CodePoints: []int{330}, Characters: []byte{0xc5, 0x8a}}, - "ETH": {Name: "ETH", CodePoints: []int{208}, Characters: []byte{0xc3, 0x90}}, - "Eacute": {Name: "Eacute", CodePoints: []int{201}, Characters: []byte{0xc3, 0x89}}, - "Ecaron": {Name: "Ecaron", CodePoints: []int{282}, Characters: []byte{0xc4, 0x9a}}, - "Ecirc": {Name: "Ecirc", CodePoints: []int{202}, Characters: []byte{0xc3, 0x8a}}, - "Ecy": {Name: "Ecy", CodePoints: []int{1069}, Characters: []byte{0xd0, 0xad}}, - "Edot": {Name: "Edot", CodePoints: []int{278}, Characters: []byte{0xc4, 0x96}}, - "Efr": {Name: "Efr", CodePoints: []int{120072}, Characters: []byte{0xf0, 0x9d, 0x94, 0x88}}, - "Egrave": {Name: "Egrave", CodePoints: []int{200}, Characters: []byte{0xc3, 0x88}}, - "Element": {Name: "Element", CodePoints: []int{8712}, Characters: []byte{0xe2, 0x88, 0x88}}, - "Emacr": {Name: "Emacr", CodePoints: []int{274}, Characters: []byte{0xc4, 0x92}}, - "EmptySmallSquare": {Name: "EmptySmallSquare", CodePoints: []int{9723}, Characters: []byte{0xe2, 0x97, 0xbb}}, - "EmptyVerySmallSquare": {Name: "EmptyVerySmallSquare", CodePoints: []int{9643}, Characters: []byte{0xe2, 0x96, 0xab}}, - "Eogon": {Name: "Eogon", CodePoints: []int{280}, Characters: []byte{0xc4, 0x98}}, - "Eopf": {Name: "Eopf", CodePoints: []int{120124}, Characters: []byte{0xf0, 0x9d, 0x94, 0xbc}}, - "Epsilon": {Name: "Epsilon", CodePoints: []int{917}, Characters: []byte{0xce, 0x95}}, - "Equal": {Name: "Equal", CodePoints: []int{10869}, Characters: []byte{0xe2, 0xa9, 0xb5}}, - "EqualTilde": {Name: "EqualTilde", CodePoints: []int{8770}, Characters: []byte{0xe2, 0x89, 0x82}}, - "Equilibrium": {Name: "Equilibrium", CodePoints: []int{8652}, Characters: []byte{0xe2, 0x87, 0x8c}}, - "Escr": {Name: "Escr", CodePoints: []int{8496}, Characters: []byte{0xe2, 0x84, 0xb0}}, - "Esim": {Name: "Esim", CodePoints: []int{10867}, Characters: []byte{0xe2, 0xa9, 0xb3}}, - "Eta": {Name: "Eta", CodePoints: []int{919}, Characters: []byte{0xce, 0x97}}, - "Euml": {Name: "Euml", CodePoints: []int{203}, Characters: []byte{0xc3, 0x8b}}, - "Exists": {Name: "Exists", CodePoints: []int{8707}, Characters: []byte{0xe2, 0x88, 0x83}}, - "ExponentialE": {Name: "ExponentialE", CodePoints: []int{8519}, Characters: []byte{0xe2, 0x85, 0x87}}, - "Fcy": {Name: "Fcy", CodePoints: []int{1060}, Characters: []byte{0xd0, 0xa4}}, - "Ffr": {Name: "Ffr", CodePoints: []int{120073}, Characters: []byte{0xf0, 0x9d, 0x94, 0x89}}, - "FilledSmallSquare": {Name: "FilledSmallSquare", CodePoints: []int{9724}, Characters: []byte{0xe2, 0x97, 0xbc}}, - "FilledVerySmallSquare": {Name: "FilledVerySmallSquare", CodePoints: []int{9642}, Characters: []byte{0xe2, 0x96, 0xaa}}, - "Fopf": {Name: "Fopf", CodePoints: []int{120125}, Characters: []byte{0xf0, 0x9d, 0x94, 0xbd}}, - "ForAll": {Name: "ForAll", CodePoints: []int{8704}, Characters: []byte{0xe2, 0x88, 0x80}}, - "Fouriertrf": {Name: "Fouriertrf", CodePoints: []int{8497}, Characters: []byte{0xe2, 0x84, 0xb1}}, - "Fscr": {Name: "Fscr", CodePoints: []int{8497}, Characters: []byte{0xe2, 0x84, 0xb1}}, - "GJcy": {Name: "GJcy", CodePoints: []int{1027}, Characters: []byte{0xd0, 0x83}}, - "GT": {Name: "GT", CodePoints: []int{62}, Characters: []byte{0x3e}}, - "Gamma": {Name: "Gamma", CodePoints: []int{915}, Characters: []byte{0xce, 0x93}}, - "Gammad": {Name: "Gammad", CodePoints: []int{988}, Characters: []byte{0xcf, 0x9c}}, - "Gbreve": {Name: "Gbreve", CodePoints: []int{286}, Characters: []byte{0xc4, 0x9e}}, - "Gcedil": {Name: "Gcedil", CodePoints: []int{290}, Characters: []byte{0xc4, 0xa2}}, - "Gcirc": {Name: "Gcirc", CodePoints: []int{284}, Characters: []byte{0xc4, 0x9c}}, - "Gcy": {Name: "Gcy", CodePoints: []int{1043}, Characters: []byte{0xd0, 0x93}}, - "Gdot": {Name: "Gdot", CodePoints: []int{288}, Characters: []byte{0xc4, 0xa0}}, - "Gfr": {Name: "Gfr", CodePoints: []int{120074}, Characters: []byte{0xf0, 0x9d, 0x94, 0x8a}}, - "Gg": {Name: "Gg", CodePoints: []int{8921}, Characters: []byte{0xe2, 0x8b, 0x99}}, - "Gopf": {Name: "Gopf", CodePoints: []int{120126}, Characters: []byte{0xf0, 0x9d, 0x94, 0xbe}}, - "GreaterEqual": {Name: "GreaterEqual", CodePoints: []int{8805}, Characters: []byte{0xe2, 0x89, 0xa5}}, - "GreaterEqualLess": {Name: "GreaterEqualLess", CodePoints: []int{8923}, Characters: []byte{0xe2, 0x8b, 0x9b}}, - "GreaterFullEqual": {Name: "GreaterFullEqual", CodePoints: []int{8807}, Characters: []byte{0xe2, 0x89, 0xa7}}, - "GreaterGreater": {Name: "GreaterGreater", CodePoints: []int{10914}, Characters: []byte{0xe2, 0xaa, 0xa2}}, - "GreaterLess": {Name: "GreaterLess", CodePoints: []int{8823}, Characters: []byte{0xe2, 0x89, 0xb7}}, - "GreaterSlantEqual": {Name: "GreaterSlantEqual", CodePoints: []int{10878}, Characters: []byte{0xe2, 0xa9, 0xbe}}, - "GreaterTilde": {Name: "GreaterTilde", CodePoints: []int{8819}, Characters: []byte{0xe2, 0x89, 0xb3}}, - "Gscr": {Name: "Gscr", CodePoints: []int{119970}, Characters: []byte{0xf0, 0x9d, 0x92, 0xa2}}, - "Gt": {Name: "Gt", CodePoints: []int{8811}, Characters: []byte{0xe2, 0x89, 0xab}}, - "HARDcy": {Name: "HARDcy", CodePoints: []int{1066}, Characters: []byte{0xd0, 0xaa}}, - "Hacek": {Name: "Hacek", CodePoints: []int{711}, Characters: []byte{0xcb, 0x87}}, - "Hat": {Name: "Hat", CodePoints: []int{94}, Characters: []byte{0x5e}}, - "Hcirc": {Name: "Hcirc", CodePoints: []int{292}, Characters: []byte{0xc4, 0xa4}}, - "Hfr": {Name: "Hfr", CodePoints: []int{8460}, Characters: []byte{0xe2, 0x84, 0x8c}}, - "HilbertSpace": {Name: "HilbertSpace", CodePoints: []int{8459}, Characters: []byte{0xe2, 0x84, 0x8b}}, - "Hopf": {Name: "Hopf", CodePoints: []int{8461}, Characters: []byte{0xe2, 0x84, 0x8d}}, - "HorizontalLine": {Name: "HorizontalLine", CodePoints: []int{9472}, Characters: []byte{0xe2, 0x94, 0x80}}, - "Hscr": {Name: "Hscr", CodePoints: []int{8459}, Characters: []byte{0xe2, 0x84, 0x8b}}, - "Hstrok": {Name: "Hstrok", CodePoints: []int{294}, Characters: []byte{0xc4, 0xa6}}, - "HumpDownHump": {Name: "HumpDownHump", CodePoints: []int{8782}, Characters: []byte{0xe2, 0x89, 0x8e}}, - "HumpEqual": {Name: "HumpEqual", CodePoints: []int{8783}, Characters: []byte{0xe2, 0x89, 0x8f}}, - "IEcy": {Name: "IEcy", CodePoints: []int{1045}, Characters: []byte{0xd0, 0x95}}, - "IJlig": {Name: "IJlig", CodePoints: []int{306}, Characters: []byte{0xc4, 0xb2}}, - "IOcy": {Name: "IOcy", CodePoints: []int{1025}, Characters: []byte{0xd0, 0x81}}, - "Iacute": {Name: "Iacute", CodePoints: []int{205}, Characters: []byte{0xc3, 0x8d}}, - "Icirc": {Name: "Icirc", CodePoints: []int{206}, Characters: []byte{0xc3, 0x8e}}, - "Icy": {Name: "Icy", CodePoints: []int{1048}, Characters: []byte{0xd0, 0x98}}, - "Idot": {Name: "Idot", CodePoints: []int{304}, Characters: []byte{0xc4, 0xb0}}, - "Ifr": {Name: "Ifr", CodePoints: []int{8465}, Characters: []byte{0xe2, 0x84, 0x91}}, - "Igrave": {Name: "Igrave", CodePoints: []int{204}, Characters: []byte{0xc3, 0x8c}}, - "Im": {Name: "Im", CodePoints: []int{8465}, Characters: []byte{0xe2, 0x84, 0x91}}, - "Imacr": {Name: "Imacr", CodePoints: []int{298}, Characters: []byte{0xc4, 0xaa}}, - "ImaginaryI": {Name: "ImaginaryI", CodePoints: []int{8520}, Characters: []byte{0xe2, 0x85, 0x88}}, - "Implies": {Name: "Implies", CodePoints: []int{8658}, Characters: []byte{0xe2, 0x87, 0x92}}, - "Int": {Name: "Int", CodePoints: []int{8748}, Characters: []byte{0xe2, 0x88, 0xac}}, - "Integral": {Name: "Integral", CodePoints: []int{8747}, Characters: []byte{0xe2, 0x88, 0xab}}, - "Intersection": {Name: "Intersection", CodePoints: []int{8898}, Characters: []byte{0xe2, 0x8b, 0x82}}, - "InvisibleComma": {Name: "InvisibleComma", CodePoints: []int{8291}, Characters: []byte{0xe2, 0x81, 0xa3}}, - "InvisibleTimes": {Name: "InvisibleTimes", CodePoints: []int{8290}, Characters: []byte{0xe2, 0x81, 0xa2}}, - "Iogon": {Name: "Iogon", CodePoints: []int{302}, Characters: []byte{0xc4, 0xae}}, - "Iopf": {Name: "Iopf", CodePoints: []int{120128}, Characters: []byte{0xf0, 0x9d, 0x95, 0x80}}, - "Iota": {Name: "Iota", CodePoints: []int{921}, Characters: []byte{0xce, 0x99}}, - "Iscr": {Name: "Iscr", CodePoints: []int{8464}, Characters: []byte{0xe2, 0x84, 0x90}}, - "Itilde": {Name: "Itilde", CodePoints: []int{296}, Characters: []byte{0xc4, 0xa8}}, - "Iukcy": {Name: "Iukcy", CodePoints: []int{1030}, Characters: []byte{0xd0, 0x86}}, - "Iuml": {Name: "Iuml", CodePoints: []int{207}, Characters: []byte{0xc3, 0x8f}}, - "Jcirc": {Name: "Jcirc", CodePoints: []int{308}, Characters: []byte{0xc4, 0xb4}}, - "Jcy": {Name: "Jcy", CodePoints: []int{1049}, Characters: []byte{0xd0, 0x99}}, - "Jfr": {Name: "Jfr", CodePoints: []int{120077}, Characters: []byte{0xf0, 0x9d, 0x94, 0x8d}}, - "Jopf": {Name: "Jopf", CodePoints: []int{120129}, Characters: []byte{0xf0, 0x9d, 0x95, 0x81}}, - "Jscr": {Name: "Jscr", CodePoints: []int{119973}, Characters: []byte{0xf0, 0x9d, 0x92, 0xa5}}, - "Jsercy": {Name: "Jsercy", CodePoints: []int{1032}, Characters: []byte{0xd0, 0x88}}, - "Jukcy": {Name: "Jukcy", CodePoints: []int{1028}, Characters: []byte{0xd0, 0x84}}, - "KHcy": {Name: "KHcy", CodePoints: []int{1061}, Characters: []byte{0xd0, 0xa5}}, - "KJcy": {Name: "KJcy", CodePoints: []int{1036}, Characters: []byte{0xd0, 0x8c}}, - "Kappa": {Name: "Kappa", CodePoints: []int{922}, Characters: []byte{0xce, 0x9a}}, - "Kcedil": {Name: "Kcedil", CodePoints: []int{310}, Characters: []byte{0xc4, 0xb6}}, - "Kcy": {Name: "Kcy", CodePoints: []int{1050}, Characters: []byte{0xd0, 0x9a}}, - "Kfr": {Name: "Kfr", CodePoints: []int{120078}, Characters: []byte{0xf0, 0x9d, 0x94, 0x8e}}, - "Kopf": {Name: "Kopf", CodePoints: []int{120130}, Characters: []byte{0xf0, 0x9d, 0x95, 0x82}}, - "Kscr": {Name: "Kscr", CodePoints: []int{119974}, Characters: []byte{0xf0, 0x9d, 0x92, 0xa6}}, - "LJcy": {Name: "LJcy", CodePoints: []int{1033}, Characters: []byte{0xd0, 0x89}}, - "LT": {Name: "LT", CodePoints: []int{60}, Characters: []byte{0x3c}}, - "Lacute": {Name: "Lacute", CodePoints: []int{313}, Characters: []byte{0xc4, 0xb9}}, - "Lambda": {Name: "Lambda", CodePoints: []int{923}, Characters: []byte{0xce, 0x9b}}, - "Lang": {Name: "Lang", CodePoints: []int{10218}, Characters: []byte{0xe2, 0x9f, 0xaa}}, - "Laplacetrf": {Name: "Laplacetrf", CodePoints: []int{8466}, Characters: []byte{0xe2, 0x84, 0x92}}, - "Larr": {Name: "Larr", CodePoints: []int{8606}, Characters: []byte{0xe2, 0x86, 0x9e}}, - "Lcaron": {Name: "Lcaron", CodePoints: []int{317}, Characters: []byte{0xc4, 0xbd}}, - "Lcedil": {Name: "Lcedil", CodePoints: []int{315}, Characters: []byte{0xc4, 0xbb}}, - "Lcy": {Name: "Lcy", CodePoints: []int{1051}, Characters: []byte{0xd0, 0x9b}}, - "LeftAngleBracket": {Name: "LeftAngleBracket", CodePoints: []int{10216}, Characters: []byte{0xe2, 0x9f, 0xa8}}, - "LeftArrow": {Name: "LeftArrow", CodePoints: []int{8592}, Characters: []byte{0xe2, 0x86, 0x90}}, - "LeftArrowBar": {Name: "LeftArrowBar", CodePoints: []int{8676}, Characters: []byte{0xe2, 0x87, 0xa4}}, - "LeftArrowRightArrow": {Name: "LeftArrowRightArrow", CodePoints: []int{8646}, Characters: []byte{0xe2, 0x87, 0x86}}, - "LeftCeiling": {Name: "LeftCeiling", CodePoints: []int{8968}, Characters: []byte{0xe2, 0x8c, 0x88}}, - "LeftDoubleBracket": {Name: "LeftDoubleBracket", CodePoints: []int{10214}, Characters: []byte{0xe2, 0x9f, 0xa6}}, - "LeftDownTeeVector": {Name: "LeftDownTeeVector", CodePoints: []int{10593}, Characters: []byte{0xe2, 0xa5, 0xa1}}, - "LeftDownVector": {Name: "LeftDownVector", CodePoints: []int{8643}, Characters: []byte{0xe2, 0x87, 0x83}}, - "LeftDownVectorBar": {Name: "LeftDownVectorBar", CodePoints: []int{10585}, Characters: []byte{0xe2, 0xa5, 0x99}}, - "LeftFloor": {Name: "LeftFloor", CodePoints: []int{8970}, Characters: []byte{0xe2, 0x8c, 0x8a}}, - "LeftRightArrow": {Name: "LeftRightArrow", CodePoints: []int{8596}, Characters: []byte{0xe2, 0x86, 0x94}}, - "LeftRightVector": {Name: "LeftRightVector", CodePoints: []int{10574}, Characters: []byte{0xe2, 0xa5, 0x8e}}, - "LeftTee": {Name: "LeftTee", CodePoints: []int{8867}, Characters: []byte{0xe2, 0x8a, 0xa3}}, - "LeftTeeArrow": {Name: "LeftTeeArrow", CodePoints: []int{8612}, Characters: []byte{0xe2, 0x86, 0xa4}}, - "LeftTeeVector": {Name: "LeftTeeVector", CodePoints: []int{10586}, Characters: []byte{0xe2, 0xa5, 0x9a}}, - "LeftTriangle": {Name: "LeftTriangle", CodePoints: []int{8882}, Characters: []byte{0xe2, 0x8a, 0xb2}}, - "LeftTriangleBar": {Name: "LeftTriangleBar", CodePoints: []int{10703}, Characters: []byte{0xe2, 0xa7, 0x8f}}, - "LeftTriangleEqual": {Name: "LeftTriangleEqual", CodePoints: []int{8884}, Characters: []byte{0xe2, 0x8a, 0xb4}}, - "LeftUpDownVector": {Name: "LeftUpDownVector", CodePoints: []int{10577}, Characters: []byte{0xe2, 0xa5, 0x91}}, - "LeftUpTeeVector": {Name: "LeftUpTeeVector", CodePoints: []int{10592}, Characters: []byte{0xe2, 0xa5, 0xa0}}, - "LeftUpVector": {Name: "LeftUpVector", CodePoints: []int{8639}, Characters: []byte{0xe2, 0x86, 0xbf}}, - "LeftUpVectorBar": {Name: "LeftUpVectorBar", CodePoints: []int{10584}, Characters: []byte{0xe2, 0xa5, 0x98}}, - "LeftVector": {Name: "LeftVector", CodePoints: []int{8636}, Characters: []byte{0xe2, 0x86, 0xbc}}, - "LeftVectorBar": {Name: "LeftVectorBar", CodePoints: []int{10578}, Characters: []byte{0xe2, 0xa5, 0x92}}, - "Leftarrow": {Name: "Leftarrow", CodePoints: []int{8656}, Characters: []byte{0xe2, 0x87, 0x90}}, - "Leftrightarrow": {Name: "Leftrightarrow", CodePoints: []int{8660}, Characters: []byte{0xe2, 0x87, 0x94}}, - "LessEqualGreater": {Name: "LessEqualGreater", CodePoints: []int{8922}, Characters: []byte{0xe2, 0x8b, 0x9a}}, - "LessFullEqual": {Name: "LessFullEqual", CodePoints: []int{8806}, Characters: []byte{0xe2, 0x89, 0xa6}}, - "LessGreater": {Name: "LessGreater", CodePoints: []int{8822}, Characters: []byte{0xe2, 0x89, 0xb6}}, - "LessLess": {Name: "LessLess", CodePoints: []int{10913}, Characters: []byte{0xe2, 0xaa, 0xa1}}, - "LessSlantEqual": {Name: "LessSlantEqual", CodePoints: []int{10877}, Characters: []byte{0xe2, 0xa9, 0xbd}}, - "LessTilde": {Name: "LessTilde", CodePoints: []int{8818}, Characters: []byte{0xe2, 0x89, 0xb2}}, - "Lfr": {Name: "Lfr", CodePoints: []int{120079}, Characters: []byte{0xf0, 0x9d, 0x94, 0x8f}}, - "Ll": {Name: "Ll", CodePoints: []int{8920}, Characters: []byte{0xe2, 0x8b, 0x98}}, - "Lleftarrow": {Name: "Lleftarrow", CodePoints: []int{8666}, Characters: []byte{0xe2, 0x87, 0x9a}}, - "Lmidot": {Name: "Lmidot", CodePoints: []int{319}, Characters: []byte{0xc4, 0xbf}}, - "LongLeftArrow": {Name: "LongLeftArrow", CodePoints: []int{10229}, Characters: []byte{0xe2, 0x9f, 0xb5}}, - "LongLeftRightArrow": {Name: "LongLeftRightArrow", CodePoints: []int{10231}, Characters: []byte{0xe2, 0x9f, 0xb7}}, - "LongRightArrow": {Name: "LongRightArrow", CodePoints: []int{10230}, Characters: []byte{0xe2, 0x9f, 0xb6}}, - "Longleftarrow": {Name: "Longleftarrow", CodePoints: []int{10232}, Characters: []byte{0xe2, 0x9f, 0xb8}}, - "Longleftrightarrow": {Name: "Longleftrightarrow", CodePoints: []int{10234}, Characters: []byte{0xe2, 0x9f, 0xba}}, - "Longrightarrow": {Name: "Longrightarrow", CodePoints: []int{10233}, Characters: []byte{0xe2, 0x9f, 0xb9}}, - "Lopf": {Name: "Lopf", CodePoints: []int{120131}, Characters: []byte{0xf0, 0x9d, 0x95, 0x83}}, - "LowerLeftArrow": {Name: "LowerLeftArrow", CodePoints: []int{8601}, Characters: []byte{0xe2, 0x86, 0x99}}, - "LowerRightArrow": {Name: "LowerRightArrow", CodePoints: []int{8600}, Characters: []byte{0xe2, 0x86, 0x98}}, - "Lscr": {Name: "Lscr", CodePoints: []int{8466}, Characters: []byte{0xe2, 0x84, 0x92}}, - "Lsh": {Name: "Lsh", CodePoints: []int{8624}, Characters: []byte{0xe2, 0x86, 0xb0}}, - "Lstrok": {Name: "Lstrok", CodePoints: []int{321}, Characters: []byte{0xc5, 0x81}}, - "Lt": {Name: "Lt", CodePoints: []int{8810}, Characters: []byte{0xe2, 0x89, 0xaa}}, - "Map": {Name: "Map", CodePoints: []int{10501}, Characters: []byte{0xe2, 0xa4, 0x85}}, - "Mcy": {Name: "Mcy", CodePoints: []int{1052}, Characters: []byte{0xd0, 0x9c}}, - "MediumSpace": {Name: "MediumSpace", CodePoints: []int{8287}, Characters: []byte{0xe2, 0x81, 0x9f}}, - "Mellintrf": {Name: "Mellintrf", CodePoints: []int{8499}, Characters: []byte{0xe2, 0x84, 0xb3}}, - "Mfr": {Name: "Mfr", CodePoints: []int{120080}, Characters: []byte{0xf0, 0x9d, 0x94, 0x90}}, - "MinusPlus": {Name: "MinusPlus", CodePoints: []int{8723}, Characters: []byte{0xe2, 0x88, 0x93}}, - "Mopf": {Name: "Mopf", CodePoints: []int{120132}, Characters: []byte{0xf0, 0x9d, 0x95, 0x84}}, - "Mscr": {Name: "Mscr", CodePoints: []int{8499}, Characters: []byte{0xe2, 0x84, 0xb3}}, - "Mu": {Name: "Mu", CodePoints: []int{924}, Characters: []byte{0xce, 0x9c}}, - "NJcy": {Name: "NJcy", CodePoints: []int{1034}, Characters: []byte{0xd0, 0x8a}}, - "Nacute": {Name: "Nacute", CodePoints: []int{323}, Characters: []byte{0xc5, 0x83}}, - "Ncaron": {Name: "Ncaron", CodePoints: []int{327}, Characters: []byte{0xc5, 0x87}}, - "Ncedil": {Name: "Ncedil", CodePoints: []int{325}, Characters: []byte{0xc5, 0x85}}, - "Ncy": {Name: "Ncy", CodePoints: []int{1053}, Characters: []byte{0xd0, 0x9d}}, - "NegativeMediumSpace": {Name: "NegativeMediumSpace", CodePoints: []int{8203}, Characters: []byte{0xe2, 0x80, 0x8b}}, - "NegativeThickSpace": {Name: "NegativeThickSpace", CodePoints: []int{8203}, Characters: []byte{0xe2, 0x80, 0x8b}}, - "NegativeThinSpace": {Name: "NegativeThinSpace", CodePoints: []int{8203}, Characters: []byte{0xe2, 0x80, 0x8b}}, - "NegativeVeryThinSpace": {Name: "NegativeVeryThinSpace", CodePoints: []int{8203}, Characters: []byte{0xe2, 0x80, 0x8b}}, - "NestedGreaterGreater": {Name: "NestedGreaterGreater", CodePoints: []int{8811}, Characters: []byte{0xe2, 0x89, 0xab}}, - "NestedLessLess": {Name: "NestedLessLess", CodePoints: []int{8810}, Characters: []byte{0xe2, 0x89, 0xaa}}, - "NewLine": {Name: "NewLine", CodePoints: []int{10}, Characters: []byte{0xa}}, - "Nfr": {Name: "Nfr", CodePoints: []int{120081}, Characters: []byte{0xf0, 0x9d, 0x94, 0x91}}, - "NoBreak": {Name: "NoBreak", CodePoints: []int{8288}, Characters: []byte{0xe2, 0x81, 0xa0}}, - "NonBreakingSpace": {Name: "NonBreakingSpace", CodePoints: []int{160}, Characters: []byte{0xc2, 0xa0}}, - "Nopf": {Name: "Nopf", CodePoints: []int{8469}, Characters: []byte{0xe2, 0x84, 0x95}}, - "Not": {Name: "Not", CodePoints: []int{10988}, Characters: []byte{0xe2, 0xab, 0xac}}, - "NotCongruent": {Name: "NotCongruent", CodePoints: []int{8802}, Characters: []byte{0xe2, 0x89, 0xa2}}, - "NotCupCap": {Name: "NotCupCap", CodePoints: []int{8813}, Characters: []byte{0xe2, 0x89, 0xad}}, - "NotDoubleVerticalBar": {Name: "NotDoubleVerticalBar", CodePoints: []int{8742}, Characters: []byte{0xe2, 0x88, 0xa6}}, - "NotElement": {Name: "NotElement", CodePoints: []int{8713}, Characters: []byte{0xe2, 0x88, 0x89}}, - "NotEqual": {Name: "NotEqual", CodePoints: []int{8800}, Characters: []byte{0xe2, 0x89, 0xa0}}, - "NotEqualTilde": {Name: "NotEqualTilde", CodePoints: []int{8770, 824}, Characters: []byte{0xe2, 0x89, 0x82, 0xcc, 0xb8}}, - "NotExists": {Name: "NotExists", CodePoints: []int{8708}, Characters: []byte{0xe2, 0x88, 0x84}}, - "NotGreater": {Name: "NotGreater", CodePoints: []int{8815}, Characters: []byte{0xe2, 0x89, 0xaf}}, - "NotGreaterEqual": {Name: "NotGreaterEqual", CodePoints: []int{8817}, Characters: []byte{0xe2, 0x89, 0xb1}}, - "NotGreaterFullEqual": {Name: "NotGreaterFullEqual", CodePoints: []int{8807, 824}, Characters: []byte{0xe2, 0x89, 0xa7, 0xcc, 0xb8}}, - "NotGreaterGreater": {Name: "NotGreaterGreater", CodePoints: []int{8811, 824}, Characters: []byte{0xe2, 0x89, 0xab, 0xcc, 0xb8}}, - "NotGreaterLess": {Name: "NotGreaterLess", CodePoints: []int{8825}, Characters: []byte{0xe2, 0x89, 0xb9}}, - "NotGreaterSlantEqual": {Name: "NotGreaterSlantEqual", CodePoints: []int{10878, 824}, Characters: []byte{0xe2, 0xa9, 0xbe, 0xcc, 0xb8}}, - "NotGreaterTilde": {Name: "NotGreaterTilde", CodePoints: []int{8821}, Characters: []byte{0xe2, 0x89, 0xb5}}, - "NotHumpDownHump": {Name: "NotHumpDownHump", CodePoints: []int{8782, 824}, Characters: []byte{0xe2, 0x89, 0x8e, 0xcc, 0xb8}}, - "NotHumpEqual": {Name: "NotHumpEqual", CodePoints: []int{8783, 824}, Characters: []byte{0xe2, 0x89, 0x8f, 0xcc, 0xb8}}, - "NotLeftTriangle": {Name: "NotLeftTriangle", CodePoints: []int{8938}, Characters: []byte{0xe2, 0x8b, 0xaa}}, - "NotLeftTriangleBar": {Name: "NotLeftTriangleBar", CodePoints: []int{10703, 824}, Characters: []byte{0xe2, 0xa7, 0x8f, 0xcc, 0xb8}}, - "NotLeftTriangleEqual": {Name: "NotLeftTriangleEqual", CodePoints: []int{8940}, Characters: []byte{0xe2, 0x8b, 0xac}}, - "NotLess": {Name: "NotLess", CodePoints: []int{8814}, Characters: []byte{0xe2, 0x89, 0xae}}, - "NotLessEqual": {Name: "NotLessEqual", CodePoints: []int{8816}, Characters: []byte{0xe2, 0x89, 0xb0}}, - "NotLessGreater": {Name: "NotLessGreater", CodePoints: []int{8824}, Characters: []byte{0xe2, 0x89, 0xb8}}, - "NotLessLess": {Name: "NotLessLess", CodePoints: []int{8810, 824}, Characters: []byte{0xe2, 0x89, 0xaa, 0xcc, 0xb8}}, - "NotLessSlantEqual": {Name: "NotLessSlantEqual", CodePoints: []int{10877, 824}, Characters: []byte{0xe2, 0xa9, 0xbd, 0xcc, 0xb8}}, - "NotLessTilde": {Name: "NotLessTilde", CodePoints: []int{8820}, Characters: []byte{0xe2, 0x89, 0xb4}}, - "NotNestedGreaterGreater": {Name: "NotNestedGreaterGreater", CodePoints: []int{10914, 824}, Characters: []byte{0xe2, 0xaa, 0xa2, 0xcc, 0xb8}}, - "NotNestedLessLess": {Name: "NotNestedLessLess", CodePoints: []int{10913, 824}, Characters: []byte{0xe2, 0xaa, 0xa1, 0xcc, 0xb8}}, - "NotPrecedes": {Name: "NotPrecedes", CodePoints: []int{8832}, Characters: []byte{0xe2, 0x8a, 0x80}}, - "NotPrecedesEqual": {Name: "NotPrecedesEqual", CodePoints: []int{10927, 824}, Characters: []byte{0xe2, 0xaa, 0xaf, 0xcc, 0xb8}}, - "NotPrecedesSlantEqual": {Name: "NotPrecedesSlantEqual", CodePoints: []int{8928}, Characters: []byte{0xe2, 0x8b, 0xa0}}, - "NotReverseElement": {Name: "NotReverseElement", CodePoints: []int{8716}, Characters: []byte{0xe2, 0x88, 0x8c}}, - "NotRightTriangle": {Name: "NotRightTriangle", CodePoints: []int{8939}, Characters: []byte{0xe2, 0x8b, 0xab}}, - "NotRightTriangleBar": {Name: "NotRightTriangleBar", CodePoints: []int{10704, 824}, Characters: []byte{0xe2, 0xa7, 0x90, 0xcc, 0xb8}}, - "NotRightTriangleEqual": {Name: "NotRightTriangleEqual", CodePoints: []int{8941}, Characters: []byte{0xe2, 0x8b, 0xad}}, - "NotSquareSubset": {Name: "NotSquareSubset", CodePoints: []int{8847, 824}, Characters: []byte{0xe2, 0x8a, 0x8f, 0xcc, 0xb8}}, - "NotSquareSubsetEqual": {Name: "NotSquareSubsetEqual", CodePoints: []int{8930}, Characters: []byte{0xe2, 0x8b, 0xa2}}, - "NotSquareSuperset": {Name: "NotSquareSuperset", CodePoints: []int{8848, 824}, Characters: []byte{0xe2, 0x8a, 0x90, 0xcc, 0xb8}}, - "NotSquareSupersetEqual": {Name: "NotSquareSupersetEqual", CodePoints: []int{8931}, Characters: []byte{0xe2, 0x8b, 0xa3}}, - "NotSubset": {Name: "NotSubset", CodePoints: []int{8834, 8402}, Characters: []byte{0xe2, 0x8a, 0x82, 0xe2, 0x83, 0x92}}, - "NotSubsetEqual": {Name: "NotSubsetEqual", CodePoints: []int{8840}, Characters: []byte{0xe2, 0x8a, 0x88}}, - "NotSucceeds": {Name: "NotSucceeds", CodePoints: []int{8833}, Characters: []byte{0xe2, 0x8a, 0x81}}, - "NotSucceedsEqual": {Name: "NotSucceedsEqual", CodePoints: []int{10928, 824}, Characters: []byte{0xe2, 0xaa, 0xb0, 0xcc, 0xb8}}, - "NotSucceedsSlantEqual": {Name: "NotSucceedsSlantEqual", CodePoints: []int{8929}, Characters: []byte{0xe2, 0x8b, 0xa1}}, - "NotSucceedsTilde": {Name: "NotSucceedsTilde", CodePoints: []int{8831, 824}, Characters: []byte{0xe2, 0x89, 0xbf, 0xcc, 0xb8}}, - "NotSuperset": {Name: "NotSuperset", CodePoints: []int{8835, 8402}, Characters: []byte{0xe2, 0x8a, 0x83, 0xe2, 0x83, 0x92}}, - "NotSupersetEqual": {Name: "NotSupersetEqual", CodePoints: []int{8841}, Characters: []byte{0xe2, 0x8a, 0x89}}, - "NotTilde": {Name: "NotTilde", CodePoints: []int{8769}, Characters: []byte{0xe2, 0x89, 0x81}}, - "NotTildeEqual": {Name: "NotTildeEqual", CodePoints: []int{8772}, Characters: []byte{0xe2, 0x89, 0x84}}, - "NotTildeFullEqual": {Name: "NotTildeFullEqual", CodePoints: []int{8775}, Characters: []byte{0xe2, 0x89, 0x87}}, - "NotTildeTilde": {Name: "NotTildeTilde", CodePoints: []int{8777}, Characters: []byte{0xe2, 0x89, 0x89}}, - "NotVerticalBar": {Name: "NotVerticalBar", CodePoints: []int{8740}, Characters: []byte{0xe2, 0x88, 0xa4}}, - "Nscr": {Name: "Nscr", CodePoints: []int{119977}, Characters: []byte{0xf0, 0x9d, 0x92, 0xa9}}, - "Ntilde": {Name: "Ntilde", CodePoints: []int{209}, Characters: []byte{0xc3, 0x91}}, - "Nu": {Name: "Nu", CodePoints: []int{925}, Characters: []byte{0xce, 0x9d}}, - "OElig": {Name: "OElig", CodePoints: []int{338}, Characters: []byte{0xc5, 0x92}}, - "Oacute": {Name: "Oacute", CodePoints: []int{211}, Characters: []byte{0xc3, 0x93}}, - "Ocirc": {Name: "Ocirc", CodePoints: []int{212}, Characters: []byte{0xc3, 0x94}}, - "Ocy": {Name: "Ocy", CodePoints: []int{1054}, Characters: []byte{0xd0, 0x9e}}, - "Odblac": {Name: "Odblac", CodePoints: []int{336}, Characters: []byte{0xc5, 0x90}}, - "Ofr": {Name: "Ofr", CodePoints: []int{120082}, Characters: []byte{0xf0, 0x9d, 0x94, 0x92}}, - "Ograve": {Name: "Ograve", CodePoints: []int{210}, Characters: []byte{0xc3, 0x92}}, - "Omacr": {Name: "Omacr", CodePoints: []int{332}, Characters: []byte{0xc5, 0x8c}}, - "Omega": {Name: "Omega", CodePoints: []int{937}, Characters: []byte{0xce, 0xa9}}, - "Omicron": {Name: "Omicron", CodePoints: []int{927}, Characters: []byte{0xce, 0x9f}}, - "Oopf": {Name: "Oopf", CodePoints: []int{120134}, Characters: []byte{0xf0, 0x9d, 0x95, 0x86}}, - "OpenCurlyDoubleQuote": {Name: "OpenCurlyDoubleQuote", CodePoints: []int{8220}, Characters: []byte{0xe2, 0x80, 0x9c}}, - "OpenCurlyQuote": {Name: "OpenCurlyQuote", CodePoints: []int{8216}, Characters: []byte{0xe2, 0x80, 0x98}}, - "Or": {Name: "Or", CodePoints: []int{10836}, Characters: []byte{0xe2, 0xa9, 0x94}}, - "Oscr": {Name: "Oscr", CodePoints: []int{119978}, Characters: []byte{0xf0, 0x9d, 0x92, 0xaa}}, - "Oslash": {Name: "Oslash", CodePoints: []int{216}, Characters: []byte{0xc3, 0x98}}, - "Otilde": {Name: "Otilde", CodePoints: []int{213}, Characters: []byte{0xc3, 0x95}}, - "Otimes": {Name: "Otimes", CodePoints: []int{10807}, Characters: []byte{0xe2, 0xa8, 0xb7}}, - "Ouml": {Name: "Ouml", CodePoints: []int{214}, Characters: []byte{0xc3, 0x96}}, - "OverBar": {Name: "OverBar", CodePoints: []int{8254}, Characters: []byte{0xe2, 0x80, 0xbe}}, - "OverBrace": {Name: "OverBrace", CodePoints: []int{9182}, Characters: []byte{0xe2, 0x8f, 0x9e}}, - "OverBracket": {Name: "OverBracket", CodePoints: []int{9140}, Characters: []byte{0xe2, 0x8e, 0xb4}}, - "OverParenthesis": {Name: "OverParenthesis", CodePoints: []int{9180}, Characters: []byte{0xe2, 0x8f, 0x9c}}, - "PartialD": {Name: "PartialD", CodePoints: []int{8706}, Characters: []byte{0xe2, 0x88, 0x82}}, - "Pcy": {Name: "Pcy", CodePoints: []int{1055}, Characters: []byte{0xd0, 0x9f}}, - "Pfr": {Name: "Pfr", CodePoints: []int{120083}, Characters: []byte{0xf0, 0x9d, 0x94, 0x93}}, - "Phi": {Name: "Phi", CodePoints: []int{934}, Characters: []byte{0xce, 0xa6}}, - "Pi": {Name: "Pi", CodePoints: []int{928}, Characters: []byte{0xce, 0xa0}}, - "PlusMinus": {Name: "PlusMinus", CodePoints: []int{177}, Characters: []byte{0xc2, 0xb1}}, - "Poincareplane": {Name: "Poincareplane", CodePoints: []int{8460}, Characters: []byte{0xe2, 0x84, 0x8c}}, - "Popf": {Name: "Popf", CodePoints: []int{8473}, Characters: []byte{0xe2, 0x84, 0x99}}, - "Pr": {Name: "Pr", CodePoints: []int{10939}, Characters: []byte{0xe2, 0xaa, 0xbb}}, - "Precedes": {Name: "Precedes", CodePoints: []int{8826}, Characters: []byte{0xe2, 0x89, 0xba}}, - "PrecedesEqual": {Name: "PrecedesEqual", CodePoints: []int{10927}, Characters: []byte{0xe2, 0xaa, 0xaf}}, - "PrecedesSlantEqual": {Name: "PrecedesSlantEqual", CodePoints: []int{8828}, Characters: []byte{0xe2, 0x89, 0xbc}}, - "PrecedesTilde": {Name: "PrecedesTilde", CodePoints: []int{8830}, Characters: []byte{0xe2, 0x89, 0xbe}}, - "Prime": {Name: "Prime", CodePoints: []int{8243}, Characters: []byte{0xe2, 0x80, 0xb3}}, - "Product": {Name: "Product", CodePoints: []int{8719}, Characters: []byte{0xe2, 0x88, 0x8f}}, - "Proportion": {Name: "Proportion", CodePoints: []int{8759}, Characters: []byte{0xe2, 0x88, 0xb7}}, - "Proportional": {Name: "Proportional", CodePoints: []int{8733}, Characters: []byte{0xe2, 0x88, 0x9d}}, - "Pscr": {Name: "Pscr", CodePoints: []int{119979}, Characters: []byte{0xf0, 0x9d, 0x92, 0xab}}, - "Psi": {Name: "Psi", CodePoints: []int{936}, Characters: []byte{0xce, 0xa8}}, - "QUOT": {Name: "QUOT", CodePoints: []int{34}, Characters: []byte{0x22}}, - "Qfr": {Name: "Qfr", CodePoints: []int{120084}, Characters: []byte{0xf0, 0x9d, 0x94, 0x94}}, - "Qopf": {Name: "Qopf", CodePoints: []int{8474}, Characters: []byte{0xe2, 0x84, 0x9a}}, - "Qscr": {Name: "Qscr", CodePoints: []int{119980}, Characters: []byte{0xf0, 0x9d, 0x92, 0xac}}, - "RBarr": {Name: "RBarr", CodePoints: []int{10512}, Characters: []byte{0xe2, 0xa4, 0x90}}, - "REG": {Name: "REG", CodePoints: []int{174}, Characters: []byte{0xc2, 0xae}}, - "Racute": {Name: "Racute", CodePoints: []int{340}, Characters: []byte{0xc5, 0x94}}, - "Rang": {Name: "Rang", CodePoints: []int{10219}, Characters: []byte{0xe2, 0x9f, 0xab}}, - "Rarr": {Name: "Rarr", CodePoints: []int{8608}, Characters: []byte{0xe2, 0x86, 0xa0}}, - "Rarrtl": {Name: "Rarrtl", CodePoints: []int{10518}, Characters: []byte{0xe2, 0xa4, 0x96}}, - "Rcaron": {Name: "Rcaron", CodePoints: []int{344}, Characters: []byte{0xc5, 0x98}}, - "Rcedil": {Name: "Rcedil", CodePoints: []int{342}, Characters: []byte{0xc5, 0x96}}, - "Rcy": {Name: "Rcy", CodePoints: []int{1056}, Characters: []byte{0xd0, 0xa0}}, - "Re": {Name: "Re", CodePoints: []int{8476}, Characters: []byte{0xe2, 0x84, 0x9c}}, - "ReverseElement": {Name: "ReverseElement", CodePoints: []int{8715}, Characters: []byte{0xe2, 0x88, 0x8b}}, - "ReverseEquilibrium": {Name: "ReverseEquilibrium", CodePoints: []int{8651}, Characters: []byte{0xe2, 0x87, 0x8b}}, - "ReverseUpEquilibrium": {Name: "ReverseUpEquilibrium", CodePoints: []int{10607}, Characters: []byte{0xe2, 0xa5, 0xaf}}, - "Rfr": {Name: "Rfr", CodePoints: []int{8476}, Characters: []byte{0xe2, 0x84, 0x9c}}, - "Rho": {Name: "Rho", CodePoints: []int{929}, Characters: []byte{0xce, 0xa1}}, - "RightAngleBracket": {Name: "RightAngleBracket", CodePoints: []int{10217}, Characters: []byte{0xe2, 0x9f, 0xa9}}, - "RightArrow": {Name: "RightArrow", CodePoints: []int{8594}, Characters: []byte{0xe2, 0x86, 0x92}}, - "RightArrowBar": {Name: "RightArrowBar", CodePoints: []int{8677}, Characters: []byte{0xe2, 0x87, 0xa5}}, - "RightArrowLeftArrow": {Name: "RightArrowLeftArrow", CodePoints: []int{8644}, Characters: []byte{0xe2, 0x87, 0x84}}, - "RightCeiling": {Name: "RightCeiling", CodePoints: []int{8969}, Characters: []byte{0xe2, 0x8c, 0x89}}, - "RightDoubleBracket": {Name: "RightDoubleBracket", CodePoints: []int{10215}, Characters: []byte{0xe2, 0x9f, 0xa7}}, - "RightDownTeeVector": {Name: "RightDownTeeVector", CodePoints: []int{10589}, Characters: []byte{0xe2, 0xa5, 0x9d}}, - "RightDownVector": {Name: "RightDownVector", CodePoints: []int{8642}, Characters: []byte{0xe2, 0x87, 0x82}}, - "RightDownVectorBar": {Name: "RightDownVectorBar", CodePoints: []int{10581}, Characters: []byte{0xe2, 0xa5, 0x95}}, - "RightFloor": {Name: "RightFloor", CodePoints: []int{8971}, Characters: []byte{0xe2, 0x8c, 0x8b}}, - "RightTee": {Name: "RightTee", CodePoints: []int{8866}, Characters: []byte{0xe2, 0x8a, 0xa2}}, - "RightTeeArrow": {Name: "RightTeeArrow", CodePoints: []int{8614}, Characters: []byte{0xe2, 0x86, 0xa6}}, - "RightTeeVector": {Name: "RightTeeVector", CodePoints: []int{10587}, Characters: []byte{0xe2, 0xa5, 0x9b}}, - "RightTriangle": {Name: "RightTriangle", CodePoints: []int{8883}, Characters: []byte{0xe2, 0x8a, 0xb3}}, - "RightTriangleBar": {Name: "RightTriangleBar", CodePoints: []int{10704}, Characters: []byte{0xe2, 0xa7, 0x90}}, - "RightTriangleEqual": {Name: "RightTriangleEqual", CodePoints: []int{8885}, Characters: []byte{0xe2, 0x8a, 0xb5}}, - "RightUpDownVector": {Name: "RightUpDownVector", CodePoints: []int{10575}, Characters: []byte{0xe2, 0xa5, 0x8f}}, - "RightUpTeeVector": {Name: "RightUpTeeVector", CodePoints: []int{10588}, Characters: []byte{0xe2, 0xa5, 0x9c}}, - "RightUpVector": {Name: "RightUpVector", CodePoints: []int{8638}, Characters: []byte{0xe2, 0x86, 0xbe}}, - "RightUpVectorBar": {Name: "RightUpVectorBar", CodePoints: []int{10580}, Characters: []byte{0xe2, 0xa5, 0x94}}, - "RightVector": {Name: "RightVector", CodePoints: []int{8640}, Characters: []byte{0xe2, 0x87, 0x80}}, - "RightVectorBar": {Name: "RightVectorBar", CodePoints: []int{10579}, Characters: []byte{0xe2, 0xa5, 0x93}}, - "Rightarrow": {Name: "Rightarrow", CodePoints: []int{8658}, Characters: []byte{0xe2, 0x87, 0x92}}, - "Ropf": {Name: "Ropf", CodePoints: []int{8477}, Characters: []byte{0xe2, 0x84, 0x9d}}, - "RoundImplies": {Name: "RoundImplies", CodePoints: []int{10608}, Characters: []byte{0xe2, 0xa5, 0xb0}}, - "Rrightarrow": {Name: "Rrightarrow", CodePoints: []int{8667}, Characters: []byte{0xe2, 0x87, 0x9b}}, - "Rscr": {Name: "Rscr", CodePoints: []int{8475}, Characters: []byte{0xe2, 0x84, 0x9b}}, - "Rsh": {Name: "Rsh", CodePoints: []int{8625}, Characters: []byte{0xe2, 0x86, 0xb1}}, - "RuleDelayed": {Name: "RuleDelayed", CodePoints: []int{10740}, Characters: []byte{0xe2, 0xa7, 0xb4}}, - "SHCHcy": {Name: "SHCHcy", CodePoints: []int{1065}, Characters: []byte{0xd0, 0xa9}}, - "SHcy": {Name: "SHcy", CodePoints: []int{1064}, Characters: []byte{0xd0, 0xa8}}, - "SOFTcy": {Name: "SOFTcy", CodePoints: []int{1068}, Characters: []byte{0xd0, 0xac}}, - "Sacute": {Name: "Sacute", CodePoints: []int{346}, Characters: []byte{0xc5, 0x9a}}, - "Sc": {Name: "Sc", CodePoints: []int{10940}, Characters: []byte{0xe2, 0xaa, 0xbc}}, - "Scaron": {Name: "Scaron", CodePoints: []int{352}, Characters: []byte{0xc5, 0xa0}}, - "Scedil": {Name: "Scedil", CodePoints: []int{350}, Characters: []byte{0xc5, 0x9e}}, - "Scirc": {Name: "Scirc", CodePoints: []int{348}, Characters: []byte{0xc5, 0x9c}}, - "Scy": {Name: "Scy", CodePoints: []int{1057}, Characters: []byte{0xd0, 0xa1}}, - "Sfr": {Name: "Sfr", CodePoints: []int{120086}, Characters: []byte{0xf0, 0x9d, 0x94, 0x96}}, - "ShortDownArrow": {Name: "ShortDownArrow", CodePoints: []int{8595}, Characters: []byte{0xe2, 0x86, 0x93}}, - "ShortLeftArrow": {Name: "ShortLeftArrow", CodePoints: []int{8592}, Characters: []byte{0xe2, 0x86, 0x90}}, - "ShortRightArrow": {Name: "ShortRightArrow", CodePoints: []int{8594}, Characters: []byte{0xe2, 0x86, 0x92}}, - "ShortUpArrow": {Name: "ShortUpArrow", CodePoints: []int{8593}, Characters: []byte{0xe2, 0x86, 0x91}}, - "Sigma": {Name: "Sigma", CodePoints: []int{931}, Characters: []byte{0xce, 0xa3}}, - "SmallCircle": {Name: "SmallCircle", CodePoints: []int{8728}, Characters: []byte{0xe2, 0x88, 0x98}}, - "Sopf": {Name: "Sopf", CodePoints: []int{120138}, Characters: []byte{0xf0, 0x9d, 0x95, 0x8a}}, - "Sqrt": {Name: "Sqrt", CodePoints: []int{8730}, Characters: []byte{0xe2, 0x88, 0x9a}}, - "Square": {Name: "Square", CodePoints: []int{9633}, Characters: []byte{0xe2, 0x96, 0xa1}}, - "SquareIntersection": {Name: "SquareIntersection", CodePoints: []int{8851}, Characters: []byte{0xe2, 0x8a, 0x93}}, - "SquareSubset": {Name: "SquareSubset", CodePoints: []int{8847}, Characters: []byte{0xe2, 0x8a, 0x8f}}, - "SquareSubsetEqual": {Name: "SquareSubsetEqual", CodePoints: []int{8849}, Characters: []byte{0xe2, 0x8a, 0x91}}, - "SquareSuperset": {Name: "SquareSuperset", CodePoints: []int{8848}, Characters: []byte{0xe2, 0x8a, 0x90}}, - "SquareSupersetEqual": {Name: "SquareSupersetEqual", CodePoints: []int{8850}, Characters: []byte{0xe2, 0x8a, 0x92}}, - "SquareUnion": {Name: "SquareUnion", CodePoints: []int{8852}, Characters: []byte{0xe2, 0x8a, 0x94}}, - "Sscr": {Name: "Sscr", CodePoints: []int{119982}, Characters: []byte{0xf0, 0x9d, 0x92, 0xae}}, - "Star": {Name: "Star", CodePoints: []int{8902}, Characters: []byte{0xe2, 0x8b, 0x86}}, - "Sub": {Name: "Sub", CodePoints: []int{8912}, Characters: []byte{0xe2, 0x8b, 0x90}}, - "Subset": {Name: "Subset", CodePoints: []int{8912}, Characters: []byte{0xe2, 0x8b, 0x90}}, - "SubsetEqual": {Name: "SubsetEqual", CodePoints: []int{8838}, Characters: []byte{0xe2, 0x8a, 0x86}}, - "Succeeds": {Name: "Succeeds", CodePoints: []int{8827}, Characters: []byte{0xe2, 0x89, 0xbb}}, - "SucceedsEqual": {Name: "SucceedsEqual", CodePoints: []int{10928}, Characters: []byte{0xe2, 0xaa, 0xb0}}, - "SucceedsSlantEqual": {Name: "SucceedsSlantEqual", CodePoints: []int{8829}, Characters: []byte{0xe2, 0x89, 0xbd}}, - "SucceedsTilde": {Name: "SucceedsTilde", CodePoints: []int{8831}, Characters: []byte{0xe2, 0x89, 0xbf}}, - "SuchThat": {Name: "SuchThat", CodePoints: []int{8715}, Characters: []byte{0xe2, 0x88, 0x8b}}, - "Sum": {Name: "Sum", CodePoints: []int{8721}, Characters: []byte{0xe2, 0x88, 0x91}}, - "Sup": {Name: "Sup", CodePoints: []int{8913}, Characters: []byte{0xe2, 0x8b, 0x91}}, - "Superset": {Name: "Superset", CodePoints: []int{8835}, Characters: []byte{0xe2, 0x8a, 0x83}}, - "SupersetEqual": {Name: "SupersetEqual", CodePoints: []int{8839}, Characters: []byte{0xe2, 0x8a, 0x87}}, - "Supset": {Name: "Supset", CodePoints: []int{8913}, Characters: []byte{0xe2, 0x8b, 0x91}}, - "THORN": {Name: "THORN", CodePoints: []int{222}, Characters: []byte{0xc3, 0x9e}}, - "TRADE": {Name: "TRADE", CodePoints: []int{8482}, Characters: []byte{0xe2, 0x84, 0xa2}}, - "TSHcy": {Name: "TSHcy", CodePoints: []int{1035}, Characters: []byte{0xd0, 0x8b}}, - "TScy": {Name: "TScy", CodePoints: []int{1062}, Characters: []byte{0xd0, 0xa6}}, - "Tab": {Name: "Tab", CodePoints: []int{9}, Characters: []byte{0x9}}, - "Tau": {Name: "Tau", CodePoints: []int{932}, Characters: []byte{0xce, 0xa4}}, - "Tcaron": {Name: "Tcaron", CodePoints: []int{356}, Characters: []byte{0xc5, 0xa4}}, - "Tcedil": {Name: "Tcedil", CodePoints: []int{354}, Characters: []byte{0xc5, 0xa2}}, - "Tcy": {Name: "Tcy", CodePoints: []int{1058}, Characters: []byte{0xd0, 0xa2}}, - "Tfr": {Name: "Tfr", CodePoints: []int{120087}, Characters: []byte{0xf0, 0x9d, 0x94, 0x97}}, - "Therefore": {Name: "Therefore", CodePoints: []int{8756}, Characters: []byte{0xe2, 0x88, 0xb4}}, - "Theta": {Name: "Theta", CodePoints: []int{920}, Characters: []byte{0xce, 0x98}}, - "ThickSpace": {Name: "ThickSpace", CodePoints: []int{8287, 8202}, Characters: []byte{0xe2, 0x81, 0x9f, 0xe2, 0x80, 0x8a}}, - "ThinSpace": {Name: "ThinSpace", CodePoints: []int{8201}, Characters: []byte{0xe2, 0x80, 0x89}}, - "Tilde": {Name: "Tilde", CodePoints: []int{8764}, Characters: []byte{0xe2, 0x88, 0xbc}}, - "TildeEqual": {Name: "TildeEqual", CodePoints: []int{8771}, Characters: []byte{0xe2, 0x89, 0x83}}, - "TildeFullEqual": {Name: "TildeFullEqual", CodePoints: []int{8773}, Characters: []byte{0xe2, 0x89, 0x85}}, - "TildeTilde": {Name: "TildeTilde", CodePoints: []int{8776}, Characters: []byte{0xe2, 0x89, 0x88}}, - "Topf": {Name: "Topf", CodePoints: []int{120139}, Characters: []byte{0xf0, 0x9d, 0x95, 0x8b}}, - "TripleDot": {Name: "TripleDot", CodePoints: []int{8411}, Characters: []byte{0xe2, 0x83, 0x9b}}, - "Tscr": {Name: "Tscr", CodePoints: []int{119983}, Characters: []byte{0xf0, 0x9d, 0x92, 0xaf}}, - "Tstrok": {Name: "Tstrok", CodePoints: []int{358}, Characters: []byte{0xc5, 0xa6}}, - "Uacute": {Name: "Uacute", CodePoints: []int{218}, Characters: []byte{0xc3, 0x9a}}, - "Uarr": {Name: "Uarr", CodePoints: []int{8607}, Characters: []byte{0xe2, 0x86, 0x9f}}, - "Uarrocir": {Name: "Uarrocir", CodePoints: []int{10569}, Characters: []byte{0xe2, 0xa5, 0x89}}, - "Ubrcy": {Name: "Ubrcy", CodePoints: []int{1038}, Characters: []byte{0xd0, 0x8e}}, - "Ubreve": {Name: "Ubreve", CodePoints: []int{364}, Characters: []byte{0xc5, 0xac}}, - "Ucirc": {Name: "Ucirc", CodePoints: []int{219}, Characters: []byte{0xc3, 0x9b}}, - "Ucy": {Name: "Ucy", CodePoints: []int{1059}, Characters: []byte{0xd0, 0xa3}}, - "Udblac": {Name: "Udblac", CodePoints: []int{368}, Characters: []byte{0xc5, 0xb0}}, - "Ufr": {Name: "Ufr", CodePoints: []int{120088}, Characters: []byte{0xf0, 0x9d, 0x94, 0x98}}, - "Ugrave": {Name: "Ugrave", CodePoints: []int{217}, Characters: []byte{0xc3, 0x99}}, - "Umacr": {Name: "Umacr", CodePoints: []int{362}, Characters: []byte{0xc5, 0xaa}}, - "UnderBar": {Name: "UnderBar", CodePoints: []int{95}, Characters: []byte{0x5f}}, - "UnderBrace": {Name: "UnderBrace", CodePoints: []int{9183}, Characters: []byte{0xe2, 0x8f, 0x9f}}, - "UnderBracket": {Name: "UnderBracket", CodePoints: []int{9141}, Characters: []byte{0xe2, 0x8e, 0xb5}}, - "UnderParenthesis": {Name: "UnderParenthesis", CodePoints: []int{9181}, Characters: []byte{0xe2, 0x8f, 0x9d}}, - "Union": {Name: "Union", CodePoints: []int{8899}, Characters: []byte{0xe2, 0x8b, 0x83}}, - "UnionPlus": {Name: "UnionPlus", CodePoints: []int{8846}, Characters: []byte{0xe2, 0x8a, 0x8e}}, - "Uogon": {Name: "Uogon", CodePoints: []int{370}, Characters: []byte{0xc5, 0xb2}}, - "Uopf": {Name: "Uopf", CodePoints: []int{120140}, Characters: []byte{0xf0, 0x9d, 0x95, 0x8c}}, - "UpArrow": {Name: "UpArrow", CodePoints: []int{8593}, Characters: []byte{0xe2, 0x86, 0x91}}, - "UpArrowBar": {Name: "UpArrowBar", CodePoints: []int{10514}, Characters: []byte{0xe2, 0xa4, 0x92}}, - "UpArrowDownArrow": {Name: "UpArrowDownArrow", CodePoints: []int{8645}, Characters: []byte{0xe2, 0x87, 0x85}}, - "UpDownArrow": {Name: "UpDownArrow", CodePoints: []int{8597}, Characters: []byte{0xe2, 0x86, 0x95}}, - "UpEquilibrium": {Name: "UpEquilibrium", CodePoints: []int{10606}, Characters: []byte{0xe2, 0xa5, 0xae}}, - "UpTee": {Name: "UpTee", CodePoints: []int{8869}, Characters: []byte{0xe2, 0x8a, 0xa5}}, - "UpTeeArrow": {Name: "UpTeeArrow", CodePoints: []int{8613}, Characters: []byte{0xe2, 0x86, 0xa5}}, - "Uparrow": {Name: "Uparrow", CodePoints: []int{8657}, Characters: []byte{0xe2, 0x87, 0x91}}, - "Updownarrow": {Name: "Updownarrow", CodePoints: []int{8661}, Characters: []byte{0xe2, 0x87, 0x95}}, - "UpperLeftArrow": {Name: "UpperLeftArrow", CodePoints: []int{8598}, Characters: []byte{0xe2, 0x86, 0x96}}, - "UpperRightArrow": {Name: "UpperRightArrow", CodePoints: []int{8599}, Characters: []byte{0xe2, 0x86, 0x97}}, - "Upsi": {Name: "Upsi", CodePoints: []int{978}, Characters: []byte{0xcf, 0x92}}, - "Upsilon": {Name: "Upsilon", CodePoints: []int{933}, Characters: []byte{0xce, 0xa5}}, - "Uring": {Name: "Uring", CodePoints: []int{366}, Characters: []byte{0xc5, 0xae}}, - "Uscr": {Name: "Uscr", CodePoints: []int{119984}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb0}}, - "Utilde": {Name: "Utilde", CodePoints: []int{360}, Characters: []byte{0xc5, 0xa8}}, - "Uuml": {Name: "Uuml", CodePoints: []int{220}, Characters: []byte{0xc3, 0x9c}}, - "VDash": {Name: "VDash", CodePoints: []int{8875}, Characters: []byte{0xe2, 0x8a, 0xab}}, - "Vbar": {Name: "Vbar", CodePoints: []int{10987}, Characters: []byte{0xe2, 0xab, 0xab}}, - "Vcy": {Name: "Vcy", CodePoints: []int{1042}, Characters: []byte{0xd0, 0x92}}, - "Vdash": {Name: "Vdash", CodePoints: []int{8873}, Characters: []byte{0xe2, 0x8a, 0xa9}}, - "Vdashl": {Name: "Vdashl", CodePoints: []int{10982}, Characters: []byte{0xe2, 0xab, 0xa6}}, - "Vee": {Name: "Vee", CodePoints: []int{8897}, Characters: []byte{0xe2, 0x8b, 0x81}}, - "Verbar": {Name: "Verbar", CodePoints: []int{8214}, Characters: []byte{0xe2, 0x80, 0x96}}, - "Vert": {Name: "Vert", CodePoints: []int{8214}, Characters: []byte{0xe2, 0x80, 0x96}}, - "VerticalBar": {Name: "VerticalBar", CodePoints: []int{8739}, Characters: []byte{0xe2, 0x88, 0xa3}}, - "VerticalLine": {Name: "VerticalLine", CodePoints: []int{124}, Characters: []byte{0x7c}}, - "VerticalSeparator": {Name: "VerticalSeparator", CodePoints: []int{10072}, Characters: []byte{0xe2, 0x9d, 0x98}}, - "VerticalTilde": {Name: "VerticalTilde", CodePoints: []int{8768}, Characters: []byte{0xe2, 0x89, 0x80}}, - "VeryThinSpace": {Name: "VeryThinSpace", CodePoints: []int{8202}, Characters: []byte{0xe2, 0x80, 0x8a}}, - "Vfr": {Name: "Vfr", CodePoints: []int{120089}, Characters: []byte{0xf0, 0x9d, 0x94, 0x99}}, - "Vopf": {Name: "Vopf", CodePoints: []int{120141}, Characters: []byte{0xf0, 0x9d, 0x95, 0x8d}}, - "Vscr": {Name: "Vscr", CodePoints: []int{119985}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb1}}, - "Vvdash": {Name: "Vvdash", CodePoints: []int{8874}, Characters: []byte{0xe2, 0x8a, 0xaa}}, - "Wcirc": {Name: "Wcirc", CodePoints: []int{372}, Characters: []byte{0xc5, 0xb4}}, - "Wedge": {Name: "Wedge", CodePoints: []int{8896}, Characters: []byte{0xe2, 0x8b, 0x80}}, - "Wfr": {Name: "Wfr", CodePoints: []int{120090}, Characters: []byte{0xf0, 0x9d, 0x94, 0x9a}}, - "Wopf": {Name: "Wopf", CodePoints: []int{120142}, Characters: []byte{0xf0, 0x9d, 0x95, 0x8e}}, - "Wscr": {Name: "Wscr", CodePoints: []int{119986}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb2}}, - "Xfr": {Name: "Xfr", CodePoints: []int{120091}, Characters: []byte{0xf0, 0x9d, 0x94, 0x9b}}, - "Xi": {Name: "Xi", CodePoints: []int{926}, Characters: []byte{0xce, 0x9e}}, - "Xopf": {Name: "Xopf", CodePoints: []int{120143}, Characters: []byte{0xf0, 0x9d, 0x95, 0x8f}}, - "Xscr": {Name: "Xscr", CodePoints: []int{119987}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb3}}, - "YAcy": {Name: "YAcy", CodePoints: []int{1071}, Characters: []byte{0xd0, 0xaf}}, - "YIcy": {Name: "YIcy", CodePoints: []int{1031}, Characters: []byte{0xd0, 0x87}}, - "YUcy": {Name: "YUcy", CodePoints: []int{1070}, Characters: []byte{0xd0, 0xae}}, - "Yacute": {Name: "Yacute", CodePoints: []int{221}, Characters: []byte{0xc3, 0x9d}}, - "Ycirc": {Name: "Ycirc", CodePoints: []int{374}, Characters: []byte{0xc5, 0xb6}}, - "Ycy": {Name: "Ycy", CodePoints: []int{1067}, Characters: []byte{0xd0, 0xab}}, - "Yfr": {Name: "Yfr", CodePoints: []int{120092}, Characters: []byte{0xf0, 0x9d, 0x94, 0x9c}}, - "Yopf": {Name: "Yopf", CodePoints: []int{120144}, Characters: []byte{0xf0, 0x9d, 0x95, 0x90}}, - "Yscr": {Name: "Yscr", CodePoints: []int{119988}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb4}}, - "Yuml": {Name: "Yuml", CodePoints: []int{376}, Characters: []byte{0xc5, 0xb8}}, - "ZHcy": {Name: "ZHcy", CodePoints: []int{1046}, Characters: []byte{0xd0, 0x96}}, - "Zacute": {Name: "Zacute", CodePoints: []int{377}, Characters: []byte{0xc5, 0xb9}}, - "Zcaron": {Name: "Zcaron", CodePoints: []int{381}, Characters: []byte{0xc5, 0xbd}}, - "Zcy": {Name: "Zcy", CodePoints: []int{1047}, Characters: []byte{0xd0, 0x97}}, - "Zdot": {Name: "Zdot", CodePoints: []int{379}, Characters: []byte{0xc5, 0xbb}}, - "ZeroWidthSpace": {Name: "ZeroWidthSpace", CodePoints: []int{8203}, Characters: []byte{0xe2, 0x80, 0x8b}}, - "Zeta": {Name: "Zeta", CodePoints: []int{918}, Characters: []byte{0xce, 0x96}}, - "Zfr": {Name: "Zfr", CodePoints: []int{8488}, Characters: []byte{0xe2, 0x84, 0xa8}}, - "Zopf": {Name: "Zopf", CodePoints: []int{8484}, Characters: []byte{0xe2, 0x84, 0xa4}}, - "Zscr": {Name: "Zscr", CodePoints: []int{119989}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb5}}, - "aacute": {Name: "aacute", CodePoints: []int{225}, Characters: []byte{0xc3, 0xa1}}, - "abreve": {Name: "abreve", CodePoints: []int{259}, Characters: []byte{0xc4, 0x83}}, - "ac": {Name: "ac", CodePoints: []int{8766}, Characters: []byte{0xe2, 0x88, 0xbe}}, - "acE": {Name: "acE", CodePoints: []int{8766, 819}, Characters: []byte{0xe2, 0x88, 0xbe, 0xcc, 0xb3}}, - "acd": {Name: "acd", CodePoints: []int{8767}, Characters: []byte{0xe2, 0x88, 0xbf}}, - "acirc": {Name: "acirc", CodePoints: []int{226}, Characters: []byte{0xc3, 0xa2}}, - "acute": {Name: "acute", CodePoints: []int{180}, Characters: []byte{0xc2, 0xb4}}, - "acy": {Name: "acy", CodePoints: []int{1072}, Characters: []byte{0xd0, 0xb0}}, - "aelig": {Name: "aelig", CodePoints: []int{230}, Characters: []byte{0xc3, 0xa6}}, - "af": {Name: "af", CodePoints: []int{8289}, Characters: []byte{0xe2, 0x81, 0xa1}}, - "afr": {Name: "afr", CodePoints: []int{120094}, Characters: []byte{0xf0, 0x9d, 0x94, 0x9e}}, - "agrave": {Name: "agrave", CodePoints: []int{224}, Characters: []byte{0xc3, 0xa0}}, - "alefsym": {Name: "alefsym", CodePoints: []int{8501}, Characters: []byte{0xe2, 0x84, 0xb5}}, - "aleph": {Name: "aleph", CodePoints: []int{8501}, Characters: []byte{0xe2, 0x84, 0xb5}}, - "alpha": {Name: "alpha", CodePoints: []int{945}, Characters: []byte{0xce, 0xb1}}, - "amacr": {Name: "amacr", CodePoints: []int{257}, Characters: []byte{0xc4, 0x81}}, - "amalg": {Name: "amalg", CodePoints: []int{10815}, Characters: []byte{0xe2, 0xa8, 0xbf}}, - "amp": {Name: "amp", CodePoints: []int{38}, Characters: []byte{0x26}}, - "and": {Name: "and", CodePoints: []int{8743}, Characters: []byte{0xe2, 0x88, 0xa7}}, - "andand": {Name: "andand", CodePoints: []int{10837}, Characters: []byte{0xe2, 0xa9, 0x95}}, - "andd": {Name: "andd", CodePoints: []int{10844}, Characters: []byte{0xe2, 0xa9, 0x9c}}, - "andslope": {Name: "andslope", CodePoints: []int{10840}, Characters: []byte{0xe2, 0xa9, 0x98}}, - "andv": {Name: "andv", CodePoints: []int{10842}, Characters: []byte{0xe2, 0xa9, 0x9a}}, - "ang": {Name: "ang", CodePoints: []int{8736}, Characters: []byte{0xe2, 0x88, 0xa0}}, - "ange": {Name: "ange", CodePoints: []int{10660}, Characters: []byte{0xe2, 0xa6, 0xa4}}, - "angle": {Name: "angle", CodePoints: []int{8736}, Characters: []byte{0xe2, 0x88, 0xa0}}, - "angmsd": {Name: "angmsd", CodePoints: []int{8737}, Characters: []byte{0xe2, 0x88, 0xa1}}, - "angmsdaa": {Name: "angmsdaa", CodePoints: []int{10664}, Characters: []byte{0xe2, 0xa6, 0xa8}}, - "angmsdab": {Name: "angmsdab", CodePoints: []int{10665}, Characters: []byte{0xe2, 0xa6, 0xa9}}, - "angmsdac": {Name: "angmsdac", CodePoints: []int{10666}, Characters: []byte{0xe2, 0xa6, 0xaa}}, - "angmsdad": {Name: "angmsdad", CodePoints: []int{10667}, Characters: []byte{0xe2, 0xa6, 0xab}}, - "angmsdae": {Name: "angmsdae", CodePoints: []int{10668}, Characters: []byte{0xe2, 0xa6, 0xac}}, - "angmsdaf": {Name: "angmsdaf", CodePoints: []int{10669}, Characters: []byte{0xe2, 0xa6, 0xad}}, - "angmsdag": {Name: "angmsdag", CodePoints: []int{10670}, Characters: []byte{0xe2, 0xa6, 0xae}}, - "angmsdah": {Name: "angmsdah", CodePoints: []int{10671}, Characters: []byte{0xe2, 0xa6, 0xaf}}, - "angrt": {Name: "angrt", CodePoints: []int{8735}, Characters: []byte{0xe2, 0x88, 0x9f}}, - "angrtvb": {Name: "angrtvb", CodePoints: []int{8894}, Characters: []byte{0xe2, 0x8a, 0xbe}}, - "angrtvbd": {Name: "angrtvbd", CodePoints: []int{10653}, Characters: []byte{0xe2, 0xa6, 0x9d}}, - "angsph": {Name: "angsph", CodePoints: []int{8738}, Characters: []byte{0xe2, 0x88, 0xa2}}, - "angst": {Name: "angst", CodePoints: []int{197}, Characters: []byte{0xc3, 0x85}}, - "angzarr": {Name: "angzarr", CodePoints: []int{9084}, Characters: []byte{0xe2, 0x8d, 0xbc}}, - "aogon": {Name: "aogon", CodePoints: []int{261}, Characters: []byte{0xc4, 0x85}}, - "aopf": {Name: "aopf", CodePoints: []int{120146}, Characters: []byte{0xf0, 0x9d, 0x95, 0x92}}, - "ap": {Name: "ap", CodePoints: []int{8776}, Characters: []byte{0xe2, 0x89, 0x88}}, - "apE": {Name: "apE", CodePoints: []int{10864}, Characters: []byte{0xe2, 0xa9, 0xb0}}, - "apacir": {Name: "apacir", CodePoints: []int{10863}, Characters: []byte{0xe2, 0xa9, 0xaf}}, - "ape": {Name: "ape", CodePoints: []int{8778}, Characters: []byte{0xe2, 0x89, 0x8a}}, - "apid": {Name: "apid", CodePoints: []int{8779}, Characters: []byte{0xe2, 0x89, 0x8b}}, - "apos": {Name: "apos", CodePoints: []int{39}, Characters: []byte{0x27}}, - "approx": {Name: "approx", CodePoints: []int{8776}, Characters: []byte{0xe2, 0x89, 0x88}}, - "approxeq": {Name: "approxeq", CodePoints: []int{8778}, Characters: []byte{0xe2, 0x89, 0x8a}}, - "aring": {Name: "aring", CodePoints: []int{229}, Characters: []byte{0xc3, 0xa5}}, - "ascr": {Name: "ascr", CodePoints: []int{119990}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb6}}, - "ast": {Name: "ast", CodePoints: []int{42}, Characters: []byte{0x2a}}, - "asymp": {Name: "asymp", CodePoints: []int{8776}, Characters: []byte{0xe2, 0x89, 0x88}}, - "asympeq": {Name: "asympeq", CodePoints: []int{8781}, Characters: []byte{0xe2, 0x89, 0x8d}}, - "atilde": {Name: "atilde", CodePoints: []int{227}, Characters: []byte{0xc3, 0xa3}}, - "auml": {Name: "auml", CodePoints: []int{228}, Characters: []byte{0xc3, 0xa4}}, - "awconint": {Name: "awconint", CodePoints: []int{8755}, Characters: []byte{0xe2, 0x88, 0xb3}}, - "awint": {Name: "awint", CodePoints: []int{10769}, Characters: []byte{0xe2, 0xa8, 0x91}}, - "bNot": {Name: "bNot", CodePoints: []int{10989}, Characters: []byte{0xe2, 0xab, 0xad}}, - "backcong": {Name: "backcong", CodePoints: []int{8780}, Characters: []byte{0xe2, 0x89, 0x8c}}, - "backepsilon": {Name: "backepsilon", CodePoints: []int{1014}, Characters: []byte{0xcf, 0xb6}}, - "backprime": {Name: "backprime", CodePoints: []int{8245}, Characters: []byte{0xe2, 0x80, 0xb5}}, - "backsim": {Name: "backsim", CodePoints: []int{8765}, Characters: []byte{0xe2, 0x88, 0xbd}}, - "backsimeq": {Name: "backsimeq", CodePoints: []int{8909}, Characters: []byte{0xe2, 0x8b, 0x8d}}, - "barvee": {Name: "barvee", CodePoints: []int{8893}, Characters: []byte{0xe2, 0x8a, 0xbd}}, - "barwed": {Name: "barwed", CodePoints: []int{8965}, Characters: []byte{0xe2, 0x8c, 0x85}}, - "barwedge": {Name: "barwedge", CodePoints: []int{8965}, Characters: []byte{0xe2, 0x8c, 0x85}}, - "bbrk": {Name: "bbrk", CodePoints: []int{9141}, Characters: []byte{0xe2, 0x8e, 0xb5}}, - "bbrktbrk": {Name: "bbrktbrk", CodePoints: []int{9142}, Characters: []byte{0xe2, 0x8e, 0xb6}}, - "bcong": {Name: "bcong", CodePoints: []int{8780}, Characters: []byte{0xe2, 0x89, 0x8c}}, - "bcy": {Name: "bcy", CodePoints: []int{1073}, Characters: []byte{0xd0, 0xb1}}, - "bdquo": {Name: "bdquo", CodePoints: []int{8222}, Characters: []byte{0xe2, 0x80, 0x9e}}, - "becaus": {Name: "becaus", CodePoints: []int{8757}, Characters: []byte{0xe2, 0x88, 0xb5}}, - "because": {Name: "because", CodePoints: []int{8757}, Characters: []byte{0xe2, 0x88, 0xb5}}, - "bemptyv": {Name: "bemptyv", CodePoints: []int{10672}, Characters: []byte{0xe2, 0xa6, 0xb0}}, - "bepsi": {Name: "bepsi", CodePoints: []int{1014}, Characters: []byte{0xcf, 0xb6}}, - "bernou": {Name: "bernou", CodePoints: []int{8492}, Characters: []byte{0xe2, 0x84, 0xac}}, - "beta": {Name: "beta", CodePoints: []int{946}, Characters: []byte{0xce, 0xb2}}, - "beth": {Name: "beth", CodePoints: []int{8502}, Characters: []byte{0xe2, 0x84, 0xb6}}, - "between": {Name: "between", CodePoints: []int{8812}, Characters: []byte{0xe2, 0x89, 0xac}}, - "bfr": {Name: "bfr", CodePoints: []int{120095}, Characters: []byte{0xf0, 0x9d, 0x94, 0x9f}}, - "bigcap": {Name: "bigcap", CodePoints: []int{8898}, Characters: []byte{0xe2, 0x8b, 0x82}}, - "bigcirc": {Name: "bigcirc", CodePoints: []int{9711}, Characters: []byte{0xe2, 0x97, 0xaf}}, - "bigcup": {Name: "bigcup", CodePoints: []int{8899}, Characters: []byte{0xe2, 0x8b, 0x83}}, - "bigodot": {Name: "bigodot", CodePoints: []int{10752}, Characters: []byte{0xe2, 0xa8, 0x80}}, - "bigoplus": {Name: "bigoplus", CodePoints: []int{10753}, Characters: []byte{0xe2, 0xa8, 0x81}}, - "bigotimes": {Name: "bigotimes", CodePoints: []int{10754}, Characters: []byte{0xe2, 0xa8, 0x82}}, - "bigsqcup": {Name: "bigsqcup", CodePoints: []int{10758}, Characters: []byte{0xe2, 0xa8, 0x86}}, - "bigstar": {Name: "bigstar", CodePoints: []int{9733}, Characters: []byte{0xe2, 0x98, 0x85}}, - "bigtriangledown": {Name: "bigtriangledown", CodePoints: []int{9661}, Characters: []byte{0xe2, 0x96, 0xbd}}, - "bigtriangleup": {Name: "bigtriangleup", CodePoints: []int{9651}, Characters: []byte{0xe2, 0x96, 0xb3}}, - "biguplus": {Name: "biguplus", CodePoints: []int{10756}, Characters: []byte{0xe2, 0xa8, 0x84}}, - "bigvee": {Name: "bigvee", CodePoints: []int{8897}, Characters: []byte{0xe2, 0x8b, 0x81}}, - "bigwedge": {Name: "bigwedge", CodePoints: []int{8896}, Characters: []byte{0xe2, 0x8b, 0x80}}, - "bkarow": {Name: "bkarow", CodePoints: []int{10509}, Characters: []byte{0xe2, 0xa4, 0x8d}}, - "blacklozenge": {Name: "blacklozenge", CodePoints: []int{10731}, Characters: []byte{0xe2, 0xa7, 0xab}}, - "blacksquare": {Name: "blacksquare", CodePoints: []int{9642}, Characters: []byte{0xe2, 0x96, 0xaa}}, - "blacktriangle": {Name: "blacktriangle", CodePoints: []int{9652}, Characters: []byte{0xe2, 0x96, 0xb4}}, - "blacktriangledown": {Name: "blacktriangledown", CodePoints: []int{9662}, Characters: []byte{0xe2, 0x96, 0xbe}}, - "blacktriangleleft": {Name: "blacktriangleleft", CodePoints: []int{9666}, Characters: []byte{0xe2, 0x97, 0x82}}, - "blacktriangleright": {Name: "blacktriangleright", CodePoints: []int{9656}, Characters: []byte{0xe2, 0x96, 0xb8}}, - "blank": {Name: "blank", CodePoints: []int{9251}, Characters: []byte{0xe2, 0x90, 0xa3}}, - "blk12": {Name: "blk12", CodePoints: []int{9618}, Characters: []byte{0xe2, 0x96, 0x92}}, - "blk14": {Name: "blk14", CodePoints: []int{9617}, Characters: []byte{0xe2, 0x96, 0x91}}, - "blk34": {Name: "blk34", CodePoints: []int{9619}, Characters: []byte{0xe2, 0x96, 0x93}}, - "block": {Name: "block", CodePoints: []int{9608}, Characters: []byte{0xe2, 0x96, 0x88}}, - "bne": {Name: "bne", CodePoints: []int{61, 8421}, Characters: []byte{0x3d, 0xe2, 0x83, 0xa5}}, - "bnequiv": {Name: "bnequiv", CodePoints: []int{8801, 8421}, Characters: []byte{0xe2, 0x89, 0xa1, 0xe2, 0x83, 0xa5}}, - "bnot": {Name: "bnot", CodePoints: []int{8976}, Characters: []byte{0xe2, 0x8c, 0x90}}, - "bopf": {Name: "bopf", CodePoints: []int{120147}, Characters: []byte{0xf0, 0x9d, 0x95, 0x93}}, - "bot": {Name: "bot", CodePoints: []int{8869}, Characters: []byte{0xe2, 0x8a, 0xa5}}, - "bottom": {Name: "bottom", CodePoints: []int{8869}, Characters: []byte{0xe2, 0x8a, 0xa5}}, - "bowtie": {Name: "bowtie", CodePoints: []int{8904}, Characters: []byte{0xe2, 0x8b, 0x88}}, - "boxDL": {Name: "boxDL", CodePoints: []int{9559}, Characters: []byte{0xe2, 0x95, 0x97}}, - "boxDR": {Name: "boxDR", CodePoints: []int{9556}, Characters: []byte{0xe2, 0x95, 0x94}}, - "boxDl": {Name: "boxDl", CodePoints: []int{9558}, Characters: []byte{0xe2, 0x95, 0x96}}, - "boxDr": {Name: "boxDr", CodePoints: []int{9555}, Characters: []byte{0xe2, 0x95, 0x93}}, - "boxH": {Name: "boxH", CodePoints: []int{9552}, Characters: []byte{0xe2, 0x95, 0x90}}, - "boxHD": {Name: "boxHD", CodePoints: []int{9574}, Characters: []byte{0xe2, 0x95, 0xa6}}, - "boxHU": {Name: "boxHU", CodePoints: []int{9577}, Characters: []byte{0xe2, 0x95, 0xa9}}, - "boxHd": {Name: "boxHd", CodePoints: []int{9572}, Characters: []byte{0xe2, 0x95, 0xa4}}, - "boxHu": {Name: "boxHu", CodePoints: []int{9575}, Characters: []byte{0xe2, 0x95, 0xa7}}, - "boxUL": {Name: "boxUL", CodePoints: []int{9565}, Characters: []byte{0xe2, 0x95, 0x9d}}, - "boxUR": {Name: "boxUR", CodePoints: []int{9562}, Characters: []byte{0xe2, 0x95, 0x9a}}, - "boxUl": {Name: "boxUl", CodePoints: []int{9564}, Characters: []byte{0xe2, 0x95, 0x9c}}, - "boxUr": {Name: "boxUr", CodePoints: []int{9561}, Characters: []byte{0xe2, 0x95, 0x99}}, - "boxV": {Name: "boxV", CodePoints: []int{9553}, Characters: []byte{0xe2, 0x95, 0x91}}, - "boxVH": {Name: "boxVH", CodePoints: []int{9580}, Characters: []byte{0xe2, 0x95, 0xac}}, - "boxVL": {Name: "boxVL", CodePoints: []int{9571}, Characters: []byte{0xe2, 0x95, 0xa3}}, - "boxVR": {Name: "boxVR", CodePoints: []int{9568}, Characters: []byte{0xe2, 0x95, 0xa0}}, - "boxVh": {Name: "boxVh", CodePoints: []int{9579}, Characters: []byte{0xe2, 0x95, 0xab}}, - "boxVl": {Name: "boxVl", CodePoints: []int{9570}, Characters: []byte{0xe2, 0x95, 0xa2}}, - "boxVr": {Name: "boxVr", CodePoints: []int{9567}, Characters: []byte{0xe2, 0x95, 0x9f}}, - "boxbox": {Name: "boxbox", CodePoints: []int{10697}, Characters: []byte{0xe2, 0xa7, 0x89}}, - "boxdL": {Name: "boxdL", CodePoints: []int{9557}, Characters: []byte{0xe2, 0x95, 0x95}}, - "boxdR": {Name: "boxdR", CodePoints: []int{9554}, Characters: []byte{0xe2, 0x95, 0x92}}, - "boxdl": {Name: "boxdl", CodePoints: []int{9488}, Characters: []byte{0xe2, 0x94, 0x90}}, - "boxdr": {Name: "boxdr", CodePoints: []int{9484}, Characters: []byte{0xe2, 0x94, 0x8c}}, - "boxh": {Name: "boxh", CodePoints: []int{9472}, Characters: []byte{0xe2, 0x94, 0x80}}, - "boxhD": {Name: "boxhD", CodePoints: []int{9573}, Characters: []byte{0xe2, 0x95, 0xa5}}, - "boxhU": {Name: "boxhU", CodePoints: []int{9576}, Characters: []byte{0xe2, 0x95, 0xa8}}, - "boxhd": {Name: "boxhd", CodePoints: []int{9516}, Characters: []byte{0xe2, 0x94, 0xac}}, - "boxhu": {Name: "boxhu", CodePoints: []int{9524}, Characters: []byte{0xe2, 0x94, 0xb4}}, - "boxminus": {Name: "boxminus", CodePoints: []int{8863}, Characters: []byte{0xe2, 0x8a, 0x9f}}, - "boxplus": {Name: "boxplus", CodePoints: []int{8862}, Characters: []byte{0xe2, 0x8a, 0x9e}}, - "boxtimes": {Name: "boxtimes", CodePoints: []int{8864}, Characters: []byte{0xe2, 0x8a, 0xa0}}, - "boxuL": {Name: "boxuL", CodePoints: []int{9563}, Characters: []byte{0xe2, 0x95, 0x9b}}, - "boxuR": {Name: "boxuR", CodePoints: []int{9560}, Characters: []byte{0xe2, 0x95, 0x98}}, - "boxul": {Name: "boxul", CodePoints: []int{9496}, Characters: []byte{0xe2, 0x94, 0x98}}, - "boxur": {Name: "boxur", CodePoints: []int{9492}, Characters: []byte{0xe2, 0x94, 0x94}}, - "boxv": {Name: "boxv", CodePoints: []int{9474}, Characters: []byte{0xe2, 0x94, 0x82}}, - "boxvH": {Name: "boxvH", CodePoints: []int{9578}, Characters: []byte{0xe2, 0x95, 0xaa}}, - "boxvL": {Name: "boxvL", CodePoints: []int{9569}, Characters: []byte{0xe2, 0x95, 0xa1}}, - "boxvR": {Name: "boxvR", CodePoints: []int{9566}, Characters: []byte{0xe2, 0x95, 0x9e}}, - "boxvh": {Name: "boxvh", CodePoints: []int{9532}, Characters: []byte{0xe2, 0x94, 0xbc}}, - "boxvl": {Name: "boxvl", CodePoints: []int{9508}, Characters: []byte{0xe2, 0x94, 0xa4}}, - "boxvr": {Name: "boxvr", CodePoints: []int{9500}, Characters: []byte{0xe2, 0x94, 0x9c}}, - "bprime": {Name: "bprime", CodePoints: []int{8245}, Characters: []byte{0xe2, 0x80, 0xb5}}, - "breve": {Name: "breve", CodePoints: []int{728}, Characters: []byte{0xcb, 0x98}}, - "brvbar": {Name: "brvbar", CodePoints: []int{166}, Characters: []byte{0xc2, 0xa6}}, - "bscr": {Name: "bscr", CodePoints: []int{119991}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb7}}, - "bsemi": {Name: "bsemi", CodePoints: []int{8271}, Characters: []byte{0xe2, 0x81, 0x8f}}, - "bsim": {Name: "bsim", CodePoints: []int{8765}, Characters: []byte{0xe2, 0x88, 0xbd}}, - "bsime": {Name: "bsime", CodePoints: []int{8909}, Characters: []byte{0xe2, 0x8b, 0x8d}}, - "bsol": {Name: "bsol", CodePoints: []int{92}, Characters: []byte{0x5c}}, - "bsolb": {Name: "bsolb", CodePoints: []int{10693}, Characters: []byte{0xe2, 0xa7, 0x85}}, - "bsolhsub": {Name: "bsolhsub", CodePoints: []int{10184}, Characters: []byte{0xe2, 0x9f, 0x88}}, - "bull": {Name: "bull", CodePoints: []int{8226}, Characters: []byte{0xe2, 0x80, 0xa2}}, - "bullet": {Name: "bullet", CodePoints: []int{8226}, Characters: []byte{0xe2, 0x80, 0xa2}}, - "bump": {Name: "bump", CodePoints: []int{8782}, Characters: []byte{0xe2, 0x89, 0x8e}}, - "bumpE": {Name: "bumpE", CodePoints: []int{10926}, Characters: []byte{0xe2, 0xaa, 0xae}}, - "bumpe": {Name: "bumpe", CodePoints: []int{8783}, Characters: []byte{0xe2, 0x89, 0x8f}}, - "bumpeq": {Name: "bumpeq", CodePoints: []int{8783}, Characters: []byte{0xe2, 0x89, 0x8f}}, - "cacute": {Name: "cacute", CodePoints: []int{263}, Characters: []byte{0xc4, 0x87}}, - "cap": {Name: "cap", CodePoints: []int{8745}, Characters: []byte{0xe2, 0x88, 0xa9}}, - "capand": {Name: "capand", CodePoints: []int{10820}, Characters: []byte{0xe2, 0xa9, 0x84}}, - "capbrcup": {Name: "capbrcup", CodePoints: []int{10825}, Characters: []byte{0xe2, 0xa9, 0x89}}, - "capcap": {Name: "capcap", CodePoints: []int{10827}, Characters: []byte{0xe2, 0xa9, 0x8b}}, - "capcup": {Name: "capcup", CodePoints: []int{10823}, Characters: []byte{0xe2, 0xa9, 0x87}}, - "capdot": {Name: "capdot", CodePoints: []int{10816}, Characters: []byte{0xe2, 0xa9, 0x80}}, - "caps": {Name: "caps", CodePoints: []int{8745, 65024}, Characters: []byte{0xe2, 0x88, 0xa9, 0xef, 0xb8, 0x80}}, - "caret": {Name: "caret", CodePoints: []int{8257}, Characters: []byte{0xe2, 0x81, 0x81}}, - "caron": {Name: "caron", CodePoints: []int{711}, Characters: []byte{0xcb, 0x87}}, - "ccaps": {Name: "ccaps", CodePoints: []int{10829}, Characters: []byte{0xe2, 0xa9, 0x8d}}, - "ccaron": {Name: "ccaron", CodePoints: []int{269}, Characters: []byte{0xc4, 0x8d}}, - "ccedil": {Name: "ccedil", CodePoints: []int{231}, Characters: []byte{0xc3, 0xa7}}, - "ccirc": {Name: "ccirc", CodePoints: []int{265}, Characters: []byte{0xc4, 0x89}}, - "ccups": {Name: "ccups", CodePoints: []int{10828}, Characters: []byte{0xe2, 0xa9, 0x8c}}, - "ccupssm": {Name: "ccupssm", CodePoints: []int{10832}, Characters: []byte{0xe2, 0xa9, 0x90}}, - "cdot": {Name: "cdot", CodePoints: []int{267}, Characters: []byte{0xc4, 0x8b}}, - "cedil": {Name: "cedil", CodePoints: []int{184}, Characters: []byte{0xc2, 0xb8}}, - "cemptyv": {Name: "cemptyv", CodePoints: []int{10674}, Characters: []byte{0xe2, 0xa6, 0xb2}}, - "cent": {Name: "cent", CodePoints: []int{162}, Characters: []byte{0xc2, 0xa2}}, - "centerdot": {Name: "centerdot", CodePoints: []int{183}, Characters: []byte{0xc2, 0xb7}}, - "cfr": {Name: "cfr", CodePoints: []int{120096}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa0}}, - "chcy": {Name: "chcy", CodePoints: []int{1095}, Characters: []byte{0xd1, 0x87}}, - "check": {Name: "check", CodePoints: []int{10003}, Characters: []byte{0xe2, 0x9c, 0x93}}, - "checkmark": {Name: "checkmark", CodePoints: []int{10003}, Characters: []byte{0xe2, 0x9c, 0x93}}, - "chi": {Name: "chi", CodePoints: []int{967}, Characters: []byte{0xcf, 0x87}}, - "cir": {Name: "cir", CodePoints: []int{9675}, Characters: []byte{0xe2, 0x97, 0x8b}}, - "cirE": {Name: "cirE", CodePoints: []int{10691}, Characters: []byte{0xe2, 0xa7, 0x83}}, - "circ": {Name: "circ", CodePoints: []int{710}, Characters: []byte{0xcb, 0x86}}, - "circeq": {Name: "circeq", CodePoints: []int{8791}, Characters: []byte{0xe2, 0x89, 0x97}}, - "circlearrowleft": {Name: "circlearrowleft", CodePoints: []int{8634}, Characters: []byte{0xe2, 0x86, 0xba}}, - "circlearrowright": {Name: "circlearrowright", CodePoints: []int{8635}, Characters: []byte{0xe2, 0x86, 0xbb}}, - "circledR": {Name: "circledR", CodePoints: []int{174}, Characters: []byte{0xc2, 0xae}}, - "circledS": {Name: "circledS", CodePoints: []int{9416}, Characters: []byte{0xe2, 0x93, 0x88}}, - "circledast": {Name: "circledast", CodePoints: []int{8859}, Characters: []byte{0xe2, 0x8a, 0x9b}}, - "circledcirc": {Name: "circledcirc", CodePoints: []int{8858}, Characters: []byte{0xe2, 0x8a, 0x9a}}, - "circleddash": {Name: "circleddash", CodePoints: []int{8861}, Characters: []byte{0xe2, 0x8a, 0x9d}}, - "cire": {Name: "cire", CodePoints: []int{8791}, Characters: []byte{0xe2, 0x89, 0x97}}, - "cirfnint": {Name: "cirfnint", CodePoints: []int{10768}, Characters: []byte{0xe2, 0xa8, 0x90}}, - "cirmid": {Name: "cirmid", CodePoints: []int{10991}, Characters: []byte{0xe2, 0xab, 0xaf}}, - "cirscir": {Name: "cirscir", CodePoints: []int{10690}, Characters: []byte{0xe2, 0xa7, 0x82}}, - "clubs": {Name: "clubs", CodePoints: []int{9827}, Characters: []byte{0xe2, 0x99, 0xa3}}, - "clubsuit": {Name: "clubsuit", CodePoints: []int{9827}, Characters: []byte{0xe2, 0x99, 0xa3}}, - "colon": {Name: "colon", CodePoints: []int{58}, Characters: []byte{0x3a}}, - "colone": {Name: "colone", CodePoints: []int{8788}, Characters: []byte{0xe2, 0x89, 0x94}}, - "coloneq": {Name: "coloneq", CodePoints: []int{8788}, Characters: []byte{0xe2, 0x89, 0x94}}, - "comma": {Name: "comma", CodePoints: []int{44}, Characters: []byte{0x2c}}, - "commat": {Name: "commat", CodePoints: []int{64}, Characters: []byte{0x40}}, - "comp": {Name: "comp", CodePoints: []int{8705}, Characters: []byte{0xe2, 0x88, 0x81}}, - "compfn": {Name: "compfn", CodePoints: []int{8728}, Characters: []byte{0xe2, 0x88, 0x98}}, - "complement": {Name: "complement", CodePoints: []int{8705}, Characters: []byte{0xe2, 0x88, 0x81}}, - "complexes": {Name: "complexes", CodePoints: []int{8450}, Characters: []byte{0xe2, 0x84, 0x82}}, - "cong": {Name: "cong", CodePoints: []int{8773}, Characters: []byte{0xe2, 0x89, 0x85}}, - "congdot": {Name: "congdot", CodePoints: []int{10861}, Characters: []byte{0xe2, 0xa9, 0xad}}, - "conint": {Name: "conint", CodePoints: []int{8750}, Characters: []byte{0xe2, 0x88, 0xae}}, - "copf": {Name: "copf", CodePoints: []int{120148}, Characters: []byte{0xf0, 0x9d, 0x95, 0x94}}, - "coprod": {Name: "coprod", CodePoints: []int{8720}, Characters: []byte{0xe2, 0x88, 0x90}}, - "copy": {Name: "copy", CodePoints: []int{169}, Characters: []byte{0xc2, 0xa9}}, - "copysr": {Name: "copysr", CodePoints: []int{8471}, Characters: []byte{0xe2, 0x84, 0x97}}, - "crarr": {Name: "crarr", CodePoints: []int{8629}, Characters: []byte{0xe2, 0x86, 0xb5}}, - "cross": {Name: "cross", CodePoints: []int{10007}, Characters: []byte{0xe2, 0x9c, 0x97}}, - "cscr": {Name: "cscr", CodePoints: []int{119992}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb8}}, - "csub": {Name: "csub", CodePoints: []int{10959}, Characters: []byte{0xe2, 0xab, 0x8f}}, - "csube": {Name: "csube", CodePoints: []int{10961}, Characters: []byte{0xe2, 0xab, 0x91}}, - "csup": {Name: "csup", CodePoints: []int{10960}, Characters: []byte{0xe2, 0xab, 0x90}}, - "csupe": {Name: "csupe", CodePoints: []int{10962}, Characters: []byte{0xe2, 0xab, 0x92}}, - "ctdot": {Name: "ctdot", CodePoints: []int{8943}, Characters: []byte{0xe2, 0x8b, 0xaf}}, - "cudarrl": {Name: "cudarrl", CodePoints: []int{10552}, Characters: []byte{0xe2, 0xa4, 0xb8}}, - "cudarrr": {Name: "cudarrr", CodePoints: []int{10549}, Characters: []byte{0xe2, 0xa4, 0xb5}}, - "cuepr": {Name: "cuepr", CodePoints: []int{8926}, Characters: []byte{0xe2, 0x8b, 0x9e}}, - "cuesc": {Name: "cuesc", CodePoints: []int{8927}, Characters: []byte{0xe2, 0x8b, 0x9f}}, - "cularr": {Name: "cularr", CodePoints: []int{8630}, Characters: []byte{0xe2, 0x86, 0xb6}}, - "cularrp": {Name: "cularrp", CodePoints: []int{10557}, Characters: []byte{0xe2, 0xa4, 0xbd}}, - "cup": {Name: "cup", CodePoints: []int{8746}, Characters: []byte{0xe2, 0x88, 0xaa}}, - "cupbrcap": {Name: "cupbrcap", CodePoints: []int{10824}, Characters: []byte{0xe2, 0xa9, 0x88}}, - "cupcap": {Name: "cupcap", CodePoints: []int{10822}, Characters: []byte{0xe2, 0xa9, 0x86}}, - "cupcup": {Name: "cupcup", CodePoints: []int{10826}, Characters: []byte{0xe2, 0xa9, 0x8a}}, - "cupdot": {Name: "cupdot", CodePoints: []int{8845}, Characters: []byte{0xe2, 0x8a, 0x8d}}, - "cupor": {Name: "cupor", CodePoints: []int{10821}, Characters: []byte{0xe2, 0xa9, 0x85}}, - "cups": {Name: "cups", CodePoints: []int{8746, 65024}, Characters: []byte{0xe2, 0x88, 0xaa, 0xef, 0xb8, 0x80}}, - "curarr": {Name: "curarr", CodePoints: []int{8631}, Characters: []byte{0xe2, 0x86, 0xb7}}, - "curarrm": {Name: "curarrm", CodePoints: []int{10556}, Characters: []byte{0xe2, 0xa4, 0xbc}}, - "curlyeqprec": {Name: "curlyeqprec", CodePoints: []int{8926}, Characters: []byte{0xe2, 0x8b, 0x9e}}, - "curlyeqsucc": {Name: "curlyeqsucc", CodePoints: []int{8927}, Characters: []byte{0xe2, 0x8b, 0x9f}}, - "curlyvee": {Name: "curlyvee", CodePoints: []int{8910}, Characters: []byte{0xe2, 0x8b, 0x8e}}, - "curlywedge": {Name: "curlywedge", CodePoints: []int{8911}, Characters: []byte{0xe2, 0x8b, 0x8f}}, - "curren": {Name: "curren", CodePoints: []int{164}, Characters: []byte{0xc2, 0xa4}}, - "curvearrowleft": {Name: "curvearrowleft", CodePoints: []int{8630}, Characters: []byte{0xe2, 0x86, 0xb6}}, - "curvearrowright": {Name: "curvearrowright", CodePoints: []int{8631}, Characters: []byte{0xe2, 0x86, 0xb7}}, - "cuvee": {Name: "cuvee", CodePoints: []int{8910}, Characters: []byte{0xe2, 0x8b, 0x8e}}, - "cuwed": {Name: "cuwed", CodePoints: []int{8911}, Characters: []byte{0xe2, 0x8b, 0x8f}}, - "cwconint": {Name: "cwconint", CodePoints: []int{8754}, Characters: []byte{0xe2, 0x88, 0xb2}}, - "cwint": {Name: "cwint", CodePoints: []int{8753}, Characters: []byte{0xe2, 0x88, 0xb1}}, - "cylcty": {Name: "cylcty", CodePoints: []int{9005}, Characters: []byte{0xe2, 0x8c, 0xad}}, - "dArr": {Name: "dArr", CodePoints: []int{8659}, Characters: []byte{0xe2, 0x87, 0x93}}, - "dHar": {Name: "dHar", CodePoints: []int{10597}, Characters: []byte{0xe2, 0xa5, 0xa5}}, - "dagger": {Name: "dagger", CodePoints: []int{8224}, Characters: []byte{0xe2, 0x80, 0xa0}}, - "daleth": {Name: "daleth", CodePoints: []int{8504}, Characters: []byte{0xe2, 0x84, 0xb8}}, - "darr": {Name: "darr", CodePoints: []int{8595}, Characters: []byte{0xe2, 0x86, 0x93}}, - "dash": {Name: "dash", CodePoints: []int{8208}, Characters: []byte{0xe2, 0x80, 0x90}}, - "dashv": {Name: "dashv", CodePoints: []int{8867}, Characters: []byte{0xe2, 0x8a, 0xa3}}, - "dbkarow": {Name: "dbkarow", CodePoints: []int{10511}, Characters: []byte{0xe2, 0xa4, 0x8f}}, - "dblac": {Name: "dblac", CodePoints: []int{733}, Characters: []byte{0xcb, 0x9d}}, - "dcaron": {Name: "dcaron", CodePoints: []int{271}, Characters: []byte{0xc4, 0x8f}}, - "dcy": {Name: "dcy", CodePoints: []int{1076}, Characters: []byte{0xd0, 0xb4}}, - "dd": {Name: "dd", CodePoints: []int{8518}, Characters: []byte{0xe2, 0x85, 0x86}}, - "ddagger": {Name: "ddagger", CodePoints: []int{8225}, Characters: []byte{0xe2, 0x80, 0xa1}}, - "ddarr": {Name: "ddarr", CodePoints: []int{8650}, Characters: []byte{0xe2, 0x87, 0x8a}}, - "ddotseq": {Name: "ddotseq", CodePoints: []int{10871}, Characters: []byte{0xe2, 0xa9, 0xb7}}, - "deg": {Name: "deg", CodePoints: []int{176}, Characters: []byte{0xc2, 0xb0}}, - "delta": {Name: "delta", CodePoints: []int{948}, Characters: []byte{0xce, 0xb4}}, - "demptyv": {Name: "demptyv", CodePoints: []int{10673}, Characters: []byte{0xe2, 0xa6, 0xb1}}, - "dfisht": {Name: "dfisht", CodePoints: []int{10623}, Characters: []byte{0xe2, 0xa5, 0xbf}}, - "dfr": {Name: "dfr", CodePoints: []int{120097}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa1}}, - "dharl": {Name: "dharl", CodePoints: []int{8643}, Characters: []byte{0xe2, 0x87, 0x83}}, - "dharr": {Name: "dharr", CodePoints: []int{8642}, Characters: []byte{0xe2, 0x87, 0x82}}, - "diam": {Name: "diam", CodePoints: []int{8900}, Characters: []byte{0xe2, 0x8b, 0x84}}, - "diamond": {Name: "diamond", CodePoints: []int{8900}, Characters: []byte{0xe2, 0x8b, 0x84}}, - "diamondsuit": {Name: "diamondsuit", CodePoints: []int{9830}, Characters: []byte{0xe2, 0x99, 0xa6}}, - "diams": {Name: "diams", CodePoints: []int{9830}, Characters: []byte{0xe2, 0x99, 0xa6}}, - "die": {Name: "die", CodePoints: []int{168}, Characters: []byte{0xc2, 0xa8}}, - "digamma": {Name: "digamma", CodePoints: []int{989}, Characters: []byte{0xcf, 0x9d}}, - "disin": {Name: "disin", CodePoints: []int{8946}, Characters: []byte{0xe2, 0x8b, 0xb2}}, - "div": {Name: "div", CodePoints: []int{247}, Characters: []byte{0xc3, 0xb7}}, - "divide": {Name: "divide", CodePoints: []int{247}, Characters: []byte{0xc3, 0xb7}}, - "divideontimes": {Name: "divideontimes", CodePoints: []int{8903}, Characters: []byte{0xe2, 0x8b, 0x87}}, - "divonx": {Name: "divonx", CodePoints: []int{8903}, Characters: []byte{0xe2, 0x8b, 0x87}}, - "djcy": {Name: "djcy", CodePoints: []int{1106}, Characters: []byte{0xd1, 0x92}}, - "dlcorn": {Name: "dlcorn", CodePoints: []int{8990}, Characters: []byte{0xe2, 0x8c, 0x9e}}, - "dlcrop": {Name: "dlcrop", CodePoints: []int{8973}, Characters: []byte{0xe2, 0x8c, 0x8d}}, - "dollar": {Name: "dollar", CodePoints: []int{36}, Characters: []byte{0x24}}, - "dopf": {Name: "dopf", CodePoints: []int{120149}, Characters: []byte{0xf0, 0x9d, 0x95, 0x95}}, - "dot": {Name: "dot", CodePoints: []int{729}, Characters: []byte{0xcb, 0x99}}, - "doteq": {Name: "doteq", CodePoints: []int{8784}, Characters: []byte{0xe2, 0x89, 0x90}}, - "doteqdot": {Name: "doteqdot", CodePoints: []int{8785}, Characters: []byte{0xe2, 0x89, 0x91}}, - "dotminus": {Name: "dotminus", CodePoints: []int{8760}, Characters: []byte{0xe2, 0x88, 0xb8}}, - "dotplus": {Name: "dotplus", CodePoints: []int{8724}, Characters: []byte{0xe2, 0x88, 0x94}}, - "dotsquare": {Name: "dotsquare", CodePoints: []int{8865}, Characters: []byte{0xe2, 0x8a, 0xa1}}, - "doublebarwedge": {Name: "doublebarwedge", CodePoints: []int{8966}, Characters: []byte{0xe2, 0x8c, 0x86}}, - "downarrow": {Name: "downarrow", CodePoints: []int{8595}, Characters: []byte{0xe2, 0x86, 0x93}}, - "downdownarrows": {Name: "downdownarrows", CodePoints: []int{8650}, Characters: []byte{0xe2, 0x87, 0x8a}}, - "downharpoonleft": {Name: "downharpoonleft", CodePoints: []int{8643}, Characters: []byte{0xe2, 0x87, 0x83}}, - "downharpoonright": {Name: "downharpoonright", CodePoints: []int{8642}, Characters: []byte{0xe2, 0x87, 0x82}}, - "drbkarow": {Name: "drbkarow", CodePoints: []int{10512}, Characters: []byte{0xe2, 0xa4, 0x90}}, - "drcorn": {Name: "drcorn", CodePoints: []int{8991}, Characters: []byte{0xe2, 0x8c, 0x9f}}, - "drcrop": {Name: "drcrop", CodePoints: []int{8972}, Characters: []byte{0xe2, 0x8c, 0x8c}}, - "dscr": {Name: "dscr", CodePoints: []int{119993}, Characters: []byte{0xf0, 0x9d, 0x92, 0xb9}}, - "dscy": {Name: "dscy", CodePoints: []int{1109}, Characters: []byte{0xd1, 0x95}}, - "dsol": {Name: "dsol", CodePoints: []int{10742}, Characters: []byte{0xe2, 0xa7, 0xb6}}, - "dstrok": {Name: "dstrok", CodePoints: []int{273}, Characters: []byte{0xc4, 0x91}}, - "dtdot": {Name: "dtdot", CodePoints: []int{8945}, Characters: []byte{0xe2, 0x8b, 0xb1}}, - "dtri": {Name: "dtri", CodePoints: []int{9663}, Characters: []byte{0xe2, 0x96, 0xbf}}, - "dtrif": {Name: "dtrif", CodePoints: []int{9662}, Characters: []byte{0xe2, 0x96, 0xbe}}, - "duarr": {Name: "duarr", CodePoints: []int{8693}, Characters: []byte{0xe2, 0x87, 0xb5}}, - "duhar": {Name: "duhar", CodePoints: []int{10607}, Characters: []byte{0xe2, 0xa5, 0xaf}}, - "dwangle": {Name: "dwangle", CodePoints: []int{10662}, Characters: []byte{0xe2, 0xa6, 0xa6}}, - "dzcy": {Name: "dzcy", CodePoints: []int{1119}, Characters: []byte{0xd1, 0x9f}}, - "dzigrarr": {Name: "dzigrarr", CodePoints: []int{10239}, Characters: []byte{0xe2, 0x9f, 0xbf}}, - "eDDot": {Name: "eDDot", CodePoints: []int{10871}, Characters: []byte{0xe2, 0xa9, 0xb7}}, - "eDot": {Name: "eDot", CodePoints: []int{8785}, Characters: []byte{0xe2, 0x89, 0x91}}, - "eacute": {Name: "eacute", CodePoints: []int{233}, Characters: []byte{0xc3, 0xa9}}, - "easter": {Name: "easter", CodePoints: []int{10862}, Characters: []byte{0xe2, 0xa9, 0xae}}, - "ecaron": {Name: "ecaron", CodePoints: []int{283}, Characters: []byte{0xc4, 0x9b}}, - "ecir": {Name: "ecir", CodePoints: []int{8790}, Characters: []byte{0xe2, 0x89, 0x96}}, - "ecirc": {Name: "ecirc", CodePoints: []int{234}, Characters: []byte{0xc3, 0xaa}}, - "ecolon": {Name: "ecolon", CodePoints: []int{8789}, Characters: []byte{0xe2, 0x89, 0x95}}, - "ecy": {Name: "ecy", CodePoints: []int{1101}, Characters: []byte{0xd1, 0x8d}}, - "edot": {Name: "edot", CodePoints: []int{279}, Characters: []byte{0xc4, 0x97}}, - "ee": {Name: "ee", CodePoints: []int{8519}, Characters: []byte{0xe2, 0x85, 0x87}}, - "efDot": {Name: "efDot", CodePoints: []int{8786}, Characters: []byte{0xe2, 0x89, 0x92}}, - "efr": {Name: "efr", CodePoints: []int{120098}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa2}}, - "eg": {Name: "eg", CodePoints: []int{10906}, Characters: []byte{0xe2, 0xaa, 0x9a}}, - "egrave": {Name: "egrave", CodePoints: []int{232}, Characters: []byte{0xc3, 0xa8}}, - "egs": {Name: "egs", CodePoints: []int{10902}, Characters: []byte{0xe2, 0xaa, 0x96}}, - "egsdot": {Name: "egsdot", CodePoints: []int{10904}, Characters: []byte{0xe2, 0xaa, 0x98}}, - "el": {Name: "el", CodePoints: []int{10905}, Characters: []byte{0xe2, 0xaa, 0x99}}, - "elinters": {Name: "elinters", CodePoints: []int{9191}, Characters: []byte{0xe2, 0x8f, 0xa7}}, - "ell": {Name: "ell", CodePoints: []int{8467}, Characters: []byte{0xe2, 0x84, 0x93}}, - "els": {Name: "els", CodePoints: []int{10901}, Characters: []byte{0xe2, 0xaa, 0x95}}, - "elsdot": {Name: "elsdot", CodePoints: []int{10903}, Characters: []byte{0xe2, 0xaa, 0x97}}, - "emacr": {Name: "emacr", CodePoints: []int{275}, Characters: []byte{0xc4, 0x93}}, - "empty": {Name: "empty", CodePoints: []int{8709}, Characters: []byte{0xe2, 0x88, 0x85}}, - "emptyset": {Name: "emptyset", CodePoints: []int{8709}, Characters: []byte{0xe2, 0x88, 0x85}}, - "emptyv": {Name: "emptyv", CodePoints: []int{8709}, Characters: []byte{0xe2, 0x88, 0x85}}, - "emsp": {Name: "emsp", CodePoints: []int{8195}, Characters: []byte{0xe2, 0x80, 0x83}}, - "emsp13": {Name: "emsp13", CodePoints: []int{8196}, Characters: []byte{0xe2, 0x80, 0x84}}, - "emsp14": {Name: "emsp14", CodePoints: []int{8197}, Characters: []byte{0xe2, 0x80, 0x85}}, - "eng": {Name: "eng", CodePoints: []int{331}, Characters: []byte{0xc5, 0x8b}}, - "ensp": {Name: "ensp", CodePoints: []int{8194}, Characters: []byte{0xe2, 0x80, 0x82}}, - "eogon": {Name: "eogon", CodePoints: []int{281}, Characters: []byte{0xc4, 0x99}}, - "eopf": {Name: "eopf", CodePoints: []int{120150}, Characters: []byte{0xf0, 0x9d, 0x95, 0x96}}, - "epar": {Name: "epar", CodePoints: []int{8917}, Characters: []byte{0xe2, 0x8b, 0x95}}, - "eparsl": {Name: "eparsl", CodePoints: []int{10723}, Characters: []byte{0xe2, 0xa7, 0xa3}}, - "eplus": {Name: "eplus", CodePoints: []int{10865}, Characters: []byte{0xe2, 0xa9, 0xb1}}, - "epsi": {Name: "epsi", CodePoints: []int{949}, Characters: []byte{0xce, 0xb5}}, - "epsilon": {Name: "epsilon", CodePoints: []int{949}, Characters: []byte{0xce, 0xb5}}, - "epsiv": {Name: "epsiv", CodePoints: []int{1013}, Characters: []byte{0xcf, 0xb5}}, - "eqcirc": {Name: "eqcirc", CodePoints: []int{8790}, Characters: []byte{0xe2, 0x89, 0x96}}, - "eqcolon": {Name: "eqcolon", CodePoints: []int{8789}, Characters: []byte{0xe2, 0x89, 0x95}}, - "eqsim": {Name: "eqsim", CodePoints: []int{8770}, Characters: []byte{0xe2, 0x89, 0x82}}, - "eqslantgtr": {Name: "eqslantgtr", CodePoints: []int{10902}, Characters: []byte{0xe2, 0xaa, 0x96}}, - "eqslantless": {Name: "eqslantless", CodePoints: []int{10901}, Characters: []byte{0xe2, 0xaa, 0x95}}, - "equals": {Name: "equals", CodePoints: []int{61}, Characters: []byte{0x3d}}, - "equest": {Name: "equest", CodePoints: []int{8799}, Characters: []byte{0xe2, 0x89, 0x9f}}, - "equiv": {Name: "equiv", CodePoints: []int{8801}, Characters: []byte{0xe2, 0x89, 0xa1}}, - "equivDD": {Name: "equivDD", CodePoints: []int{10872}, Characters: []byte{0xe2, 0xa9, 0xb8}}, - "eqvparsl": {Name: "eqvparsl", CodePoints: []int{10725}, Characters: []byte{0xe2, 0xa7, 0xa5}}, - "erDot": {Name: "erDot", CodePoints: []int{8787}, Characters: []byte{0xe2, 0x89, 0x93}}, - "erarr": {Name: "erarr", CodePoints: []int{10609}, Characters: []byte{0xe2, 0xa5, 0xb1}}, - "escr": {Name: "escr", CodePoints: []int{8495}, Characters: []byte{0xe2, 0x84, 0xaf}}, - "esdot": {Name: "esdot", CodePoints: []int{8784}, Characters: []byte{0xe2, 0x89, 0x90}}, - "esim": {Name: "esim", CodePoints: []int{8770}, Characters: []byte{0xe2, 0x89, 0x82}}, - "eta": {Name: "eta", CodePoints: []int{951}, Characters: []byte{0xce, 0xb7}}, - "eth": {Name: "eth", CodePoints: []int{240}, Characters: []byte{0xc3, 0xb0}}, - "euml": {Name: "euml", CodePoints: []int{235}, Characters: []byte{0xc3, 0xab}}, - "euro": {Name: "euro", CodePoints: []int{8364}, Characters: []byte{0xe2, 0x82, 0xac}}, - "excl": {Name: "excl", CodePoints: []int{33}, Characters: []byte{0x21}}, - "exist": {Name: "exist", CodePoints: []int{8707}, Characters: []byte{0xe2, 0x88, 0x83}}, - "expectation": {Name: "expectation", CodePoints: []int{8496}, Characters: []byte{0xe2, 0x84, 0xb0}}, - "exponentiale": {Name: "exponentiale", CodePoints: []int{8519}, Characters: []byte{0xe2, 0x85, 0x87}}, - "fallingdotseq": {Name: "fallingdotseq", CodePoints: []int{8786}, Characters: []byte{0xe2, 0x89, 0x92}}, - "fcy": {Name: "fcy", CodePoints: []int{1092}, Characters: []byte{0xd1, 0x84}}, - "female": {Name: "female", CodePoints: []int{9792}, Characters: []byte{0xe2, 0x99, 0x80}}, - "ffilig": {Name: "ffilig", CodePoints: []int{64259}, Characters: []byte{0xef, 0xac, 0x83}}, - "fflig": {Name: "fflig", CodePoints: []int{64256}, Characters: []byte{0xef, 0xac, 0x80}}, - "ffllig": {Name: "ffllig", CodePoints: []int{64260}, Characters: []byte{0xef, 0xac, 0x84}}, - "ffr": {Name: "ffr", CodePoints: []int{120099}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa3}}, - "filig": {Name: "filig", CodePoints: []int{64257}, Characters: []byte{0xef, 0xac, 0x81}}, - "fjlig": {Name: "fjlig", CodePoints: []int{102, 106}, Characters: []byte{0x66, 0x6a}}, - "flat": {Name: "flat", CodePoints: []int{9837}, Characters: []byte{0xe2, 0x99, 0xad}}, - "fllig": {Name: "fllig", CodePoints: []int{64258}, Characters: []byte{0xef, 0xac, 0x82}}, - "fltns": {Name: "fltns", CodePoints: []int{9649}, Characters: []byte{0xe2, 0x96, 0xb1}}, - "fnof": {Name: "fnof", CodePoints: []int{402}, Characters: []byte{0xc6, 0x92}}, - "fopf": {Name: "fopf", CodePoints: []int{120151}, Characters: []byte{0xf0, 0x9d, 0x95, 0x97}}, - "forall": {Name: "forall", CodePoints: []int{8704}, Characters: []byte{0xe2, 0x88, 0x80}}, - "fork": {Name: "fork", CodePoints: []int{8916}, Characters: []byte{0xe2, 0x8b, 0x94}}, - "forkv": {Name: "forkv", CodePoints: []int{10969}, Characters: []byte{0xe2, 0xab, 0x99}}, - "fpartint": {Name: "fpartint", CodePoints: []int{10765}, Characters: []byte{0xe2, 0xa8, 0x8d}}, - "frac12": {Name: "frac12", CodePoints: []int{189}, Characters: []byte{0xc2, 0xbd}}, - "frac13": {Name: "frac13", CodePoints: []int{8531}, Characters: []byte{0xe2, 0x85, 0x93}}, - "frac14": {Name: "frac14", CodePoints: []int{188}, Characters: []byte{0xc2, 0xbc}}, - "frac15": {Name: "frac15", CodePoints: []int{8533}, Characters: []byte{0xe2, 0x85, 0x95}}, - "frac16": {Name: "frac16", CodePoints: []int{8537}, Characters: []byte{0xe2, 0x85, 0x99}}, - "frac18": {Name: "frac18", CodePoints: []int{8539}, Characters: []byte{0xe2, 0x85, 0x9b}}, - "frac23": {Name: "frac23", CodePoints: []int{8532}, Characters: []byte{0xe2, 0x85, 0x94}}, - "frac25": {Name: "frac25", CodePoints: []int{8534}, Characters: []byte{0xe2, 0x85, 0x96}}, - "frac34": {Name: "frac34", CodePoints: []int{190}, Characters: []byte{0xc2, 0xbe}}, - "frac35": {Name: "frac35", CodePoints: []int{8535}, Characters: []byte{0xe2, 0x85, 0x97}}, - "frac38": {Name: "frac38", CodePoints: []int{8540}, Characters: []byte{0xe2, 0x85, 0x9c}}, - "frac45": {Name: "frac45", CodePoints: []int{8536}, Characters: []byte{0xe2, 0x85, 0x98}}, - "frac56": {Name: "frac56", CodePoints: []int{8538}, Characters: []byte{0xe2, 0x85, 0x9a}}, - "frac58": {Name: "frac58", CodePoints: []int{8541}, Characters: []byte{0xe2, 0x85, 0x9d}}, - "frac78": {Name: "frac78", CodePoints: []int{8542}, Characters: []byte{0xe2, 0x85, 0x9e}}, - "frasl": {Name: "frasl", CodePoints: []int{8260}, Characters: []byte{0xe2, 0x81, 0x84}}, - "frown": {Name: "frown", CodePoints: []int{8994}, Characters: []byte{0xe2, 0x8c, 0xa2}}, - "fscr": {Name: "fscr", CodePoints: []int{119995}, Characters: []byte{0xf0, 0x9d, 0x92, 0xbb}}, - "gE": {Name: "gE", CodePoints: []int{8807}, Characters: []byte{0xe2, 0x89, 0xa7}}, - "gEl": {Name: "gEl", CodePoints: []int{10892}, Characters: []byte{0xe2, 0xaa, 0x8c}}, - "gacute": {Name: "gacute", CodePoints: []int{501}, Characters: []byte{0xc7, 0xb5}}, - "gamma": {Name: "gamma", CodePoints: []int{947}, Characters: []byte{0xce, 0xb3}}, - "gammad": {Name: "gammad", CodePoints: []int{989}, Characters: []byte{0xcf, 0x9d}}, - "gap": {Name: "gap", CodePoints: []int{10886}, Characters: []byte{0xe2, 0xaa, 0x86}}, - "gbreve": {Name: "gbreve", CodePoints: []int{287}, Characters: []byte{0xc4, 0x9f}}, - "gcirc": {Name: "gcirc", CodePoints: []int{285}, Characters: []byte{0xc4, 0x9d}}, - "gcy": {Name: "gcy", CodePoints: []int{1075}, Characters: []byte{0xd0, 0xb3}}, - "gdot": {Name: "gdot", CodePoints: []int{289}, Characters: []byte{0xc4, 0xa1}}, - "ge": {Name: "ge", CodePoints: []int{8805}, Characters: []byte{0xe2, 0x89, 0xa5}}, - "gel": {Name: "gel", CodePoints: []int{8923}, Characters: []byte{0xe2, 0x8b, 0x9b}}, - "geq": {Name: "geq", CodePoints: []int{8805}, Characters: []byte{0xe2, 0x89, 0xa5}}, - "geqq": {Name: "geqq", CodePoints: []int{8807}, Characters: []byte{0xe2, 0x89, 0xa7}}, - "geqslant": {Name: "geqslant", CodePoints: []int{10878}, Characters: []byte{0xe2, 0xa9, 0xbe}}, - "ges": {Name: "ges", CodePoints: []int{10878}, Characters: []byte{0xe2, 0xa9, 0xbe}}, - "gescc": {Name: "gescc", CodePoints: []int{10921}, Characters: []byte{0xe2, 0xaa, 0xa9}}, - "gesdot": {Name: "gesdot", CodePoints: []int{10880}, Characters: []byte{0xe2, 0xaa, 0x80}}, - "gesdoto": {Name: "gesdoto", CodePoints: []int{10882}, Characters: []byte{0xe2, 0xaa, 0x82}}, - "gesdotol": {Name: "gesdotol", CodePoints: []int{10884}, Characters: []byte{0xe2, 0xaa, 0x84}}, - "gesl": {Name: "gesl", CodePoints: []int{8923, 65024}, Characters: []byte{0xe2, 0x8b, 0x9b, 0xef, 0xb8, 0x80}}, - "gesles": {Name: "gesles", CodePoints: []int{10900}, Characters: []byte{0xe2, 0xaa, 0x94}}, - "gfr": {Name: "gfr", CodePoints: []int{120100}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa4}}, - "gg": {Name: "gg", CodePoints: []int{8811}, Characters: []byte{0xe2, 0x89, 0xab}}, - "ggg": {Name: "ggg", CodePoints: []int{8921}, Characters: []byte{0xe2, 0x8b, 0x99}}, - "gimel": {Name: "gimel", CodePoints: []int{8503}, Characters: []byte{0xe2, 0x84, 0xb7}}, - "gjcy": {Name: "gjcy", CodePoints: []int{1107}, Characters: []byte{0xd1, 0x93}}, - "gl": {Name: "gl", CodePoints: []int{8823}, Characters: []byte{0xe2, 0x89, 0xb7}}, - "glE": {Name: "glE", CodePoints: []int{10898}, Characters: []byte{0xe2, 0xaa, 0x92}}, - "gla": {Name: "gla", CodePoints: []int{10917}, Characters: []byte{0xe2, 0xaa, 0xa5}}, - "glj": {Name: "glj", CodePoints: []int{10916}, Characters: []byte{0xe2, 0xaa, 0xa4}}, - "gnE": {Name: "gnE", CodePoints: []int{8809}, Characters: []byte{0xe2, 0x89, 0xa9}}, - "gnap": {Name: "gnap", CodePoints: []int{10890}, Characters: []byte{0xe2, 0xaa, 0x8a}}, - "gnapprox": {Name: "gnapprox", CodePoints: []int{10890}, Characters: []byte{0xe2, 0xaa, 0x8a}}, - "gne": {Name: "gne", CodePoints: []int{10888}, Characters: []byte{0xe2, 0xaa, 0x88}}, - "gneq": {Name: "gneq", CodePoints: []int{10888}, Characters: []byte{0xe2, 0xaa, 0x88}}, - "gneqq": {Name: "gneqq", CodePoints: []int{8809}, Characters: []byte{0xe2, 0x89, 0xa9}}, - "gnsim": {Name: "gnsim", CodePoints: []int{8935}, Characters: []byte{0xe2, 0x8b, 0xa7}}, - "gopf": {Name: "gopf", CodePoints: []int{120152}, Characters: []byte{0xf0, 0x9d, 0x95, 0x98}}, - "grave": {Name: "grave", CodePoints: []int{96}, Characters: []byte{0x60}}, - "gscr": {Name: "gscr", CodePoints: []int{8458}, Characters: []byte{0xe2, 0x84, 0x8a}}, - "gsim": {Name: "gsim", CodePoints: []int{8819}, Characters: []byte{0xe2, 0x89, 0xb3}}, - "gsime": {Name: "gsime", CodePoints: []int{10894}, Characters: []byte{0xe2, 0xaa, 0x8e}}, - "gsiml": {Name: "gsiml", CodePoints: []int{10896}, Characters: []byte{0xe2, 0xaa, 0x90}}, - "gt": {Name: "gt", CodePoints: []int{62}, Characters: []byte{0x3e}}, - "gtcc": {Name: "gtcc", CodePoints: []int{10919}, Characters: []byte{0xe2, 0xaa, 0xa7}}, - "gtcir": {Name: "gtcir", CodePoints: []int{10874}, Characters: []byte{0xe2, 0xa9, 0xba}}, - "gtdot": {Name: "gtdot", CodePoints: []int{8919}, Characters: []byte{0xe2, 0x8b, 0x97}}, - "gtlPar": {Name: "gtlPar", CodePoints: []int{10645}, Characters: []byte{0xe2, 0xa6, 0x95}}, - "gtquest": {Name: "gtquest", CodePoints: []int{10876}, Characters: []byte{0xe2, 0xa9, 0xbc}}, - "gtrapprox": {Name: "gtrapprox", CodePoints: []int{10886}, Characters: []byte{0xe2, 0xaa, 0x86}}, - "gtrarr": {Name: "gtrarr", CodePoints: []int{10616}, Characters: []byte{0xe2, 0xa5, 0xb8}}, - "gtrdot": {Name: "gtrdot", CodePoints: []int{8919}, Characters: []byte{0xe2, 0x8b, 0x97}}, - "gtreqless": {Name: "gtreqless", CodePoints: []int{8923}, Characters: []byte{0xe2, 0x8b, 0x9b}}, - "gtreqqless": {Name: "gtreqqless", CodePoints: []int{10892}, Characters: []byte{0xe2, 0xaa, 0x8c}}, - "gtrless": {Name: "gtrless", CodePoints: []int{8823}, Characters: []byte{0xe2, 0x89, 0xb7}}, - "gtrsim": {Name: "gtrsim", CodePoints: []int{8819}, Characters: []byte{0xe2, 0x89, 0xb3}}, - "gvertneqq": {Name: "gvertneqq", CodePoints: []int{8809, 65024}, Characters: []byte{0xe2, 0x89, 0xa9, 0xef, 0xb8, 0x80}}, - "gvnE": {Name: "gvnE", CodePoints: []int{8809, 65024}, Characters: []byte{0xe2, 0x89, 0xa9, 0xef, 0xb8, 0x80}}, - "hArr": {Name: "hArr", CodePoints: []int{8660}, Characters: []byte{0xe2, 0x87, 0x94}}, - "hairsp": {Name: "hairsp", CodePoints: []int{8202}, Characters: []byte{0xe2, 0x80, 0x8a}}, - "half": {Name: "half", CodePoints: []int{189}, Characters: []byte{0xc2, 0xbd}}, - "hamilt": {Name: "hamilt", CodePoints: []int{8459}, Characters: []byte{0xe2, 0x84, 0x8b}}, - "hardcy": {Name: "hardcy", CodePoints: []int{1098}, Characters: []byte{0xd1, 0x8a}}, - "harr": {Name: "harr", CodePoints: []int{8596}, Characters: []byte{0xe2, 0x86, 0x94}}, - "harrcir": {Name: "harrcir", CodePoints: []int{10568}, Characters: []byte{0xe2, 0xa5, 0x88}}, - "harrw": {Name: "harrw", CodePoints: []int{8621}, Characters: []byte{0xe2, 0x86, 0xad}}, - "hbar": {Name: "hbar", CodePoints: []int{8463}, Characters: []byte{0xe2, 0x84, 0x8f}}, - "hcirc": {Name: "hcirc", CodePoints: []int{293}, Characters: []byte{0xc4, 0xa5}}, - "hearts": {Name: "hearts", CodePoints: []int{9829}, Characters: []byte{0xe2, 0x99, 0xa5}}, - "heartsuit": {Name: "heartsuit", CodePoints: []int{9829}, Characters: []byte{0xe2, 0x99, 0xa5}}, - "hellip": {Name: "hellip", CodePoints: []int{8230}, Characters: []byte{0xe2, 0x80, 0xa6}}, - "hercon": {Name: "hercon", CodePoints: []int{8889}, Characters: []byte{0xe2, 0x8a, 0xb9}}, - "hfr": {Name: "hfr", CodePoints: []int{120101}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa5}}, - "hksearow": {Name: "hksearow", CodePoints: []int{10533}, Characters: []byte{0xe2, 0xa4, 0xa5}}, - "hkswarow": {Name: "hkswarow", CodePoints: []int{10534}, Characters: []byte{0xe2, 0xa4, 0xa6}}, - "hoarr": {Name: "hoarr", CodePoints: []int{8703}, Characters: []byte{0xe2, 0x87, 0xbf}}, - "homtht": {Name: "homtht", CodePoints: []int{8763}, Characters: []byte{0xe2, 0x88, 0xbb}}, - "hookleftarrow": {Name: "hookleftarrow", CodePoints: []int{8617}, Characters: []byte{0xe2, 0x86, 0xa9}}, - "hookrightarrow": {Name: "hookrightarrow", CodePoints: []int{8618}, Characters: []byte{0xe2, 0x86, 0xaa}}, - "hopf": {Name: "hopf", CodePoints: []int{120153}, Characters: []byte{0xf0, 0x9d, 0x95, 0x99}}, - "horbar": {Name: "horbar", CodePoints: []int{8213}, Characters: []byte{0xe2, 0x80, 0x95}}, - "hscr": {Name: "hscr", CodePoints: []int{119997}, Characters: []byte{0xf0, 0x9d, 0x92, 0xbd}}, - "hslash": {Name: "hslash", CodePoints: []int{8463}, Characters: []byte{0xe2, 0x84, 0x8f}}, - "hstrok": {Name: "hstrok", CodePoints: []int{295}, Characters: []byte{0xc4, 0xa7}}, - "hybull": {Name: "hybull", CodePoints: []int{8259}, Characters: []byte{0xe2, 0x81, 0x83}}, - "hyphen": {Name: "hyphen", CodePoints: []int{8208}, Characters: []byte{0xe2, 0x80, 0x90}}, - "iacute": {Name: "iacute", CodePoints: []int{237}, Characters: []byte{0xc3, 0xad}}, - "ic": {Name: "ic", CodePoints: []int{8291}, Characters: []byte{0xe2, 0x81, 0xa3}}, - "icirc": {Name: "icirc", CodePoints: []int{238}, Characters: []byte{0xc3, 0xae}}, - "icy": {Name: "icy", CodePoints: []int{1080}, Characters: []byte{0xd0, 0xb8}}, - "iecy": {Name: "iecy", CodePoints: []int{1077}, Characters: []byte{0xd0, 0xb5}}, - "iexcl": {Name: "iexcl", CodePoints: []int{161}, Characters: []byte{0xc2, 0xa1}}, - "iff": {Name: "iff", CodePoints: []int{8660}, Characters: []byte{0xe2, 0x87, 0x94}}, - "ifr": {Name: "ifr", CodePoints: []int{120102}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa6}}, - "igrave": {Name: "igrave", CodePoints: []int{236}, Characters: []byte{0xc3, 0xac}}, - "ii": {Name: "ii", CodePoints: []int{8520}, Characters: []byte{0xe2, 0x85, 0x88}}, - "iiiint": {Name: "iiiint", CodePoints: []int{10764}, Characters: []byte{0xe2, 0xa8, 0x8c}}, - "iiint": {Name: "iiint", CodePoints: []int{8749}, Characters: []byte{0xe2, 0x88, 0xad}}, - "iinfin": {Name: "iinfin", CodePoints: []int{10716}, Characters: []byte{0xe2, 0xa7, 0x9c}}, - "iiota": {Name: "iiota", CodePoints: []int{8489}, Characters: []byte{0xe2, 0x84, 0xa9}}, - "ijlig": {Name: "ijlig", CodePoints: []int{307}, Characters: []byte{0xc4, 0xb3}}, - "imacr": {Name: "imacr", CodePoints: []int{299}, Characters: []byte{0xc4, 0xab}}, - "image": {Name: "image", CodePoints: []int{8465}, Characters: []byte{0xe2, 0x84, 0x91}}, - "imagline": {Name: "imagline", CodePoints: []int{8464}, Characters: []byte{0xe2, 0x84, 0x90}}, - "imagpart": {Name: "imagpart", CodePoints: []int{8465}, Characters: []byte{0xe2, 0x84, 0x91}}, - "imath": {Name: "imath", CodePoints: []int{305}, Characters: []byte{0xc4, 0xb1}}, - "imof": {Name: "imof", CodePoints: []int{8887}, Characters: []byte{0xe2, 0x8a, 0xb7}}, - "imped": {Name: "imped", CodePoints: []int{437}, Characters: []byte{0xc6, 0xb5}}, - "in": {Name: "in", CodePoints: []int{8712}, Characters: []byte{0xe2, 0x88, 0x88}}, - "incare": {Name: "incare", CodePoints: []int{8453}, Characters: []byte{0xe2, 0x84, 0x85}}, - "infin": {Name: "infin", CodePoints: []int{8734}, Characters: []byte{0xe2, 0x88, 0x9e}}, - "infintie": {Name: "infintie", CodePoints: []int{10717}, Characters: []byte{0xe2, 0xa7, 0x9d}}, - "inodot": {Name: "inodot", CodePoints: []int{305}, Characters: []byte{0xc4, 0xb1}}, - "int": {Name: "int", CodePoints: []int{8747}, Characters: []byte{0xe2, 0x88, 0xab}}, - "intcal": {Name: "intcal", CodePoints: []int{8890}, Characters: []byte{0xe2, 0x8a, 0xba}}, - "integers": {Name: "integers", CodePoints: []int{8484}, Characters: []byte{0xe2, 0x84, 0xa4}}, - "intercal": {Name: "intercal", CodePoints: []int{8890}, Characters: []byte{0xe2, 0x8a, 0xba}}, - "intlarhk": {Name: "intlarhk", CodePoints: []int{10775}, Characters: []byte{0xe2, 0xa8, 0x97}}, - "intprod": {Name: "intprod", CodePoints: []int{10812}, Characters: []byte{0xe2, 0xa8, 0xbc}}, - "iocy": {Name: "iocy", CodePoints: []int{1105}, Characters: []byte{0xd1, 0x91}}, - "iogon": {Name: "iogon", CodePoints: []int{303}, Characters: []byte{0xc4, 0xaf}}, - "iopf": {Name: "iopf", CodePoints: []int{120154}, Characters: []byte{0xf0, 0x9d, 0x95, 0x9a}}, - "iota": {Name: "iota", CodePoints: []int{953}, Characters: []byte{0xce, 0xb9}}, - "iprod": {Name: "iprod", CodePoints: []int{10812}, Characters: []byte{0xe2, 0xa8, 0xbc}}, - "iquest": {Name: "iquest", CodePoints: []int{191}, Characters: []byte{0xc2, 0xbf}}, - "iscr": {Name: "iscr", CodePoints: []int{119998}, Characters: []byte{0xf0, 0x9d, 0x92, 0xbe}}, - "isin": {Name: "isin", CodePoints: []int{8712}, Characters: []byte{0xe2, 0x88, 0x88}}, - "isinE": {Name: "isinE", CodePoints: []int{8953}, Characters: []byte{0xe2, 0x8b, 0xb9}}, - "isindot": {Name: "isindot", CodePoints: []int{8949}, Characters: []byte{0xe2, 0x8b, 0xb5}}, - "isins": {Name: "isins", CodePoints: []int{8948}, Characters: []byte{0xe2, 0x8b, 0xb4}}, - "isinsv": {Name: "isinsv", CodePoints: []int{8947}, Characters: []byte{0xe2, 0x8b, 0xb3}}, - "isinv": {Name: "isinv", CodePoints: []int{8712}, Characters: []byte{0xe2, 0x88, 0x88}}, - "it": {Name: "it", CodePoints: []int{8290}, Characters: []byte{0xe2, 0x81, 0xa2}}, - "itilde": {Name: "itilde", CodePoints: []int{297}, Characters: []byte{0xc4, 0xa9}}, - "iukcy": {Name: "iukcy", CodePoints: []int{1110}, Characters: []byte{0xd1, 0x96}}, - "iuml": {Name: "iuml", CodePoints: []int{239}, Characters: []byte{0xc3, 0xaf}}, - "jcirc": {Name: "jcirc", CodePoints: []int{309}, Characters: []byte{0xc4, 0xb5}}, - "jcy": {Name: "jcy", CodePoints: []int{1081}, Characters: []byte{0xd0, 0xb9}}, - "jfr": {Name: "jfr", CodePoints: []int{120103}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa7}}, - "jmath": {Name: "jmath", CodePoints: []int{567}, Characters: []byte{0xc8, 0xb7}}, - "jopf": {Name: "jopf", CodePoints: []int{120155}, Characters: []byte{0xf0, 0x9d, 0x95, 0x9b}}, - "jscr": {Name: "jscr", CodePoints: []int{119999}, Characters: []byte{0xf0, 0x9d, 0x92, 0xbf}}, - "jsercy": {Name: "jsercy", CodePoints: []int{1112}, Characters: []byte{0xd1, 0x98}}, - "jukcy": {Name: "jukcy", CodePoints: []int{1108}, Characters: []byte{0xd1, 0x94}}, - "kappa": {Name: "kappa", CodePoints: []int{954}, Characters: []byte{0xce, 0xba}}, - "kappav": {Name: "kappav", CodePoints: []int{1008}, Characters: []byte{0xcf, 0xb0}}, - "kcedil": {Name: "kcedil", CodePoints: []int{311}, Characters: []byte{0xc4, 0xb7}}, - "kcy": {Name: "kcy", CodePoints: []int{1082}, Characters: []byte{0xd0, 0xba}}, - "kfr": {Name: "kfr", CodePoints: []int{120104}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa8}}, - "kgreen": {Name: "kgreen", CodePoints: []int{312}, Characters: []byte{0xc4, 0xb8}}, - "khcy": {Name: "khcy", CodePoints: []int{1093}, Characters: []byte{0xd1, 0x85}}, - "kjcy": {Name: "kjcy", CodePoints: []int{1116}, Characters: []byte{0xd1, 0x9c}}, - "kopf": {Name: "kopf", CodePoints: []int{120156}, Characters: []byte{0xf0, 0x9d, 0x95, 0x9c}}, - "kscr": {Name: "kscr", CodePoints: []int{120000}, Characters: []byte{0xf0, 0x9d, 0x93, 0x80}}, - "lAarr": {Name: "lAarr", CodePoints: []int{8666}, Characters: []byte{0xe2, 0x87, 0x9a}}, - "lArr": {Name: "lArr", CodePoints: []int{8656}, Characters: []byte{0xe2, 0x87, 0x90}}, - "lAtail": {Name: "lAtail", CodePoints: []int{10523}, Characters: []byte{0xe2, 0xa4, 0x9b}}, - "lBarr": {Name: "lBarr", CodePoints: []int{10510}, Characters: []byte{0xe2, 0xa4, 0x8e}}, - "lE": {Name: "lE", CodePoints: []int{8806}, Characters: []byte{0xe2, 0x89, 0xa6}}, - "lEg": {Name: "lEg", CodePoints: []int{10891}, Characters: []byte{0xe2, 0xaa, 0x8b}}, - "lHar": {Name: "lHar", CodePoints: []int{10594}, Characters: []byte{0xe2, 0xa5, 0xa2}}, - "lacute": {Name: "lacute", CodePoints: []int{314}, Characters: []byte{0xc4, 0xba}}, - "laemptyv": {Name: "laemptyv", CodePoints: []int{10676}, Characters: []byte{0xe2, 0xa6, 0xb4}}, - "lagran": {Name: "lagran", CodePoints: []int{8466}, Characters: []byte{0xe2, 0x84, 0x92}}, - "lambda": {Name: "lambda", CodePoints: []int{955}, Characters: []byte{0xce, 0xbb}}, - "lang": {Name: "lang", CodePoints: []int{10216}, Characters: []byte{0xe2, 0x9f, 0xa8}}, - "langd": {Name: "langd", CodePoints: []int{10641}, Characters: []byte{0xe2, 0xa6, 0x91}}, - "langle": {Name: "langle", CodePoints: []int{10216}, Characters: []byte{0xe2, 0x9f, 0xa8}}, - "lap": {Name: "lap", CodePoints: []int{10885}, Characters: []byte{0xe2, 0xaa, 0x85}}, - "laquo": {Name: "laquo", CodePoints: []int{171}, Characters: []byte{0xc2, 0xab}}, - "larr": {Name: "larr", CodePoints: []int{8592}, Characters: []byte{0xe2, 0x86, 0x90}}, - "larrb": {Name: "larrb", CodePoints: []int{8676}, Characters: []byte{0xe2, 0x87, 0xa4}}, - "larrbfs": {Name: "larrbfs", CodePoints: []int{10527}, Characters: []byte{0xe2, 0xa4, 0x9f}}, - "larrfs": {Name: "larrfs", CodePoints: []int{10525}, Characters: []byte{0xe2, 0xa4, 0x9d}}, - "larrhk": {Name: "larrhk", CodePoints: []int{8617}, Characters: []byte{0xe2, 0x86, 0xa9}}, - "larrlp": {Name: "larrlp", CodePoints: []int{8619}, Characters: []byte{0xe2, 0x86, 0xab}}, - "larrpl": {Name: "larrpl", CodePoints: []int{10553}, Characters: []byte{0xe2, 0xa4, 0xb9}}, - "larrsim": {Name: "larrsim", CodePoints: []int{10611}, Characters: []byte{0xe2, 0xa5, 0xb3}}, - "larrtl": {Name: "larrtl", CodePoints: []int{8610}, Characters: []byte{0xe2, 0x86, 0xa2}}, - "lat": {Name: "lat", CodePoints: []int{10923}, Characters: []byte{0xe2, 0xaa, 0xab}}, - "latail": {Name: "latail", CodePoints: []int{10521}, Characters: []byte{0xe2, 0xa4, 0x99}}, - "late": {Name: "late", CodePoints: []int{10925}, Characters: []byte{0xe2, 0xaa, 0xad}}, - "lates": {Name: "lates", CodePoints: []int{10925, 65024}, Characters: []byte{0xe2, 0xaa, 0xad, 0xef, 0xb8, 0x80}}, - "lbarr": {Name: "lbarr", CodePoints: []int{10508}, Characters: []byte{0xe2, 0xa4, 0x8c}}, - "lbbrk": {Name: "lbbrk", CodePoints: []int{10098}, Characters: []byte{0xe2, 0x9d, 0xb2}}, - "lbrace": {Name: "lbrace", CodePoints: []int{123}, Characters: []byte{0x7b}}, - "lbrack": {Name: "lbrack", CodePoints: []int{91}, Characters: []byte{0x5b}}, - "lbrke": {Name: "lbrke", CodePoints: []int{10635}, Characters: []byte{0xe2, 0xa6, 0x8b}}, - "lbrksld": {Name: "lbrksld", CodePoints: []int{10639}, Characters: []byte{0xe2, 0xa6, 0x8f}}, - "lbrkslu": {Name: "lbrkslu", CodePoints: []int{10637}, Characters: []byte{0xe2, 0xa6, 0x8d}}, - "lcaron": {Name: "lcaron", CodePoints: []int{318}, Characters: []byte{0xc4, 0xbe}}, - "lcedil": {Name: "lcedil", CodePoints: []int{316}, Characters: []byte{0xc4, 0xbc}}, - "lceil": {Name: "lceil", CodePoints: []int{8968}, Characters: []byte{0xe2, 0x8c, 0x88}}, - "lcub": {Name: "lcub", CodePoints: []int{123}, Characters: []byte{0x7b}}, - "lcy": {Name: "lcy", CodePoints: []int{1083}, Characters: []byte{0xd0, 0xbb}}, - "ldca": {Name: "ldca", CodePoints: []int{10550}, Characters: []byte{0xe2, 0xa4, 0xb6}}, - "ldquo": {Name: "ldquo", CodePoints: []int{8220}, Characters: []byte{0xe2, 0x80, 0x9c}}, - "ldquor": {Name: "ldquor", CodePoints: []int{8222}, Characters: []byte{0xe2, 0x80, 0x9e}}, - "ldrdhar": {Name: "ldrdhar", CodePoints: []int{10599}, Characters: []byte{0xe2, 0xa5, 0xa7}}, - "ldrushar": {Name: "ldrushar", CodePoints: []int{10571}, Characters: []byte{0xe2, 0xa5, 0x8b}}, - "ldsh": {Name: "ldsh", CodePoints: []int{8626}, Characters: []byte{0xe2, 0x86, 0xb2}}, - "le": {Name: "le", CodePoints: []int{8804}, Characters: []byte{0xe2, 0x89, 0xa4}}, - "leftarrow": {Name: "leftarrow", CodePoints: []int{8592}, Characters: []byte{0xe2, 0x86, 0x90}}, - "leftarrowtail": {Name: "leftarrowtail", CodePoints: []int{8610}, Characters: []byte{0xe2, 0x86, 0xa2}}, - "leftharpoondown": {Name: "leftharpoondown", CodePoints: []int{8637}, Characters: []byte{0xe2, 0x86, 0xbd}}, - "leftharpoonup": {Name: "leftharpoonup", CodePoints: []int{8636}, Characters: []byte{0xe2, 0x86, 0xbc}}, - "leftleftarrows": {Name: "leftleftarrows", CodePoints: []int{8647}, Characters: []byte{0xe2, 0x87, 0x87}}, - "leftrightarrow": {Name: "leftrightarrow", CodePoints: []int{8596}, Characters: []byte{0xe2, 0x86, 0x94}}, - "leftrightarrows": {Name: "leftrightarrows", CodePoints: []int{8646}, Characters: []byte{0xe2, 0x87, 0x86}}, - "leftrightharpoons": {Name: "leftrightharpoons", CodePoints: []int{8651}, Characters: []byte{0xe2, 0x87, 0x8b}}, - "leftrightsquigarrow": {Name: "leftrightsquigarrow", CodePoints: []int{8621}, Characters: []byte{0xe2, 0x86, 0xad}}, - "leftthreetimes": {Name: "leftthreetimes", CodePoints: []int{8907}, Characters: []byte{0xe2, 0x8b, 0x8b}}, - "leg": {Name: "leg", CodePoints: []int{8922}, Characters: []byte{0xe2, 0x8b, 0x9a}}, - "leq": {Name: "leq", CodePoints: []int{8804}, Characters: []byte{0xe2, 0x89, 0xa4}}, - "leqq": {Name: "leqq", CodePoints: []int{8806}, Characters: []byte{0xe2, 0x89, 0xa6}}, - "leqslant": {Name: "leqslant", CodePoints: []int{10877}, Characters: []byte{0xe2, 0xa9, 0xbd}}, - "les": {Name: "les", CodePoints: []int{10877}, Characters: []byte{0xe2, 0xa9, 0xbd}}, - "lescc": {Name: "lescc", CodePoints: []int{10920}, Characters: []byte{0xe2, 0xaa, 0xa8}}, - "lesdot": {Name: "lesdot", CodePoints: []int{10879}, Characters: []byte{0xe2, 0xa9, 0xbf}}, - "lesdoto": {Name: "lesdoto", CodePoints: []int{10881}, Characters: []byte{0xe2, 0xaa, 0x81}}, - "lesdotor": {Name: "lesdotor", CodePoints: []int{10883}, Characters: []byte{0xe2, 0xaa, 0x83}}, - "lesg": {Name: "lesg", CodePoints: []int{8922, 65024}, Characters: []byte{0xe2, 0x8b, 0x9a, 0xef, 0xb8, 0x80}}, - "lesges": {Name: "lesges", CodePoints: []int{10899}, Characters: []byte{0xe2, 0xaa, 0x93}}, - "lessapprox": {Name: "lessapprox", CodePoints: []int{10885}, Characters: []byte{0xe2, 0xaa, 0x85}}, - "lessdot": {Name: "lessdot", CodePoints: []int{8918}, Characters: []byte{0xe2, 0x8b, 0x96}}, - "lesseqgtr": {Name: "lesseqgtr", CodePoints: []int{8922}, Characters: []byte{0xe2, 0x8b, 0x9a}}, - "lesseqqgtr": {Name: "lesseqqgtr", CodePoints: []int{10891}, Characters: []byte{0xe2, 0xaa, 0x8b}}, - "lessgtr": {Name: "lessgtr", CodePoints: []int{8822}, Characters: []byte{0xe2, 0x89, 0xb6}}, - "lesssim": {Name: "lesssim", CodePoints: []int{8818}, Characters: []byte{0xe2, 0x89, 0xb2}}, - "lfisht": {Name: "lfisht", CodePoints: []int{10620}, Characters: []byte{0xe2, 0xa5, 0xbc}}, - "lfloor": {Name: "lfloor", CodePoints: []int{8970}, Characters: []byte{0xe2, 0x8c, 0x8a}}, - "lfr": {Name: "lfr", CodePoints: []int{120105}, Characters: []byte{0xf0, 0x9d, 0x94, 0xa9}}, - "lg": {Name: "lg", CodePoints: []int{8822}, Characters: []byte{0xe2, 0x89, 0xb6}}, - "lgE": {Name: "lgE", CodePoints: []int{10897}, Characters: []byte{0xe2, 0xaa, 0x91}}, - "lhard": {Name: "lhard", CodePoints: []int{8637}, Characters: []byte{0xe2, 0x86, 0xbd}}, - "lharu": {Name: "lharu", CodePoints: []int{8636}, Characters: []byte{0xe2, 0x86, 0xbc}}, - "lharul": {Name: "lharul", CodePoints: []int{10602}, Characters: []byte{0xe2, 0xa5, 0xaa}}, - "lhblk": {Name: "lhblk", CodePoints: []int{9604}, Characters: []byte{0xe2, 0x96, 0x84}}, - "ljcy": {Name: "ljcy", CodePoints: []int{1113}, Characters: []byte{0xd1, 0x99}}, - "ll": {Name: "ll", CodePoints: []int{8810}, Characters: []byte{0xe2, 0x89, 0xaa}}, - "llarr": {Name: "llarr", CodePoints: []int{8647}, Characters: []byte{0xe2, 0x87, 0x87}}, - "llcorner": {Name: "llcorner", CodePoints: []int{8990}, Characters: []byte{0xe2, 0x8c, 0x9e}}, - "llhard": {Name: "llhard", CodePoints: []int{10603}, Characters: []byte{0xe2, 0xa5, 0xab}}, - "lltri": {Name: "lltri", CodePoints: []int{9722}, Characters: []byte{0xe2, 0x97, 0xba}}, - "lmidot": {Name: "lmidot", CodePoints: []int{320}, Characters: []byte{0xc5, 0x80}}, - "lmoust": {Name: "lmoust", CodePoints: []int{9136}, Characters: []byte{0xe2, 0x8e, 0xb0}}, - "lmoustache": {Name: "lmoustache", CodePoints: []int{9136}, Characters: []byte{0xe2, 0x8e, 0xb0}}, - "lnE": {Name: "lnE", CodePoints: []int{8808}, Characters: []byte{0xe2, 0x89, 0xa8}}, - "lnap": {Name: "lnap", CodePoints: []int{10889}, Characters: []byte{0xe2, 0xaa, 0x89}}, - "lnapprox": {Name: "lnapprox", CodePoints: []int{10889}, Characters: []byte{0xe2, 0xaa, 0x89}}, - "lne": {Name: "lne", CodePoints: []int{10887}, Characters: []byte{0xe2, 0xaa, 0x87}}, - "lneq": {Name: "lneq", CodePoints: []int{10887}, Characters: []byte{0xe2, 0xaa, 0x87}}, - "lneqq": {Name: "lneqq", CodePoints: []int{8808}, Characters: []byte{0xe2, 0x89, 0xa8}}, - "lnsim": {Name: "lnsim", CodePoints: []int{8934}, Characters: []byte{0xe2, 0x8b, 0xa6}}, - "loang": {Name: "loang", CodePoints: []int{10220}, Characters: []byte{0xe2, 0x9f, 0xac}}, - "loarr": {Name: "loarr", CodePoints: []int{8701}, Characters: []byte{0xe2, 0x87, 0xbd}}, - "lobrk": {Name: "lobrk", CodePoints: []int{10214}, Characters: []byte{0xe2, 0x9f, 0xa6}}, - "longleftarrow": {Name: "longleftarrow", CodePoints: []int{10229}, Characters: []byte{0xe2, 0x9f, 0xb5}}, - "longleftrightarrow": {Name: "longleftrightarrow", CodePoints: []int{10231}, Characters: []byte{0xe2, 0x9f, 0xb7}}, - "longmapsto": {Name: "longmapsto", CodePoints: []int{10236}, Characters: []byte{0xe2, 0x9f, 0xbc}}, - "longrightarrow": {Name: "longrightarrow", CodePoints: []int{10230}, Characters: []byte{0xe2, 0x9f, 0xb6}}, - "looparrowleft": {Name: "looparrowleft", CodePoints: []int{8619}, Characters: []byte{0xe2, 0x86, 0xab}}, - "looparrowright": {Name: "looparrowright", CodePoints: []int{8620}, Characters: []byte{0xe2, 0x86, 0xac}}, - "lopar": {Name: "lopar", CodePoints: []int{10629}, Characters: []byte{0xe2, 0xa6, 0x85}}, - "lopf": {Name: "lopf", CodePoints: []int{120157}, Characters: []byte{0xf0, 0x9d, 0x95, 0x9d}}, - "loplus": {Name: "loplus", CodePoints: []int{10797}, Characters: []byte{0xe2, 0xa8, 0xad}}, - "lotimes": {Name: "lotimes", CodePoints: []int{10804}, Characters: []byte{0xe2, 0xa8, 0xb4}}, - "lowast": {Name: "lowast", CodePoints: []int{8727}, Characters: []byte{0xe2, 0x88, 0x97}}, - "lowbar": {Name: "lowbar", CodePoints: []int{95}, Characters: []byte{0x5f}}, - "loz": {Name: "loz", CodePoints: []int{9674}, Characters: []byte{0xe2, 0x97, 0x8a}}, - "lozenge": {Name: "lozenge", CodePoints: []int{9674}, Characters: []byte{0xe2, 0x97, 0x8a}}, - "lozf": {Name: "lozf", CodePoints: []int{10731}, Characters: []byte{0xe2, 0xa7, 0xab}}, - "lpar": {Name: "lpar", CodePoints: []int{40}, Characters: []byte{0x28}}, - "lparlt": {Name: "lparlt", CodePoints: []int{10643}, Characters: []byte{0xe2, 0xa6, 0x93}}, - "lrarr": {Name: "lrarr", CodePoints: []int{8646}, Characters: []byte{0xe2, 0x87, 0x86}}, - "lrcorner": {Name: "lrcorner", CodePoints: []int{8991}, Characters: []byte{0xe2, 0x8c, 0x9f}}, - "lrhar": {Name: "lrhar", CodePoints: []int{8651}, Characters: []byte{0xe2, 0x87, 0x8b}}, - "lrhard": {Name: "lrhard", CodePoints: []int{10605}, Characters: []byte{0xe2, 0xa5, 0xad}}, - "lrm": {Name: "lrm", CodePoints: []int{8206}, Characters: []byte{0xe2, 0x80, 0x8e}}, - "lrtri": {Name: "lrtri", CodePoints: []int{8895}, Characters: []byte{0xe2, 0x8a, 0xbf}}, - "lsaquo": {Name: "lsaquo", CodePoints: []int{8249}, Characters: []byte{0xe2, 0x80, 0xb9}}, - "lscr": {Name: "lscr", CodePoints: []int{120001}, Characters: []byte{0xf0, 0x9d, 0x93, 0x81}}, - "lsh": {Name: "lsh", CodePoints: []int{8624}, Characters: []byte{0xe2, 0x86, 0xb0}}, - "lsim": {Name: "lsim", CodePoints: []int{8818}, Characters: []byte{0xe2, 0x89, 0xb2}}, - "lsime": {Name: "lsime", CodePoints: []int{10893}, Characters: []byte{0xe2, 0xaa, 0x8d}}, - "lsimg": {Name: "lsimg", CodePoints: []int{10895}, Characters: []byte{0xe2, 0xaa, 0x8f}}, - "lsqb": {Name: "lsqb", CodePoints: []int{91}, Characters: []byte{0x5b}}, - "lsquo": {Name: "lsquo", CodePoints: []int{8216}, Characters: []byte{0xe2, 0x80, 0x98}}, - "lsquor": {Name: "lsquor", CodePoints: []int{8218}, Characters: []byte{0xe2, 0x80, 0x9a}}, - "lstrok": {Name: "lstrok", CodePoints: []int{322}, Characters: []byte{0xc5, 0x82}}, - "lt": {Name: "lt", CodePoints: []int{60}, Characters: []byte{0x3c}}, - "ltcc": {Name: "ltcc", CodePoints: []int{10918}, Characters: []byte{0xe2, 0xaa, 0xa6}}, - "ltcir": {Name: "ltcir", CodePoints: []int{10873}, Characters: []byte{0xe2, 0xa9, 0xb9}}, - "ltdot": {Name: "ltdot", CodePoints: []int{8918}, Characters: []byte{0xe2, 0x8b, 0x96}}, - "lthree": {Name: "lthree", CodePoints: []int{8907}, Characters: []byte{0xe2, 0x8b, 0x8b}}, - "ltimes": {Name: "ltimes", CodePoints: []int{8905}, Characters: []byte{0xe2, 0x8b, 0x89}}, - "ltlarr": {Name: "ltlarr", CodePoints: []int{10614}, Characters: []byte{0xe2, 0xa5, 0xb6}}, - "ltquest": {Name: "ltquest", CodePoints: []int{10875}, Characters: []byte{0xe2, 0xa9, 0xbb}}, - "ltrPar": {Name: "ltrPar", CodePoints: []int{10646}, Characters: []byte{0xe2, 0xa6, 0x96}}, - "ltri": {Name: "ltri", CodePoints: []int{9667}, Characters: []byte{0xe2, 0x97, 0x83}}, - "ltrie": {Name: "ltrie", CodePoints: []int{8884}, Characters: []byte{0xe2, 0x8a, 0xb4}}, - "ltrif": {Name: "ltrif", CodePoints: []int{9666}, Characters: []byte{0xe2, 0x97, 0x82}}, - "lurdshar": {Name: "lurdshar", CodePoints: []int{10570}, Characters: []byte{0xe2, 0xa5, 0x8a}}, - "luruhar": {Name: "luruhar", CodePoints: []int{10598}, Characters: []byte{0xe2, 0xa5, 0xa6}}, - "lvertneqq": {Name: "lvertneqq", CodePoints: []int{8808, 65024}, Characters: []byte{0xe2, 0x89, 0xa8, 0xef, 0xb8, 0x80}}, - "lvnE": {Name: "lvnE", CodePoints: []int{8808, 65024}, Characters: []byte{0xe2, 0x89, 0xa8, 0xef, 0xb8, 0x80}}, - "mDDot": {Name: "mDDot", CodePoints: []int{8762}, Characters: []byte{0xe2, 0x88, 0xba}}, - "macr": {Name: "macr", CodePoints: []int{175}, Characters: []byte{0xc2, 0xaf}}, - "male": {Name: "male", CodePoints: []int{9794}, Characters: []byte{0xe2, 0x99, 0x82}}, - "malt": {Name: "malt", CodePoints: []int{10016}, Characters: []byte{0xe2, 0x9c, 0xa0}}, - "maltese": {Name: "maltese", CodePoints: []int{10016}, Characters: []byte{0xe2, 0x9c, 0xa0}}, - "map": {Name: "map", CodePoints: []int{8614}, Characters: []byte{0xe2, 0x86, 0xa6}}, - "mapsto": {Name: "mapsto", CodePoints: []int{8614}, Characters: []byte{0xe2, 0x86, 0xa6}}, - "mapstodown": {Name: "mapstodown", CodePoints: []int{8615}, Characters: []byte{0xe2, 0x86, 0xa7}}, - "mapstoleft": {Name: "mapstoleft", CodePoints: []int{8612}, Characters: []byte{0xe2, 0x86, 0xa4}}, - "mapstoup": {Name: "mapstoup", CodePoints: []int{8613}, Characters: []byte{0xe2, 0x86, 0xa5}}, - "marker": {Name: "marker", CodePoints: []int{9646}, Characters: []byte{0xe2, 0x96, 0xae}}, - "mcomma": {Name: "mcomma", CodePoints: []int{10793}, Characters: []byte{0xe2, 0xa8, 0xa9}}, - "mcy": {Name: "mcy", CodePoints: []int{1084}, Characters: []byte{0xd0, 0xbc}}, - "mdash": {Name: "mdash", CodePoints: []int{8212}, Characters: []byte{0xe2, 0x80, 0x94}}, - "measuredangle": {Name: "measuredangle", CodePoints: []int{8737}, Characters: []byte{0xe2, 0x88, 0xa1}}, - "mfr": {Name: "mfr", CodePoints: []int{120106}, Characters: []byte{0xf0, 0x9d, 0x94, 0xaa}}, - "mho": {Name: "mho", CodePoints: []int{8487}, Characters: []byte{0xe2, 0x84, 0xa7}}, - "micro": {Name: "micro", CodePoints: []int{181}, Characters: []byte{0xc2, 0xb5}}, - "mid": {Name: "mid", CodePoints: []int{8739}, Characters: []byte{0xe2, 0x88, 0xa3}}, - "midast": {Name: "midast", CodePoints: []int{42}, Characters: []byte{0x2a}}, - "midcir": {Name: "midcir", CodePoints: []int{10992}, Characters: []byte{0xe2, 0xab, 0xb0}}, - "middot": {Name: "middot", CodePoints: []int{183}, Characters: []byte{0xc2, 0xb7}}, - "minus": {Name: "minus", CodePoints: []int{8722}, Characters: []byte{0xe2, 0x88, 0x92}}, - "minusb": {Name: "minusb", CodePoints: []int{8863}, Characters: []byte{0xe2, 0x8a, 0x9f}}, - "minusd": {Name: "minusd", CodePoints: []int{8760}, Characters: []byte{0xe2, 0x88, 0xb8}}, - "minusdu": {Name: "minusdu", CodePoints: []int{10794}, Characters: []byte{0xe2, 0xa8, 0xaa}}, - "mlcp": {Name: "mlcp", CodePoints: []int{10971}, Characters: []byte{0xe2, 0xab, 0x9b}}, - "mldr": {Name: "mldr", CodePoints: []int{8230}, Characters: []byte{0xe2, 0x80, 0xa6}}, - "mnplus": {Name: "mnplus", CodePoints: []int{8723}, Characters: []byte{0xe2, 0x88, 0x93}}, - "models": {Name: "models", CodePoints: []int{8871}, Characters: []byte{0xe2, 0x8a, 0xa7}}, - "mopf": {Name: "mopf", CodePoints: []int{120158}, Characters: []byte{0xf0, 0x9d, 0x95, 0x9e}}, - "mp": {Name: "mp", CodePoints: []int{8723}, Characters: []byte{0xe2, 0x88, 0x93}}, - "mscr": {Name: "mscr", CodePoints: []int{120002}, Characters: []byte{0xf0, 0x9d, 0x93, 0x82}}, - "mstpos": {Name: "mstpos", CodePoints: []int{8766}, Characters: []byte{0xe2, 0x88, 0xbe}}, - "mu": {Name: "mu", CodePoints: []int{956}, Characters: []byte{0xce, 0xbc}}, - "multimap": {Name: "multimap", CodePoints: []int{8888}, Characters: []byte{0xe2, 0x8a, 0xb8}}, - "mumap": {Name: "mumap", CodePoints: []int{8888}, Characters: []byte{0xe2, 0x8a, 0xb8}}, - "nGg": {Name: "nGg", CodePoints: []int{8921, 824}, Characters: []byte{0xe2, 0x8b, 0x99, 0xcc, 0xb8}}, - "nGt": {Name: "nGt", CodePoints: []int{8811, 8402}, Characters: []byte{0xe2, 0x89, 0xab, 0xe2, 0x83, 0x92}}, - "nGtv": {Name: "nGtv", CodePoints: []int{8811, 824}, Characters: []byte{0xe2, 0x89, 0xab, 0xcc, 0xb8}}, - "nLeftarrow": {Name: "nLeftarrow", CodePoints: []int{8653}, Characters: []byte{0xe2, 0x87, 0x8d}}, - "nLeftrightarrow": {Name: "nLeftrightarrow", CodePoints: []int{8654}, Characters: []byte{0xe2, 0x87, 0x8e}}, - "nLl": {Name: "nLl", CodePoints: []int{8920, 824}, Characters: []byte{0xe2, 0x8b, 0x98, 0xcc, 0xb8}}, - "nLt": {Name: "nLt", CodePoints: []int{8810, 8402}, Characters: []byte{0xe2, 0x89, 0xaa, 0xe2, 0x83, 0x92}}, - "nLtv": {Name: "nLtv", CodePoints: []int{8810, 824}, Characters: []byte{0xe2, 0x89, 0xaa, 0xcc, 0xb8}}, - "nRightarrow": {Name: "nRightarrow", CodePoints: []int{8655}, Characters: []byte{0xe2, 0x87, 0x8f}}, - "nVDash": {Name: "nVDash", CodePoints: []int{8879}, Characters: []byte{0xe2, 0x8a, 0xaf}}, - "nVdash": {Name: "nVdash", CodePoints: []int{8878}, Characters: []byte{0xe2, 0x8a, 0xae}}, - "nabla": {Name: "nabla", CodePoints: []int{8711}, Characters: []byte{0xe2, 0x88, 0x87}}, - "nacute": {Name: "nacute", CodePoints: []int{324}, Characters: []byte{0xc5, 0x84}}, - "nang": {Name: "nang", CodePoints: []int{8736, 8402}, Characters: []byte{0xe2, 0x88, 0xa0, 0xe2, 0x83, 0x92}}, - "nap": {Name: "nap", CodePoints: []int{8777}, Characters: []byte{0xe2, 0x89, 0x89}}, - "napE": {Name: "napE", CodePoints: []int{10864, 824}, Characters: []byte{0xe2, 0xa9, 0xb0, 0xcc, 0xb8}}, - "napid": {Name: "napid", CodePoints: []int{8779, 824}, Characters: []byte{0xe2, 0x89, 0x8b, 0xcc, 0xb8}}, - "napos": {Name: "napos", CodePoints: []int{329}, Characters: []byte{0xc5, 0x89}}, - "napprox": {Name: "napprox", CodePoints: []int{8777}, Characters: []byte{0xe2, 0x89, 0x89}}, - "natur": {Name: "natur", CodePoints: []int{9838}, Characters: []byte{0xe2, 0x99, 0xae}}, - "natural": {Name: "natural", CodePoints: []int{9838}, Characters: []byte{0xe2, 0x99, 0xae}}, - "naturals": {Name: "naturals", CodePoints: []int{8469}, Characters: []byte{0xe2, 0x84, 0x95}}, - "nbsp": {Name: "nbsp", CodePoints: []int{160}, Characters: []byte{0xc2, 0xa0}}, - "nbump": {Name: "nbump", CodePoints: []int{8782, 824}, Characters: []byte{0xe2, 0x89, 0x8e, 0xcc, 0xb8}}, - "nbumpe": {Name: "nbumpe", CodePoints: []int{8783, 824}, Characters: []byte{0xe2, 0x89, 0x8f, 0xcc, 0xb8}}, - "ncap": {Name: "ncap", CodePoints: []int{10819}, Characters: []byte{0xe2, 0xa9, 0x83}}, - "ncaron": {Name: "ncaron", CodePoints: []int{328}, Characters: []byte{0xc5, 0x88}}, - "ncedil": {Name: "ncedil", CodePoints: []int{326}, Characters: []byte{0xc5, 0x86}}, - "ncong": {Name: "ncong", CodePoints: []int{8775}, Characters: []byte{0xe2, 0x89, 0x87}}, - "ncongdot": {Name: "ncongdot", CodePoints: []int{10861, 824}, Characters: []byte{0xe2, 0xa9, 0xad, 0xcc, 0xb8}}, - "ncup": {Name: "ncup", CodePoints: []int{10818}, Characters: []byte{0xe2, 0xa9, 0x82}}, - "ncy": {Name: "ncy", CodePoints: []int{1085}, Characters: []byte{0xd0, 0xbd}}, - "ndash": {Name: "ndash", CodePoints: []int{8211}, Characters: []byte{0xe2, 0x80, 0x93}}, - "ne": {Name: "ne", CodePoints: []int{8800}, Characters: []byte{0xe2, 0x89, 0xa0}}, - "neArr": {Name: "neArr", CodePoints: []int{8663}, Characters: []byte{0xe2, 0x87, 0x97}}, - "nearhk": {Name: "nearhk", CodePoints: []int{10532}, Characters: []byte{0xe2, 0xa4, 0xa4}}, - "nearr": {Name: "nearr", CodePoints: []int{8599}, Characters: []byte{0xe2, 0x86, 0x97}}, - "nearrow": {Name: "nearrow", CodePoints: []int{8599}, Characters: []byte{0xe2, 0x86, 0x97}}, - "nedot": {Name: "nedot", CodePoints: []int{8784, 824}, Characters: []byte{0xe2, 0x89, 0x90, 0xcc, 0xb8}}, - "nequiv": {Name: "nequiv", CodePoints: []int{8802}, Characters: []byte{0xe2, 0x89, 0xa2}}, - "nesear": {Name: "nesear", CodePoints: []int{10536}, Characters: []byte{0xe2, 0xa4, 0xa8}}, - "nesim": {Name: "nesim", CodePoints: []int{8770, 824}, Characters: []byte{0xe2, 0x89, 0x82, 0xcc, 0xb8}}, - "nexist": {Name: "nexist", CodePoints: []int{8708}, Characters: []byte{0xe2, 0x88, 0x84}}, - "nexists": {Name: "nexists", CodePoints: []int{8708}, Characters: []byte{0xe2, 0x88, 0x84}}, - "nfr": {Name: "nfr", CodePoints: []int{120107}, Characters: []byte{0xf0, 0x9d, 0x94, 0xab}}, - "ngE": {Name: "ngE", CodePoints: []int{8807, 824}, Characters: []byte{0xe2, 0x89, 0xa7, 0xcc, 0xb8}}, - "nge": {Name: "nge", CodePoints: []int{8817}, Characters: []byte{0xe2, 0x89, 0xb1}}, - "ngeq": {Name: "ngeq", CodePoints: []int{8817}, Characters: []byte{0xe2, 0x89, 0xb1}}, - "ngeqq": {Name: "ngeqq", CodePoints: []int{8807, 824}, Characters: []byte{0xe2, 0x89, 0xa7, 0xcc, 0xb8}}, - "ngeqslant": {Name: "ngeqslant", CodePoints: []int{10878, 824}, Characters: []byte{0xe2, 0xa9, 0xbe, 0xcc, 0xb8}}, - "nges": {Name: "nges", CodePoints: []int{10878, 824}, Characters: []byte{0xe2, 0xa9, 0xbe, 0xcc, 0xb8}}, - "ngsim": {Name: "ngsim", CodePoints: []int{8821}, Characters: []byte{0xe2, 0x89, 0xb5}}, - "ngt": {Name: "ngt", CodePoints: []int{8815}, Characters: []byte{0xe2, 0x89, 0xaf}}, - "ngtr": {Name: "ngtr", CodePoints: []int{8815}, Characters: []byte{0xe2, 0x89, 0xaf}}, - "nhArr": {Name: "nhArr", CodePoints: []int{8654}, Characters: []byte{0xe2, 0x87, 0x8e}}, - "nharr": {Name: "nharr", CodePoints: []int{8622}, Characters: []byte{0xe2, 0x86, 0xae}}, - "nhpar": {Name: "nhpar", CodePoints: []int{10994}, Characters: []byte{0xe2, 0xab, 0xb2}}, - "ni": {Name: "ni", CodePoints: []int{8715}, Characters: []byte{0xe2, 0x88, 0x8b}}, - "nis": {Name: "nis", CodePoints: []int{8956}, Characters: []byte{0xe2, 0x8b, 0xbc}}, - "nisd": {Name: "nisd", CodePoints: []int{8954}, Characters: []byte{0xe2, 0x8b, 0xba}}, - "niv": {Name: "niv", CodePoints: []int{8715}, Characters: []byte{0xe2, 0x88, 0x8b}}, - "njcy": {Name: "njcy", CodePoints: []int{1114}, Characters: []byte{0xd1, 0x9a}}, - "nlArr": {Name: "nlArr", CodePoints: []int{8653}, Characters: []byte{0xe2, 0x87, 0x8d}}, - "nlE": {Name: "nlE", CodePoints: []int{8806, 824}, Characters: []byte{0xe2, 0x89, 0xa6, 0xcc, 0xb8}}, - "nlarr": {Name: "nlarr", CodePoints: []int{8602}, Characters: []byte{0xe2, 0x86, 0x9a}}, - "nldr": {Name: "nldr", CodePoints: []int{8229}, Characters: []byte{0xe2, 0x80, 0xa5}}, - "nle": {Name: "nle", CodePoints: []int{8816}, Characters: []byte{0xe2, 0x89, 0xb0}}, - "nleftarrow": {Name: "nleftarrow", CodePoints: []int{8602}, Characters: []byte{0xe2, 0x86, 0x9a}}, - "nleftrightarrow": {Name: "nleftrightarrow", CodePoints: []int{8622}, Characters: []byte{0xe2, 0x86, 0xae}}, - "nleq": {Name: "nleq", CodePoints: []int{8816}, Characters: []byte{0xe2, 0x89, 0xb0}}, - "nleqq": {Name: "nleqq", CodePoints: []int{8806, 824}, Characters: []byte{0xe2, 0x89, 0xa6, 0xcc, 0xb8}}, - "nleqslant": {Name: "nleqslant", CodePoints: []int{10877, 824}, Characters: []byte{0xe2, 0xa9, 0xbd, 0xcc, 0xb8}}, - "nles": {Name: "nles", CodePoints: []int{10877, 824}, Characters: []byte{0xe2, 0xa9, 0xbd, 0xcc, 0xb8}}, - "nless": {Name: "nless", CodePoints: []int{8814}, Characters: []byte{0xe2, 0x89, 0xae}}, - "nlsim": {Name: "nlsim", CodePoints: []int{8820}, Characters: []byte{0xe2, 0x89, 0xb4}}, - "nlt": {Name: "nlt", CodePoints: []int{8814}, Characters: []byte{0xe2, 0x89, 0xae}}, - "nltri": {Name: "nltri", CodePoints: []int{8938}, Characters: []byte{0xe2, 0x8b, 0xaa}}, - "nltrie": {Name: "nltrie", CodePoints: []int{8940}, Characters: []byte{0xe2, 0x8b, 0xac}}, - "nmid": {Name: "nmid", CodePoints: []int{8740}, Characters: []byte{0xe2, 0x88, 0xa4}}, - "nopf": {Name: "nopf", CodePoints: []int{120159}, Characters: []byte{0xf0, 0x9d, 0x95, 0x9f}}, - "not": {Name: "not", CodePoints: []int{172}, Characters: []byte{0xc2, 0xac}}, - "notin": {Name: "notin", CodePoints: []int{8713}, Characters: []byte{0xe2, 0x88, 0x89}}, - "notinE": {Name: "notinE", CodePoints: []int{8953, 824}, Characters: []byte{0xe2, 0x8b, 0xb9, 0xcc, 0xb8}}, - "notindot": {Name: "notindot", CodePoints: []int{8949, 824}, Characters: []byte{0xe2, 0x8b, 0xb5, 0xcc, 0xb8}}, - "notinva": {Name: "notinva", CodePoints: []int{8713}, Characters: []byte{0xe2, 0x88, 0x89}}, - "notinvb": {Name: "notinvb", CodePoints: []int{8951}, Characters: []byte{0xe2, 0x8b, 0xb7}}, - "notinvc": {Name: "notinvc", CodePoints: []int{8950}, Characters: []byte{0xe2, 0x8b, 0xb6}}, - "notni": {Name: "notni", CodePoints: []int{8716}, Characters: []byte{0xe2, 0x88, 0x8c}}, - "notniva": {Name: "notniva", CodePoints: []int{8716}, Characters: []byte{0xe2, 0x88, 0x8c}}, - "notnivb": {Name: "notnivb", CodePoints: []int{8958}, Characters: []byte{0xe2, 0x8b, 0xbe}}, - "notnivc": {Name: "notnivc", CodePoints: []int{8957}, Characters: []byte{0xe2, 0x8b, 0xbd}}, - "npar": {Name: "npar", CodePoints: []int{8742}, Characters: []byte{0xe2, 0x88, 0xa6}}, - "nparallel": {Name: "nparallel", CodePoints: []int{8742}, Characters: []byte{0xe2, 0x88, 0xa6}}, - "nparsl": {Name: "nparsl", CodePoints: []int{11005, 8421}, Characters: []byte{0xe2, 0xab, 0xbd, 0xe2, 0x83, 0xa5}}, - "npart": {Name: "npart", CodePoints: []int{8706, 824}, Characters: []byte{0xe2, 0x88, 0x82, 0xcc, 0xb8}}, - "npolint": {Name: "npolint", CodePoints: []int{10772}, Characters: []byte{0xe2, 0xa8, 0x94}}, - "npr": {Name: "npr", CodePoints: []int{8832}, Characters: []byte{0xe2, 0x8a, 0x80}}, - "nprcue": {Name: "nprcue", CodePoints: []int{8928}, Characters: []byte{0xe2, 0x8b, 0xa0}}, - "npre": {Name: "npre", CodePoints: []int{10927, 824}, Characters: []byte{0xe2, 0xaa, 0xaf, 0xcc, 0xb8}}, - "nprec": {Name: "nprec", CodePoints: []int{8832}, Characters: []byte{0xe2, 0x8a, 0x80}}, - "npreceq": {Name: "npreceq", CodePoints: []int{10927, 824}, Characters: []byte{0xe2, 0xaa, 0xaf, 0xcc, 0xb8}}, - "nrArr": {Name: "nrArr", CodePoints: []int{8655}, Characters: []byte{0xe2, 0x87, 0x8f}}, - "nrarr": {Name: "nrarr", CodePoints: []int{8603}, Characters: []byte{0xe2, 0x86, 0x9b}}, - "nrarrc": {Name: "nrarrc", CodePoints: []int{10547, 824}, Characters: []byte{0xe2, 0xa4, 0xb3, 0xcc, 0xb8}}, - "nrarrw": {Name: "nrarrw", CodePoints: []int{8605, 824}, Characters: []byte{0xe2, 0x86, 0x9d, 0xcc, 0xb8}}, - "nrightarrow": {Name: "nrightarrow", CodePoints: []int{8603}, Characters: []byte{0xe2, 0x86, 0x9b}}, - "nrtri": {Name: "nrtri", CodePoints: []int{8939}, Characters: []byte{0xe2, 0x8b, 0xab}}, - "nrtrie": {Name: "nrtrie", CodePoints: []int{8941}, Characters: []byte{0xe2, 0x8b, 0xad}}, - "nsc": {Name: "nsc", CodePoints: []int{8833}, Characters: []byte{0xe2, 0x8a, 0x81}}, - "nsccue": {Name: "nsccue", CodePoints: []int{8929}, Characters: []byte{0xe2, 0x8b, 0xa1}}, - "nsce": {Name: "nsce", CodePoints: []int{10928, 824}, Characters: []byte{0xe2, 0xaa, 0xb0, 0xcc, 0xb8}}, - "nscr": {Name: "nscr", CodePoints: []int{120003}, Characters: []byte{0xf0, 0x9d, 0x93, 0x83}}, - "nshortmid": {Name: "nshortmid", CodePoints: []int{8740}, Characters: []byte{0xe2, 0x88, 0xa4}}, - "nshortparallel": {Name: "nshortparallel", CodePoints: []int{8742}, Characters: []byte{0xe2, 0x88, 0xa6}}, - "nsim": {Name: "nsim", CodePoints: []int{8769}, Characters: []byte{0xe2, 0x89, 0x81}}, - "nsime": {Name: "nsime", CodePoints: []int{8772}, Characters: []byte{0xe2, 0x89, 0x84}}, - "nsimeq": {Name: "nsimeq", CodePoints: []int{8772}, Characters: []byte{0xe2, 0x89, 0x84}}, - "nsmid": {Name: "nsmid", CodePoints: []int{8740}, Characters: []byte{0xe2, 0x88, 0xa4}}, - "nspar": {Name: "nspar", CodePoints: []int{8742}, Characters: []byte{0xe2, 0x88, 0xa6}}, - "nsqsube": {Name: "nsqsube", CodePoints: []int{8930}, Characters: []byte{0xe2, 0x8b, 0xa2}}, - "nsqsupe": {Name: "nsqsupe", CodePoints: []int{8931}, Characters: []byte{0xe2, 0x8b, 0xa3}}, - "nsub": {Name: "nsub", CodePoints: []int{8836}, Characters: []byte{0xe2, 0x8a, 0x84}}, - "nsubE": {Name: "nsubE", CodePoints: []int{10949, 824}, Characters: []byte{0xe2, 0xab, 0x85, 0xcc, 0xb8}}, - "nsube": {Name: "nsube", CodePoints: []int{8840}, Characters: []byte{0xe2, 0x8a, 0x88}}, - "nsubset": {Name: "nsubset", CodePoints: []int{8834, 8402}, Characters: []byte{0xe2, 0x8a, 0x82, 0xe2, 0x83, 0x92}}, - "nsubseteq": {Name: "nsubseteq", CodePoints: []int{8840}, Characters: []byte{0xe2, 0x8a, 0x88}}, - "nsubseteqq": {Name: "nsubseteqq", CodePoints: []int{10949, 824}, Characters: []byte{0xe2, 0xab, 0x85, 0xcc, 0xb8}}, - "nsucc": {Name: "nsucc", CodePoints: []int{8833}, Characters: []byte{0xe2, 0x8a, 0x81}}, - "nsucceq": {Name: "nsucceq", CodePoints: []int{10928, 824}, Characters: []byte{0xe2, 0xaa, 0xb0, 0xcc, 0xb8}}, - "nsup": {Name: "nsup", CodePoints: []int{8837}, Characters: []byte{0xe2, 0x8a, 0x85}}, - "nsupE": {Name: "nsupE", CodePoints: []int{10950, 824}, Characters: []byte{0xe2, 0xab, 0x86, 0xcc, 0xb8}}, - "nsupe": {Name: "nsupe", CodePoints: []int{8841}, Characters: []byte{0xe2, 0x8a, 0x89}}, - "nsupset": {Name: "nsupset", CodePoints: []int{8835, 8402}, Characters: []byte{0xe2, 0x8a, 0x83, 0xe2, 0x83, 0x92}}, - "nsupseteq": {Name: "nsupseteq", CodePoints: []int{8841}, Characters: []byte{0xe2, 0x8a, 0x89}}, - "nsupseteqq": {Name: "nsupseteqq", CodePoints: []int{10950, 824}, Characters: []byte{0xe2, 0xab, 0x86, 0xcc, 0xb8}}, - "ntgl": {Name: "ntgl", CodePoints: []int{8825}, Characters: []byte{0xe2, 0x89, 0xb9}}, - "ntilde": {Name: "ntilde", CodePoints: []int{241}, Characters: []byte{0xc3, 0xb1}}, - "ntlg": {Name: "ntlg", CodePoints: []int{8824}, Characters: []byte{0xe2, 0x89, 0xb8}}, - "ntriangleleft": {Name: "ntriangleleft", CodePoints: []int{8938}, Characters: []byte{0xe2, 0x8b, 0xaa}}, - "ntrianglelefteq": {Name: "ntrianglelefteq", CodePoints: []int{8940}, Characters: []byte{0xe2, 0x8b, 0xac}}, - "ntriangleright": {Name: "ntriangleright", CodePoints: []int{8939}, Characters: []byte{0xe2, 0x8b, 0xab}}, - "ntrianglerighteq": {Name: "ntrianglerighteq", CodePoints: []int{8941}, Characters: []byte{0xe2, 0x8b, 0xad}}, - "nu": {Name: "nu", CodePoints: []int{957}, Characters: []byte{0xce, 0xbd}}, - "num": {Name: "num", CodePoints: []int{35}, Characters: []byte{0x23}}, - "numero": {Name: "numero", CodePoints: []int{8470}, Characters: []byte{0xe2, 0x84, 0x96}}, - "numsp": {Name: "numsp", CodePoints: []int{8199}, Characters: []byte{0xe2, 0x80, 0x87}}, - "nvDash": {Name: "nvDash", CodePoints: []int{8877}, Characters: []byte{0xe2, 0x8a, 0xad}}, - "nvHarr": {Name: "nvHarr", CodePoints: []int{10500}, Characters: []byte{0xe2, 0xa4, 0x84}}, - "nvap": {Name: "nvap", CodePoints: []int{8781, 8402}, Characters: []byte{0xe2, 0x89, 0x8d, 0xe2, 0x83, 0x92}}, - "nvdash": {Name: "nvdash", CodePoints: []int{8876}, Characters: []byte{0xe2, 0x8a, 0xac}}, - "nvge": {Name: "nvge", CodePoints: []int{8805, 8402}, Characters: []byte{0xe2, 0x89, 0xa5, 0xe2, 0x83, 0x92}}, - "nvgt": {Name: "nvgt", CodePoints: []int{62, 8402}, Characters: []byte{0x3e, 0xe2, 0x83, 0x92}}, - "nvinfin": {Name: "nvinfin", CodePoints: []int{10718}, Characters: []byte{0xe2, 0xa7, 0x9e}}, - "nvlArr": {Name: "nvlArr", CodePoints: []int{10498}, Characters: []byte{0xe2, 0xa4, 0x82}}, - "nvle": {Name: "nvle", CodePoints: []int{8804, 8402}, Characters: []byte{0xe2, 0x89, 0xa4, 0xe2, 0x83, 0x92}}, - "nvlt": {Name: "nvlt", CodePoints: []int{60, 8402}, Characters: []byte{0x3c, 0xe2, 0x83, 0x92}}, - "nvltrie": {Name: "nvltrie", CodePoints: []int{8884, 8402}, Characters: []byte{0xe2, 0x8a, 0xb4, 0xe2, 0x83, 0x92}}, - "nvrArr": {Name: "nvrArr", CodePoints: []int{10499}, Characters: []byte{0xe2, 0xa4, 0x83}}, - "nvrtrie": {Name: "nvrtrie", CodePoints: []int{8885, 8402}, Characters: []byte{0xe2, 0x8a, 0xb5, 0xe2, 0x83, 0x92}}, - "nvsim": {Name: "nvsim", CodePoints: []int{8764, 8402}, Characters: []byte{0xe2, 0x88, 0xbc, 0xe2, 0x83, 0x92}}, - "nwArr": {Name: "nwArr", CodePoints: []int{8662}, Characters: []byte{0xe2, 0x87, 0x96}}, - "nwarhk": {Name: "nwarhk", CodePoints: []int{10531}, Characters: []byte{0xe2, 0xa4, 0xa3}}, - "nwarr": {Name: "nwarr", CodePoints: []int{8598}, Characters: []byte{0xe2, 0x86, 0x96}}, - "nwarrow": {Name: "nwarrow", CodePoints: []int{8598}, Characters: []byte{0xe2, 0x86, 0x96}}, - "nwnear": {Name: "nwnear", CodePoints: []int{10535}, Characters: []byte{0xe2, 0xa4, 0xa7}}, - "oS": {Name: "oS", CodePoints: []int{9416}, Characters: []byte{0xe2, 0x93, 0x88}}, - "oacute": {Name: "oacute", CodePoints: []int{243}, Characters: []byte{0xc3, 0xb3}}, - "oast": {Name: "oast", CodePoints: []int{8859}, Characters: []byte{0xe2, 0x8a, 0x9b}}, - "ocir": {Name: "ocir", CodePoints: []int{8858}, Characters: []byte{0xe2, 0x8a, 0x9a}}, - "ocirc": {Name: "ocirc", CodePoints: []int{244}, Characters: []byte{0xc3, 0xb4}}, - "ocy": {Name: "ocy", CodePoints: []int{1086}, Characters: []byte{0xd0, 0xbe}}, - "odash": {Name: "odash", CodePoints: []int{8861}, Characters: []byte{0xe2, 0x8a, 0x9d}}, - "odblac": {Name: "odblac", CodePoints: []int{337}, Characters: []byte{0xc5, 0x91}}, - "odiv": {Name: "odiv", CodePoints: []int{10808}, Characters: []byte{0xe2, 0xa8, 0xb8}}, - "odot": {Name: "odot", CodePoints: []int{8857}, Characters: []byte{0xe2, 0x8a, 0x99}}, - "odsold": {Name: "odsold", CodePoints: []int{10684}, Characters: []byte{0xe2, 0xa6, 0xbc}}, - "oelig": {Name: "oelig", CodePoints: []int{339}, Characters: []byte{0xc5, 0x93}}, - "ofcir": {Name: "ofcir", CodePoints: []int{10687}, Characters: []byte{0xe2, 0xa6, 0xbf}}, - "ofr": {Name: "ofr", CodePoints: []int{120108}, Characters: []byte{0xf0, 0x9d, 0x94, 0xac}}, - "ogon": {Name: "ogon", CodePoints: []int{731}, Characters: []byte{0xcb, 0x9b}}, - "ograve": {Name: "ograve", CodePoints: []int{242}, Characters: []byte{0xc3, 0xb2}}, - "ogt": {Name: "ogt", CodePoints: []int{10689}, Characters: []byte{0xe2, 0xa7, 0x81}}, - "ohbar": {Name: "ohbar", CodePoints: []int{10677}, Characters: []byte{0xe2, 0xa6, 0xb5}}, - "ohm": {Name: "ohm", CodePoints: []int{937}, Characters: []byte{0xce, 0xa9}}, - "oint": {Name: "oint", CodePoints: []int{8750}, Characters: []byte{0xe2, 0x88, 0xae}}, - "olarr": {Name: "olarr", CodePoints: []int{8634}, Characters: []byte{0xe2, 0x86, 0xba}}, - "olcir": {Name: "olcir", CodePoints: []int{10686}, Characters: []byte{0xe2, 0xa6, 0xbe}}, - "olcross": {Name: "olcross", CodePoints: []int{10683}, Characters: []byte{0xe2, 0xa6, 0xbb}}, - "oline": {Name: "oline", CodePoints: []int{8254}, Characters: []byte{0xe2, 0x80, 0xbe}}, - "olt": {Name: "olt", CodePoints: []int{10688}, Characters: []byte{0xe2, 0xa7, 0x80}}, - "omacr": {Name: "omacr", CodePoints: []int{333}, Characters: []byte{0xc5, 0x8d}}, - "omega": {Name: "omega", CodePoints: []int{969}, Characters: []byte{0xcf, 0x89}}, - "omicron": {Name: "omicron", CodePoints: []int{959}, Characters: []byte{0xce, 0xbf}}, - "omid": {Name: "omid", CodePoints: []int{10678}, Characters: []byte{0xe2, 0xa6, 0xb6}}, - "ominus": {Name: "ominus", CodePoints: []int{8854}, Characters: []byte{0xe2, 0x8a, 0x96}}, - "oopf": {Name: "oopf", CodePoints: []int{120160}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa0}}, - "opar": {Name: "opar", CodePoints: []int{10679}, Characters: []byte{0xe2, 0xa6, 0xb7}}, - "operp": {Name: "operp", CodePoints: []int{10681}, Characters: []byte{0xe2, 0xa6, 0xb9}}, - "oplus": {Name: "oplus", CodePoints: []int{8853}, Characters: []byte{0xe2, 0x8a, 0x95}}, - "or": {Name: "or", CodePoints: []int{8744}, Characters: []byte{0xe2, 0x88, 0xa8}}, - "orarr": {Name: "orarr", CodePoints: []int{8635}, Characters: []byte{0xe2, 0x86, 0xbb}}, - "ord": {Name: "ord", CodePoints: []int{10845}, Characters: []byte{0xe2, 0xa9, 0x9d}}, - "order": {Name: "order", CodePoints: []int{8500}, Characters: []byte{0xe2, 0x84, 0xb4}}, - "orderof": {Name: "orderof", CodePoints: []int{8500}, Characters: []byte{0xe2, 0x84, 0xb4}}, - "ordf": {Name: "ordf", CodePoints: []int{170}, Characters: []byte{0xc2, 0xaa}}, - "ordm": {Name: "ordm", CodePoints: []int{186}, Characters: []byte{0xc2, 0xba}}, - "origof": {Name: "origof", CodePoints: []int{8886}, Characters: []byte{0xe2, 0x8a, 0xb6}}, - "oror": {Name: "oror", CodePoints: []int{10838}, Characters: []byte{0xe2, 0xa9, 0x96}}, - "orslope": {Name: "orslope", CodePoints: []int{10839}, Characters: []byte{0xe2, 0xa9, 0x97}}, - "orv": {Name: "orv", CodePoints: []int{10843}, Characters: []byte{0xe2, 0xa9, 0x9b}}, - "oscr": {Name: "oscr", CodePoints: []int{8500}, Characters: []byte{0xe2, 0x84, 0xb4}}, - "oslash": {Name: "oslash", CodePoints: []int{248}, Characters: []byte{0xc3, 0xb8}}, - "osol": {Name: "osol", CodePoints: []int{8856}, Characters: []byte{0xe2, 0x8a, 0x98}}, - "otilde": {Name: "otilde", CodePoints: []int{245}, Characters: []byte{0xc3, 0xb5}}, - "otimes": {Name: "otimes", CodePoints: []int{8855}, Characters: []byte{0xe2, 0x8a, 0x97}}, - "otimesas": {Name: "otimesas", CodePoints: []int{10806}, Characters: []byte{0xe2, 0xa8, 0xb6}}, - "ouml": {Name: "ouml", CodePoints: []int{246}, Characters: []byte{0xc3, 0xb6}}, - "ovbar": {Name: "ovbar", CodePoints: []int{9021}, Characters: []byte{0xe2, 0x8c, 0xbd}}, - "par": {Name: "par", CodePoints: []int{8741}, Characters: []byte{0xe2, 0x88, 0xa5}}, - "para": {Name: "para", CodePoints: []int{182}, Characters: []byte{0xc2, 0xb6}}, - "parallel": {Name: "parallel", CodePoints: []int{8741}, Characters: []byte{0xe2, 0x88, 0xa5}}, - "parsim": {Name: "parsim", CodePoints: []int{10995}, Characters: []byte{0xe2, 0xab, 0xb3}}, - "parsl": {Name: "parsl", CodePoints: []int{11005}, Characters: []byte{0xe2, 0xab, 0xbd}}, - "part": {Name: "part", CodePoints: []int{8706}, Characters: []byte{0xe2, 0x88, 0x82}}, - "pcy": {Name: "pcy", CodePoints: []int{1087}, Characters: []byte{0xd0, 0xbf}}, - "percnt": {Name: "percnt", CodePoints: []int{37}, Characters: []byte{0x25}}, - "period": {Name: "period", CodePoints: []int{46}, Characters: []byte{0x2e}}, - "permil": {Name: "permil", CodePoints: []int{8240}, Characters: []byte{0xe2, 0x80, 0xb0}}, - "perp": {Name: "perp", CodePoints: []int{8869}, Characters: []byte{0xe2, 0x8a, 0xa5}}, - "pertenk": {Name: "pertenk", CodePoints: []int{8241}, Characters: []byte{0xe2, 0x80, 0xb1}}, - "pfr": {Name: "pfr", CodePoints: []int{120109}, Characters: []byte{0xf0, 0x9d, 0x94, 0xad}}, - "phi": {Name: "phi", CodePoints: []int{966}, Characters: []byte{0xcf, 0x86}}, - "phiv": {Name: "phiv", CodePoints: []int{981}, Characters: []byte{0xcf, 0x95}}, - "phmmat": {Name: "phmmat", CodePoints: []int{8499}, Characters: []byte{0xe2, 0x84, 0xb3}}, - "phone": {Name: "phone", CodePoints: []int{9742}, Characters: []byte{0xe2, 0x98, 0x8e}}, - "pi": {Name: "pi", CodePoints: []int{960}, Characters: []byte{0xcf, 0x80}}, - "pitchfork": {Name: "pitchfork", CodePoints: []int{8916}, Characters: []byte{0xe2, 0x8b, 0x94}}, - "piv": {Name: "piv", CodePoints: []int{982}, Characters: []byte{0xcf, 0x96}}, - "planck": {Name: "planck", CodePoints: []int{8463}, Characters: []byte{0xe2, 0x84, 0x8f}}, - "planckh": {Name: "planckh", CodePoints: []int{8462}, Characters: []byte{0xe2, 0x84, 0x8e}}, - "plankv": {Name: "plankv", CodePoints: []int{8463}, Characters: []byte{0xe2, 0x84, 0x8f}}, - "plus": {Name: "plus", CodePoints: []int{43}, Characters: []byte{0x2b}}, - "plusacir": {Name: "plusacir", CodePoints: []int{10787}, Characters: []byte{0xe2, 0xa8, 0xa3}}, - "plusb": {Name: "plusb", CodePoints: []int{8862}, Characters: []byte{0xe2, 0x8a, 0x9e}}, - "pluscir": {Name: "pluscir", CodePoints: []int{10786}, Characters: []byte{0xe2, 0xa8, 0xa2}}, - "plusdo": {Name: "plusdo", CodePoints: []int{8724}, Characters: []byte{0xe2, 0x88, 0x94}}, - "plusdu": {Name: "plusdu", CodePoints: []int{10789}, Characters: []byte{0xe2, 0xa8, 0xa5}}, - "pluse": {Name: "pluse", CodePoints: []int{10866}, Characters: []byte{0xe2, 0xa9, 0xb2}}, - "plusmn": {Name: "plusmn", CodePoints: []int{177}, Characters: []byte{0xc2, 0xb1}}, - "plussim": {Name: "plussim", CodePoints: []int{10790}, Characters: []byte{0xe2, 0xa8, 0xa6}}, - "plustwo": {Name: "plustwo", CodePoints: []int{10791}, Characters: []byte{0xe2, 0xa8, 0xa7}}, - "pm": {Name: "pm", CodePoints: []int{177}, Characters: []byte{0xc2, 0xb1}}, - "pointint": {Name: "pointint", CodePoints: []int{10773}, Characters: []byte{0xe2, 0xa8, 0x95}}, - "popf": {Name: "popf", CodePoints: []int{120161}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa1}}, - "pound": {Name: "pound", CodePoints: []int{163}, Characters: []byte{0xc2, 0xa3}}, - "pr": {Name: "pr", CodePoints: []int{8826}, Characters: []byte{0xe2, 0x89, 0xba}}, - "prE": {Name: "prE", CodePoints: []int{10931}, Characters: []byte{0xe2, 0xaa, 0xb3}}, - "prap": {Name: "prap", CodePoints: []int{10935}, Characters: []byte{0xe2, 0xaa, 0xb7}}, - "prcue": {Name: "prcue", CodePoints: []int{8828}, Characters: []byte{0xe2, 0x89, 0xbc}}, - "pre": {Name: "pre", CodePoints: []int{10927}, Characters: []byte{0xe2, 0xaa, 0xaf}}, - "prec": {Name: "prec", CodePoints: []int{8826}, Characters: []byte{0xe2, 0x89, 0xba}}, - "precapprox": {Name: "precapprox", CodePoints: []int{10935}, Characters: []byte{0xe2, 0xaa, 0xb7}}, - "preccurlyeq": {Name: "preccurlyeq", CodePoints: []int{8828}, Characters: []byte{0xe2, 0x89, 0xbc}}, - "preceq": {Name: "preceq", CodePoints: []int{10927}, Characters: []byte{0xe2, 0xaa, 0xaf}}, - "precnapprox": {Name: "precnapprox", CodePoints: []int{10937}, Characters: []byte{0xe2, 0xaa, 0xb9}}, - "precneqq": {Name: "precneqq", CodePoints: []int{10933}, Characters: []byte{0xe2, 0xaa, 0xb5}}, - "precnsim": {Name: "precnsim", CodePoints: []int{8936}, Characters: []byte{0xe2, 0x8b, 0xa8}}, - "precsim": {Name: "precsim", CodePoints: []int{8830}, Characters: []byte{0xe2, 0x89, 0xbe}}, - "prime": {Name: "prime", CodePoints: []int{8242}, Characters: []byte{0xe2, 0x80, 0xb2}}, - "primes": {Name: "primes", CodePoints: []int{8473}, Characters: []byte{0xe2, 0x84, 0x99}}, - "prnE": {Name: "prnE", CodePoints: []int{10933}, Characters: []byte{0xe2, 0xaa, 0xb5}}, - "prnap": {Name: "prnap", CodePoints: []int{10937}, Characters: []byte{0xe2, 0xaa, 0xb9}}, - "prnsim": {Name: "prnsim", CodePoints: []int{8936}, Characters: []byte{0xe2, 0x8b, 0xa8}}, - "prod": {Name: "prod", CodePoints: []int{8719}, Characters: []byte{0xe2, 0x88, 0x8f}}, - "profalar": {Name: "profalar", CodePoints: []int{9006}, Characters: []byte{0xe2, 0x8c, 0xae}}, - "profline": {Name: "profline", CodePoints: []int{8978}, Characters: []byte{0xe2, 0x8c, 0x92}}, - "profsurf": {Name: "profsurf", CodePoints: []int{8979}, Characters: []byte{0xe2, 0x8c, 0x93}}, - "prop": {Name: "prop", CodePoints: []int{8733}, Characters: []byte{0xe2, 0x88, 0x9d}}, - "propto": {Name: "propto", CodePoints: []int{8733}, Characters: []byte{0xe2, 0x88, 0x9d}}, - "prsim": {Name: "prsim", CodePoints: []int{8830}, Characters: []byte{0xe2, 0x89, 0xbe}}, - "prurel": {Name: "prurel", CodePoints: []int{8880}, Characters: []byte{0xe2, 0x8a, 0xb0}}, - "pscr": {Name: "pscr", CodePoints: []int{120005}, Characters: []byte{0xf0, 0x9d, 0x93, 0x85}}, - "psi": {Name: "psi", CodePoints: []int{968}, Characters: []byte{0xcf, 0x88}}, - "puncsp": {Name: "puncsp", CodePoints: []int{8200}, Characters: []byte{0xe2, 0x80, 0x88}}, - "qfr": {Name: "qfr", CodePoints: []int{120110}, Characters: []byte{0xf0, 0x9d, 0x94, 0xae}}, - "qint": {Name: "qint", CodePoints: []int{10764}, Characters: []byte{0xe2, 0xa8, 0x8c}}, - "qopf": {Name: "qopf", CodePoints: []int{120162}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa2}}, - "qprime": {Name: "qprime", CodePoints: []int{8279}, Characters: []byte{0xe2, 0x81, 0x97}}, - "qscr": {Name: "qscr", CodePoints: []int{120006}, Characters: []byte{0xf0, 0x9d, 0x93, 0x86}}, - "quaternions": {Name: "quaternions", CodePoints: []int{8461}, Characters: []byte{0xe2, 0x84, 0x8d}}, - "quatint": {Name: "quatint", CodePoints: []int{10774}, Characters: []byte{0xe2, 0xa8, 0x96}}, - "quest": {Name: "quest", CodePoints: []int{63}, Characters: []byte{0x3f}}, - "questeq": {Name: "questeq", CodePoints: []int{8799}, Characters: []byte{0xe2, 0x89, 0x9f}}, - "quot": {Name: "quot", CodePoints: []int{34}, Characters: []byte{0x22}}, - "rAarr": {Name: "rAarr", CodePoints: []int{8667}, Characters: []byte{0xe2, 0x87, 0x9b}}, - "rArr": {Name: "rArr", CodePoints: []int{8658}, Characters: []byte{0xe2, 0x87, 0x92}}, - "rAtail": {Name: "rAtail", CodePoints: []int{10524}, Characters: []byte{0xe2, 0xa4, 0x9c}}, - "rBarr": {Name: "rBarr", CodePoints: []int{10511}, Characters: []byte{0xe2, 0xa4, 0x8f}}, - "rHar": {Name: "rHar", CodePoints: []int{10596}, Characters: []byte{0xe2, 0xa5, 0xa4}}, - "race": {Name: "race", CodePoints: []int{8765, 817}, Characters: []byte{0xe2, 0x88, 0xbd, 0xcc, 0xb1}}, - "racute": {Name: "racute", CodePoints: []int{341}, Characters: []byte{0xc5, 0x95}}, - "radic": {Name: "radic", CodePoints: []int{8730}, Characters: []byte{0xe2, 0x88, 0x9a}}, - "raemptyv": {Name: "raemptyv", CodePoints: []int{10675}, Characters: []byte{0xe2, 0xa6, 0xb3}}, - "rang": {Name: "rang", CodePoints: []int{10217}, Characters: []byte{0xe2, 0x9f, 0xa9}}, - "rangd": {Name: "rangd", CodePoints: []int{10642}, Characters: []byte{0xe2, 0xa6, 0x92}}, - "range": {Name: "range", CodePoints: []int{10661}, Characters: []byte{0xe2, 0xa6, 0xa5}}, - "rangle": {Name: "rangle", CodePoints: []int{10217}, Characters: []byte{0xe2, 0x9f, 0xa9}}, - "raquo": {Name: "raquo", CodePoints: []int{187}, Characters: []byte{0xc2, 0xbb}}, - "rarr": {Name: "rarr", CodePoints: []int{8594}, Characters: []byte{0xe2, 0x86, 0x92}}, - "rarrap": {Name: "rarrap", CodePoints: []int{10613}, Characters: []byte{0xe2, 0xa5, 0xb5}}, - "rarrb": {Name: "rarrb", CodePoints: []int{8677}, Characters: []byte{0xe2, 0x87, 0xa5}}, - "rarrbfs": {Name: "rarrbfs", CodePoints: []int{10528}, Characters: []byte{0xe2, 0xa4, 0xa0}}, - "rarrc": {Name: "rarrc", CodePoints: []int{10547}, Characters: []byte{0xe2, 0xa4, 0xb3}}, - "rarrfs": {Name: "rarrfs", CodePoints: []int{10526}, Characters: []byte{0xe2, 0xa4, 0x9e}}, - "rarrhk": {Name: "rarrhk", CodePoints: []int{8618}, Characters: []byte{0xe2, 0x86, 0xaa}}, - "rarrlp": {Name: "rarrlp", CodePoints: []int{8620}, Characters: []byte{0xe2, 0x86, 0xac}}, - "rarrpl": {Name: "rarrpl", CodePoints: []int{10565}, Characters: []byte{0xe2, 0xa5, 0x85}}, - "rarrsim": {Name: "rarrsim", CodePoints: []int{10612}, Characters: []byte{0xe2, 0xa5, 0xb4}}, - "rarrtl": {Name: "rarrtl", CodePoints: []int{8611}, Characters: []byte{0xe2, 0x86, 0xa3}}, - "rarrw": {Name: "rarrw", CodePoints: []int{8605}, Characters: []byte{0xe2, 0x86, 0x9d}}, - "ratail": {Name: "ratail", CodePoints: []int{10522}, Characters: []byte{0xe2, 0xa4, 0x9a}}, - "ratio": {Name: "ratio", CodePoints: []int{8758}, Characters: []byte{0xe2, 0x88, 0xb6}}, - "rationals": {Name: "rationals", CodePoints: []int{8474}, Characters: []byte{0xe2, 0x84, 0x9a}}, - "rbarr": {Name: "rbarr", CodePoints: []int{10509}, Characters: []byte{0xe2, 0xa4, 0x8d}}, - "rbbrk": {Name: "rbbrk", CodePoints: []int{10099}, Characters: []byte{0xe2, 0x9d, 0xb3}}, - "rbrace": {Name: "rbrace", CodePoints: []int{125}, Characters: []byte{0x7d}}, - "rbrack": {Name: "rbrack", CodePoints: []int{93}, Characters: []byte{0x5d}}, - "rbrke": {Name: "rbrke", CodePoints: []int{10636}, Characters: []byte{0xe2, 0xa6, 0x8c}}, - "rbrksld": {Name: "rbrksld", CodePoints: []int{10638}, Characters: []byte{0xe2, 0xa6, 0x8e}}, - "rbrkslu": {Name: "rbrkslu", CodePoints: []int{10640}, Characters: []byte{0xe2, 0xa6, 0x90}}, - "rcaron": {Name: "rcaron", CodePoints: []int{345}, Characters: []byte{0xc5, 0x99}}, - "rcedil": {Name: "rcedil", CodePoints: []int{343}, Characters: []byte{0xc5, 0x97}}, - "rceil": {Name: "rceil", CodePoints: []int{8969}, Characters: []byte{0xe2, 0x8c, 0x89}}, - "rcub": {Name: "rcub", CodePoints: []int{125}, Characters: []byte{0x7d}}, - "rcy": {Name: "rcy", CodePoints: []int{1088}, Characters: []byte{0xd1, 0x80}}, - "rdca": {Name: "rdca", CodePoints: []int{10551}, Characters: []byte{0xe2, 0xa4, 0xb7}}, - "rdldhar": {Name: "rdldhar", CodePoints: []int{10601}, Characters: []byte{0xe2, 0xa5, 0xa9}}, - "rdquo": {Name: "rdquo", CodePoints: []int{8221}, Characters: []byte{0xe2, 0x80, 0x9d}}, - "rdquor": {Name: "rdquor", CodePoints: []int{8221}, Characters: []byte{0xe2, 0x80, 0x9d}}, - "rdsh": {Name: "rdsh", CodePoints: []int{8627}, Characters: []byte{0xe2, 0x86, 0xb3}}, - "real": {Name: "real", CodePoints: []int{8476}, Characters: []byte{0xe2, 0x84, 0x9c}}, - "realine": {Name: "realine", CodePoints: []int{8475}, Characters: []byte{0xe2, 0x84, 0x9b}}, - "realpart": {Name: "realpart", CodePoints: []int{8476}, Characters: []byte{0xe2, 0x84, 0x9c}}, - "reals": {Name: "reals", CodePoints: []int{8477}, Characters: []byte{0xe2, 0x84, 0x9d}}, - "rect": {Name: "rect", CodePoints: []int{9645}, Characters: []byte{0xe2, 0x96, 0xad}}, - "reg": {Name: "reg", CodePoints: []int{174}, Characters: []byte{0xc2, 0xae}}, - "rfisht": {Name: "rfisht", CodePoints: []int{10621}, Characters: []byte{0xe2, 0xa5, 0xbd}}, - "rfloor": {Name: "rfloor", CodePoints: []int{8971}, Characters: []byte{0xe2, 0x8c, 0x8b}}, - "rfr": {Name: "rfr", CodePoints: []int{120111}, Characters: []byte{0xf0, 0x9d, 0x94, 0xaf}}, - "rhard": {Name: "rhard", CodePoints: []int{8641}, Characters: []byte{0xe2, 0x87, 0x81}}, - "rharu": {Name: "rharu", CodePoints: []int{8640}, Characters: []byte{0xe2, 0x87, 0x80}}, - "rharul": {Name: "rharul", CodePoints: []int{10604}, Characters: []byte{0xe2, 0xa5, 0xac}}, - "rho": {Name: "rho", CodePoints: []int{961}, Characters: []byte{0xcf, 0x81}}, - "rhov": {Name: "rhov", CodePoints: []int{1009}, Characters: []byte{0xcf, 0xb1}}, - "rightarrow": {Name: "rightarrow", CodePoints: []int{8594}, Characters: []byte{0xe2, 0x86, 0x92}}, - "rightarrowtail": {Name: "rightarrowtail", CodePoints: []int{8611}, Characters: []byte{0xe2, 0x86, 0xa3}}, - "rightharpoondown": {Name: "rightharpoondown", CodePoints: []int{8641}, Characters: []byte{0xe2, 0x87, 0x81}}, - "rightharpoonup": {Name: "rightharpoonup", CodePoints: []int{8640}, Characters: []byte{0xe2, 0x87, 0x80}}, - "rightleftarrows": {Name: "rightleftarrows", CodePoints: []int{8644}, Characters: []byte{0xe2, 0x87, 0x84}}, - "rightleftharpoons": {Name: "rightleftharpoons", CodePoints: []int{8652}, Characters: []byte{0xe2, 0x87, 0x8c}}, - "rightrightarrows": {Name: "rightrightarrows", CodePoints: []int{8649}, Characters: []byte{0xe2, 0x87, 0x89}}, - "rightsquigarrow": {Name: "rightsquigarrow", CodePoints: []int{8605}, Characters: []byte{0xe2, 0x86, 0x9d}}, - "rightthreetimes": {Name: "rightthreetimes", CodePoints: []int{8908}, Characters: []byte{0xe2, 0x8b, 0x8c}}, - "ring": {Name: "ring", CodePoints: []int{730}, Characters: []byte{0xcb, 0x9a}}, - "risingdotseq": {Name: "risingdotseq", CodePoints: []int{8787}, Characters: []byte{0xe2, 0x89, 0x93}}, - "rlarr": {Name: "rlarr", CodePoints: []int{8644}, Characters: []byte{0xe2, 0x87, 0x84}}, - "rlhar": {Name: "rlhar", CodePoints: []int{8652}, Characters: []byte{0xe2, 0x87, 0x8c}}, - "rlm": {Name: "rlm", CodePoints: []int{8207}, Characters: []byte{0xe2, 0x80, 0x8f}}, - "rmoust": {Name: "rmoust", CodePoints: []int{9137}, Characters: []byte{0xe2, 0x8e, 0xb1}}, - "rmoustache": {Name: "rmoustache", CodePoints: []int{9137}, Characters: []byte{0xe2, 0x8e, 0xb1}}, - "rnmid": {Name: "rnmid", CodePoints: []int{10990}, Characters: []byte{0xe2, 0xab, 0xae}}, - "roang": {Name: "roang", CodePoints: []int{10221}, Characters: []byte{0xe2, 0x9f, 0xad}}, - "roarr": {Name: "roarr", CodePoints: []int{8702}, Characters: []byte{0xe2, 0x87, 0xbe}}, - "robrk": {Name: "robrk", CodePoints: []int{10215}, Characters: []byte{0xe2, 0x9f, 0xa7}}, - "ropar": {Name: "ropar", CodePoints: []int{10630}, Characters: []byte{0xe2, 0xa6, 0x86}}, - "ropf": {Name: "ropf", CodePoints: []int{120163}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa3}}, - "roplus": {Name: "roplus", CodePoints: []int{10798}, Characters: []byte{0xe2, 0xa8, 0xae}}, - "rotimes": {Name: "rotimes", CodePoints: []int{10805}, Characters: []byte{0xe2, 0xa8, 0xb5}}, - "rpar": {Name: "rpar", CodePoints: []int{41}, Characters: []byte{0x29}}, - "rpargt": {Name: "rpargt", CodePoints: []int{10644}, Characters: []byte{0xe2, 0xa6, 0x94}}, - "rppolint": {Name: "rppolint", CodePoints: []int{10770}, Characters: []byte{0xe2, 0xa8, 0x92}}, - "rrarr": {Name: "rrarr", CodePoints: []int{8649}, Characters: []byte{0xe2, 0x87, 0x89}}, - "rsaquo": {Name: "rsaquo", CodePoints: []int{8250}, Characters: []byte{0xe2, 0x80, 0xba}}, - "rscr": {Name: "rscr", CodePoints: []int{120007}, Characters: []byte{0xf0, 0x9d, 0x93, 0x87}}, - "rsh": {Name: "rsh", CodePoints: []int{8625}, Characters: []byte{0xe2, 0x86, 0xb1}}, - "rsqb": {Name: "rsqb", CodePoints: []int{93}, Characters: []byte{0x5d}}, - "rsquo": {Name: "rsquo", CodePoints: []int{8217}, Characters: []byte{0xe2, 0x80, 0x99}}, - "rsquor": {Name: "rsquor", CodePoints: []int{8217}, Characters: []byte{0xe2, 0x80, 0x99}}, - "rthree": {Name: "rthree", CodePoints: []int{8908}, Characters: []byte{0xe2, 0x8b, 0x8c}}, - "rtimes": {Name: "rtimes", CodePoints: []int{8906}, Characters: []byte{0xe2, 0x8b, 0x8a}}, - "rtri": {Name: "rtri", CodePoints: []int{9657}, Characters: []byte{0xe2, 0x96, 0xb9}}, - "rtrie": {Name: "rtrie", CodePoints: []int{8885}, Characters: []byte{0xe2, 0x8a, 0xb5}}, - "rtrif": {Name: "rtrif", CodePoints: []int{9656}, Characters: []byte{0xe2, 0x96, 0xb8}}, - "rtriltri": {Name: "rtriltri", CodePoints: []int{10702}, Characters: []byte{0xe2, 0xa7, 0x8e}}, - "ruluhar": {Name: "ruluhar", CodePoints: []int{10600}, Characters: []byte{0xe2, 0xa5, 0xa8}}, - "rx": {Name: "rx", CodePoints: []int{8478}, Characters: []byte{0xe2, 0x84, 0x9e}}, - "sacute": {Name: "sacute", CodePoints: []int{347}, Characters: []byte{0xc5, 0x9b}}, - "sbquo": {Name: "sbquo", CodePoints: []int{8218}, Characters: []byte{0xe2, 0x80, 0x9a}}, - "sc": {Name: "sc", CodePoints: []int{8827}, Characters: []byte{0xe2, 0x89, 0xbb}}, - "scE": {Name: "scE", CodePoints: []int{10932}, Characters: []byte{0xe2, 0xaa, 0xb4}}, - "scap": {Name: "scap", CodePoints: []int{10936}, Characters: []byte{0xe2, 0xaa, 0xb8}}, - "scaron": {Name: "scaron", CodePoints: []int{353}, Characters: []byte{0xc5, 0xa1}}, - "sccue": {Name: "sccue", CodePoints: []int{8829}, Characters: []byte{0xe2, 0x89, 0xbd}}, - "sce": {Name: "sce", CodePoints: []int{10928}, Characters: []byte{0xe2, 0xaa, 0xb0}}, - "scedil": {Name: "scedil", CodePoints: []int{351}, Characters: []byte{0xc5, 0x9f}}, - "scirc": {Name: "scirc", CodePoints: []int{349}, Characters: []byte{0xc5, 0x9d}}, - "scnE": {Name: "scnE", CodePoints: []int{10934}, Characters: []byte{0xe2, 0xaa, 0xb6}}, - "scnap": {Name: "scnap", CodePoints: []int{10938}, Characters: []byte{0xe2, 0xaa, 0xba}}, - "scnsim": {Name: "scnsim", CodePoints: []int{8937}, Characters: []byte{0xe2, 0x8b, 0xa9}}, - "scpolint": {Name: "scpolint", CodePoints: []int{10771}, Characters: []byte{0xe2, 0xa8, 0x93}}, - "scsim": {Name: "scsim", CodePoints: []int{8831}, Characters: []byte{0xe2, 0x89, 0xbf}}, - "scy": {Name: "scy", CodePoints: []int{1089}, Characters: []byte{0xd1, 0x81}}, - "sdot": {Name: "sdot", CodePoints: []int{8901}, Characters: []byte{0xe2, 0x8b, 0x85}}, - "sdotb": {Name: "sdotb", CodePoints: []int{8865}, Characters: []byte{0xe2, 0x8a, 0xa1}}, - "sdote": {Name: "sdote", CodePoints: []int{10854}, Characters: []byte{0xe2, 0xa9, 0xa6}}, - "seArr": {Name: "seArr", CodePoints: []int{8664}, Characters: []byte{0xe2, 0x87, 0x98}}, - "searhk": {Name: "searhk", CodePoints: []int{10533}, Characters: []byte{0xe2, 0xa4, 0xa5}}, - "searr": {Name: "searr", CodePoints: []int{8600}, Characters: []byte{0xe2, 0x86, 0x98}}, - "searrow": {Name: "searrow", CodePoints: []int{8600}, Characters: []byte{0xe2, 0x86, 0x98}}, - "sect": {Name: "sect", CodePoints: []int{167}, Characters: []byte{0xc2, 0xa7}}, - "semi": {Name: "semi", CodePoints: []int{59}, Characters: []byte{0x3b}}, - "seswar": {Name: "seswar", CodePoints: []int{10537}, Characters: []byte{0xe2, 0xa4, 0xa9}}, - "setminus": {Name: "setminus", CodePoints: []int{8726}, Characters: []byte{0xe2, 0x88, 0x96}}, - "setmn": {Name: "setmn", CodePoints: []int{8726}, Characters: []byte{0xe2, 0x88, 0x96}}, - "sext": {Name: "sext", CodePoints: []int{10038}, Characters: []byte{0xe2, 0x9c, 0xb6}}, - "sfr": {Name: "sfr", CodePoints: []int{120112}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb0}}, - "sfrown": {Name: "sfrown", CodePoints: []int{8994}, Characters: []byte{0xe2, 0x8c, 0xa2}}, - "sharp": {Name: "sharp", CodePoints: []int{9839}, Characters: []byte{0xe2, 0x99, 0xaf}}, - "shchcy": {Name: "shchcy", CodePoints: []int{1097}, Characters: []byte{0xd1, 0x89}}, - "shcy": {Name: "shcy", CodePoints: []int{1096}, Characters: []byte{0xd1, 0x88}}, - "shortmid": {Name: "shortmid", CodePoints: []int{8739}, Characters: []byte{0xe2, 0x88, 0xa3}}, - "shortparallel": {Name: "shortparallel", CodePoints: []int{8741}, Characters: []byte{0xe2, 0x88, 0xa5}}, - "shy": {Name: "shy", CodePoints: []int{173}, Characters: []byte{0xc2, 0xad}}, - "sigma": {Name: "sigma", CodePoints: []int{963}, Characters: []byte{0xcf, 0x83}}, - "sigmaf": {Name: "sigmaf", CodePoints: []int{962}, Characters: []byte{0xcf, 0x82}}, - "sigmav": {Name: "sigmav", CodePoints: []int{962}, Characters: []byte{0xcf, 0x82}}, - "sim": {Name: "sim", CodePoints: []int{8764}, Characters: []byte{0xe2, 0x88, 0xbc}}, - "simdot": {Name: "simdot", CodePoints: []int{10858}, Characters: []byte{0xe2, 0xa9, 0xaa}}, - "sime": {Name: "sime", CodePoints: []int{8771}, Characters: []byte{0xe2, 0x89, 0x83}}, - "simeq": {Name: "simeq", CodePoints: []int{8771}, Characters: []byte{0xe2, 0x89, 0x83}}, - "simg": {Name: "simg", CodePoints: []int{10910}, Characters: []byte{0xe2, 0xaa, 0x9e}}, - "simgE": {Name: "simgE", CodePoints: []int{10912}, Characters: []byte{0xe2, 0xaa, 0xa0}}, - "siml": {Name: "siml", CodePoints: []int{10909}, Characters: []byte{0xe2, 0xaa, 0x9d}}, - "simlE": {Name: "simlE", CodePoints: []int{10911}, Characters: []byte{0xe2, 0xaa, 0x9f}}, - "simne": {Name: "simne", CodePoints: []int{8774}, Characters: []byte{0xe2, 0x89, 0x86}}, - "simplus": {Name: "simplus", CodePoints: []int{10788}, Characters: []byte{0xe2, 0xa8, 0xa4}}, - "simrarr": {Name: "simrarr", CodePoints: []int{10610}, Characters: []byte{0xe2, 0xa5, 0xb2}}, - "slarr": {Name: "slarr", CodePoints: []int{8592}, Characters: []byte{0xe2, 0x86, 0x90}}, - "smallsetminus": {Name: "smallsetminus", CodePoints: []int{8726}, Characters: []byte{0xe2, 0x88, 0x96}}, - "smashp": {Name: "smashp", CodePoints: []int{10803}, Characters: []byte{0xe2, 0xa8, 0xb3}}, - "smeparsl": {Name: "smeparsl", CodePoints: []int{10724}, Characters: []byte{0xe2, 0xa7, 0xa4}}, - "smid": {Name: "smid", CodePoints: []int{8739}, Characters: []byte{0xe2, 0x88, 0xa3}}, - "smile": {Name: "smile", CodePoints: []int{8995}, Characters: []byte{0xe2, 0x8c, 0xa3}}, - "smt": {Name: "smt", CodePoints: []int{10922}, Characters: []byte{0xe2, 0xaa, 0xaa}}, - "smte": {Name: "smte", CodePoints: []int{10924}, Characters: []byte{0xe2, 0xaa, 0xac}}, - "smtes": {Name: "smtes", CodePoints: []int{10924, 65024}, Characters: []byte{0xe2, 0xaa, 0xac, 0xef, 0xb8, 0x80}}, - "softcy": {Name: "softcy", CodePoints: []int{1100}, Characters: []byte{0xd1, 0x8c}}, - "sol": {Name: "sol", CodePoints: []int{47}, Characters: []byte{0x2f}}, - "solb": {Name: "solb", CodePoints: []int{10692}, Characters: []byte{0xe2, 0xa7, 0x84}}, - "solbar": {Name: "solbar", CodePoints: []int{9023}, Characters: []byte{0xe2, 0x8c, 0xbf}}, - "sopf": {Name: "sopf", CodePoints: []int{120164}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa4}}, - "spades": {Name: "spades", CodePoints: []int{9824}, Characters: []byte{0xe2, 0x99, 0xa0}}, - "spadesuit": {Name: "spadesuit", CodePoints: []int{9824}, Characters: []byte{0xe2, 0x99, 0xa0}}, - "spar": {Name: "spar", CodePoints: []int{8741}, Characters: []byte{0xe2, 0x88, 0xa5}}, - "sqcap": {Name: "sqcap", CodePoints: []int{8851}, Characters: []byte{0xe2, 0x8a, 0x93}}, - "sqcaps": {Name: "sqcaps", CodePoints: []int{8851, 65024}, Characters: []byte{0xe2, 0x8a, 0x93, 0xef, 0xb8, 0x80}}, - "sqcup": {Name: "sqcup", CodePoints: []int{8852}, Characters: []byte{0xe2, 0x8a, 0x94}}, - "sqcups": {Name: "sqcups", CodePoints: []int{8852, 65024}, Characters: []byte{0xe2, 0x8a, 0x94, 0xef, 0xb8, 0x80}}, - "sqsub": {Name: "sqsub", CodePoints: []int{8847}, Characters: []byte{0xe2, 0x8a, 0x8f}}, - "sqsube": {Name: "sqsube", CodePoints: []int{8849}, Characters: []byte{0xe2, 0x8a, 0x91}}, - "sqsubset": {Name: "sqsubset", CodePoints: []int{8847}, Characters: []byte{0xe2, 0x8a, 0x8f}}, - "sqsubseteq": {Name: "sqsubseteq", CodePoints: []int{8849}, Characters: []byte{0xe2, 0x8a, 0x91}}, - "sqsup": {Name: "sqsup", CodePoints: []int{8848}, Characters: []byte{0xe2, 0x8a, 0x90}}, - "sqsupe": {Name: "sqsupe", CodePoints: []int{8850}, Characters: []byte{0xe2, 0x8a, 0x92}}, - "sqsupset": {Name: "sqsupset", CodePoints: []int{8848}, Characters: []byte{0xe2, 0x8a, 0x90}}, - "sqsupseteq": {Name: "sqsupseteq", CodePoints: []int{8850}, Characters: []byte{0xe2, 0x8a, 0x92}}, - "squ": {Name: "squ", CodePoints: []int{9633}, Characters: []byte{0xe2, 0x96, 0xa1}}, - "square": {Name: "square", CodePoints: []int{9633}, Characters: []byte{0xe2, 0x96, 0xa1}}, - "squarf": {Name: "squarf", CodePoints: []int{9642}, Characters: []byte{0xe2, 0x96, 0xaa}}, - "squf": {Name: "squf", CodePoints: []int{9642}, Characters: []byte{0xe2, 0x96, 0xaa}}, - "srarr": {Name: "srarr", CodePoints: []int{8594}, Characters: []byte{0xe2, 0x86, 0x92}}, - "sscr": {Name: "sscr", CodePoints: []int{120008}, Characters: []byte{0xf0, 0x9d, 0x93, 0x88}}, - "ssetmn": {Name: "ssetmn", CodePoints: []int{8726}, Characters: []byte{0xe2, 0x88, 0x96}}, - "ssmile": {Name: "ssmile", CodePoints: []int{8995}, Characters: []byte{0xe2, 0x8c, 0xa3}}, - "sstarf": {Name: "sstarf", CodePoints: []int{8902}, Characters: []byte{0xe2, 0x8b, 0x86}}, - "star": {Name: "star", CodePoints: []int{9734}, Characters: []byte{0xe2, 0x98, 0x86}}, - "starf": {Name: "starf", CodePoints: []int{9733}, Characters: []byte{0xe2, 0x98, 0x85}}, - "straightepsilon": {Name: "straightepsilon", CodePoints: []int{1013}, Characters: []byte{0xcf, 0xb5}}, - "straightphi": {Name: "straightphi", CodePoints: []int{981}, Characters: []byte{0xcf, 0x95}}, - "strns": {Name: "strns", CodePoints: []int{175}, Characters: []byte{0xc2, 0xaf}}, - "sub": {Name: "sub", CodePoints: []int{8834}, Characters: []byte{0xe2, 0x8a, 0x82}}, - "subE": {Name: "subE", CodePoints: []int{10949}, Characters: []byte{0xe2, 0xab, 0x85}}, - "subdot": {Name: "subdot", CodePoints: []int{10941}, Characters: []byte{0xe2, 0xaa, 0xbd}}, - "sube": {Name: "sube", CodePoints: []int{8838}, Characters: []byte{0xe2, 0x8a, 0x86}}, - "subedot": {Name: "subedot", CodePoints: []int{10947}, Characters: []byte{0xe2, 0xab, 0x83}}, - "submult": {Name: "submult", CodePoints: []int{10945}, Characters: []byte{0xe2, 0xab, 0x81}}, - "subnE": {Name: "subnE", CodePoints: []int{10955}, Characters: []byte{0xe2, 0xab, 0x8b}}, - "subne": {Name: "subne", CodePoints: []int{8842}, Characters: []byte{0xe2, 0x8a, 0x8a}}, - "subplus": {Name: "subplus", CodePoints: []int{10943}, Characters: []byte{0xe2, 0xaa, 0xbf}}, - "subrarr": {Name: "subrarr", CodePoints: []int{10617}, Characters: []byte{0xe2, 0xa5, 0xb9}}, - "subset": {Name: "subset", CodePoints: []int{8834}, Characters: []byte{0xe2, 0x8a, 0x82}}, - "subseteq": {Name: "subseteq", CodePoints: []int{8838}, Characters: []byte{0xe2, 0x8a, 0x86}}, - "subseteqq": {Name: "subseteqq", CodePoints: []int{10949}, Characters: []byte{0xe2, 0xab, 0x85}}, - "subsetneq": {Name: "subsetneq", CodePoints: []int{8842}, Characters: []byte{0xe2, 0x8a, 0x8a}}, - "subsetneqq": {Name: "subsetneqq", CodePoints: []int{10955}, Characters: []byte{0xe2, 0xab, 0x8b}}, - "subsim": {Name: "subsim", CodePoints: []int{10951}, Characters: []byte{0xe2, 0xab, 0x87}}, - "subsub": {Name: "subsub", CodePoints: []int{10965}, Characters: []byte{0xe2, 0xab, 0x95}}, - "subsup": {Name: "subsup", CodePoints: []int{10963}, Characters: []byte{0xe2, 0xab, 0x93}}, - "succ": {Name: "succ", CodePoints: []int{8827}, Characters: []byte{0xe2, 0x89, 0xbb}}, - "succapprox": {Name: "succapprox", CodePoints: []int{10936}, Characters: []byte{0xe2, 0xaa, 0xb8}}, - "succcurlyeq": {Name: "succcurlyeq", CodePoints: []int{8829}, Characters: []byte{0xe2, 0x89, 0xbd}}, - "succeq": {Name: "succeq", CodePoints: []int{10928}, Characters: []byte{0xe2, 0xaa, 0xb0}}, - "succnapprox": {Name: "succnapprox", CodePoints: []int{10938}, Characters: []byte{0xe2, 0xaa, 0xba}}, - "succneqq": {Name: "succneqq", CodePoints: []int{10934}, Characters: []byte{0xe2, 0xaa, 0xb6}}, - "succnsim": {Name: "succnsim", CodePoints: []int{8937}, Characters: []byte{0xe2, 0x8b, 0xa9}}, - "succsim": {Name: "succsim", CodePoints: []int{8831}, Characters: []byte{0xe2, 0x89, 0xbf}}, - "sum": {Name: "sum", CodePoints: []int{8721}, Characters: []byte{0xe2, 0x88, 0x91}}, - "sung": {Name: "sung", CodePoints: []int{9834}, Characters: []byte{0xe2, 0x99, 0xaa}}, - "sup": {Name: "sup", CodePoints: []int{8835}, Characters: []byte{0xe2, 0x8a, 0x83}}, - "sup1": {Name: "sup1", CodePoints: []int{185}, Characters: []byte{0xc2, 0xb9}}, - "sup2": {Name: "sup2", CodePoints: []int{178}, Characters: []byte{0xc2, 0xb2}}, - "sup3": {Name: "sup3", CodePoints: []int{179}, Characters: []byte{0xc2, 0xb3}}, - "supE": {Name: "supE", CodePoints: []int{10950}, Characters: []byte{0xe2, 0xab, 0x86}}, - "supdot": {Name: "supdot", CodePoints: []int{10942}, Characters: []byte{0xe2, 0xaa, 0xbe}}, - "supdsub": {Name: "supdsub", CodePoints: []int{10968}, Characters: []byte{0xe2, 0xab, 0x98}}, - "supe": {Name: "supe", CodePoints: []int{8839}, Characters: []byte{0xe2, 0x8a, 0x87}}, - "supedot": {Name: "supedot", CodePoints: []int{10948}, Characters: []byte{0xe2, 0xab, 0x84}}, - "suphsol": {Name: "suphsol", CodePoints: []int{10185}, Characters: []byte{0xe2, 0x9f, 0x89}}, - "suphsub": {Name: "suphsub", CodePoints: []int{10967}, Characters: []byte{0xe2, 0xab, 0x97}}, - "suplarr": {Name: "suplarr", CodePoints: []int{10619}, Characters: []byte{0xe2, 0xa5, 0xbb}}, - "supmult": {Name: "supmult", CodePoints: []int{10946}, Characters: []byte{0xe2, 0xab, 0x82}}, - "supnE": {Name: "supnE", CodePoints: []int{10956}, Characters: []byte{0xe2, 0xab, 0x8c}}, - "supne": {Name: "supne", CodePoints: []int{8843}, Characters: []byte{0xe2, 0x8a, 0x8b}}, - "supplus": {Name: "supplus", CodePoints: []int{10944}, Characters: []byte{0xe2, 0xab, 0x80}}, - "supset": {Name: "supset", CodePoints: []int{8835}, Characters: []byte{0xe2, 0x8a, 0x83}}, - "supseteq": {Name: "supseteq", CodePoints: []int{8839}, Characters: []byte{0xe2, 0x8a, 0x87}}, - "supseteqq": {Name: "supseteqq", CodePoints: []int{10950}, Characters: []byte{0xe2, 0xab, 0x86}}, - "supsetneq": {Name: "supsetneq", CodePoints: []int{8843}, Characters: []byte{0xe2, 0x8a, 0x8b}}, - "supsetneqq": {Name: "supsetneqq", CodePoints: []int{10956}, Characters: []byte{0xe2, 0xab, 0x8c}}, - "supsim": {Name: "supsim", CodePoints: []int{10952}, Characters: []byte{0xe2, 0xab, 0x88}}, - "supsub": {Name: "supsub", CodePoints: []int{10964}, Characters: []byte{0xe2, 0xab, 0x94}}, - "supsup": {Name: "supsup", CodePoints: []int{10966}, Characters: []byte{0xe2, 0xab, 0x96}}, - "swArr": {Name: "swArr", CodePoints: []int{8665}, Characters: []byte{0xe2, 0x87, 0x99}}, - "swarhk": {Name: "swarhk", CodePoints: []int{10534}, Characters: []byte{0xe2, 0xa4, 0xa6}}, - "swarr": {Name: "swarr", CodePoints: []int{8601}, Characters: []byte{0xe2, 0x86, 0x99}}, - "swarrow": {Name: "swarrow", CodePoints: []int{8601}, Characters: []byte{0xe2, 0x86, 0x99}}, - "swnwar": {Name: "swnwar", CodePoints: []int{10538}, Characters: []byte{0xe2, 0xa4, 0xaa}}, - "szlig": {Name: "szlig", CodePoints: []int{223}, Characters: []byte{0xc3, 0x9f}}, - "target": {Name: "target", CodePoints: []int{8982}, Characters: []byte{0xe2, 0x8c, 0x96}}, - "tau": {Name: "tau", CodePoints: []int{964}, Characters: []byte{0xcf, 0x84}}, - "tbrk": {Name: "tbrk", CodePoints: []int{9140}, Characters: []byte{0xe2, 0x8e, 0xb4}}, - "tcaron": {Name: "tcaron", CodePoints: []int{357}, Characters: []byte{0xc5, 0xa5}}, - "tcedil": {Name: "tcedil", CodePoints: []int{355}, Characters: []byte{0xc5, 0xa3}}, - "tcy": {Name: "tcy", CodePoints: []int{1090}, Characters: []byte{0xd1, 0x82}}, - "tdot": {Name: "tdot", CodePoints: []int{8411}, Characters: []byte{0xe2, 0x83, 0x9b}}, - "telrec": {Name: "telrec", CodePoints: []int{8981}, Characters: []byte{0xe2, 0x8c, 0x95}}, - "tfr": {Name: "tfr", CodePoints: []int{120113}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb1}}, - "there4": {Name: "there4", CodePoints: []int{8756}, Characters: []byte{0xe2, 0x88, 0xb4}}, - "therefore": {Name: "therefore", CodePoints: []int{8756}, Characters: []byte{0xe2, 0x88, 0xb4}}, - "theta": {Name: "theta", CodePoints: []int{952}, Characters: []byte{0xce, 0xb8}}, - "thetasym": {Name: "thetasym", CodePoints: []int{977}, Characters: []byte{0xcf, 0x91}}, - "thetav": {Name: "thetav", CodePoints: []int{977}, Characters: []byte{0xcf, 0x91}}, - "thickapprox": {Name: "thickapprox", CodePoints: []int{8776}, Characters: []byte{0xe2, 0x89, 0x88}}, - "thicksim": {Name: "thicksim", CodePoints: []int{8764}, Characters: []byte{0xe2, 0x88, 0xbc}}, - "thinsp": {Name: "thinsp", CodePoints: []int{8201}, Characters: []byte{0xe2, 0x80, 0x89}}, - "thkap": {Name: "thkap", CodePoints: []int{8776}, Characters: []byte{0xe2, 0x89, 0x88}}, - "thksim": {Name: "thksim", CodePoints: []int{8764}, Characters: []byte{0xe2, 0x88, 0xbc}}, - "thorn": {Name: "thorn", CodePoints: []int{254}, Characters: []byte{0xc3, 0xbe}}, - "tilde": {Name: "tilde", CodePoints: []int{732}, Characters: []byte{0xcb, 0x9c}}, - "times": {Name: "times", CodePoints: []int{215}, Characters: []byte{0xc3, 0x97}}, - "timesb": {Name: "timesb", CodePoints: []int{8864}, Characters: []byte{0xe2, 0x8a, 0xa0}}, - "timesbar": {Name: "timesbar", CodePoints: []int{10801}, Characters: []byte{0xe2, 0xa8, 0xb1}}, - "timesd": {Name: "timesd", CodePoints: []int{10800}, Characters: []byte{0xe2, 0xa8, 0xb0}}, - "tint": {Name: "tint", CodePoints: []int{8749}, Characters: []byte{0xe2, 0x88, 0xad}}, - "toea": {Name: "toea", CodePoints: []int{10536}, Characters: []byte{0xe2, 0xa4, 0xa8}}, - "top": {Name: "top", CodePoints: []int{8868}, Characters: []byte{0xe2, 0x8a, 0xa4}}, - "topbot": {Name: "topbot", CodePoints: []int{9014}, Characters: []byte{0xe2, 0x8c, 0xb6}}, - "topcir": {Name: "topcir", CodePoints: []int{10993}, Characters: []byte{0xe2, 0xab, 0xb1}}, - "topf": {Name: "topf", CodePoints: []int{120165}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa5}}, - "topfork": {Name: "topfork", CodePoints: []int{10970}, Characters: []byte{0xe2, 0xab, 0x9a}}, - "tosa": {Name: "tosa", CodePoints: []int{10537}, Characters: []byte{0xe2, 0xa4, 0xa9}}, - "tprime": {Name: "tprime", CodePoints: []int{8244}, Characters: []byte{0xe2, 0x80, 0xb4}}, - "trade": {Name: "trade", CodePoints: []int{8482}, Characters: []byte{0xe2, 0x84, 0xa2}}, - "triangle": {Name: "triangle", CodePoints: []int{9653}, Characters: []byte{0xe2, 0x96, 0xb5}}, - "triangledown": {Name: "triangledown", CodePoints: []int{9663}, Characters: []byte{0xe2, 0x96, 0xbf}}, - "triangleleft": {Name: "triangleleft", CodePoints: []int{9667}, Characters: []byte{0xe2, 0x97, 0x83}}, - "trianglelefteq": {Name: "trianglelefteq", CodePoints: []int{8884}, Characters: []byte{0xe2, 0x8a, 0xb4}}, - "triangleq": {Name: "triangleq", CodePoints: []int{8796}, Characters: []byte{0xe2, 0x89, 0x9c}}, - "triangleright": {Name: "triangleright", CodePoints: []int{9657}, Characters: []byte{0xe2, 0x96, 0xb9}}, - "trianglerighteq": {Name: "trianglerighteq", CodePoints: []int{8885}, Characters: []byte{0xe2, 0x8a, 0xb5}}, - "tridot": {Name: "tridot", CodePoints: []int{9708}, Characters: []byte{0xe2, 0x97, 0xac}}, - "trie": {Name: "trie", CodePoints: []int{8796}, Characters: []byte{0xe2, 0x89, 0x9c}}, - "triminus": {Name: "triminus", CodePoints: []int{10810}, Characters: []byte{0xe2, 0xa8, 0xba}}, - "triplus": {Name: "triplus", CodePoints: []int{10809}, Characters: []byte{0xe2, 0xa8, 0xb9}}, - "trisb": {Name: "trisb", CodePoints: []int{10701}, Characters: []byte{0xe2, 0xa7, 0x8d}}, - "tritime": {Name: "tritime", CodePoints: []int{10811}, Characters: []byte{0xe2, 0xa8, 0xbb}}, - "trpezium": {Name: "trpezium", CodePoints: []int{9186}, Characters: []byte{0xe2, 0x8f, 0xa2}}, - "tscr": {Name: "tscr", CodePoints: []int{120009}, Characters: []byte{0xf0, 0x9d, 0x93, 0x89}}, - "tscy": {Name: "tscy", CodePoints: []int{1094}, Characters: []byte{0xd1, 0x86}}, - "tshcy": {Name: "tshcy", CodePoints: []int{1115}, Characters: []byte{0xd1, 0x9b}}, - "tstrok": {Name: "tstrok", CodePoints: []int{359}, Characters: []byte{0xc5, 0xa7}}, - "twixt": {Name: "twixt", CodePoints: []int{8812}, Characters: []byte{0xe2, 0x89, 0xac}}, - "twoheadleftarrow": {Name: "twoheadleftarrow", CodePoints: []int{8606}, Characters: []byte{0xe2, 0x86, 0x9e}}, - "twoheadrightarrow": {Name: "twoheadrightarrow", CodePoints: []int{8608}, Characters: []byte{0xe2, 0x86, 0xa0}}, - "uArr": {Name: "uArr", CodePoints: []int{8657}, Characters: []byte{0xe2, 0x87, 0x91}}, - "uHar": {Name: "uHar", CodePoints: []int{10595}, Characters: []byte{0xe2, 0xa5, 0xa3}}, - "uacute": {Name: "uacute", CodePoints: []int{250}, Characters: []byte{0xc3, 0xba}}, - "uarr": {Name: "uarr", CodePoints: []int{8593}, Characters: []byte{0xe2, 0x86, 0x91}}, - "ubrcy": {Name: "ubrcy", CodePoints: []int{1118}, Characters: []byte{0xd1, 0x9e}}, - "ubreve": {Name: "ubreve", CodePoints: []int{365}, Characters: []byte{0xc5, 0xad}}, - "ucirc": {Name: "ucirc", CodePoints: []int{251}, Characters: []byte{0xc3, 0xbb}}, - "ucy": {Name: "ucy", CodePoints: []int{1091}, Characters: []byte{0xd1, 0x83}}, - "udarr": {Name: "udarr", CodePoints: []int{8645}, Characters: []byte{0xe2, 0x87, 0x85}}, - "udblac": {Name: "udblac", CodePoints: []int{369}, Characters: []byte{0xc5, 0xb1}}, - "udhar": {Name: "udhar", CodePoints: []int{10606}, Characters: []byte{0xe2, 0xa5, 0xae}}, - "ufisht": {Name: "ufisht", CodePoints: []int{10622}, Characters: []byte{0xe2, 0xa5, 0xbe}}, - "ufr": {Name: "ufr", CodePoints: []int{120114}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb2}}, - "ugrave": {Name: "ugrave", CodePoints: []int{249}, Characters: []byte{0xc3, 0xb9}}, - "uharl": {Name: "uharl", CodePoints: []int{8639}, Characters: []byte{0xe2, 0x86, 0xbf}}, - "uharr": {Name: "uharr", CodePoints: []int{8638}, Characters: []byte{0xe2, 0x86, 0xbe}}, - "uhblk": {Name: "uhblk", CodePoints: []int{9600}, Characters: []byte{0xe2, 0x96, 0x80}}, - "ulcorn": {Name: "ulcorn", CodePoints: []int{8988}, Characters: []byte{0xe2, 0x8c, 0x9c}}, - "ulcorner": {Name: "ulcorner", CodePoints: []int{8988}, Characters: []byte{0xe2, 0x8c, 0x9c}}, - "ulcrop": {Name: "ulcrop", CodePoints: []int{8975}, Characters: []byte{0xe2, 0x8c, 0x8f}}, - "ultri": {Name: "ultri", CodePoints: []int{9720}, Characters: []byte{0xe2, 0x97, 0xb8}}, - "umacr": {Name: "umacr", CodePoints: []int{363}, Characters: []byte{0xc5, 0xab}}, - "uml": {Name: "uml", CodePoints: []int{168}, Characters: []byte{0xc2, 0xa8}}, - "uogon": {Name: "uogon", CodePoints: []int{371}, Characters: []byte{0xc5, 0xb3}}, - "uopf": {Name: "uopf", CodePoints: []int{120166}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa6}}, - "uparrow": {Name: "uparrow", CodePoints: []int{8593}, Characters: []byte{0xe2, 0x86, 0x91}}, - "updownarrow": {Name: "updownarrow", CodePoints: []int{8597}, Characters: []byte{0xe2, 0x86, 0x95}}, - "upharpoonleft": {Name: "upharpoonleft", CodePoints: []int{8639}, Characters: []byte{0xe2, 0x86, 0xbf}}, - "upharpoonright": {Name: "upharpoonright", CodePoints: []int{8638}, Characters: []byte{0xe2, 0x86, 0xbe}}, - "uplus": {Name: "uplus", CodePoints: []int{8846}, Characters: []byte{0xe2, 0x8a, 0x8e}}, - "upsi": {Name: "upsi", CodePoints: []int{965}, Characters: []byte{0xcf, 0x85}}, - "upsih": {Name: "upsih", CodePoints: []int{978}, Characters: []byte{0xcf, 0x92}}, - "upsilon": {Name: "upsilon", CodePoints: []int{965}, Characters: []byte{0xcf, 0x85}}, - "upuparrows": {Name: "upuparrows", CodePoints: []int{8648}, Characters: []byte{0xe2, 0x87, 0x88}}, - "urcorn": {Name: "urcorn", CodePoints: []int{8989}, Characters: []byte{0xe2, 0x8c, 0x9d}}, - "urcorner": {Name: "urcorner", CodePoints: []int{8989}, Characters: []byte{0xe2, 0x8c, 0x9d}}, - "urcrop": {Name: "urcrop", CodePoints: []int{8974}, Characters: []byte{0xe2, 0x8c, 0x8e}}, - "uring": {Name: "uring", CodePoints: []int{367}, Characters: []byte{0xc5, 0xaf}}, - "urtri": {Name: "urtri", CodePoints: []int{9721}, Characters: []byte{0xe2, 0x97, 0xb9}}, - "uscr": {Name: "uscr", CodePoints: []int{120010}, Characters: []byte{0xf0, 0x9d, 0x93, 0x8a}}, - "utdot": {Name: "utdot", CodePoints: []int{8944}, Characters: []byte{0xe2, 0x8b, 0xb0}}, - "utilde": {Name: "utilde", CodePoints: []int{361}, Characters: []byte{0xc5, 0xa9}}, - "utri": {Name: "utri", CodePoints: []int{9653}, Characters: []byte{0xe2, 0x96, 0xb5}}, - "utrif": {Name: "utrif", CodePoints: []int{9652}, Characters: []byte{0xe2, 0x96, 0xb4}}, - "uuarr": {Name: "uuarr", CodePoints: []int{8648}, Characters: []byte{0xe2, 0x87, 0x88}}, - "uuml": {Name: "uuml", CodePoints: []int{252}, Characters: []byte{0xc3, 0xbc}}, - "uwangle": {Name: "uwangle", CodePoints: []int{10663}, Characters: []byte{0xe2, 0xa6, 0xa7}}, - "vArr": {Name: "vArr", CodePoints: []int{8661}, Characters: []byte{0xe2, 0x87, 0x95}}, - "vBar": {Name: "vBar", CodePoints: []int{10984}, Characters: []byte{0xe2, 0xab, 0xa8}}, - "vBarv": {Name: "vBarv", CodePoints: []int{10985}, Characters: []byte{0xe2, 0xab, 0xa9}}, - "vDash": {Name: "vDash", CodePoints: []int{8872}, Characters: []byte{0xe2, 0x8a, 0xa8}}, - "vangrt": {Name: "vangrt", CodePoints: []int{10652}, Characters: []byte{0xe2, 0xa6, 0x9c}}, - "varepsilon": {Name: "varepsilon", CodePoints: []int{1013}, Characters: []byte{0xcf, 0xb5}}, - "varkappa": {Name: "varkappa", CodePoints: []int{1008}, Characters: []byte{0xcf, 0xb0}}, - "varnothing": {Name: "varnothing", CodePoints: []int{8709}, Characters: []byte{0xe2, 0x88, 0x85}}, - "varphi": {Name: "varphi", CodePoints: []int{981}, Characters: []byte{0xcf, 0x95}}, - "varpi": {Name: "varpi", CodePoints: []int{982}, Characters: []byte{0xcf, 0x96}}, - "varpropto": {Name: "varpropto", CodePoints: []int{8733}, Characters: []byte{0xe2, 0x88, 0x9d}}, - "varr": {Name: "varr", CodePoints: []int{8597}, Characters: []byte{0xe2, 0x86, 0x95}}, - "varrho": {Name: "varrho", CodePoints: []int{1009}, Characters: []byte{0xcf, 0xb1}}, - "varsigma": {Name: "varsigma", CodePoints: []int{962}, Characters: []byte{0xcf, 0x82}}, - "varsubsetneq": {Name: "varsubsetneq", CodePoints: []int{8842, 65024}, Characters: []byte{0xe2, 0x8a, 0x8a, 0xef, 0xb8, 0x80}}, - "varsubsetneqq": {Name: "varsubsetneqq", CodePoints: []int{10955, 65024}, Characters: []byte{0xe2, 0xab, 0x8b, 0xef, 0xb8, 0x80}}, - "varsupsetneq": {Name: "varsupsetneq", CodePoints: []int{8843, 65024}, Characters: []byte{0xe2, 0x8a, 0x8b, 0xef, 0xb8, 0x80}}, - "varsupsetneqq": {Name: "varsupsetneqq", CodePoints: []int{10956, 65024}, Characters: []byte{0xe2, 0xab, 0x8c, 0xef, 0xb8, 0x80}}, - "vartheta": {Name: "vartheta", CodePoints: []int{977}, Characters: []byte{0xcf, 0x91}}, - "vartriangleleft": {Name: "vartriangleleft", CodePoints: []int{8882}, Characters: []byte{0xe2, 0x8a, 0xb2}}, - "vartriangleright": {Name: "vartriangleright", CodePoints: []int{8883}, Characters: []byte{0xe2, 0x8a, 0xb3}}, - "vcy": {Name: "vcy", CodePoints: []int{1074}, Characters: []byte{0xd0, 0xb2}}, - "vdash": {Name: "vdash", CodePoints: []int{8866}, Characters: []byte{0xe2, 0x8a, 0xa2}}, - "vee": {Name: "vee", CodePoints: []int{8744}, Characters: []byte{0xe2, 0x88, 0xa8}}, - "veebar": {Name: "veebar", CodePoints: []int{8891}, Characters: []byte{0xe2, 0x8a, 0xbb}}, - "veeeq": {Name: "veeeq", CodePoints: []int{8794}, Characters: []byte{0xe2, 0x89, 0x9a}}, - "vellip": {Name: "vellip", CodePoints: []int{8942}, Characters: []byte{0xe2, 0x8b, 0xae}}, - "verbar": {Name: "verbar", CodePoints: []int{124}, Characters: []byte{0x7c}}, - "vert": {Name: "vert", CodePoints: []int{124}, Characters: []byte{0x7c}}, - "vfr": {Name: "vfr", CodePoints: []int{120115}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb3}}, - "vltri": {Name: "vltri", CodePoints: []int{8882}, Characters: []byte{0xe2, 0x8a, 0xb2}}, - "vnsub": {Name: "vnsub", CodePoints: []int{8834, 8402}, Characters: []byte{0xe2, 0x8a, 0x82, 0xe2, 0x83, 0x92}}, - "vnsup": {Name: "vnsup", CodePoints: []int{8835, 8402}, Characters: []byte{0xe2, 0x8a, 0x83, 0xe2, 0x83, 0x92}}, - "vopf": {Name: "vopf", CodePoints: []int{120167}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa7}}, - "vprop": {Name: "vprop", CodePoints: []int{8733}, Characters: []byte{0xe2, 0x88, 0x9d}}, - "vrtri": {Name: "vrtri", CodePoints: []int{8883}, Characters: []byte{0xe2, 0x8a, 0xb3}}, - "vscr": {Name: "vscr", CodePoints: []int{120011}, Characters: []byte{0xf0, 0x9d, 0x93, 0x8b}}, - "vsubnE": {Name: "vsubnE", CodePoints: []int{10955, 65024}, Characters: []byte{0xe2, 0xab, 0x8b, 0xef, 0xb8, 0x80}}, - "vsubne": {Name: "vsubne", CodePoints: []int{8842, 65024}, Characters: []byte{0xe2, 0x8a, 0x8a, 0xef, 0xb8, 0x80}}, - "vsupnE": {Name: "vsupnE", CodePoints: []int{10956, 65024}, Characters: []byte{0xe2, 0xab, 0x8c, 0xef, 0xb8, 0x80}}, - "vsupne": {Name: "vsupne", CodePoints: []int{8843, 65024}, Characters: []byte{0xe2, 0x8a, 0x8b, 0xef, 0xb8, 0x80}}, - "vzigzag": {Name: "vzigzag", CodePoints: []int{10650}, Characters: []byte{0xe2, 0xa6, 0x9a}}, - "wcirc": {Name: "wcirc", CodePoints: []int{373}, Characters: []byte{0xc5, 0xb5}}, - "wedbar": {Name: "wedbar", CodePoints: []int{10847}, Characters: []byte{0xe2, 0xa9, 0x9f}}, - "wedge": {Name: "wedge", CodePoints: []int{8743}, Characters: []byte{0xe2, 0x88, 0xa7}}, - "wedgeq": {Name: "wedgeq", CodePoints: []int{8793}, Characters: []byte{0xe2, 0x89, 0x99}}, - "weierp": {Name: "weierp", CodePoints: []int{8472}, Characters: []byte{0xe2, 0x84, 0x98}}, - "wfr": {Name: "wfr", CodePoints: []int{120116}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb4}}, - "wopf": {Name: "wopf", CodePoints: []int{120168}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa8}}, - "wp": {Name: "wp", CodePoints: []int{8472}, Characters: []byte{0xe2, 0x84, 0x98}}, - "wr": {Name: "wr", CodePoints: []int{8768}, Characters: []byte{0xe2, 0x89, 0x80}}, - "wreath": {Name: "wreath", CodePoints: []int{8768}, Characters: []byte{0xe2, 0x89, 0x80}}, - "wscr": {Name: "wscr", CodePoints: []int{120012}, Characters: []byte{0xf0, 0x9d, 0x93, 0x8c}}, - "xcap": {Name: "xcap", CodePoints: []int{8898}, Characters: []byte{0xe2, 0x8b, 0x82}}, - "xcirc": {Name: "xcirc", CodePoints: []int{9711}, Characters: []byte{0xe2, 0x97, 0xaf}}, - "xcup": {Name: "xcup", CodePoints: []int{8899}, Characters: []byte{0xe2, 0x8b, 0x83}}, - "xdtri": {Name: "xdtri", CodePoints: []int{9661}, Characters: []byte{0xe2, 0x96, 0xbd}}, - "xfr": {Name: "xfr", CodePoints: []int{120117}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb5}}, - "xhArr": {Name: "xhArr", CodePoints: []int{10234}, Characters: []byte{0xe2, 0x9f, 0xba}}, - "xharr": {Name: "xharr", CodePoints: []int{10231}, Characters: []byte{0xe2, 0x9f, 0xb7}}, - "xi": {Name: "xi", CodePoints: []int{958}, Characters: []byte{0xce, 0xbe}}, - "xlArr": {Name: "xlArr", CodePoints: []int{10232}, Characters: []byte{0xe2, 0x9f, 0xb8}}, - "xlarr": {Name: "xlarr", CodePoints: []int{10229}, Characters: []byte{0xe2, 0x9f, 0xb5}}, - "xmap": {Name: "xmap", CodePoints: []int{10236}, Characters: []byte{0xe2, 0x9f, 0xbc}}, - "xnis": {Name: "xnis", CodePoints: []int{8955}, Characters: []byte{0xe2, 0x8b, 0xbb}}, - "xodot": {Name: "xodot", CodePoints: []int{10752}, Characters: []byte{0xe2, 0xa8, 0x80}}, - "xopf": {Name: "xopf", CodePoints: []int{120169}, Characters: []byte{0xf0, 0x9d, 0x95, 0xa9}}, - "xoplus": {Name: "xoplus", CodePoints: []int{10753}, Characters: []byte{0xe2, 0xa8, 0x81}}, - "xotime": {Name: "xotime", CodePoints: []int{10754}, Characters: []byte{0xe2, 0xa8, 0x82}}, - "xrArr": {Name: "xrArr", CodePoints: []int{10233}, Characters: []byte{0xe2, 0x9f, 0xb9}}, - "xrarr": {Name: "xrarr", CodePoints: []int{10230}, Characters: []byte{0xe2, 0x9f, 0xb6}}, - "xscr": {Name: "xscr", CodePoints: []int{120013}, Characters: []byte{0xf0, 0x9d, 0x93, 0x8d}}, - "xsqcup": {Name: "xsqcup", CodePoints: []int{10758}, Characters: []byte{0xe2, 0xa8, 0x86}}, - "xuplus": {Name: "xuplus", CodePoints: []int{10756}, Characters: []byte{0xe2, 0xa8, 0x84}}, - "xutri": {Name: "xutri", CodePoints: []int{9651}, Characters: []byte{0xe2, 0x96, 0xb3}}, - "xvee": {Name: "xvee", CodePoints: []int{8897}, Characters: []byte{0xe2, 0x8b, 0x81}}, - "xwedge": {Name: "xwedge", CodePoints: []int{8896}, Characters: []byte{0xe2, 0x8b, 0x80}}, - "yacute": {Name: "yacute", CodePoints: []int{253}, Characters: []byte{0xc3, 0xbd}}, - "yacy": {Name: "yacy", CodePoints: []int{1103}, Characters: []byte{0xd1, 0x8f}}, - "ycirc": {Name: "ycirc", CodePoints: []int{375}, Characters: []byte{0xc5, 0xb7}}, - "ycy": {Name: "ycy", CodePoints: []int{1099}, Characters: []byte{0xd1, 0x8b}}, - "yen": {Name: "yen", CodePoints: []int{165}, Characters: []byte{0xc2, 0xa5}}, - "yfr": {Name: "yfr", CodePoints: []int{120118}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb6}}, - "yicy": {Name: "yicy", CodePoints: []int{1111}, Characters: []byte{0xd1, 0x97}}, - "yopf": {Name: "yopf", CodePoints: []int{120170}, Characters: []byte{0xf0, 0x9d, 0x95, 0xaa}}, - "yscr": {Name: "yscr", CodePoints: []int{120014}, Characters: []byte{0xf0, 0x9d, 0x93, 0x8e}}, - "yucy": {Name: "yucy", CodePoints: []int{1102}, Characters: []byte{0xd1, 0x8e}}, - "yuml": {Name: "yuml", CodePoints: []int{255}, Characters: []byte{0xc3, 0xbf}}, - "zacute": {Name: "zacute", CodePoints: []int{378}, Characters: []byte{0xc5, 0xba}}, - "zcaron": {Name: "zcaron", CodePoints: []int{382}, Characters: []byte{0xc5, 0xbe}}, - "zcy": {Name: "zcy", CodePoints: []int{1079}, Characters: []byte{0xd0, 0xb7}}, - "zdot": {Name: "zdot", CodePoints: []int{380}, Characters: []byte{0xc5, 0xbc}}, - "zeetrf": {Name: "zeetrf", CodePoints: []int{8488}, Characters: []byte{0xe2, 0x84, 0xa8}}, - "zeta": {Name: "zeta", CodePoints: []int{950}, Characters: []byte{0xce, 0xb6}}, - "zfr": {Name: "zfr", CodePoints: []int{120119}, Characters: []byte{0xf0, 0x9d, 0x94, 0xb7}}, - "zhcy": {Name: "zhcy", CodePoints: []int{1078}, Characters: []byte{0xd0, 0xb6}}, - "zigrarr": {Name: "zigrarr", CodePoints: []int{8669}, Characters: []byte{0xe2, 0x87, 0x9d}}, - "zopf": {Name: "zopf", CodePoints: []int{120171}, Characters: []byte{0xf0, 0x9d, 0x95, 0xab}}, - "zscr": {Name: "zscr", CodePoints: []int{120015}, Characters: []byte{0xf0, 0x9d, 0x93, 0x8f}}, - "zwj": {Name: "zwj", CodePoints: []int{8205}, Characters: []byte{0xe2, 0x80, 0x8d}}, - "zwnj": {Name: "zwnj", CodePoints: []int{8204}, Characters: []byte{0xe2, 0x80, 0x8c}}, -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/unicode_case_folding.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/unicode_case_folding.go deleted file mode 100644 index f66ee7c43..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/unicode_case_folding.go +++ /dev/null @@ -1,1491 +0,0 @@ -package util - -var unicodeCaseFoldings = map[rune][]rune{ - 0x41: []int32{97}, - 0x42: []int32{98}, - 0x43: []int32{99}, - 0x44: []int32{100}, - 0x45: []int32{101}, - 0x46: []int32{102}, - 0x47: []int32{103}, - 0x48: []int32{104}, - 0x49: []int32{105}, - 0x4a: []int32{106}, - 0x4b: []int32{107}, - 0x4c: []int32{108}, - 0x4d: []int32{109}, - 0x4e: []int32{110}, - 0x4f: []int32{111}, - 0x50: []int32{112}, - 0x51: []int32{113}, - 0x52: []int32{114}, - 0x53: []int32{115}, - 0x54: []int32{116}, - 0x55: []int32{117}, - 0x56: []int32{118}, - 0x57: []int32{119}, - 0x58: []int32{120}, - 0x59: []int32{121}, - 0x5a: []int32{122}, - 0xb5: []int32{956}, - 0xc0: []int32{224}, - 0xc1: []int32{225}, - 0xc2: []int32{226}, - 0xc3: []int32{227}, - 0xc4: []int32{228}, - 0xc5: []int32{229}, - 0xc6: []int32{230}, - 0xc7: []int32{231}, - 0xc8: []int32{232}, - 0xc9: []int32{233}, - 0xca: []int32{234}, - 0xcb: []int32{235}, - 0xcc: []int32{236}, - 0xcd: []int32{237}, - 0xce: []int32{238}, - 0xcf: []int32{239}, - 0xd0: []int32{240}, - 0xd1: []int32{241}, - 0xd2: []int32{242}, - 0xd3: []int32{243}, - 0xd4: []int32{244}, - 0xd5: []int32{245}, - 0xd6: []int32{246}, - 0xd8: []int32{248}, - 0xd9: []int32{249}, - 0xda: []int32{250}, - 0xdb: []int32{251}, - 0xdc: []int32{252}, - 0xdd: []int32{253}, - 0xde: []int32{254}, - 0xdf: []int32{115, 115}, - 0x100: []int32{257}, - 0x102: []int32{259}, - 0x104: []int32{261}, - 0x106: []int32{263}, - 0x108: []int32{265}, - 0x10a: []int32{267}, - 0x10c: []int32{269}, - 0x10e: []int32{271}, - 0x110: []int32{273}, - 0x112: []int32{275}, - 0x114: []int32{277}, - 0x116: []int32{279}, - 0x118: []int32{281}, - 0x11a: []int32{283}, - 0x11c: []int32{285}, - 0x11e: []int32{287}, - 0x120: []int32{289}, - 0x122: []int32{291}, - 0x124: []int32{293}, - 0x126: []int32{295}, - 0x128: []int32{297}, - 0x12a: []int32{299}, - 0x12c: []int32{301}, - 0x12e: []int32{303}, - 0x130: []int32{105, 775}, - 0x132: []int32{307}, - 0x134: []int32{309}, - 0x136: []int32{311}, - 0x139: []int32{314}, - 0x13b: []int32{316}, - 0x13d: []int32{318}, - 0x13f: []int32{320}, - 0x141: []int32{322}, - 0x143: []int32{324}, - 0x145: []int32{326}, - 0x147: []int32{328}, - 0x149: []int32{700, 110}, - 0x14a: []int32{331}, - 0x14c: []int32{333}, - 0x14e: []int32{335}, - 0x150: []int32{337}, - 0x152: []int32{339}, - 0x154: []int32{341}, - 0x156: []int32{343}, - 0x158: []int32{345}, - 0x15a: []int32{347}, - 0x15c: []int32{349}, - 0x15e: []int32{351}, - 0x160: []int32{353}, - 0x162: []int32{355}, - 0x164: []int32{357}, - 0x166: []int32{359}, - 0x168: []int32{361}, - 0x16a: []int32{363}, - 0x16c: []int32{365}, - 0x16e: []int32{367}, - 0x170: []int32{369}, - 0x172: []int32{371}, - 0x174: []int32{373}, - 0x176: []int32{375}, - 0x178: []int32{255}, - 0x179: []int32{378}, - 0x17b: []int32{380}, - 0x17d: []int32{382}, - 0x17f: []int32{115}, - 0x181: []int32{595}, - 0x182: []int32{387}, - 0x184: []int32{389}, - 0x186: []int32{596}, - 0x187: []int32{392}, - 0x189: []int32{598}, - 0x18a: []int32{599}, - 0x18b: []int32{396}, - 0x18e: []int32{477}, - 0x18f: []int32{601}, - 0x190: []int32{603}, - 0x191: []int32{402}, - 0x193: []int32{608}, - 0x194: []int32{611}, - 0x196: []int32{617}, - 0x197: []int32{616}, - 0x198: []int32{409}, - 0x19c: []int32{623}, - 0x19d: []int32{626}, - 0x19f: []int32{629}, - 0x1a0: []int32{417}, - 0x1a2: []int32{419}, - 0x1a4: []int32{421}, - 0x1a6: []int32{640}, - 0x1a7: []int32{424}, - 0x1a9: []int32{643}, - 0x1ac: []int32{429}, - 0x1ae: []int32{648}, - 0x1af: []int32{432}, - 0x1b1: []int32{650}, - 0x1b2: []int32{651}, - 0x1b3: []int32{436}, - 0x1b5: []int32{438}, - 0x1b7: []int32{658}, - 0x1b8: []int32{441}, - 0x1bc: []int32{445}, - 0x1c4: []int32{454}, - 0x1c5: []int32{454}, - 0x1c7: []int32{457}, - 0x1c8: []int32{457}, - 0x1ca: []int32{460}, - 0x1cb: []int32{460}, - 0x1cd: []int32{462}, - 0x1cf: []int32{464}, - 0x1d1: []int32{466}, - 0x1d3: []int32{468}, - 0x1d5: []int32{470}, - 0x1d7: []int32{472}, - 0x1d9: []int32{474}, - 0x1db: []int32{476}, - 0x1de: []int32{479}, - 0x1e0: []int32{481}, - 0x1e2: []int32{483}, - 0x1e4: []int32{485}, - 0x1e6: []int32{487}, - 0x1e8: []int32{489}, - 0x1ea: []int32{491}, - 0x1ec: []int32{493}, - 0x1ee: []int32{495}, - 0x1f0: []int32{106, 780}, - 0x1f1: []int32{499}, - 0x1f2: []int32{499}, - 0x1f4: []int32{501}, - 0x1f6: []int32{405}, - 0x1f7: []int32{447}, - 0x1f8: []int32{505}, - 0x1fa: []int32{507}, - 0x1fc: []int32{509}, - 0x1fe: []int32{511}, - 0x200: []int32{513}, - 0x202: []int32{515}, - 0x204: []int32{517}, - 0x206: []int32{519}, - 0x208: []int32{521}, - 0x20a: []int32{523}, - 0x20c: []int32{525}, - 0x20e: []int32{527}, - 0x210: []int32{529}, - 0x212: []int32{531}, - 0x214: []int32{533}, - 0x216: []int32{535}, - 0x218: []int32{537}, - 0x21a: []int32{539}, - 0x21c: []int32{541}, - 0x21e: []int32{543}, - 0x220: []int32{414}, - 0x222: []int32{547}, - 0x224: []int32{549}, - 0x226: []int32{551}, - 0x228: []int32{553}, - 0x22a: []int32{555}, - 0x22c: []int32{557}, - 0x22e: []int32{559}, - 0x230: []int32{561}, - 0x232: []int32{563}, - 0x23a: []int32{11365}, - 0x23b: []int32{572}, - 0x23d: []int32{410}, - 0x23e: []int32{11366}, - 0x241: []int32{578}, - 0x243: []int32{384}, - 0x244: []int32{649}, - 0x245: []int32{652}, - 0x246: []int32{583}, - 0x248: []int32{585}, - 0x24a: []int32{587}, - 0x24c: []int32{589}, - 0x24e: []int32{591}, - 0x345: []int32{953}, - 0x370: []int32{881}, - 0x372: []int32{883}, - 0x376: []int32{887}, - 0x37f: []int32{1011}, - 0x386: []int32{940}, - 0x388: []int32{941}, - 0x389: []int32{942}, - 0x38a: []int32{943}, - 0x38c: []int32{972}, - 0x38e: []int32{973}, - 0x38f: []int32{974}, - 0x390: []int32{953, 776, 769}, - 0x391: []int32{945}, - 0x392: []int32{946}, - 0x393: []int32{947}, - 0x394: []int32{948}, - 0x395: []int32{949}, - 0x396: []int32{950}, - 0x397: []int32{951}, - 0x398: []int32{952}, - 0x399: []int32{953}, - 0x39a: []int32{954}, - 0x39b: []int32{955}, - 0x39c: []int32{956}, - 0x39d: []int32{957}, - 0x39e: []int32{958}, - 0x39f: []int32{959}, - 0x3a0: []int32{960}, - 0x3a1: []int32{961}, - 0x3a3: []int32{963}, - 0x3a4: []int32{964}, - 0x3a5: []int32{965}, - 0x3a6: []int32{966}, - 0x3a7: []int32{967}, - 0x3a8: []int32{968}, - 0x3a9: []int32{969}, - 0x3aa: []int32{970}, - 0x3ab: []int32{971}, - 0x3b0: []int32{965, 776, 769}, - 0x3c2: []int32{963}, - 0x3cf: []int32{983}, - 0x3d0: []int32{946}, - 0x3d1: []int32{952}, - 0x3d5: []int32{966}, - 0x3d6: []int32{960}, - 0x3d8: []int32{985}, - 0x3da: []int32{987}, - 0x3dc: []int32{989}, - 0x3de: []int32{991}, - 0x3e0: []int32{993}, - 0x3e2: []int32{995}, - 0x3e4: []int32{997}, - 0x3e6: []int32{999}, - 0x3e8: []int32{1001}, - 0x3ea: []int32{1003}, - 0x3ec: []int32{1005}, - 0x3ee: []int32{1007}, - 0x3f0: []int32{954}, - 0x3f1: []int32{961}, - 0x3f4: []int32{952}, - 0x3f5: []int32{949}, - 0x3f7: []int32{1016}, - 0x3f9: []int32{1010}, - 0x3fa: []int32{1019}, - 0x3fd: []int32{891}, - 0x3fe: []int32{892}, - 0x3ff: []int32{893}, - 0x400: []int32{1104}, - 0x401: []int32{1105}, - 0x402: []int32{1106}, - 0x403: []int32{1107}, - 0x404: []int32{1108}, - 0x405: []int32{1109}, - 0x406: []int32{1110}, - 0x407: []int32{1111}, - 0x408: []int32{1112}, - 0x409: []int32{1113}, - 0x40a: []int32{1114}, - 0x40b: []int32{1115}, - 0x40c: []int32{1116}, - 0x40d: []int32{1117}, - 0x40e: []int32{1118}, - 0x40f: []int32{1119}, - 0x410: []int32{1072}, - 0x411: []int32{1073}, - 0x412: []int32{1074}, - 0x413: []int32{1075}, - 0x414: []int32{1076}, - 0x415: []int32{1077}, - 0x416: []int32{1078}, - 0x417: []int32{1079}, - 0x418: []int32{1080}, - 0x419: []int32{1081}, - 0x41a: []int32{1082}, - 0x41b: []int32{1083}, - 0x41c: []int32{1084}, - 0x41d: []int32{1085}, - 0x41e: []int32{1086}, - 0x41f: []int32{1087}, - 0x420: []int32{1088}, - 0x421: []int32{1089}, - 0x422: []int32{1090}, - 0x423: []int32{1091}, - 0x424: []int32{1092}, - 0x425: []int32{1093}, - 0x426: []int32{1094}, - 0x427: []int32{1095}, - 0x428: []int32{1096}, - 0x429: []int32{1097}, - 0x42a: []int32{1098}, - 0x42b: []int32{1099}, - 0x42c: []int32{1100}, - 0x42d: []int32{1101}, - 0x42e: []int32{1102}, - 0x42f: []int32{1103}, - 0x460: []int32{1121}, - 0x462: []int32{1123}, - 0x464: []int32{1125}, - 0x466: []int32{1127}, - 0x468: []int32{1129}, - 0x46a: []int32{1131}, - 0x46c: []int32{1133}, - 0x46e: []int32{1135}, - 0x470: []int32{1137}, - 0x472: []int32{1139}, - 0x474: []int32{1141}, - 0x476: []int32{1143}, - 0x478: []int32{1145}, - 0x47a: []int32{1147}, - 0x47c: []int32{1149}, - 0x47e: []int32{1151}, - 0x480: []int32{1153}, - 0x48a: []int32{1163}, - 0x48c: []int32{1165}, - 0x48e: []int32{1167}, - 0x490: []int32{1169}, - 0x492: []int32{1171}, - 0x494: []int32{1173}, - 0x496: []int32{1175}, - 0x498: []int32{1177}, - 0x49a: []int32{1179}, - 0x49c: []int32{1181}, - 0x49e: []int32{1183}, - 0x4a0: []int32{1185}, - 0x4a2: []int32{1187}, - 0x4a4: []int32{1189}, - 0x4a6: []int32{1191}, - 0x4a8: []int32{1193}, - 0x4aa: []int32{1195}, - 0x4ac: []int32{1197}, - 0x4ae: []int32{1199}, - 0x4b0: []int32{1201}, - 0x4b2: []int32{1203}, - 0x4b4: []int32{1205}, - 0x4b6: []int32{1207}, - 0x4b8: []int32{1209}, - 0x4ba: []int32{1211}, - 0x4bc: []int32{1213}, - 0x4be: []int32{1215}, - 0x4c0: []int32{1231}, - 0x4c1: []int32{1218}, - 0x4c3: []int32{1220}, - 0x4c5: []int32{1222}, - 0x4c7: []int32{1224}, - 0x4c9: []int32{1226}, - 0x4cb: []int32{1228}, - 0x4cd: []int32{1230}, - 0x4d0: []int32{1233}, - 0x4d2: []int32{1235}, - 0x4d4: []int32{1237}, - 0x4d6: []int32{1239}, - 0x4d8: []int32{1241}, - 0x4da: []int32{1243}, - 0x4dc: []int32{1245}, - 0x4de: []int32{1247}, - 0x4e0: []int32{1249}, - 0x4e2: []int32{1251}, - 0x4e4: []int32{1253}, - 0x4e6: []int32{1255}, - 0x4e8: []int32{1257}, - 0x4ea: []int32{1259}, - 0x4ec: []int32{1261}, - 0x4ee: []int32{1263}, - 0x4f0: []int32{1265}, - 0x4f2: []int32{1267}, - 0x4f4: []int32{1269}, - 0x4f6: []int32{1271}, - 0x4f8: []int32{1273}, - 0x4fa: []int32{1275}, - 0x4fc: []int32{1277}, - 0x4fe: []int32{1279}, - 0x500: []int32{1281}, - 0x502: []int32{1283}, - 0x504: []int32{1285}, - 0x506: []int32{1287}, - 0x508: []int32{1289}, - 0x50a: []int32{1291}, - 0x50c: []int32{1293}, - 0x50e: []int32{1295}, - 0x510: []int32{1297}, - 0x512: []int32{1299}, - 0x514: []int32{1301}, - 0x516: []int32{1303}, - 0x518: []int32{1305}, - 0x51a: []int32{1307}, - 0x51c: []int32{1309}, - 0x51e: []int32{1311}, - 0x520: []int32{1313}, - 0x522: []int32{1315}, - 0x524: []int32{1317}, - 0x526: []int32{1319}, - 0x528: []int32{1321}, - 0x52a: []int32{1323}, - 0x52c: []int32{1325}, - 0x52e: []int32{1327}, - 0x531: []int32{1377}, - 0x532: []int32{1378}, - 0x533: []int32{1379}, - 0x534: []int32{1380}, - 0x535: []int32{1381}, - 0x536: []int32{1382}, - 0x537: []int32{1383}, - 0x538: []int32{1384}, - 0x539: []int32{1385}, - 0x53a: []int32{1386}, - 0x53b: []int32{1387}, - 0x53c: []int32{1388}, - 0x53d: []int32{1389}, - 0x53e: []int32{1390}, - 0x53f: []int32{1391}, - 0x540: []int32{1392}, - 0x541: []int32{1393}, - 0x542: []int32{1394}, - 0x543: []int32{1395}, - 0x544: []int32{1396}, - 0x545: []int32{1397}, - 0x546: []int32{1398}, - 0x547: []int32{1399}, - 0x548: []int32{1400}, - 0x549: []int32{1401}, - 0x54a: []int32{1402}, - 0x54b: []int32{1403}, - 0x54c: []int32{1404}, - 0x54d: []int32{1405}, - 0x54e: []int32{1406}, - 0x54f: []int32{1407}, - 0x550: []int32{1408}, - 0x551: []int32{1409}, - 0x552: []int32{1410}, - 0x553: []int32{1411}, - 0x554: []int32{1412}, - 0x555: []int32{1413}, - 0x556: []int32{1414}, - 0x587: []int32{1381, 1410}, - 0x10a0: []int32{11520}, - 0x10a1: []int32{11521}, - 0x10a2: []int32{11522}, - 0x10a3: []int32{11523}, - 0x10a4: []int32{11524}, - 0x10a5: []int32{11525}, - 0x10a6: []int32{11526}, - 0x10a7: []int32{11527}, - 0x10a8: []int32{11528}, - 0x10a9: []int32{11529}, - 0x10aa: []int32{11530}, - 0x10ab: []int32{11531}, - 0x10ac: []int32{11532}, - 0x10ad: []int32{11533}, - 0x10ae: []int32{11534}, - 0x10af: []int32{11535}, - 0x10b0: []int32{11536}, - 0x10b1: []int32{11537}, - 0x10b2: []int32{11538}, - 0x10b3: []int32{11539}, - 0x10b4: []int32{11540}, - 0x10b5: []int32{11541}, - 0x10b6: []int32{11542}, - 0x10b7: []int32{11543}, - 0x10b8: []int32{11544}, - 0x10b9: []int32{11545}, - 0x10ba: []int32{11546}, - 0x10bb: []int32{11547}, - 0x10bc: []int32{11548}, - 0x10bd: []int32{11549}, - 0x10be: []int32{11550}, - 0x10bf: []int32{11551}, - 0x10c0: []int32{11552}, - 0x10c1: []int32{11553}, - 0x10c2: []int32{11554}, - 0x10c3: []int32{11555}, - 0x10c4: []int32{11556}, - 0x10c5: []int32{11557}, - 0x10c7: []int32{11559}, - 0x10cd: []int32{11565}, - 0x13f8: []int32{5104}, - 0x13f9: []int32{5105}, - 0x13fa: []int32{5106}, - 0x13fb: []int32{5107}, - 0x13fc: []int32{5108}, - 0x13fd: []int32{5109}, - 0x1c80: []int32{1074}, - 0x1c81: []int32{1076}, - 0x1c82: []int32{1086}, - 0x1c83: []int32{1089}, - 0x1c84: []int32{1090}, - 0x1c85: []int32{1090}, - 0x1c86: []int32{1098}, - 0x1c87: []int32{1123}, - 0x1c88: []int32{42571}, - 0x1c90: []int32{4304}, - 0x1c91: []int32{4305}, - 0x1c92: []int32{4306}, - 0x1c93: []int32{4307}, - 0x1c94: []int32{4308}, - 0x1c95: []int32{4309}, - 0x1c96: []int32{4310}, - 0x1c97: []int32{4311}, - 0x1c98: []int32{4312}, - 0x1c99: []int32{4313}, - 0x1c9a: []int32{4314}, - 0x1c9b: []int32{4315}, - 0x1c9c: []int32{4316}, - 0x1c9d: []int32{4317}, - 0x1c9e: []int32{4318}, - 0x1c9f: []int32{4319}, - 0x1ca0: []int32{4320}, - 0x1ca1: []int32{4321}, - 0x1ca2: []int32{4322}, - 0x1ca3: []int32{4323}, - 0x1ca4: []int32{4324}, - 0x1ca5: []int32{4325}, - 0x1ca6: []int32{4326}, - 0x1ca7: []int32{4327}, - 0x1ca8: []int32{4328}, - 0x1ca9: []int32{4329}, - 0x1caa: []int32{4330}, - 0x1cab: []int32{4331}, - 0x1cac: []int32{4332}, - 0x1cad: []int32{4333}, - 0x1cae: []int32{4334}, - 0x1caf: []int32{4335}, - 0x1cb0: []int32{4336}, - 0x1cb1: []int32{4337}, - 0x1cb2: []int32{4338}, - 0x1cb3: []int32{4339}, - 0x1cb4: []int32{4340}, - 0x1cb5: []int32{4341}, - 0x1cb6: []int32{4342}, - 0x1cb7: []int32{4343}, - 0x1cb8: []int32{4344}, - 0x1cb9: []int32{4345}, - 0x1cba: []int32{4346}, - 0x1cbd: []int32{4349}, - 0x1cbe: []int32{4350}, - 0x1cbf: []int32{4351}, - 0x1e00: []int32{7681}, - 0x1e02: []int32{7683}, - 0x1e04: []int32{7685}, - 0x1e06: []int32{7687}, - 0x1e08: []int32{7689}, - 0x1e0a: []int32{7691}, - 0x1e0c: []int32{7693}, - 0x1e0e: []int32{7695}, - 0x1e10: []int32{7697}, - 0x1e12: []int32{7699}, - 0x1e14: []int32{7701}, - 0x1e16: []int32{7703}, - 0x1e18: []int32{7705}, - 0x1e1a: []int32{7707}, - 0x1e1c: []int32{7709}, - 0x1e1e: []int32{7711}, - 0x1e20: []int32{7713}, - 0x1e22: []int32{7715}, - 0x1e24: []int32{7717}, - 0x1e26: []int32{7719}, - 0x1e28: []int32{7721}, - 0x1e2a: []int32{7723}, - 0x1e2c: []int32{7725}, - 0x1e2e: []int32{7727}, - 0x1e30: []int32{7729}, - 0x1e32: []int32{7731}, - 0x1e34: []int32{7733}, - 0x1e36: []int32{7735}, - 0x1e38: []int32{7737}, - 0x1e3a: []int32{7739}, - 0x1e3c: []int32{7741}, - 0x1e3e: []int32{7743}, - 0x1e40: []int32{7745}, - 0x1e42: []int32{7747}, - 0x1e44: []int32{7749}, - 0x1e46: []int32{7751}, - 0x1e48: []int32{7753}, - 0x1e4a: []int32{7755}, - 0x1e4c: []int32{7757}, - 0x1e4e: []int32{7759}, - 0x1e50: []int32{7761}, - 0x1e52: []int32{7763}, - 0x1e54: []int32{7765}, - 0x1e56: []int32{7767}, - 0x1e58: []int32{7769}, - 0x1e5a: []int32{7771}, - 0x1e5c: []int32{7773}, - 0x1e5e: []int32{7775}, - 0x1e60: []int32{7777}, - 0x1e62: []int32{7779}, - 0x1e64: []int32{7781}, - 0x1e66: []int32{7783}, - 0x1e68: []int32{7785}, - 0x1e6a: []int32{7787}, - 0x1e6c: []int32{7789}, - 0x1e6e: []int32{7791}, - 0x1e70: []int32{7793}, - 0x1e72: []int32{7795}, - 0x1e74: []int32{7797}, - 0x1e76: []int32{7799}, - 0x1e78: []int32{7801}, - 0x1e7a: []int32{7803}, - 0x1e7c: []int32{7805}, - 0x1e7e: []int32{7807}, - 0x1e80: []int32{7809}, - 0x1e82: []int32{7811}, - 0x1e84: []int32{7813}, - 0x1e86: []int32{7815}, - 0x1e88: []int32{7817}, - 0x1e8a: []int32{7819}, - 0x1e8c: []int32{7821}, - 0x1e8e: []int32{7823}, - 0x1e90: []int32{7825}, - 0x1e92: []int32{7827}, - 0x1e94: []int32{7829}, - 0x1e96: []int32{104, 817}, - 0x1e97: []int32{116, 776}, - 0x1e98: []int32{119, 778}, - 0x1e99: []int32{121, 778}, - 0x1e9a: []int32{97, 702}, - 0x1e9b: []int32{7777}, - 0x1e9e: []int32{115, 115}, - 0x1ea0: []int32{7841}, - 0x1ea2: []int32{7843}, - 0x1ea4: []int32{7845}, - 0x1ea6: []int32{7847}, - 0x1ea8: []int32{7849}, - 0x1eaa: []int32{7851}, - 0x1eac: []int32{7853}, - 0x1eae: []int32{7855}, - 0x1eb0: []int32{7857}, - 0x1eb2: []int32{7859}, - 0x1eb4: []int32{7861}, - 0x1eb6: []int32{7863}, - 0x1eb8: []int32{7865}, - 0x1eba: []int32{7867}, - 0x1ebc: []int32{7869}, - 0x1ebe: []int32{7871}, - 0x1ec0: []int32{7873}, - 0x1ec2: []int32{7875}, - 0x1ec4: []int32{7877}, - 0x1ec6: []int32{7879}, - 0x1ec8: []int32{7881}, - 0x1eca: []int32{7883}, - 0x1ecc: []int32{7885}, - 0x1ece: []int32{7887}, - 0x1ed0: []int32{7889}, - 0x1ed2: []int32{7891}, - 0x1ed4: []int32{7893}, - 0x1ed6: []int32{7895}, - 0x1ed8: []int32{7897}, - 0x1eda: []int32{7899}, - 0x1edc: []int32{7901}, - 0x1ede: []int32{7903}, - 0x1ee0: []int32{7905}, - 0x1ee2: []int32{7907}, - 0x1ee4: []int32{7909}, - 0x1ee6: []int32{7911}, - 0x1ee8: []int32{7913}, - 0x1eea: []int32{7915}, - 0x1eec: []int32{7917}, - 0x1eee: []int32{7919}, - 0x1ef0: []int32{7921}, - 0x1ef2: []int32{7923}, - 0x1ef4: []int32{7925}, - 0x1ef6: []int32{7927}, - 0x1ef8: []int32{7929}, - 0x1efa: []int32{7931}, - 0x1efc: []int32{7933}, - 0x1efe: []int32{7935}, - 0x1f08: []int32{7936}, - 0x1f09: []int32{7937}, - 0x1f0a: []int32{7938}, - 0x1f0b: []int32{7939}, - 0x1f0c: []int32{7940}, - 0x1f0d: []int32{7941}, - 0x1f0e: []int32{7942}, - 0x1f0f: []int32{7943}, - 0x1f18: []int32{7952}, - 0x1f19: []int32{7953}, - 0x1f1a: []int32{7954}, - 0x1f1b: []int32{7955}, - 0x1f1c: []int32{7956}, - 0x1f1d: []int32{7957}, - 0x1f28: []int32{7968}, - 0x1f29: []int32{7969}, - 0x1f2a: []int32{7970}, - 0x1f2b: []int32{7971}, - 0x1f2c: []int32{7972}, - 0x1f2d: []int32{7973}, - 0x1f2e: []int32{7974}, - 0x1f2f: []int32{7975}, - 0x1f38: []int32{7984}, - 0x1f39: []int32{7985}, - 0x1f3a: []int32{7986}, - 0x1f3b: []int32{7987}, - 0x1f3c: []int32{7988}, - 0x1f3d: []int32{7989}, - 0x1f3e: []int32{7990}, - 0x1f3f: []int32{7991}, - 0x1f48: []int32{8000}, - 0x1f49: []int32{8001}, - 0x1f4a: []int32{8002}, - 0x1f4b: []int32{8003}, - 0x1f4c: []int32{8004}, - 0x1f4d: []int32{8005}, - 0x1f50: []int32{965, 787}, - 0x1f52: []int32{965, 787, 768}, - 0x1f54: []int32{965, 787, 769}, - 0x1f56: []int32{965, 787, 834}, - 0x1f59: []int32{8017}, - 0x1f5b: []int32{8019}, - 0x1f5d: []int32{8021}, - 0x1f5f: []int32{8023}, - 0x1f68: []int32{8032}, - 0x1f69: []int32{8033}, - 0x1f6a: []int32{8034}, - 0x1f6b: []int32{8035}, - 0x1f6c: []int32{8036}, - 0x1f6d: []int32{8037}, - 0x1f6e: []int32{8038}, - 0x1f6f: []int32{8039}, - 0x1f80: []int32{7936, 953}, - 0x1f81: []int32{7937, 953}, - 0x1f82: []int32{7938, 953}, - 0x1f83: []int32{7939, 953}, - 0x1f84: []int32{7940, 953}, - 0x1f85: []int32{7941, 953}, - 0x1f86: []int32{7942, 953}, - 0x1f87: []int32{7943, 953}, - 0x1f88: []int32{7936, 953}, - 0x1f89: []int32{7937, 953}, - 0x1f8a: []int32{7938, 953}, - 0x1f8b: []int32{7939, 953}, - 0x1f8c: []int32{7940, 953}, - 0x1f8d: []int32{7941, 953}, - 0x1f8e: []int32{7942, 953}, - 0x1f8f: []int32{7943, 953}, - 0x1f90: []int32{7968, 953}, - 0x1f91: []int32{7969, 953}, - 0x1f92: []int32{7970, 953}, - 0x1f93: []int32{7971, 953}, - 0x1f94: []int32{7972, 953}, - 0x1f95: []int32{7973, 953}, - 0x1f96: []int32{7974, 953}, - 0x1f97: []int32{7975, 953}, - 0x1f98: []int32{7968, 953}, - 0x1f99: []int32{7969, 953}, - 0x1f9a: []int32{7970, 953}, - 0x1f9b: []int32{7971, 953}, - 0x1f9c: []int32{7972, 953}, - 0x1f9d: []int32{7973, 953}, - 0x1f9e: []int32{7974, 953}, - 0x1f9f: []int32{7975, 953}, - 0x1fa0: []int32{8032, 953}, - 0x1fa1: []int32{8033, 953}, - 0x1fa2: []int32{8034, 953}, - 0x1fa3: []int32{8035, 953}, - 0x1fa4: []int32{8036, 953}, - 0x1fa5: []int32{8037, 953}, - 0x1fa6: []int32{8038, 953}, - 0x1fa7: []int32{8039, 953}, - 0x1fa8: []int32{8032, 953}, - 0x1fa9: []int32{8033, 953}, - 0x1faa: []int32{8034, 953}, - 0x1fab: []int32{8035, 953}, - 0x1fac: []int32{8036, 953}, - 0x1fad: []int32{8037, 953}, - 0x1fae: []int32{8038, 953}, - 0x1faf: []int32{8039, 953}, - 0x1fb2: []int32{8048, 953}, - 0x1fb3: []int32{945, 953}, - 0x1fb4: []int32{940, 953}, - 0x1fb6: []int32{945, 834}, - 0x1fb7: []int32{945, 834, 953}, - 0x1fb8: []int32{8112}, - 0x1fb9: []int32{8113}, - 0x1fba: []int32{8048}, - 0x1fbb: []int32{8049}, - 0x1fbc: []int32{945, 953}, - 0x1fbe: []int32{953}, - 0x1fc2: []int32{8052, 953}, - 0x1fc3: []int32{951, 953}, - 0x1fc4: []int32{942, 953}, - 0x1fc6: []int32{951, 834}, - 0x1fc7: []int32{951, 834, 953}, - 0x1fc8: []int32{8050}, - 0x1fc9: []int32{8051}, - 0x1fca: []int32{8052}, - 0x1fcb: []int32{8053}, - 0x1fcc: []int32{951, 953}, - 0x1fd2: []int32{953, 776, 768}, - 0x1fd3: []int32{953, 776, 769}, - 0x1fd6: []int32{953, 834}, - 0x1fd7: []int32{953, 776, 834}, - 0x1fd8: []int32{8144}, - 0x1fd9: []int32{8145}, - 0x1fda: []int32{8054}, - 0x1fdb: []int32{8055}, - 0x1fe2: []int32{965, 776, 768}, - 0x1fe3: []int32{965, 776, 769}, - 0x1fe4: []int32{961, 787}, - 0x1fe6: []int32{965, 834}, - 0x1fe7: []int32{965, 776, 834}, - 0x1fe8: []int32{8160}, - 0x1fe9: []int32{8161}, - 0x1fea: []int32{8058}, - 0x1feb: []int32{8059}, - 0x1fec: []int32{8165}, - 0x1ff2: []int32{8060, 953}, - 0x1ff3: []int32{969, 953}, - 0x1ff4: []int32{974, 953}, - 0x1ff6: []int32{969, 834}, - 0x1ff7: []int32{969, 834, 953}, - 0x1ff8: []int32{8056}, - 0x1ff9: []int32{8057}, - 0x1ffa: []int32{8060}, - 0x1ffb: []int32{8061}, - 0x1ffc: []int32{969, 953}, - 0x2126: []int32{969}, - 0x212a: []int32{107}, - 0x212b: []int32{229}, - 0x2132: []int32{8526}, - 0x2160: []int32{8560}, - 0x2161: []int32{8561}, - 0x2162: []int32{8562}, - 0x2163: []int32{8563}, - 0x2164: []int32{8564}, - 0x2165: []int32{8565}, - 0x2166: []int32{8566}, - 0x2167: []int32{8567}, - 0x2168: []int32{8568}, - 0x2169: []int32{8569}, - 0x216a: []int32{8570}, - 0x216b: []int32{8571}, - 0x216c: []int32{8572}, - 0x216d: []int32{8573}, - 0x216e: []int32{8574}, - 0x216f: []int32{8575}, - 0x2183: []int32{8580}, - 0x24b6: []int32{9424}, - 0x24b7: []int32{9425}, - 0x24b8: []int32{9426}, - 0x24b9: []int32{9427}, - 0x24ba: []int32{9428}, - 0x24bb: []int32{9429}, - 0x24bc: []int32{9430}, - 0x24bd: []int32{9431}, - 0x24be: []int32{9432}, - 0x24bf: []int32{9433}, - 0x24c0: []int32{9434}, - 0x24c1: []int32{9435}, - 0x24c2: []int32{9436}, - 0x24c3: []int32{9437}, - 0x24c4: []int32{9438}, - 0x24c5: []int32{9439}, - 0x24c6: []int32{9440}, - 0x24c7: []int32{9441}, - 0x24c8: []int32{9442}, - 0x24c9: []int32{9443}, - 0x24ca: []int32{9444}, - 0x24cb: []int32{9445}, - 0x24cc: []int32{9446}, - 0x24cd: []int32{9447}, - 0x24ce: []int32{9448}, - 0x24cf: []int32{9449}, - 0x2c00: []int32{11312}, - 0x2c01: []int32{11313}, - 0x2c02: []int32{11314}, - 0x2c03: []int32{11315}, - 0x2c04: []int32{11316}, - 0x2c05: []int32{11317}, - 0x2c06: []int32{11318}, - 0x2c07: []int32{11319}, - 0x2c08: []int32{11320}, - 0x2c09: []int32{11321}, - 0x2c0a: []int32{11322}, - 0x2c0b: []int32{11323}, - 0x2c0c: []int32{11324}, - 0x2c0d: []int32{11325}, - 0x2c0e: []int32{11326}, - 0x2c0f: []int32{11327}, - 0x2c10: []int32{11328}, - 0x2c11: []int32{11329}, - 0x2c12: []int32{11330}, - 0x2c13: []int32{11331}, - 0x2c14: []int32{11332}, - 0x2c15: []int32{11333}, - 0x2c16: []int32{11334}, - 0x2c17: []int32{11335}, - 0x2c18: []int32{11336}, - 0x2c19: []int32{11337}, - 0x2c1a: []int32{11338}, - 0x2c1b: []int32{11339}, - 0x2c1c: []int32{11340}, - 0x2c1d: []int32{11341}, - 0x2c1e: []int32{11342}, - 0x2c1f: []int32{11343}, - 0x2c20: []int32{11344}, - 0x2c21: []int32{11345}, - 0x2c22: []int32{11346}, - 0x2c23: []int32{11347}, - 0x2c24: []int32{11348}, - 0x2c25: []int32{11349}, - 0x2c26: []int32{11350}, - 0x2c27: []int32{11351}, - 0x2c28: []int32{11352}, - 0x2c29: []int32{11353}, - 0x2c2a: []int32{11354}, - 0x2c2b: []int32{11355}, - 0x2c2c: []int32{11356}, - 0x2c2d: []int32{11357}, - 0x2c2e: []int32{11358}, - 0x2c60: []int32{11361}, - 0x2c62: []int32{619}, - 0x2c63: []int32{7549}, - 0x2c64: []int32{637}, - 0x2c67: []int32{11368}, - 0x2c69: []int32{11370}, - 0x2c6b: []int32{11372}, - 0x2c6d: []int32{593}, - 0x2c6e: []int32{625}, - 0x2c6f: []int32{592}, - 0x2c70: []int32{594}, - 0x2c72: []int32{11379}, - 0x2c75: []int32{11382}, - 0x2c7e: []int32{575}, - 0x2c7f: []int32{576}, - 0x2c80: []int32{11393}, - 0x2c82: []int32{11395}, - 0x2c84: []int32{11397}, - 0x2c86: []int32{11399}, - 0x2c88: []int32{11401}, - 0x2c8a: []int32{11403}, - 0x2c8c: []int32{11405}, - 0x2c8e: []int32{11407}, - 0x2c90: []int32{11409}, - 0x2c92: []int32{11411}, - 0x2c94: []int32{11413}, - 0x2c96: []int32{11415}, - 0x2c98: []int32{11417}, - 0x2c9a: []int32{11419}, - 0x2c9c: []int32{11421}, - 0x2c9e: []int32{11423}, - 0x2ca0: []int32{11425}, - 0x2ca2: []int32{11427}, - 0x2ca4: []int32{11429}, - 0x2ca6: []int32{11431}, - 0x2ca8: []int32{11433}, - 0x2caa: []int32{11435}, - 0x2cac: []int32{11437}, - 0x2cae: []int32{11439}, - 0x2cb0: []int32{11441}, - 0x2cb2: []int32{11443}, - 0x2cb4: []int32{11445}, - 0x2cb6: []int32{11447}, - 0x2cb8: []int32{11449}, - 0x2cba: []int32{11451}, - 0x2cbc: []int32{11453}, - 0x2cbe: []int32{11455}, - 0x2cc0: []int32{11457}, - 0x2cc2: []int32{11459}, - 0x2cc4: []int32{11461}, - 0x2cc6: []int32{11463}, - 0x2cc8: []int32{11465}, - 0x2cca: []int32{11467}, - 0x2ccc: []int32{11469}, - 0x2cce: []int32{11471}, - 0x2cd0: []int32{11473}, - 0x2cd2: []int32{11475}, - 0x2cd4: []int32{11477}, - 0x2cd6: []int32{11479}, - 0x2cd8: []int32{11481}, - 0x2cda: []int32{11483}, - 0x2cdc: []int32{11485}, - 0x2cde: []int32{11487}, - 0x2ce0: []int32{11489}, - 0x2ce2: []int32{11491}, - 0x2ceb: []int32{11500}, - 0x2ced: []int32{11502}, - 0x2cf2: []int32{11507}, - 0xa640: []int32{42561}, - 0xa642: []int32{42563}, - 0xa644: []int32{42565}, - 0xa646: []int32{42567}, - 0xa648: []int32{42569}, - 0xa64a: []int32{42571}, - 0xa64c: []int32{42573}, - 0xa64e: []int32{42575}, - 0xa650: []int32{42577}, - 0xa652: []int32{42579}, - 0xa654: []int32{42581}, - 0xa656: []int32{42583}, - 0xa658: []int32{42585}, - 0xa65a: []int32{42587}, - 0xa65c: []int32{42589}, - 0xa65e: []int32{42591}, - 0xa660: []int32{42593}, - 0xa662: []int32{42595}, - 0xa664: []int32{42597}, - 0xa666: []int32{42599}, - 0xa668: []int32{42601}, - 0xa66a: []int32{42603}, - 0xa66c: []int32{42605}, - 0xa680: []int32{42625}, - 0xa682: []int32{42627}, - 0xa684: []int32{42629}, - 0xa686: []int32{42631}, - 0xa688: []int32{42633}, - 0xa68a: []int32{42635}, - 0xa68c: []int32{42637}, - 0xa68e: []int32{42639}, - 0xa690: []int32{42641}, - 0xa692: []int32{42643}, - 0xa694: []int32{42645}, - 0xa696: []int32{42647}, - 0xa698: []int32{42649}, - 0xa69a: []int32{42651}, - 0xa722: []int32{42787}, - 0xa724: []int32{42789}, - 0xa726: []int32{42791}, - 0xa728: []int32{42793}, - 0xa72a: []int32{42795}, - 0xa72c: []int32{42797}, - 0xa72e: []int32{42799}, - 0xa732: []int32{42803}, - 0xa734: []int32{42805}, - 0xa736: []int32{42807}, - 0xa738: []int32{42809}, - 0xa73a: []int32{42811}, - 0xa73c: []int32{42813}, - 0xa73e: []int32{42815}, - 0xa740: []int32{42817}, - 0xa742: []int32{42819}, - 0xa744: []int32{42821}, - 0xa746: []int32{42823}, - 0xa748: []int32{42825}, - 0xa74a: []int32{42827}, - 0xa74c: []int32{42829}, - 0xa74e: []int32{42831}, - 0xa750: []int32{42833}, - 0xa752: []int32{42835}, - 0xa754: []int32{42837}, - 0xa756: []int32{42839}, - 0xa758: []int32{42841}, - 0xa75a: []int32{42843}, - 0xa75c: []int32{42845}, - 0xa75e: []int32{42847}, - 0xa760: []int32{42849}, - 0xa762: []int32{42851}, - 0xa764: []int32{42853}, - 0xa766: []int32{42855}, - 0xa768: []int32{42857}, - 0xa76a: []int32{42859}, - 0xa76c: []int32{42861}, - 0xa76e: []int32{42863}, - 0xa779: []int32{42874}, - 0xa77b: []int32{42876}, - 0xa77d: []int32{7545}, - 0xa77e: []int32{42879}, - 0xa780: []int32{42881}, - 0xa782: []int32{42883}, - 0xa784: []int32{42885}, - 0xa786: []int32{42887}, - 0xa78b: []int32{42892}, - 0xa78d: []int32{613}, - 0xa790: []int32{42897}, - 0xa792: []int32{42899}, - 0xa796: []int32{42903}, - 0xa798: []int32{42905}, - 0xa79a: []int32{42907}, - 0xa79c: []int32{42909}, - 0xa79e: []int32{42911}, - 0xa7a0: []int32{42913}, - 0xa7a2: []int32{42915}, - 0xa7a4: []int32{42917}, - 0xa7a6: []int32{42919}, - 0xa7a8: []int32{42921}, - 0xa7aa: []int32{614}, - 0xa7ab: []int32{604}, - 0xa7ac: []int32{609}, - 0xa7ad: []int32{620}, - 0xa7ae: []int32{618}, - 0xa7b0: []int32{670}, - 0xa7b1: []int32{647}, - 0xa7b2: []int32{669}, - 0xa7b3: []int32{43859}, - 0xa7b4: []int32{42933}, - 0xa7b6: []int32{42935}, - 0xa7b8: []int32{42937}, - 0xa7ba: []int32{42939}, - 0xa7bc: []int32{42941}, - 0xa7be: []int32{42943}, - 0xa7c2: []int32{42947}, - 0xa7c4: []int32{42900}, - 0xa7c5: []int32{642}, - 0xa7c6: []int32{7566}, - 0xab70: []int32{5024}, - 0xab71: []int32{5025}, - 0xab72: []int32{5026}, - 0xab73: []int32{5027}, - 0xab74: []int32{5028}, - 0xab75: []int32{5029}, - 0xab76: []int32{5030}, - 0xab77: []int32{5031}, - 0xab78: []int32{5032}, - 0xab79: []int32{5033}, - 0xab7a: []int32{5034}, - 0xab7b: []int32{5035}, - 0xab7c: []int32{5036}, - 0xab7d: []int32{5037}, - 0xab7e: []int32{5038}, - 0xab7f: []int32{5039}, - 0xab80: []int32{5040}, - 0xab81: []int32{5041}, - 0xab82: []int32{5042}, - 0xab83: []int32{5043}, - 0xab84: []int32{5044}, - 0xab85: []int32{5045}, - 0xab86: []int32{5046}, - 0xab87: []int32{5047}, - 0xab88: []int32{5048}, - 0xab89: []int32{5049}, - 0xab8a: []int32{5050}, - 0xab8b: []int32{5051}, - 0xab8c: []int32{5052}, - 0xab8d: []int32{5053}, - 0xab8e: []int32{5054}, - 0xab8f: []int32{5055}, - 0xab90: []int32{5056}, - 0xab91: []int32{5057}, - 0xab92: []int32{5058}, - 0xab93: []int32{5059}, - 0xab94: []int32{5060}, - 0xab95: []int32{5061}, - 0xab96: []int32{5062}, - 0xab97: []int32{5063}, - 0xab98: []int32{5064}, - 0xab99: []int32{5065}, - 0xab9a: []int32{5066}, - 0xab9b: []int32{5067}, - 0xab9c: []int32{5068}, - 0xab9d: []int32{5069}, - 0xab9e: []int32{5070}, - 0xab9f: []int32{5071}, - 0xaba0: []int32{5072}, - 0xaba1: []int32{5073}, - 0xaba2: []int32{5074}, - 0xaba3: []int32{5075}, - 0xaba4: []int32{5076}, - 0xaba5: []int32{5077}, - 0xaba6: []int32{5078}, - 0xaba7: []int32{5079}, - 0xaba8: []int32{5080}, - 0xaba9: []int32{5081}, - 0xabaa: []int32{5082}, - 0xabab: []int32{5083}, - 0xabac: []int32{5084}, - 0xabad: []int32{5085}, - 0xabae: []int32{5086}, - 0xabaf: []int32{5087}, - 0xabb0: []int32{5088}, - 0xabb1: []int32{5089}, - 0xabb2: []int32{5090}, - 0xabb3: []int32{5091}, - 0xabb4: []int32{5092}, - 0xabb5: []int32{5093}, - 0xabb6: []int32{5094}, - 0xabb7: []int32{5095}, - 0xabb8: []int32{5096}, - 0xabb9: []int32{5097}, - 0xabba: []int32{5098}, - 0xabbb: []int32{5099}, - 0xabbc: []int32{5100}, - 0xabbd: []int32{5101}, - 0xabbe: []int32{5102}, - 0xabbf: []int32{5103}, - 0xfb00: []int32{102, 102}, - 0xfb01: []int32{102, 105}, - 0xfb02: []int32{102, 108}, - 0xfb03: []int32{102, 102, 105}, - 0xfb04: []int32{102, 102, 108}, - 0xfb05: []int32{115, 116}, - 0xfb06: []int32{115, 116}, - 0xfb13: []int32{1396, 1398}, - 0xfb14: []int32{1396, 1381}, - 0xfb15: []int32{1396, 1387}, - 0xfb16: []int32{1406, 1398}, - 0xfb17: []int32{1396, 1389}, - 0xff21: []int32{65345}, - 0xff22: []int32{65346}, - 0xff23: []int32{65347}, - 0xff24: []int32{65348}, - 0xff25: []int32{65349}, - 0xff26: []int32{65350}, - 0xff27: []int32{65351}, - 0xff28: []int32{65352}, - 0xff29: []int32{65353}, - 0xff2a: []int32{65354}, - 0xff2b: []int32{65355}, - 0xff2c: []int32{65356}, - 0xff2d: []int32{65357}, - 0xff2e: []int32{65358}, - 0xff2f: []int32{65359}, - 0xff30: []int32{65360}, - 0xff31: []int32{65361}, - 0xff32: []int32{65362}, - 0xff33: []int32{65363}, - 0xff34: []int32{65364}, - 0xff35: []int32{65365}, - 0xff36: []int32{65366}, - 0xff37: []int32{65367}, - 0xff38: []int32{65368}, - 0xff39: []int32{65369}, - 0xff3a: []int32{65370}, - 0x10400: []int32{66600}, - 0x10401: []int32{66601}, - 0x10402: []int32{66602}, - 0x10403: []int32{66603}, - 0x10404: []int32{66604}, - 0x10405: []int32{66605}, - 0x10406: []int32{66606}, - 0x10407: []int32{66607}, - 0x10408: []int32{66608}, - 0x10409: []int32{66609}, - 0x1040a: []int32{66610}, - 0x1040b: []int32{66611}, - 0x1040c: []int32{66612}, - 0x1040d: []int32{66613}, - 0x1040e: []int32{66614}, - 0x1040f: []int32{66615}, - 0x10410: []int32{66616}, - 0x10411: []int32{66617}, - 0x10412: []int32{66618}, - 0x10413: []int32{66619}, - 0x10414: []int32{66620}, - 0x10415: []int32{66621}, - 0x10416: []int32{66622}, - 0x10417: []int32{66623}, - 0x10418: []int32{66624}, - 0x10419: []int32{66625}, - 0x1041a: []int32{66626}, - 0x1041b: []int32{66627}, - 0x1041c: []int32{66628}, - 0x1041d: []int32{66629}, - 0x1041e: []int32{66630}, - 0x1041f: []int32{66631}, - 0x10420: []int32{66632}, - 0x10421: []int32{66633}, - 0x10422: []int32{66634}, - 0x10423: []int32{66635}, - 0x10424: []int32{66636}, - 0x10425: []int32{66637}, - 0x10426: []int32{66638}, - 0x10427: []int32{66639}, - 0x104b0: []int32{66776}, - 0x104b1: []int32{66777}, - 0x104b2: []int32{66778}, - 0x104b3: []int32{66779}, - 0x104b4: []int32{66780}, - 0x104b5: []int32{66781}, - 0x104b6: []int32{66782}, - 0x104b7: []int32{66783}, - 0x104b8: []int32{66784}, - 0x104b9: []int32{66785}, - 0x104ba: []int32{66786}, - 0x104bb: []int32{66787}, - 0x104bc: []int32{66788}, - 0x104bd: []int32{66789}, - 0x104be: []int32{66790}, - 0x104bf: []int32{66791}, - 0x104c0: []int32{66792}, - 0x104c1: []int32{66793}, - 0x104c2: []int32{66794}, - 0x104c3: []int32{66795}, - 0x104c4: []int32{66796}, - 0x104c5: []int32{66797}, - 0x104c6: []int32{66798}, - 0x104c7: []int32{66799}, - 0x104c8: []int32{66800}, - 0x104c9: []int32{66801}, - 0x104ca: []int32{66802}, - 0x104cb: []int32{66803}, - 0x104cc: []int32{66804}, - 0x104cd: []int32{66805}, - 0x104ce: []int32{66806}, - 0x104cf: []int32{66807}, - 0x104d0: []int32{66808}, - 0x104d1: []int32{66809}, - 0x104d2: []int32{66810}, - 0x104d3: []int32{66811}, - 0x10c80: []int32{68800}, - 0x10c81: []int32{68801}, - 0x10c82: []int32{68802}, - 0x10c83: []int32{68803}, - 0x10c84: []int32{68804}, - 0x10c85: []int32{68805}, - 0x10c86: []int32{68806}, - 0x10c87: []int32{68807}, - 0x10c88: []int32{68808}, - 0x10c89: []int32{68809}, - 0x10c8a: []int32{68810}, - 0x10c8b: []int32{68811}, - 0x10c8c: []int32{68812}, - 0x10c8d: []int32{68813}, - 0x10c8e: []int32{68814}, - 0x10c8f: []int32{68815}, - 0x10c90: []int32{68816}, - 0x10c91: []int32{68817}, - 0x10c92: []int32{68818}, - 0x10c93: []int32{68819}, - 0x10c94: []int32{68820}, - 0x10c95: []int32{68821}, - 0x10c96: []int32{68822}, - 0x10c97: []int32{68823}, - 0x10c98: []int32{68824}, - 0x10c99: []int32{68825}, - 0x10c9a: []int32{68826}, - 0x10c9b: []int32{68827}, - 0x10c9c: []int32{68828}, - 0x10c9d: []int32{68829}, - 0x10c9e: []int32{68830}, - 0x10c9f: []int32{68831}, - 0x10ca0: []int32{68832}, - 0x10ca1: []int32{68833}, - 0x10ca2: []int32{68834}, - 0x10ca3: []int32{68835}, - 0x10ca4: []int32{68836}, - 0x10ca5: []int32{68837}, - 0x10ca6: []int32{68838}, - 0x10ca7: []int32{68839}, - 0x10ca8: []int32{68840}, - 0x10ca9: []int32{68841}, - 0x10caa: []int32{68842}, - 0x10cab: []int32{68843}, - 0x10cac: []int32{68844}, - 0x10cad: []int32{68845}, - 0x10cae: []int32{68846}, - 0x10caf: []int32{68847}, - 0x10cb0: []int32{68848}, - 0x10cb1: []int32{68849}, - 0x10cb2: []int32{68850}, - 0x118a0: []int32{71872}, - 0x118a1: []int32{71873}, - 0x118a2: []int32{71874}, - 0x118a3: []int32{71875}, - 0x118a4: []int32{71876}, - 0x118a5: []int32{71877}, - 0x118a6: []int32{71878}, - 0x118a7: []int32{71879}, - 0x118a8: []int32{71880}, - 0x118a9: []int32{71881}, - 0x118aa: []int32{71882}, - 0x118ab: []int32{71883}, - 0x118ac: []int32{71884}, - 0x118ad: []int32{71885}, - 0x118ae: []int32{71886}, - 0x118af: []int32{71887}, - 0x118b0: []int32{71888}, - 0x118b1: []int32{71889}, - 0x118b2: []int32{71890}, - 0x118b3: []int32{71891}, - 0x118b4: []int32{71892}, - 0x118b5: []int32{71893}, - 0x118b6: []int32{71894}, - 0x118b7: []int32{71895}, - 0x118b8: []int32{71896}, - 0x118b9: []int32{71897}, - 0x118ba: []int32{71898}, - 0x118bb: []int32{71899}, - 0x118bc: []int32{71900}, - 0x118bd: []int32{71901}, - 0x118be: []int32{71902}, - 0x118bf: []int32{71903}, - 0x16e40: []int32{93792}, - 0x16e41: []int32{93793}, - 0x16e42: []int32{93794}, - 0x16e43: []int32{93795}, - 0x16e44: []int32{93796}, - 0x16e45: []int32{93797}, - 0x16e46: []int32{93798}, - 0x16e47: []int32{93799}, - 0x16e48: []int32{93800}, - 0x16e49: []int32{93801}, - 0x16e4a: []int32{93802}, - 0x16e4b: []int32{93803}, - 0x16e4c: []int32{93804}, - 0x16e4d: []int32{93805}, - 0x16e4e: []int32{93806}, - 0x16e4f: []int32{93807}, - 0x16e50: []int32{93808}, - 0x16e51: []int32{93809}, - 0x16e52: []int32{93810}, - 0x16e53: []int32{93811}, - 0x16e54: []int32{93812}, - 0x16e55: []int32{93813}, - 0x16e56: []int32{93814}, - 0x16e57: []int32{93815}, - 0x16e58: []int32{93816}, - 0x16e59: []int32{93817}, - 0x16e5a: []int32{93818}, - 0x16e5b: []int32{93819}, - 0x16e5c: []int32{93820}, - 0x16e5d: []int32{93821}, - 0x16e5e: []int32{93822}, - 0x16e5f: []int32{93823}, - 0x1e900: []int32{125218}, - 0x1e901: []int32{125219}, - 0x1e902: []int32{125220}, - 0x1e903: []int32{125221}, - 0x1e904: []int32{125222}, - 0x1e905: []int32{125223}, - 0x1e906: []int32{125224}, - 0x1e907: []int32{125225}, - 0x1e908: []int32{125226}, - 0x1e909: []int32{125227}, - 0x1e90a: []int32{125228}, - 0x1e90b: []int32{125229}, - 0x1e90c: []int32{125230}, - 0x1e90d: []int32{125231}, - 0x1e90e: []int32{125232}, - 0x1e90f: []int32{125233}, - 0x1e910: []int32{125234}, - 0x1e911: []int32{125235}, - 0x1e912: []int32{125236}, - 0x1e913: []int32{125237}, - 0x1e914: []int32{125238}, - 0x1e915: []int32{125239}, - 0x1e916: []int32{125240}, - 0x1e917: []int32{125241}, - 0x1e918: []int32{125242}, - 0x1e919: []int32{125243}, - 0x1e91a: []int32{125244}, - 0x1e91b: []int32{125245}, - 0x1e91c: []int32{125246}, - 0x1e91d: []int32{125247}, - 0x1e91e: []int32{125248}, - 0x1e91f: []int32{125249}, - 0x1e920: []int32{125250}, - 0x1e921: []int32{125251}, -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util.go deleted file mode 100644 index a817ec630..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util.go +++ /dev/null @@ -1,980 +0,0 @@ -// Package util provides utility functions for the goldmark. -package util - -import ( - "bytes" - "io" - "net/url" - "regexp" - "sort" - "strconv" - "unicode" - "unicode/utf8" -) - -// A CopyOnWriteBuffer is a byte buffer that copies buffer when -// it need to be changed. -type CopyOnWriteBuffer struct { - buffer []byte - copied bool -} - -// NewCopyOnWriteBuffer returns a new CopyOnWriteBuffer. -func NewCopyOnWriteBuffer(buffer []byte) CopyOnWriteBuffer { - return CopyOnWriteBuffer{ - buffer: buffer, - copied: false, - } -} - -// Write writes given bytes to the buffer. -// Write allocate new buffer and clears it at the first time. -func (b *CopyOnWriteBuffer) Write(value []byte) { - if !b.copied { - b.buffer = make([]byte, 0, len(b.buffer)+20) - b.copied = true - } - b.buffer = append(b.buffer, value...) -} - -// WriteString writes given string to the buffer. -// WriteString allocate new buffer and clears it at the first time. -func (b *CopyOnWriteBuffer) WriteString(value string) { - b.Write(StringToReadOnlyBytes(value)) -} - -// Append appends given bytes to the buffer. -// Append copy buffer at the first time. -func (b *CopyOnWriteBuffer) Append(value []byte) { - if !b.copied { - tmp := make([]byte, len(b.buffer), len(b.buffer)+20) - copy(tmp, b.buffer) - b.buffer = tmp - b.copied = true - } - b.buffer = append(b.buffer, value...) -} - -// AppendString appends given string to the buffer. -// AppendString copy buffer at the first time. -func (b *CopyOnWriteBuffer) AppendString(value string) { - b.Append(StringToReadOnlyBytes(value)) -} - -// WriteByte writes the given byte to the buffer. -// WriteByte allocate new buffer and clears it at the first time. -func (b *CopyOnWriteBuffer) WriteByte(c byte) { - if !b.copied { - b.buffer = make([]byte, 0, len(b.buffer)+20) - b.copied = true - } - b.buffer = append(b.buffer, c) -} - -// AppendByte appends given bytes to the buffer. -// AppendByte copy buffer at the first time. -func (b *CopyOnWriteBuffer) AppendByte(c byte) { - if !b.copied { - tmp := make([]byte, len(b.buffer), len(b.buffer)+20) - copy(tmp, b.buffer) - b.buffer = tmp - b.copied = true - } - b.buffer = append(b.buffer, c) -} - -// Bytes returns bytes of this buffer. -func (b *CopyOnWriteBuffer) Bytes() []byte { - return b.buffer -} - -// IsCopied returns true if buffer has been copied, otherwise false. -func (b *CopyOnWriteBuffer) IsCopied() bool { - return b.copied -} - -// IsEscapedPunctuation returns true if character at a given index i -// is an escaped punctuation, otherwise false. -func IsEscapedPunctuation(source []byte, i int) bool { - return source[i] == '\\' && i < len(source)-1 && IsPunct(source[i+1]) -} - -// ReadWhile read the given source while pred is true. -func ReadWhile(source []byte, index [2]int, pred func(byte) bool) (int, bool) { - j := index[0] - ok := false - for ; j < index[1]; j++ { - c1 := source[j] - if pred(c1) { - ok = true - continue - } - break - } - return j, ok -} - -// IsBlank returns true if the given string is all space characters. -func IsBlank(bs []byte) bool { - for _, b := range bs { - if !IsSpace(b) { - return false - } - } - return true -} - -// VisualizeSpaces visualize invisible space characters. -func VisualizeSpaces(bs []byte) []byte { - bs = bytes.Replace(bs, []byte(" "), []byte("[SPACE]"), -1) - bs = bytes.Replace(bs, []byte("\t"), []byte("[TAB]"), -1) - bs = bytes.Replace(bs, []byte("\n"), []byte("[NEWLINE]\n"), -1) - bs = bytes.Replace(bs, []byte("\r"), []byte("[CR]"), -1) - bs = bytes.Replace(bs, []byte("\v"), []byte("[VTAB]"), -1) - bs = bytes.Replace(bs, []byte("\x00"), []byte("[NUL]"), -1) - bs = bytes.Replace(bs, []byte("\ufffd"), []byte("[U+FFFD]"), -1) - return bs -} - -// TabWidth calculates actual width of a tab at the given position. -func TabWidth(currentPos int) int { - return 4 - currentPos%4 -} - -// IndentPosition searches an indent position with the given width for the given line. -// If the line contains tab characters, paddings may be not zero. -// currentPos==0 and width==2: -// -// position: 0 1 -// [TAB]aaaa -// width: 1234 5678 -// -// width=2 is in the tab character. In this case, IndentPosition returns -// (pos=1, padding=2) -func IndentPosition(bs []byte, currentPos, width int) (pos, padding int) { - return IndentPositionPadding(bs, currentPos, 0, width) -} - -// IndentPositionPadding searches an indent position with the given width for the given line. -// This function is mostly same as IndentPosition except this function -// takes account into additional paddings. -func IndentPositionPadding(bs []byte, currentPos, paddingv, width int) (pos, padding int) { - if width == 0 { - return 0, paddingv - } - w := 0 - i := 0 - l := len(bs) - for ; i < l; i++ { - if bs[i] == '\t' && w < width { - w += TabWidth(currentPos + w) - } else if bs[i] == ' ' && w < width { - w++ - } else { - break - } - } - if w >= width { - return i - paddingv, w - width - } - return -1, -1 -} - -// DedentPosition dedents lines by the given width. -// -// Deprecated: This function has bugs. Use util.IndentPositionPadding and util.FirstNonSpacePosition. -func DedentPosition(bs []byte, currentPos, width int) (pos, padding int) { - if width == 0 { - return 0, 0 - } - w := 0 - l := len(bs) - i := 0 - for ; i < l; i++ { - if bs[i] == '\t' { - w += TabWidth(currentPos + w) - } else if bs[i] == ' ' { - w++ - } else { - break - } - } - if w >= width { - return i, w - width - } - return i, 0 -} - -// DedentPositionPadding dedents lines by the given width. -// This function is mostly same as DedentPosition except this function -// takes account into additional paddings. -// -// Deprecated: This function has bugs. Use util.IndentPositionPadding and util.FirstNonSpacePosition. -func DedentPositionPadding(bs []byte, currentPos, paddingv, width int) (pos, padding int) { - if width == 0 { - return 0, paddingv - } - - w := 0 - i := 0 - l := len(bs) - for ; i < l; i++ { - if bs[i] == '\t' { - w += TabWidth(currentPos + w) - } else if bs[i] == ' ' { - w++ - } else { - break - } - } - if w >= width { - return i - paddingv, w - width - } - return i - paddingv, 0 -} - -// IndentWidth calculate an indent width for the given line. -func IndentWidth(bs []byte, currentPos int) (width, pos int) { - l := len(bs) - for i := 0; i < l; i++ { - b := bs[i] - if b == ' ' { - width++ - pos++ - } else if b == '\t' { - width += TabWidth(currentPos + width) - pos++ - } else { - break - } - } - return -} - -// FirstNonSpacePosition returns a position line that is a first nonspace -// character. -func FirstNonSpacePosition(bs []byte) int { - i := 0 - for ; i < len(bs); i++ { - c := bs[i] - if c == ' ' || c == '\t' { - continue - } - if c == '\n' { - return -1 - } - return i - } - return -1 -} - -// FindClosure returns a position that closes the given opener. -// If codeSpan is set true, it ignores characters in code spans. -// If allowNesting is set true, closures correspond to nested opener will be -// ignored. -// -// Deprecated: This function can not handle newlines. Many elements -// can be existed over multiple lines(e.g. link labels). -// Use text.Reader.FindClosure. -func FindClosure(bs []byte, opener, closure byte, codeSpan, allowNesting bool) int { - i := 0 - opened := 1 - codeSpanOpener := 0 - for i < len(bs) { - c := bs[i] - if codeSpan && codeSpanOpener != 0 && c == '`' { - codeSpanCloser := 0 - for ; i < len(bs); i++ { - if bs[i] == '`' { - codeSpanCloser++ - } else { - i-- - break - } - } - if codeSpanCloser == codeSpanOpener { - codeSpanOpener = 0 - } - } else if codeSpanOpener == 0 && c == '\\' && i < len(bs)-1 && IsPunct(bs[i+1]) { - i += 2 - continue - } else if codeSpan && codeSpanOpener == 0 && c == '`' { - for ; i < len(bs); i++ { - if bs[i] == '`' { - codeSpanOpener++ - } else { - i-- - break - } - } - } else if (codeSpan && codeSpanOpener == 0) || !codeSpan { - if c == closure { - opened-- - if opened == 0 { - return i - } - } else if c == opener { - if !allowNesting { - return -1 - } - opened++ - } - } - i++ - } - return -1 -} - -// TrimLeft trims characters in the given s from head of the source. -// bytes.TrimLeft offers same functionalities, but bytes.TrimLeft -// allocates new buffer for the result. -func TrimLeft(source, b []byte) []byte { - i := 0 - for ; i < len(source); i++ { - c := source[i] - found := false - for j := 0; j < len(b); j++ { - if c == b[j] { - found = true - break - } - } - if !found { - break - } - } - return source[i:] -} - -// TrimRight trims characters in the given s from tail of the source. -func TrimRight(source, b []byte) []byte { - i := len(source) - 1 - for ; i >= 0; i-- { - c := source[i] - found := false - for j := 0; j < len(b); j++ { - if c == b[j] { - found = true - break - } - } - if !found { - break - } - } - return source[:i+1] -} - -// TrimLeftLength returns a length of leading specified characters. -func TrimLeftLength(source, s []byte) int { - return len(source) - len(TrimLeft(source, s)) -} - -// TrimRightLength returns a length of trailing specified characters. -func TrimRightLength(source, s []byte) int { - return len(source) - len(TrimRight(source, s)) -} - -// TrimLeftSpaceLength returns a length of leading space characters. -func TrimLeftSpaceLength(source []byte) int { - i := 0 - for ; i < len(source); i++ { - if !IsSpace(source[i]) { - break - } - } - return i -} - -// TrimRightSpaceLength returns a length of trailing space characters. -func TrimRightSpaceLength(source []byte) int { - l := len(source) - i := l - 1 - for ; i >= 0; i-- { - if !IsSpace(source[i]) { - break - } - } - if i < 0 { - return l - } - return l - 1 - i -} - -// TrimLeftSpace returns a subslice of the given string by slicing off all leading -// space characters. -func TrimLeftSpace(source []byte) []byte { - return TrimLeft(source, spaces) -} - -// TrimRightSpace returns a subslice of the given string by slicing off all trailing -// space characters. -func TrimRightSpace(source []byte) []byte { - return TrimRight(source, spaces) -} - -// DoFullUnicodeCaseFolding performs full unicode case folding to given bytes. -func DoFullUnicodeCaseFolding(v []byte) []byte { - var rbuf []byte - cob := NewCopyOnWriteBuffer(v) - n := 0 - for i := 0; i < len(v); i++ { - c := v[i] - if c < 0xb5 { - if c >= 0x41 && c <= 0x5a { - // A-Z to a-z - cob.Write(v[n:i]) - cob.WriteByte(c + 32) - n = i + 1 - } - continue - } - - if !utf8.RuneStart(c) { - continue - } - r, length := utf8.DecodeRune(v[i:]) - if r == utf8.RuneError { - continue - } - folded, ok := unicodeCaseFoldings[r] - if !ok { - continue - } - - cob.Write(v[n:i]) - if rbuf == nil { - rbuf = make([]byte, 4) - } - for _, f := range folded { - l := utf8.EncodeRune(rbuf, f) - cob.Write(rbuf[:l]) - } - i += length - 1 - n = i + 1 - } - if cob.IsCopied() { - cob.Write(v[n:]) - } - return cob.Bytes() -} - -// ReplaceSpaces replaces sequence of spaces with the given repl. -func ReplaceSpaces(source []byte, repl byte) []byte { - var ret []byte - start := -1 - for i, c := range source { - iss := IsSpace(c) - if start < 0 && iss { - start = i - continue - } else if start >= 0 && iss { - continue - } else if start >= 0 { - if ret == nil { - ret = make([]byte, 0, len(source)) - ret = append(ret, source[:start]...) - } - ret = append(ret, repl) - start = -1 - } - if ret != nil { - ret = append(ret, c) - } - } - if start >= 0 && ret != nil { - ret = append(ret, repl) - } - if ret == nil { - return source - } - return ret -} - -// ToRune decode given bytes start at pos and returns a rune. -func ToRune(source []byte, pos int) rune { - i := pos - for ; i >= 0; i-- { - if utf8.RuneStart(source[i]) { - break - } - } - r, _ := utf8.DecodeRune(source[i:]) - return r -} - -// ToValidRune returns 0xFFFD if the given rune is invalid, otherwise v. -func ToValidRune(v rune) rune { - if v == 0 || !utf8.ValidRune(v) { - return rune(0xFFFD) - } - return v -} - -// ToLinkReference converts given bytes into a valid link reference string. -// ToLinkReference performs unicode case folding, trims leading and trailing spaces, converts into lower -// case and replace spaces with a single space character. -func ToLinkReference(v []byte) string { - v = TrimLeftSpace(v) - v = TrimRightSpace(v) - v = DoFullUnicodeCaseFolding(v) - return string(ReplaceSpaces(v, ' ')) -} - -var htmlEscapeTable = [256][]byte{nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, []byte("""), nil, nil, nil, []byte("&"), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, []byte("<"), nil, []byte(">"), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil} - -// EscapeHTMLByte returns HTML escaped bytes if the given byte should be escaped, -// otherwise nil. -func EscapeHTMLByte(b byte) []byte { - return htmlEscapeTable[b] -} - -// EscapeHTML escapes characters that should be escaped in HTML text. -func EscapeHTML(v []byte) []byte { - cob := NewCopyOnWriteBuffer(v) - n := 0 - for i := 0; i < len(v); i++ { - c := v[i] - escaped := htmlEscapeTable[c] - if escaped != nil { - cob.Write(v[n:i]) - cob.Write(escaped) - n = i + 1 - } - } - if cob.IsCopied() { - cob.Write(v[n:]) - } - return cob.Bytes() -} - -// UnescapePunctuations unescapes blackslash escaped punctuations. -func UnescapePunctuations(source []byte) []byte { - cob := NewCopyOnWriteBuffer(source) - limit := len(source) - n := 0 - for i := 0; i < limit; { - c := source[i] - if i < limit-1 && c == '\\' && IsPunct(source[i+1]) { - cob.Write(source[n:i]) - cob.WriteByte(source[i+1]) - i += 2 - n = i - continue - } - i++ - } - if cob.IsCopied() { - cob.Write(source[n:]) - } - return cob.Bytes() -} - -// ResolveNumericReferences resolve numeric references like 'Ӓ" . -func ResolveNumericReferences(source []byte) []byte { - cob := NewCopyOnWriteBuffer(source) - buf := make([]byte, 6, 6) - limit := len(source) - ok := false - n := 0 - for i := 0; i < limit; i++ { - if source[i] == '&' { - pos := i - next := i + 1 - if next < limit && source[next] == '#' { - nnext := next + 1 - if nnext < limit { - nc := source[nnext] - // code point like #x22; - if nnext < limit && nc == 'x' || nc == 'X' { - start := nnext + 1 - i, ok = ReadWhile(source, [2]int{start, limit}, IsHexDecimal) - if ok && i < limit && source[i] == ';' { - v, _ := strconv.ParseUint(BytesToReadOnlyString(source[start:i]), 16, 32) - cob.Write(source[n:pos]) - n = i + 1 - runeSize := utf8.EncodeRune(buf, ToValidRune(rune(v))) - cob.Write(buf[:runeSize]) - continue - } - // code point like #1234; - } else if nc >= '0' && nc <= '9' { - start := nnext - i, ok = ReadWhile(source, [2]int{start, limit}, IsNumeric) - if ok && i < limit && i-start < 8 && source[i] == ';' { - v, _ := strconv.ParseUint(BytesToReadOnlyString(source[start:i]), 0, 32) - cob.Write(source[n:pos]) - n = i + 1 - runeSize := utf8.EncodeRune(buf, ToValidRune(rune(v))) - cob.Write(buf[:runeSize]) - continue - } - } - } - } - i = next - 1 - } - } - if cob.IsCopied() { - cob.Write(source[n:]) - } - return cob.Bytes() -} - -// ResolveEntityNames resolve entity references like 'ö" . -func ResolveEntityNames(source []byte) []byte { - cob := NewCopyOnWriteBuffer(source) - limit := len(source) - ok := false - n := 0 - for i := 0; i < limit; i++ { - if source[i] == '&' { - pos := i - next := i + 1 - if !(next < limit && source[next] == '#') { - start := next - i, ok = ReadWhile(source, [2]int{start, limit}, IsAlphaNumeric) - if ok && i < limit && source[i] == ';' { - name := BytesToReadOnlyString(source[start:i]) - entity, ok := LookUpHTML5EntityByName(name) - if ok { - cob.Write(source[n:pos]) - n = i + 1 - cob.Write(entity.Characters) - continue - } - } - } - i = next - 1 - } - } - if cob.IsCopied() { - cob.Write(source[n:]) - } - return cob.Bytes() -} - -var htmlSpace = []byte("%20") - -// URLEscape escape the given URL. -// If resolveReference is set true: -// 1. unescape punctuations -// 2. resolve numeric references -// 3. resolve entity references -// -// URL encoded values (%xx) are kept as is. -func URLEscape(v []byte, resolveReference bool) []byte { - if resolveReference { - v = UnescapePunctuations(v) - v = ResolveNumericReferences(v) - v = ResolveEntityNames(v) - } - cob := NewCopyOnWriteBuffer(v) - limit := len(v) - n := 0 - - for i := 0; i < limit; { - c := v[i] - if urlEscapeTable[c] == 1 { - i++ - continue - } - if c == '%' && i+2 < limit && IsHexDecimal(v[i+1]) && IsHexDecimal(v[i+1]) { - i += 3 - continue - } - u8len := utf8lenTable[c] - if u8len == 99 { // invalid utf8 leading byte, skip it - i++ - continue - } - if c == ' ' { - cob.Write(v[n:i]) - cob.Write(htmlSpace) - i++ - n = i - continue - } - if int(u8len) > len(v) { - u8len = int8(len(v) - 1) - } - if u8len == 0 { - i++ - n = i - continue - } - cob.Write(v[n:i]) - stop := i + int(u8len) - if stop > len(v) { - i++ - n = i - continue - } - cob.Write(StringToReadOnlyBytes(url.QueryEscape(string(v[i:stop])))) - i += int(u8len) - n = i - } - if cob.IsCopied() && n < limit { - cob.Write(v[n:]) - } - return cob.Bytes() -} - -// FindURLIndex returns a stop index value if the given bytes seem an URL. -// This function is equivalent to [A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]* . -func FindURLIndex(b []byte) int { - i := 0 - if !(len(b) > 0 && urlTable[b[i]]&7 == 7) { - return -1 - } - i++ - for ; i < len(b); i++ { - c := b[i] - if urlTable[c]&4 != 4 { - break - } - } - if i == 1 || i > 33 || i >= len(b) { - return -1 - } - if b[i] != ':' { - return -1 - } - i++ - for ; i < len(b); i++ { - c := b[i] - if urlTable[c]&1 != 1 { - break - } - } - return i -} - -var emailDomainRegexp = regexp.MustCompile(`^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*`) - -// FindEmailIndex returns a stop index value if the given bytes seem an email address. -func FindEmailIndex(b []byte) int { - // TODO: eliminate regexps - i := 0 - for ; i < len(b); i++ { - c := b[i] - if emailTable[c]&1 != 1 { - break - } - } - if i == 0 { - return -1 - } - if i >= len(b) || b[i] != '@' { - return -1 - } - i++ - if i >= len(b) { - return -1 - } - match := emailDomainRegexp.FindSubmatchIndex(b[i:]) - if match == nil { - return -1 - } - return i + match[1] -} - -var spaces = []byte(" \t\n\x0b\x0c\x0d") - -var spaceTable = [256]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -var punctTable = [256]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -// a-zA-Z0-9, ;/?:@&=+$,-_.!~*'()# -var urlEscapeTable = [256]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -var utf8lenTable = [256]int8{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 99, 99, 99, 99, 99, 99, 99, 99} - -var urlTable = [256]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 5, 5, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 0, 1, 0, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} - -var emailTable = [256]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -// UTF8Len returns a byte length of the utf-8 character. -func UTF8Len(b byte) int8 { - return utf8lenTable[b] -} - -// IsPunct returns true if the given character is a punctuation, otherwise false. -func IsPunct(c byte) bool { - return punctTable[c] == 1 -} - -// IsPunctRune returns true if the given rune is a punctuation, otherwise false. -func IsPunctRune(r rune) bool { - return int32(r) <= 256 && IsPunct(byte(r)) || unicode.IsPunct(r) -} - -// IsSpace returns true if the given character is a space, otherwise false. -func IsSpace(c byte) bool { - return spaceTable[c] == 1 -} - -// IsSpaceRune returns true if the given rune is a space, otherwise false. -func IsSpaceRune(r rune) bool { - return int32(r) <= 256 && IsSpace(byte(r)) || unicode.IsSpace(r) -} - -// IsNumeric returns true if the given character is a numeric, otherwise false. -func IsNumeric(c byte) bool { - return c >= '0' && c <= '9' -} - -// IsHexDecimal returns true if the given character is a hexdecimal, otherwise false. -func IsHexDecimal(c byte) bool { - return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' -} - -// IsAlphaNumeric returns true if the given character is a alphabet or a numeric, otherwise false. -func IsAlphaNumeric(c byte) bool { - return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' -} - -// A BufWriter is a subset of the bufio.Writer . -type BufWriter interface { - io.Writer - Available() int - Buffered() int - Flush() error - WriteByte(c byte) error - WriteRune(r rune) (size int, err error) - WriteString(s string) (int, error) -} - -// A PrioritizedValue struct holds pair of an arbitrary value and a priority. -type PrioritizedValue struct { - // Value is an arbitrary value that you want to prioritize. - Value interface{} - // Priority is a priority of the value. - Priority int -} - -// PrioritizedSlice is a slice of the PrioritizedValues -type PrioritizedSlice []PrioritizedValue - -// Sort sorts the PrioritizedSlice in ascending order. -func (s PrioritizedSlice) Sort() { - sort.Slice(s, func(i, j int) bool { - return s[i].Priority < s[j].Priority - }) -} - -// Remove removes the given value from this slice. -func (s PrioritizedSlice) Remove(v interface{}) PrioritizedSlice { - i := 0 - found := false - for ; i < len(s); i++ { - if s[i].Value == v { - found = true - break - } - } - if !found { - return s - } - return append(s[:i], s[i+1:]...) -} - -// Prioritized returns a new PrioritizedValue. -func Prioritized(v interface{}, priority int) PrioritizedValue { - return PrioritizedValue{v, priority} -} - -func bytesHash(b []byte) uint64 { - var hash uint64 = 5381 - for _, c := range b { - hash = ((hash << 5) + hash) + uint64(c) - } - return hash -} - -// BytesFilter is a efficient data structure for checking whether bytes exist or not. -// BytesFilter is thread-safe. -type BytesFilter interface { - // Add adds given bytes to this set. - Add([]byte) - - // Contains return true if this set contains given bytes, otherwise false. - Contains([]byte) bool - - // Extend copies this filter and adds given bytes to new filter. - Extend(...[]byte) BytesFilter -} - -type bytesFilter struct { - chars [256]uint8 - threshold int - slots [][][]byte -} - -// NewBytesFilter returns a new BytesFilter. -func NewBytesFilter(elements ...[]byte) BytesFilter { - s := &bytesFilter{ - threshold: 3, - slots: make([][][]byte, 64), - } - for _, element := range elements { - s.Add(element) - } - return s -} - -func (s *bytesFilter) Add(b []byte) { - l := len(b) - m := s.threshold - if l < s.threshold { - m = l - } - for i := 0; i < m; i++ { - s.chars[b[i]] |= 1 << uint8(i) - } - h := bytesHash(b) % uint64(len(s.slots)) - slot := s.slots[h] - if slot == nil { - slot = [][]byte{} - } - s.slots[h] = append(slot, b) -} - -func (s *bytesFilter) Extend(bs ...[]byte) BytesFilter { - newFilter := NewBytesFilter().(*bytesFilter) - newFilter.chars = s.chars - newFilter.threshold = s.threshold - for k, v := range s.slots { - newSlot := make([][]byte, len(v)) - copy(newSlot, v) - newFilter.slots[k] = v - } - for _, b := range bs { - newFilter.Add(b) - } - return newFilter -} - -func (s *bytesFilter) Contains(b []byte) bool { - l := len(b) - m := s.threshold - if l < s.threshold { - m = l - } - for i := 0; i < m; i++ { - if (s.chars[b[i]] & (1 << uint8(i))) == 0 { - return false - } - } - h := bytesHash(b) % uint64(len(s.slots)) - slot := s.slots[h] - if slot == nil || len(slot) == 0 { - return false - } - for _, element := range slot { - if bytes.Equal(element, b) { - return true - } - } - return false -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util_safe.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util_safe.go deleted file mode 100644 index 507a9d029..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util_safe.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build appengine js - -package util - -// BytesToReadOnlyString returns a string converted from given bytes. -func BytesToReadOnlyString(b []byte) string { - return string(b) -} - -// StringToReadOnlyBytes returns bytes converted from given string. -func StringToReadOnlyBytes(s string) []byte { - return []byte(s) -} diff --git a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util_unsafe.go b/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util_unsafe.go deleted file mode 100644 index d09881104..000000000 --- a/pkg/mod/github.com/yuin/goldmark@v1.4.4/util/util_unsafe.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !appengine,!js - -package util - -import ( - "reflect" - "unsafe" -) - -// BytesToReadOnlyString returns a string converted from given bytes. -func BytesToReadOnlyString(b []byte) string { - return *(*string)(unsafe.Pointer(&b)) -} - -// StringToReadOnlyBytes returns bytes converted from given string. -func StringToReadOnlyBytes(s string) (bs []byte) { - sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) - bh := (*reflect.SliceHeader)(unsafe.Pointer(&bs)) - bh.Data = sh.Data - bh.Cap = sh.Len - bh.Len = sh.Len - return -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/.gitattributes b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/.gitattributes deleted file mode 100644 index d2f212e5d..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/.gitattributes +++ /dev/null @@ -1,10 +0,0 @@ -# Treat all files in this repo as binary, with no git magic updating -# line endings. Windows users contributing to Go will need to use a -# modern version of git and editors capable of LF line endings. -# -# We'll prevent accidental CRLF line endings from entering the repo -# via the git-review gofmt checks. -# -# See golang.org/issue/9281 - -* -text diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/.gitignore b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/.gitignore deleted file mode 100644 index 5a9d62efd..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Add no patterns to .gitignore except for files generated by the build. -last-change diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/AUTHORS b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/AUTHORS deleted file mode 100644 index 15167cd74..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/AUTHORS +++ /dev/null @@ -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. diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/CONTRIBUTING.md b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/CONTRIBUTING.md deleted file mode 100644 index d0485e887..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# Contributing to Go - -Go is an open source project. - -It is the work of hundreds of contributors. We appreciate your help! - -## Filing issues - -When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: - -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? - -General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. -The gophers there will answer or ask you to file an issue if you've tripped over a bug. - -## Contributing code - -Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) -before sending patches. - -Unless otherwise noted, the Go source files are distributed under -the BSD-style license found in the LICENSE file. diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/CONTRIBUTORS b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/CONTRIBUTORS deleted file mode 100644 index 1c4577e96..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/CONTRIBUTORS +++ /dev/null @@ -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. diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/LICENSE b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/LICENSE deleted file mode 100644 index 6a66aea5e..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/PATENTS b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/PATENTS deleted file mode 100644 index 733099041..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/README.md b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/README.md deleted file mode 100644 index a15f253df..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Go Networking - -[![Go Reference](https://pkg.go.dev/badge/golang.org/x/net.svg)](https://pkg.go.dev/golang.org/x/net) - -This repository holds supplementary Go networking libraries. - -## Download/Install - -The easiest way to install is to run `go get -u golang.org/x/net`. You can -also manually git clone the repository to `$GOPATH/src/golang.org/x/net`. - -## Report Issues / Send Patches - -This repository uses Gerrit for code changes. To learn how to submit -changes to this repository, see https://golang.org/doc/contribute.html. -The main issue tracker for the net repository is located at -https://github.com/golang/go/issues. Prefix your issue with "x/net:" in the -subject line, so it is easy to find. diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/asm.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/asm.go deleted file mode 100644 index 15e21b181..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/asm.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 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 bpf - -import "fmt" - -// Assemble converts insts into raw instructions suitable for loading -// into a BPF virtual machine. -// -// Currently, no optimization is attempted, the assembled program flow -// is exactly as provided. -func Assemble(insts []Instruction) ([]RawInstruction, error) { - ret := make([]RawInstruction, len(insts)) - var err error - for i, inst := range insts { - ret[i], err = inst.Assemble() - if err != nil { - return nil, fmt.Errorf("assembling instruction %d: %s", i+1, err) - } - } - return ret, nil -} - -// Disassemble attempts to parse raw back into -// Instructions. Unrecognized RawInstructions are assumed to be an -// extension not implemented by this package, and are passed through -// unchanged to the output. The allDecoded value reports whether insts -// contains no RawInstructions. -func Disassemble(raw []RawInstruction) (insts []Instruction, allDecoded bool) { - insts = make([]Instruction, len(raw)) - allDecoded = true - for i, r := range raw { - insts[i] = r.Disassemble() - if _, ok := insts[i].(RawInstruction); ok { - allDecoded = false - } - } - return insts, allDecoded -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/constants.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/constants.go deleted file mode 100644 index 12f3ee835..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/constants.go +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2016 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 bpf - -// A Register is a register of the BPF virtual machine. -type Register uint16 - -const ( - // RegA is the accumulator register. RegA is always the - // destination register of ALU operations. - RegA Register = iota - // RegX is the indirection register, used by LoadIndirect - // operations. - RegX -) - -// An ALUOp is an arithmetic or logic operation. -type ALUOp uint16 - -// ALU binary operation types. -const ( - ALUOpAdd ALUOp = iota << 4 - ALUOpSub - ALUOpMul - ALUOpDiv - ALUOpOr - ALUOpAnd - ALUOpShiftLeft - ALUOpShiftRight - aluOpNeg // Not exported because it's the only unary ALU operation, and gets its own instruction type. - ALUOpMod - ALUOpXor -) - -// A JumpTest is a comparison operator used in conditional jumps. -type JumpTest uint16 - -// Supported operators for conditional jumps. -// K can be RegX for JumpIfX -const ( - // K == A - JumpEqual JumpTest = iota - // K != A - JumpNotEqual - // K > A - JumpGreaterThan - // K < A - JumpLessThan - // K >= A - JumpGreaterOrEqual - // K <= A - JumpLessOrEqual - // K & A != 0 - JumpBitsSet - // K & A == 0 - JumpBitsNotSet -) - -// An Extension is a function call provided by the kernel that -// performs advanced operations that are expensive or impossible -// within the BPF virtual machine. -// -// Extensions are only implemented by the Linux kernel. -// -// TODO: should we prune this list? Some of these extensions seem -// either broken or near-impossible to use correctly, whereas other -// (len, random, ifindex) are quite useful. -type Extension int - -// Extension functions available in the Linux kernel. -const ( - // extOffset is the negative maximum number of instructions used - // to load instructions by overloading the K argument. - extOffset = -0x1000 - // ExtLen returns the length of the packet. - ExtLen Extension = 1 - // ExtProto returns the packet's L3 protocol type. - ExtProto Extension = 0 - // ExtType returns the packet's type (skb->pkt_type in the kernel) - // - // TODO: better documentation. How nice an API do we want to - // provide for these esoteric extensions? - ExtType Extension = 4 - // ExtPayloadOffset returns the offset of the packet payload, or - // the first protocol header that the kernel does not know how to - // parse. - ExtPayloadOffset Extension = 52 - // ExtInterfaceIndex returns the index of the interface on which - // the packet was received. - ExtInterfaceIndex Extension = 8 - // ExtNetlinkAttr returns the netlink attribute of type X at - // offset A. - ExtNetlinkAttr Extension = 12 - // ExtNetlinkAttrNested returns the nested netlink attribute of - // type X at offset A. - ExtNetlinkAttrNested Extension = 16 - // ExtMark returns the packet's mark value. - ExtMark Extension = 20 - // ExtQueue returns the packet's assigned hardware queue. - ExtQueue Extension = 24 - // ExtLinkLayerType returns the packet's hardware address type - // (e.g. Ethernet, Infiniband). - ExtLinkLayerType Extension = 28 - // ExtRXHash returns the packets receive hash. - // - // TODO: figure out what this rxhash actually is. - ExtRXHash Extension = 32 - // ExtCPUID returns the ID of the CPU processing the current - // packet. - ExtCPUID Extension = 36 - // ExtVLANTag returns the packet's VLAN tag. - ExtVLANTag Extension = 44 - // ExtVLANTagPresent returns non-zero if the packet has a VLAN - // tag. - // - // TODO: I think this might be a lie: it reads bit 0x1000 of the - // VLAN header, which changed meaning in recent revisions of the - // spec - this extension may now return meaningless information. - ExtVLANTagPresent Extension = 48 - // ExtVLANProto returns 0x8100 if the frame has a VLAN header, - // 0x88a8 if the frame has a "Q-in-Q" double VLAN header, or some - // other value if no VLAN information is present. - ExtVLANProto Extension = 60 - // ExtRand returns a uniformly random uint32. - ExtRand Extension = 56 -) - -// The following gives names to various bit patterns used in opcode construction. - -const ( - opMaskCls uint16 = 0x7 - // opClsLoad masks - opMaskLoadDest = 0x01 - opMaskLoadWidth = 0x18 - opMaskLoadMode = 0xe0 - // opClsALU & opClsJump - opMaskOperand = 0x08 - opMaskOperator = 0xf0 -) - -const ( - // +---------------+-----------------+---+---+---+ - // | AddrMode (3b) | LoadWidth (2b) | 0 | 0 | 0 | - // +---------------+-----------------+---+---+---+ - opClsLoadA uint16 = iota - // +---------------+-----------------+---+---+---+ - // | AddrMode (3b) | LoadWidth (2b) | 0 | 0 | 1 | - // +---------------+-----------------+---+---+---+ - opClsLoadX - // +---+---+---+---+---+---+---+---+ - // | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | - // +---+---+---+---+---+---+---+---+ - opClsStoreA - // +---+---+---+---+---+---+---+---+ - // | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | - // +---+---+---+---+---+---+---+---+ - opClsStoreX - // +---------------+-----------------+---+---+---+ - // | Operator (4b) | OperandSrc (1b) | 1 | 0 | 0 | - // +---------------+-----------------+---+---+---+ - opClsALU - // +-----------------------------+---+---+---+---+ - // | TestOperator (4b) | 0 | 1 | 0 | 1 | - // +-----------------------------+---+---+---+---+ - opClsJump - // +---+-------------------------+---+---+---+---+ - // | 0 | 0 | 0 | RetSrc (1b) | 0 | 1 | 1 | 0 | - // +---+-------------------------+---+---+---+---+ - opClsReturn - // +---+-------------------------+---+---+---+---+ - // | 0 | 0 | 0 | TXAorTAX (1b) | 0 | 1 | 1 | 1 | - // +---+-------------------------+---+---+---+---+ - opClsMisc -) - -const ( - opAddrModeImmediate uint16 = iota << 5 - opAddrModeAbsolute - opAddrModeIndirect - opAddrModeScratch - opAddrModePacketLen // actually an extension, not an addressing mode. - opAddrModeMemShift -) - -const ( - opLoadWidth4 uint16 = iota << 3 - opLoadWidth2 - opLoadWidth1 -) - -// Operand for ALU and Jump instructions -type opOperand uint16 - -// Supported operand sources. -const ( - opOperandConstant opOperand = iota << 3 - opOperandX -) - -// An jumpOp is a conditional jump condition. -type jumpOp uint16 - -// Supported jump conditions. -const ( - opJumpAlways jumpOp = iota << 4 - opJumpEqual - opJumpGT - opJumpGE - opJumpSet -) - -const ( - opRetSrcConstant uint16 = iota << 4 - opRetSrcA -) - -const ( - opMiscTAX = 0x00 - opMiscTXA = 0x80 -) diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/doc.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/doc.go deleted file mode 100644 index ae62feb53..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/doc.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2016 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 bpf implements marshaling and unmarshaling of programs for the -Berkeley Packet Filter virtual machine, and provides a Go implementation -of the virtual machine. - -BPF's main use is to specify a packet filter for network taps, so that -the kernel doesn't have to expensively copy every packet it sees to -userspace. However, it's been repurposed to other areas where running -user code in-kernel is needed. For example, Linux's seccomp uses BPF -to apply security policies to system calls. For simplicity, this -documentation refers only to packets, but other uses of BPF have their -own data payloads. - -BPF programs run in a restricted virtual machine. It has almost no -access to kernel functions, and while conditional branches are -allowed, they can only jump forwards, to guarantee that there are no -infinite loops. - -The virtual machine - -The BPF VM is an accumulator machine. Its main register, called -register A, is an implicit source and destination in all arithmetic -and logic operations. The machine also has 16 scratch registers for -temporary storage, and an indirection register (register X) for -indirect memory access. All registers are 32 bits wide. - -Each run of a BPF program is given one packet, which is placed in the -VM's read-only "main memory". LoadAbsolute and LoadIndirect -instructions can fetch up to 32 bits at a time into register A for -examination. - -The goal of a BPF program is to produce and return a verdict (uint32), -which tells the kernel what to do with the packet. In the context of -packet filtering, the returned value is the number of bytes of the -packet to forward to userspace, or 0 to ignore the packet. Other -contexts like seccomp define their own return values. - -In order to simplify programs, attempts to read past the end of the -packet terminate the program execution with a verdict of 0 (ignore -packet). This means that the vast majority of BPF programs don't need -to do any explicit bounds checking. - -In addition to the bytes of the packet, some BPF programs have access -to extensions, which are essentially calls to kernel utility -functions. Currently, the only extensions supported by this package -are the Linux packet filter extensions. - -Examples - -This packet filter selects all ARP packets. - - bpf.Assemble([]bpf.Instruction{ - // Load "EtherType" field from the ethernet header. - bpf.LoadAbsolute{Off: 12, Size: 2}, - // Skip over the next instruction if EtherType is not ARP. - bpf.JumpIf{Cond: bpf.JumpNotEqual, Val: 0x0806, SkipTrue: 1}, - // Verdict is "send up to 4k of the packet to userspace." - bpf.RetConstant{Val: 4096}, - // Verdict is "ignore packet." - bpf.RetConstant{Val: 0}, - }) - -This packet filter captures a random 1% sample of traffic. - - bpf.Assemble([]bpf.Instruction{ - // Get a 32-bit random number from the Linux kernel. - bpf.LoadExtension{Num: bpf.ExtRand}, - // 1% dice roll? - bpf.JumpIf{Cond: bpf.JumpLessThan, Val: 2^32/100, SkipFalse: 1}, - // Capture. - bpf.RetConstant{Val: 4096}, - // Ignore. - bpf.RetConstant{Val: 0}, - }) - -*/ -package bpf // import "golang.org/x/net/bpf" diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/instructions.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/instructions.go deleted file mode 100644 index 3cffcaa01..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/instructions.go +++ /dev/null @@ -1,726 +0,0 @@ -// Copyright 2016 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 bpf - -import "fmt" - -// An Instruction is one instruction executed by the BPF virtual -// machine. -type Instruction interface { - // Assemble assembles the Instruction into a RawInstruction. - Assemble() (RawInstruction, error) -} - -// A RawInstruction is a raw BPF virtual machine instruction. -type RawInstruction struct { - // Operation to execute. - Op uint16 - // For conditional jump instructions, the number of instructions - // to skip if the condition is true/false. - Jt uint8 - Jf uint8 - // Constant parameter. The meaning depends on the Op. - K uint32 -} - -// Assemble implements the Instruction Assemble method. -func (ri RawInstruction) Assemble() (RawInstruction, error) { return ri, nil } - -// Disassemble parses ri into an Instruction and returns it. If ri is -// not recognized by this package, ri itself is returned. -func (ri RawInstruction) Disassemble() Instruction { - switch ri.Op & opMaskCls { - case opClsLoadA, opClsLoadX: - reg := Register(ri.Op & opMaskLoadDest) - sz := 0 - switch ri.Op & opMaskLoadWidth { - case opLoadWidth4: - sz = 4 - case opLoadWidth2: - sz = 2 - case opLoadWidth1: - sz = 1 - default: - return ri - } - switch ri.Op & opMaskLoadMode { - case opAddrModeImmediate: - if sz != 4 { - return ri - } - return LoadConstant{Dst: reg, Val: ri.K} - case opAddrModeScratch: - if sz != 4 || ri.K > 15 { - return ri - } - return LoadScratch{Dst: reg, N: int(ri.K)} - case opAddrModeAbsolute: - if ri.K > extOffset+0xffffffff { - return LoadExtension{Num: Extension(-extOffset + ri.K)} - } - return LoadAbsolute{Size: sz, Off: ri.K} - case opAddrModeIndirect: - return LoadIndirect{Size: sz, Off: ri.K} - case opAddrModePacketLen: - if sz != 4 { - return ri - } - return LoadExtension{Num: ExtLen} - case opAddrModeMemShift: - return LoadMemShift{Off: ri.K} - default: - return ri - } - - case opClsStoreA: - if ri.Op != opClsStoreA || ri.K > 15 { - return ri - } - return StoreScratch{Src: RegA, N: int(ri.K)} - - case opClsStoreX: - if ri.Op != opClsStoreX || ri.K > 15 { - return ri - } - return StoreScratch{Src: RegX, N: int(ri.K)} - - case opClsALU: - switch op := ALUOp(ri.Op & opMaskOperator); op { - case ALUOpAdd, ALUOpSub, ALUOpMul, ALUOpDiv, ALUOpOr, ALUOpAnd, ALUOpShiftLeft, ALUOpShiftRight, ALUOpMod, ALUOpXor: - switch operand := opOperand(ri.Op & opMaskOperand); operand { - case opOperandX: - return ALUOpX{Op: op} - case opOperandConstant: - return ALUOpConstant{Op: op, Val: ri.K} - default: - return ri - } - case aluOpNeg: - return NegateA{} - default: - return ri - } - - case opClsJump: - switch op := jumpOp(ri.Op & opMaskOperator); op { - case opJumpAlways: - return Jump{Skip: ri.K} - case opJumpEqual, opJumpGT, opJumpGE, opJumpSet: - cond, skipTrue, skipFalse := jumpOpToTest(op, ri.Jt, ri.Jf) - switch operand := opOperand(ri.Op & opMaskOperand); operand { - case opOperandX: - return JumpIfX{Cond: cond, SkipTrue: skipTrue, SkipFalse: skipFalse} - case opOperandConstant: - return JumpIf{Cond: cond, Val: ri.K, SkipTrue: skipTrue, SkipFalse: skipFalse} - default: - return ri - } - default: - return ri - } - - case opClsReturn: - switch ri.Op { - case opClsReturn | opRetSrcA: - return RetA{} - case opClsReturn | opRetSrcConstant: - return RetConstant{Val: ri.K} - default: - return ri - } - - case opClsMisc: - switch ri.Op { - case opClsMisc | opMiscTAX: - return TAX{} - case opClsMisc | opMiscTXA: - return TXA{} - default: - return ri - } - - default: - panic("unreachable") // switch is exhaustive on the bit pattern - } -} - -func jumpOpToTest(op jumpOp, skipTrue uint8, skipFalse uint8) (JumpTest, uint8, uint8) { - var test JumpTest - - // Decode "fake" jump conditions that don't appear in machine code - // Ensures the Assemble -> Disassemble stage recreates the same instructions - // See https://github.com/golang/go/issues/18470 - if skipTrue == 0 { - switch op { - case opJumpEqual: - test = JumpNotEqual - case opJumpGT: - test = JumpLessOrEqual - case opJumpGE: - test = JumpLessThan - case opJumpSet: - test = JumpBitsNotSet - } - - return test, skipFalse, 0 - } - - switch op { - case opJumpEqual: - test = JumpEqual - case opJumpGT: - test = JumpGreaterThan - case opJumpGE: - test = JumpGreaterOrEqual - case opJumpSet: - test = JumpBitsSet - } - - return test, skipTrue, skipFalse -} - -// LoadConstant loads Val into register Dst. -type LoadConstant struct { - Dst Register - Val uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadConstant) Assemble() (RawInstruction, error) { - return assembleLoad(a.Dst, 4, opAddrModeImmediate, a.Val) -} - -// String returns the instruction in assembler notation. -func (a LoadConstant) String() string { - switch a.Dst { - case RegA: - return fmt.Sprintf("ld #%d", a.Val) - case RegX: - return fmt.Sprintf("ldx #%d", a.Val) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadScratch loads scratch[N] into register Dst. -type LoadScratch struct { - Dst Register - N int // 0-15 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadScratch) Assemble() (RawInstruction, error) { - if a.N < 0 || a.N > 15 { - return RawInstruction{}, fmt.Errorf("invalid scratch slot %d", a.N) - } - return assembleLoad(a.Dst, 4, opAddrModeScratch, uint32(a.N)) -} - -// String returns the instruction in assembler notation. -func (a LoadScratch) String() string { - switch a.Dst { - case RegA: - return fmt.Sprintf("ld M[%d]", a.N) - case RegX: - return fmt.Sprintf("ldx M[%d]", a.N) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadAbsolute loads packet[Off:Off+Size] as an integer value into -// register A. -type LoadAbsolute struct { - Off uint32 - Size int // 1, 2 or 4 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadAbsolute) Assemble() (RawInstruction, error) { - return assembleLoad(RegA, a.Size, opAddrModeAbsolute, a.Off) -} - -// String returns the instruction in assembler notation. -func (a LoadAbsolute) String() string { - switch a.Size { - case 1: // byte - return fmt.Sprintf("ldb [%d]", a.Off) - case 2: // half word - return fmt.Sprintf("ldh [%d]", a.Off) - case 4: // word - if a.Off > extOffset+0xffffffff { - return LoadExtension{Num: Extension(a.Off + 0x1000)}.String() - } - return fmt.Sprintf("ld [%d]", a.Off) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadIndirect loads packet[X+Off:X+Off+Size] as an integer value -// into register A. -type LoadIndirect struct { - Off uint32 - Size int // 1, 2 or 4 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadIndirect) Assemble() (RawInstruction, error) { - return assembleLoad(RegA, a.Size, opAddrModeIndirect, a.Off) -} - -// String returns the instruction in assembler notation. -func (a LoadIndirect) String() string { - switch a.Size { - case 1: // byte - return fmt.Sprintf("ldb [x + %d]", a.Off) - case 2: // half word - return fmt.Sprintf("ldh [x + %d]", a.Off) - case 4: // word - return fmt.Sprintf("ld [x + %d]", a.Off) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadMemShift multiplies the first 4 bits of the byte at packet[Off] -// by 4 and stores the result in register X. -// -// This instruction is mainly useful to load into X the length of an -// IPv4 packet header in a single instruction, rather than have to do -// the arithmetic on the header's first byte by hand. -type LoadMemShift struct { - Off uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadMemShift) Assemble() (RawInstruction, error) { - return assembleLoad(RegX, 1, opAddrModeMemShift, a.Off) -} - -// String returns the instruction in assembler notation. -func (a LoadMemShift) String() string { - return fmt.Sprintf("ldx 4*([%d]&0xf)", a.Off) -} - -// LoadExtension invokes a linux-specific extension and stores the -// result in register A. -type LoadExtension struct { - Num Extension -} - -// Assemble implements the Instruction Assemble method. -func (a LoadExtension) Assemble() (RawInstruction, error) { - if a.Num == ExtLen { - return assembleLoad(RegA, 4, opAddrModePacketLen, 0) - } - return assembleLoad(RegA, 4, opAddrModeAbsolute, uint32(extOffset+a.Num)) -} - -// String returns the instruction in assembler notation. -func (a LoadExtension) String() string { - switch a.Num { - case ExtLen: - return "ld #len" - case ExtProto: - return "ld #proto" - case ExtType: - return "ld #type" - case ExtPayloadOffset: - return "ld #poff" - case ExtInterfaceIndex: - return "ld #ifidx" - case ExtNetlinkAttr: - return "ld #nla" - case ExtNetlinkAttrNested: - return "ld #nlan" - case ExtMark: - return "ld #mark" - case ExtQueue: - return "ld #queue" - case ExtLinkLayerType: - return "ld #hatype" - case ExtRXHash: - return "ld #rxhash" - case ExtCPUID: - return "ld #cpu" - case ExtVLANTag: - return "ld #vlan_tci" - case ExtVLANTagPresent: - return "ld #vlan_avail" - case ExtVLANProto: - return "ld #vlan_tpid" - case ExtRand: - return "ld #rand" - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// StoreScratch stores register Src into scratch[N]. -type StoreScratch struct { - Src Register - N int // 0-15 -} - -// Assemble implements the Instruction Assemble method. -func (a StoreScratch) Assemble() (RawInstruction, error) { - if a.N < 0 || a.N > 15 { - return RawInstruction{}, fmt.Errorf("invalid scratch slot %d", a.N) - } - var op uint16 - switch a.Src { - case RegA: - op = opClsStoreA - case RegX: - op = opClsStoreX - default: - return RawInstruction{}, fmt.Errorf("invalid source register %v", a.Src) - } - - return RawInstruction{ - Op: op, - K: uint32(a.N), - }, nil -} - -// String returns the instruction in assembler notation. -func (a StoreScratch) String() string { - switch a.Src { - case RegA: - return fmt.Sprintf("st M[%d]", a.N) - case RegX: - return fmt.Sprintf("stx M[%d]", a.N) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// ALUOpConstant executes A = A Val. -type ALUOpConstant struct { - Op ALUOp - Val uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a ALUOpConstant) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsALU | uint16(opOperandConstant) | uint16(a.Op), - K: a.Val, - }, nil -} - -// String returns the instruction in assembler notation. -func (a ALUOpConstant) String() string { - switch a.Op { - case ALUOpAdd: - return fmt.Sprintf("add #%d", a.Val) - case ALUOpSub: - return fmt.Sprintf("sub #%d", a.Val) - case ALUOpMul: - return fmt.Sprintf("mul #%d", a.Val) - case ALUOpDiv: - return fmt.Sprintf("div #%d", a.Val) - case ALUOpMod: - return fmt.Sprintf("mod #%d", a.Val) - case ALUOpAnd: - return fmt.Sprintf("and #%d", a.Val) - case ALUOpOr: - return fmt.Sprintf("or #%d", a.Val) - case ALUOpXor: - return fmt.Sprintf("xor #%d", a.Val) - case ALUOpShiftLeft: - return fmt.Sprintf("lsh #%d", a.Val) - case ALUOpShiftRight: - return fmt.Sprintf("rsh #%d", a.Val) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// ALUOpX executes A = A X -type ALUOpX struct { - Op ALUOp -} - -// Assemble implements the Instruction Assemble method. -func (a ALUOpX) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsALU | uint16(opOperandX) | uint16(a.Op), - }, nil -} - -// String returns the instruction in assembler notation. -func (a ALUOpX) String() string { - switch a.Op { - case ALUOpAdd: - return "add x" - case ALUOpSub: - return "sub x" - case ALUOpMul: - return "mul x" - case ALUOpDiv: - return "div x" - case ALUOpMod: - return "mod x" - case ALUOpAnd: - return "and x" - case ALUOpOr: - return "or x" - case ALUOpXor: - return "xor x" - case ALUOpShiftLeft: - return "lsh x" - case ALUOpShiftRight: - return "rsh x" - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// NegateA executes A = -A. -type NegateA struct{} - -// Assemble implements the Instruction Assemble method. -func (a NegateA) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsALU | uint16(aluOpNeg), - }, nil -} - -// String returns the instruction in assembler notation. -func (a NegateA) String() string { - return fmt.Sprintf("neg") -} - -// Jump skips the following Skip instructions in the program. -type Jump struct { - Skip uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a Jump) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsJump | uint16(opJumpAlways), - K: a.Skip, - }, nil -} - -// String returns the instruction in assembler notation. -func (a Jump) String() string { - return fmt.Sprintf("ja %d", a.Skip) -} - -// JumpIf skips the following Skip instructions in the program if A -// Val is true. -type JumpIf struct { - Cond JumpTest - Val uint32 - SkipTrue uint8 - SkipFalse uint8 -} - -// Assemble implements the Instruction Assemble method. -func (a JumpIf) Assemble() (RawInstruction, error) { - return jumpToRaw(a.Cond, opOperandConstant, a.Val, a.SkipTrue, a.SkipFalse) -} - -// String returns the instruction in assembler notation. -func (a JumpIf) String() string { - return jumpToString(a.Cond, fmt.Sprintf("#%d", a.Val), a.SkipTrue, a.SkipFalse) -} - -// JumpIfX skips the following Skip instructions in the program if A -// X is true. -type JumpIfX struct { - Cond JumpTest - SkipTrue uint8 - SkipFalse uint8 -} - -// Assemble implements the Instruction Assemble method. -func (a JumpIfX) Assemble() (RawInstruction, error) { - return jumpToRaw(a.Cond, opOperandX, 0, a.SkipTrue, a.SkipFalse) -} - -// String returns the instruction in assembler notation. -func (a JumpIfX) String() string { - return jumpToString(a.Cond, "x", a.SkipTrue, a.SkipFalse) -} - -// jumpToRaw assembles a jump instruction into a RawInstruction -func jumpToRaw(test JumpTest, operand opOperand, k uint32, skipTrue, skipFalse uint8) (RawInstruction, error) { - var ( - cond jumpOp - flip bool - ) - switch test { - case JumpEqual: - cond = opJumpEqual - case JumpNotEqual: - cond, flip = opJumpEqual, true - case JumpGreaterThan: - cond = opJumpGT - case JumpLessThan: - cond, flip = opJumpGE, true - case JumpGreaterOrEqual: - cond = opJumpGE - case JumpLessOrEqual: - cond, flip = opJumpGT, true - case JumpBitsSet: - cond = opJumpSet - case JumpBitsNotSet: - cond, flip = opJumpSet, true - default: - return RawInstruction{}, fmt.Errorf("unknown JumpTest %v", test) - } - jt, jf := skipTrue, skipFalse - if flip { - jt, jf = jf, jt - } - return RawInstruction{ - Op: opClsJump | uint16(cond) | uint16(operand), - Jt: jt, - Jf: jf, - K: k, - }, nil -} - -// jumpToString converts a jump instruction to assembler notation -func jumpToString(cond JumpTest, operand string, skipTrue, skipFalse uint8) string { - switch cond { - // K == A - case JumpEqual: - return conditionalJump(operand, skipTrue, skipFalse, "jeq", "jneq") - // K != A - case JumpNotEqual: - return fmt.Sprintf("jneq %s,%d", operand, skipTrue) - // K > A - case JumpGreaterThan: - return conditionalJump(operand, skipTrue, skipFalse, "jgt", "jle") - // K < A - case JumpLessThan: - return fmt.Sprintf("jlt %s,%d", operand, skipTrue) - // K >= A - case JumpGreaterOrEqual: - return conditionalJump(operand, skipTrue, skipFalse, "jge", "jlt") - // K <= A - case JumpLessOrEqual: - return fmt.Sprintf("jle %s,%d", operand, skipTrue) - // K & A != 0 - case JumpBitsSet: - if skipFalse > 0 { - return fmt.Sprintf("jset %s,%d,%d", operand, skipTrue, skipFalse) - } - return fmt.Sprintf("jset %s,%d", operand, skipTrue) - // K & A == 0, there is no assembler instruction for JumpBitNotSet, use JumpBitSet and invert skips - case JumpBitsNotSet: - return jumpToString(JumpBitsSet, operand, skipFalse, skipTrue) - default: - return fmt.Sprintf("unknown JumpTest %#v", cond) - } -} - -func conditionalJump(operand string, skipTrue, skipFalse uint8, positiveJump, negativeJump string) string { - if skipTrue > 0 { - if skipFalse > 0 { - return fmt.Sprintf("%s %s,%d,%d", positiveJump, operand, skipTrue, skipFalse) - } - return fmt.Sprintf("%s %s,%d", positiveJump, operand, skipTrue) - } - return fmt.Sprintf("%s %s,%d", negativeJump, operand, skipFalse) -} - -// RetA exits the BPF program, returning the value of register A. -type RetA struct{} - -// Assemble implements the Instruction Assemble method. -func (a RetA) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsReturn | opRetSrcA, - }, nil -} - -// String returns the instruction in assembler notation. -func (a RetA) String() string { - return fmt.Sprintf("ret a") -} - -// RetConstant exits the BPF program, returning a constant value. -type RetConstant struct { - Val uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a RetConstant) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsReturn | opRetSrcConstant, - K: a.Val, - }, nil -} - -// String returns the instruction in assembler notation. -func (a RetConstant) String() string { - return fmt.Sprintf("ret #%d", a.Val) -} - -// TXA copies the value of register X to register A. -type TXA struct{} - -// Assemble implements the Instruction Assemble method. -func (a TXA) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsMisc | opMiscTXA, - }, nil -} - -// String returns the instruction in assembler notation. -func (a TXA) String() string { - return fmt.Sprintf("txa") -} - -// TAX copies the value of register A to register X. -type TAX struct{} - -// Assemble implements the Instruction Assemble method. -func (a TAX) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsMisc | opMiscTAX, - }, nil -} - -// String returns the instruction in assembler notation. -func (a TAX) String() string { - return fmt.Sprintf("tax") -} - -func assembleLoad(dst Register, loadSize int, mode uint16, k uint32) (RawInstruction, error) { - var ( - cls uint16 - sz uint16 - ) - switch dst { - case RegA: - cls = opClsLoadA - case RegX: - cls = opClsLoadX - default: - return RawInstruction{}, fmt.Errorf("invalid target register %v", dst) - } - switch loadSize { - case 1: - sz = opLoadWidth1 - case 2: - sz = opLoadWidth2 - case 4: - sz = opLoadWidth4 - default: - return RawInstruction{}, fmt.Errorf("invalid load byte length %d", sz) - } - return RawInstruction{ - Op: cls | sz | mode, - K: k, - }, nil -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/instructions_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/instructions_test.go deleted file mode 100644 index 69b25c541..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/instructions_test.go +++ /dev/null @@ -1,593 +0,0 @@ -// Copyright 2016 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 bpf - -import ( - "fmt" - "io/ioutil" - "reflect" - "strconv" - "strings" - "testing" -) - -// This is a direct translation of the program in -// testdata/all_instructions.txt. -var allInstructions = []Instruction{ - LoadConstant{Dst: RegA, Val: 42}, - LoadConstant{Dst: RegX, Val: 42}, - - LoadScratch{Dst: RegA, N: 3}, - LoadScratch{Dst: RegX, N: 3}, - - LoadAbsolute{Off: 42, Size: 1}, - LoadAbsolute{Off: 42, Size: 2}, - LoadAbsolute{Off: 42, Size: 4}, - - LoadIndirect{Off: 42, Size: 1}, - LoadIndirect{Off: 42, Size: 2}, - LoadIndirect{Off: 42, Size: 4}, - - LoadMemShift{Off: 42}, - - LoadExtension{Num: ExtLen}, - LoadExtension{Num: ExtProto}, - LoadExtension{Num: ExtType}, - LoadExtension{Num: ExtRand}, - - StoreScratch{Src: RegA, N: 3}, - StoreScratch{Src: RegX, N: 3}, - - ALUOpConstant{Op: ALUOpAdd, Val: 42}, - ALUOpConstant{Op: ALUOpSub, Val: 42}, - ALUOpConstant{Op: ALUOpMul, Val: 42}, - ALUOpConstant{Op: ALUOpDiv, Val: 42}, - ALUOpConstant{Op: ALUOpOr, Val: 42}, - ALUOpConstant{Op: ALUOpAnd, Val: 42}, - ALUOpConstant{Op: ALUOpShiftLeft, Val: 42}, - ALUOpConstant{Op: ALUOpShiftRight, Val: 42}, - ALUOpConstant{Op: ALUOpMod, Val: 42}, - ALUOpConstant{Op: ALUOpXor, Val: 42}, - - ALUOpX{Op: ALUOpAdd}, - ALUOpX{Op: ALUOpSub}, - ALUOpX{Op: ALUOpMul}, - ALUOpX{Op: ALUOpDiv}, - ALUOpX{Op: ALUOpOr}, - ALUOpX{Op: ALUOpAnd}, - ALUOpX{Op: ALUOpShiftLeft}, - ALUOpX{Op: ALUOpShiftRight}, - ALUOpX{Op: ALUOpMod}, - ALUOpX{Op: ALUOpXor}, - - NegateA{}, - - Jump{Skip: 17}, - JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 15, SkipFalse: 16}, - JumpIf{Cond: JumpNotEqual, Val: 42, SkipTrue: 15}, - JumpIf{Cond: JumpLessThan, Val: 42, SkipTrue: 14}, - JumpIf{Cond: JumpLessOrEqual, Val: 42, SkipTrue: 13}, - JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 11, SkipFalse: 12}, - JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 10, SkipFalse: 11}, - JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 9, SkipFalse: 10}, - - JumpIfX{Cond: JumpEqual, SkipTrue: 8, SkipFalse: 9}, - JumpIfX{Cond: JumpNotEqual, SkipTrue: 8}, - JumpIfX{Cond: JumpLessThan, SkipTrue: 7}, - JumpIfX{Cond: JumpLessOrEqual, SkipTrue: 6}, - JumpIfX{Cond: JumpGreaterThan, SkipTrue: 4, SkipFalse: 5}, - JumpIfX{Cond: JumpGreaterOrEqual, SkipTrue: 3, SkipFalse: 4}, - JumpIfX{Cond: JumpBitsSet, SkipTrue: 2, SkipFalse: 3}, - - TAX{}, - TXA{}, - - RetA{}, - RetConstant{Val: 42}, -} -var allInstructionsExpected = "testdata/all_instructions.bpf" - -// Check that we produce the same output as the canonical bpf_asm -// linux kernel tool. -func TestInterop(t *testing.T) { - out, err := Assemble(allInstructions) - if err != nil { - t.Fatalf("assembly of allInstructions program failed: %s", err) - } - t.Logf("Assembled program is %d instructions long", len(out)) - - bs, err := ioutil.ReadFile(allInstructionsExpected) - if err != nil { - t.Fatalf("reading %s: %s", allInstructionsExpected, err) - } - // First statement is the number of statements, last statement is - // empty. We just ignore both and rely on slice length. - stmts := strings.Split(string(bs), ",") - if len(stmts)-2 != len(out) { - t.Fatalf("test program lengths don't match: %s has %d, Go implementation has %d", allInstructionsExpected, len(stmts)-2, len(allInstructions)) - } - - for i, stmt := range stmts[1 : len(stmts)-2] { - nums := strings.Split(stmt, " ") - if len(nums) != 4 { - t.Fatalf("malformed instruction %d in %s: %s", i+1, allInstructionsExpected, stmt) - } - - actual := out[i] - - op, err := strconv.ParseUint(nums[0], 10, 16) - if err != nil { - t.Fatalf("malformed opcode %s in instruction %d of %s", nums[0], i+1, allInstructionsExpected) - } - if actual.Op != uint16(op) { - t.Errorf("opcode mismatch on instruction %d (%#v): got 0x%02x, want 0x%02x", i+1, allInstructions[i], actual.Op, op) - } - - jt, err := strconv.ParseUint(nums[1], 10, 8) - if err != nil { - t.Fatalf("malformed jt offset %s in instruction %d of %s", nums[1], i+1, allInstructionsExpected) - } - if actual.Jt != uint8(jt) { - t.Errorf("jt mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.Jt, jt) - } - - jf, err := strconv.ParseUint(nums[2], 10, 8) - if err != nil { - t.Fatalf("malformed jf offset %s in instruction %d of %s", nums[2], i+1, allInstructionsExpected) - } - if actual.Jf != uint8(jf) { - t.Errorf("jf mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.Jf, jf) - } - - k, err := strconv.ParseUint(nums[3], 10, 32) - if err != nil { - t.Fatalf("malformed constant %s in instruction %d of %s", nums[3], i+1, allInstructionsExpected) - } - if actual.K != uint32(k) { - t.Errorf("constant mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.K, k) - } - } -} - -// Check that assembly and disassembly match each other. -func TestAsmDisasm(t *testing.T) { - prog1, err := Assemble(allInstructions) - if err != nil { - t.Fatalf("assembly of allInstructions program failed: %s", err) - } - t.Logf("Assembled program is %d instructions long", len(prog1)) - - got, allDecoded := Disassemble(prog1) - if !allDecoded { - t.Errorf("Disassemble(Assemble(allInstructions)) produced unrecognized instructions:") - for i, inst := range got { - if r, ok := inst.(RawInstruction); ok { - t.Logf(" insn %d, %#v --> %#v", i+1, allInstructions[i], r) - } - } - } - - if len(allInstructions) != len(got) { - t.Fatalf("disassembly changed program size: %d insns before, %d insns after", len(allInstructions), len(got)) - } - if !reflect.DeepEqual(allInstructions, got) { - t.Errorf("program mutated by disassembly:") - for i := range got { - if !reflect.DeepEqual(allInstructions[i], got[i]) { - t.Logf(" insn %d, s: %#v, p1: %#v, got: %#v", i+1, allInstructions[i], prog1[i], got[i]) - } - } - } -} - -type InvalidInstruction struct{} - -func (a InvalidInstruction) Assemble() (RawInstruction, error) { - return RawInstruction{}, fmt.Errorf("Invalid Instruction") -} - -func (a InvalidInstruction) String() string { - return fmt.Sprintf("unknown instruction: %#v", a) -} - -func TestString(t *testing.T) { - testCases := []struct { - instruction Instruction - assembler string - }{ - { - instruction: LoadConstant{Dst: RegA, Val: 42}, - assembler: "ld #42", - }, - { - instruction: LoadConstant{Dst: RegX, Val: 42}, - assembler: "ldx #42", - }, - { - instruction: LoadConstant{Dst: 0xffff, Val: 42}, - assembler: "unknown instruction: bpf.LoadConstant{Dst:0xffff, Val:0x2a}", - }, - { - instruction: LoadScratch{Dst: RegA, N: 3}, - assembler: "ld M[3]", - }, - { - instruction: LoadScratch{Dst: RegX, N: 3}, - assembler: "ldx M[3]", - }, - { - instruction: LoadScratch{Dst: 0xffff, N: 3}, - assembler: "unknown instruction: bpf.LoadScratch{Dst:0xffff, N:3}", - }, - { - instruction: LoadAbsolute{Off: 42, Size: 1}, - assembler: "ldb [42]", - }, - { - instruction: LoadAbsolute{Off: 42, Size: 2}, - assembler: "ldh [42]", - }, - { - instruction: LoadAbsolute{Off: 42, Size: 4}, - assembler: "ld [42]", - }, - { - instruction: LoadAbsolute{Off: 42, Size: -1}, - assembler: "unknown instruction: bpf.LoadAbsolute{Off:0x2a, Size:-1}", - }, - { - instruction: LoadIndirect{Off: 42, Size: 1}, - assembler: "ldb [x + 42]", - }, - { - instruction: LoadIndirect{Off: 42, Size: 2}, - assembler: "ldh [x + 42]", - }, - { - instruction: LoadIndirect{Off: 42, Size: 4}, - assembler: "ld [x + 42]", - }, - { - instruction: LoadIndirect{Off: 42, Size: -1}, - assembler: "unknown instruction: bpf.LoadIndirect{Off:0x2a, Size:-1}", - }, - { - instruction: LoadMemShift{Off: 42}, - assembler: "ldx 4*([42]&0xf)", - }, - { - instruction: LoadExtension{Num: ExtLen}, - assembler: "ld #len", - }, - { - instruction: LoadExtension{Num: ExtProto}, - assembler: "ld #proto", - }, - { - instruction: LoadExtension{Num: ExtType}, - assembler: "ld #type", - }, - { - instruction: LoadExtension{Num: ExtPayloadOffset}, - assembler: "ld #poff", - }, - { - instruction: LoadExtension{Num: ExtInterfaceIndex}, - assembler: "ld #ifidx", - }, - { - instruction: LoadExtension{Num: ExtNetlinkAttr}, - assembler: "ld #nla", - }, - { - instruction: LoadExtension{Num: ExtNetlinkAttrNested}, - assembler: "ld #nlan", - }, - { - instruction: LoadExtension{Num: ExtMark}, - assembler: "ld #mark", - }, - { - instruction: LoadExtension{Num: ExtQueue}, - assembler: "ld #queue", - }, - { - instruction: LoadExtension{Num: ExtLinkLayerType}, - assembler: "ld #hatype", - }, - { - instruction: LoadExtension{Num: ExtRXHash}, - assembler: "ld #rxhash", - }, - { - instruction: LoadExtension{Num: ExtCPUID}, - assembler: "ld #cpu", - }, - { - instruction: LoadExtension{Num: ExtVLANTag}, - assembler: "ld #vlan_tci", - }, - { - instruction: LoadExtension{Num: ExtVLANTagPresent}, - assembler: "ld #vlan_avail", - }, - { - instruction: LoadExtension{Num: ExtVLANProto}, - assembler: "ld #vlan_tpid", - }, - { - instruction: LoadExtension{Num: ExtRand}, - assembler: "ld #rand", - }, - { - instruction: LoadAbsolute{Off: 0xfffff038, Size: 4}, - assembler: "ld #rand", - }, - { - instruction: LoadExtension{Num: 0xfff}, - assembler: "unknown instruction: bpf.LoadExtension{Num:4095}", - }, - { - instruction: StoreScratch{Src: RegA, N: 3}, - assembler: "st M[3]", - }, - { - instruction: StoreScratch{Src: RegX, N: 3}, - assembler: "stx M[3]", - }, - { - instruction: StoreScratch{Src: 0xffff, N: 3}, - assembler: "unknown instruction: bpf.StoreScratch{Src:0xffff, N:3}", - }, - { - instruction: ALUOpConstant{Op: ALUOpAdd, Val: 42}, - assembler: "add #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpSub, Val: 42}, - assembler: "sub #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpMul, Val: 42}, - assembler: "mul #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpDiv, Val: 42}, - assembler: "div #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpOr, Val: 42}, - assembler: "or #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpAnd, Val: 42}, - assembler: "and #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpShiftLeft, Val: 42}, - assembler: "lsh #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpShiftRight, Val: 42}, - assembler: "rsh #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpMod, Val: 42}, - assembler: "mod #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpXor, Val: 42}, - assembler: "xor #42", - }, - { - instruction: ALUOpConstant{Op: 0xffff, Val: 42}, - assembler: "unknown instruction: bpf.ALUOpConstant{Op:0xffff, Val:0x2a}", - }, - { - instruction: ALUOpX{Op: ALUOpAdd}, - assembler: "add x", - }, - { - instruction: ALUOpX{Op: ALUOpSub}, - assembler: "sub x", - }, - { - instruction: ALUOpX{Op: ALUOpMul}, - assembler: "mul x", - }, - { - instruction: ALUOpX{Op: ALUOpDiv}, - assembler: "div x", - }, - { - instruction: ALUOpX{Op: ALUOpOr}, - assembler: "or x", - }, - { - instruction: ALUOpX{Op: ALUOpAnd}, - assembler: "and x", - }, - { - instruction: ALUOpX{Op: ALUOpShiftLeft}, - assembler: "lsh x", - }, - { - instruction: ALUOpX{Op: ALUOpShiftRight}, - assembler: "rsh x", - }, - { - instruction: ALUOpX{Op: ALUOpMod}, - assembler: "mod x", - }, - { - instruction: ALUOpX{Op: ALUOpXor}, - assembler: "xor x", - }, - { - instruction: ALUOpX{Op: 0xffff}, - assembler: "unknown instruction: bpf.ALUOpX{Op:0xffff}", - }, - { - instruction: NegateA{}, - assembler: "neg", - }, - { - instruction: Jump{Skip: 10}, - assembler: "ja 10", - }, - { - instruction: JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 8, SkipFalse: 9}, - assembler: "jeq #42,8,9", - }, - { - instruction: JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 8}, - assembler: "jeq #42,8", - }, - { - instruction: JumpIf{Cond: JumpEqual, Val: 42, SkipFalse: 8}, - assembler: "jneq #42,8", - }, - { - instruction: JumpIf{Cond: JumpNotEqual, Val: 42, SkipTrue: 8}, - assembler: "jneq #42,8", - }, - { - instruction: JumpIf{Cond: JumpLessThan, Val: 42, SkipTrue: 7}, - assembler: "jlt #42,7", - }, - { - instruction: JumpIf{Cond: JumpLessOrEqual, Val: 42, SkipTrue: 6}, - assembler: "jle #42,6", - }, - { - instruction: JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 4, SkipFalse: 5}, - assembler: "jgt #42,4,5", - }, - { - instruction: JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 4}, - assembler: "jgt #42,4", - }, - { - instruction: JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 3, SkipFalse: 4}, - assembler: "jge #42,3,4", - }, - { - instruction: JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 3}, - assembler: "jge #42,3", - }, - { - instruction: JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset #42,2,3", - }, - { - instruction: JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 2}, - assembler: "jset #42,2", - }, - { - instruction: JumpIf{Cond: JumpBitsNotSet, Val: 42, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset #42,3,2", - }, - { - instruction: JumpIf{Cond: JumpBitsNotSet, Val: 42, SkipTrue: 2}, - assembler: "jset #42,0,2", - }, - { - instruction: JumpIf{Cond: 0xffff, Val: 42, SkipTrue: 1, SkipFalse: 2}, - assembler: "unknown JumpTest 0xffff", - }, - { - instruction: JumpIfX{Cond: JumpEqual, SkipTrue: 8, SkipFalse: 9}, - assembler: "jeq x,8,9", - }, - { - instruction: JumpIfX{Cond: JumpEqual, SkipTrue: 8}, - assembler: "jeq x,8", - }, - { - instruction: JumpIfX{Cond: JumpEqual, SkipFalse: 8}, - assembler: "jneq x,8", - }, - { - instruction: JumpIfX{Cond: JumpNotEqual, SkipTrue: 8}, - assembler: "jneq x,8", - }, - { - instruction: JumpIfX{Cond: JumpLessThan, SkipTrue: 7}, - assembler: "jlt x,7", - }, - { - instruction: JumpIfX{Cond: JumpLessOrEqual, SkipTrue: 6}, - assembler: "jle x,6", - }, - { - instruction: JumpIfX{Cond: JumpGreaterThan, SkipTrue: 4, SkipFalse: 5}, - assembler: "jgt x,4,5", - }, - { - instruction: JumpIfX{Cond: JumpGreaterThan, SkipTrue: 4}, - assembler: "jgt x,4", - }, - { - instruction: JumpIfX{Cond: JumpGreaterOrEqual, SkipTrue: 3, SkipFalse: 4}, - assembler: "jge x,3,4", - }, - { - instruction: JumpIfX{Cond: JumpGreaterOrEqual, SkipTrue: 3}, - assembler: "jge x,3", - }, - { - instruction: JumpIfX{Cond: JumpBitsSet, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset x,2,3", - }, - { - instruction: JumpIfX{Cond: JumpBitsSet, SkipTrue: 2}, - assembler: "jset x,2", - }, - { - instruction: JumpIfX{Cond: JumpBitsNotSet, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset x,3,2", - }, - { - instruction: JumpIfX{Cond: JumpBitsNotSet, SkipTrue: 2}, - assembler: "jset x,0,2", - }, - { - instruction: JumpIfX{Cond: 0xffff, SkipTrue: 1, SkipFalse: 2}, - assembler: "unknown JumpTest 0xffff", - }, - { - instruction: TAX{}, - assembler: "tax", - }, - { - instruction: TXA{}, - assembler: "txa", - }, - { - instruction: RetA{}, - assembler: "ret a", - }, - { - instruction: RetConstant{Val: 42}, - assembler: "ret #42", - }, - // Invalid instruction - { - instruction: InvalidInstruction{}, - assembler: "unknown instruction: bpf.InvalidInstruction{}", - }, - } - - for _, testCase := range testCases { - if input, ok := testCase.instruction.(fmt.Stringer); ok { - got := input.String() - if got != testCase.assembler { - t.Errorf("String did not return expected assembler notation, expected: %s, got: %s", testCase.assembler, got) - } - } else { - t.Errorf("Instruction %#v is not a fmt.Stringer", testCase.instruction) - } - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/setter.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/setter.go deleted file mode 100644 index 43e35f0ac..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/setter.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 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 bpf - -// A Setter is a type which can attach a compiled BPF filter to itself. -type Setter interface { - SetBPF(filter []RawInstruction) error -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/testdata/all_instructions.bpf b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/testdata/all_instructions.bpf deleted file mode 100644 index 929eb25ac..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/testdata/all_instructions.bpf +++ /dev/null @@ -1 +0,0 @@ -57,0 0 0 42,1 0 0 42,96 0 0 3,97 0 0 3,48 0 0 42,40 0 0 42,32 0 0 42,80 0 0 42,72 0 0 42,64 0 0 42,177 0 0 42,128 0 0 0,32 0 0 4294963200,32 0 0 4294963204,32 0 0 4294963256,2 0 0 3,3 0 0 3,4 0 0 42,20 0 0 42,36 0 0 42,52 0 0 42,68 0 0 42,84 0 0 42,100 0 0 42,116 0 0 42,148 0 0 42,164 0 0 42,12 0 0 0,28 0 0 0,44 0 0 0,60 0 0 0,76 0 0 0,92 0 0 0,108 0 0 0,124 0 0 0,156 0 0 0,172 0 0 0,132 0 0 0,5 0 0 17,21 15 16 42,21 0 15 42,53 0 14 42,37 0 13 42,37 11 12 42,53 10 11 42,69 9 10 42,29 8 9 0,29 0 8 0,61 0 7 0,45 0 6 0,45 4 5 0,61 3 4 0,77 2 3 0,7 0 0 0,135 0 0 0,22 0 0 0,6 0 0 42, diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/testdata/all_instructions.txt b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/testdata/all_instructions.txt deleted file mode 100644 index 8e4d7587c..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/testdata/all_instructions.txt +++ /dev/null @@ -1,88 +0,0 @@ -# This filter is compiled to all_instructions.bpf by the `bpf_asm` -# tool, which can be found in the linux kernel source tree under -# tools/bpf. - -# Load immediate -ld #42 -ldx #42 - -# Load scratch -ld M[3] -ldx M[3] - -# Load absolute -ldb [42] -ldh [42] -ld [42] - -# Load indirect -ldb [x + 42] -ldh [x + 42] -ld [x + 42] - -# Load IPv4 header length -ldx 4*([42]&0xf) - -# Run extension function -ld #len -ld #proto -ld #type -ld #rand - -# Store scratch -st M[3] -stx M[3] - -# A constant -add #42 -sub #42 -mul #42 -div #42 -or #42 -and #42 -lsh #42 -rsh #42 -mod #42 -xor #42 - -# A X -add x -sub x -mul x -div x -or x -and x -lsh x -rsh x -mod x -xor x - -# !A -neg - -# Jump A constant -ja end -jeq #42,prev,end -jne #42,end -jlt #42,end -jle #42,end -jgt #42,prev,end -jge #42,prev,end -jset #42,prev,end - -# Jump A X -jeq x,prev,end -jne x,end -jlt x,end -jle x,end -jgt x,prev,end -jge x,prev,end -jset x,prev,end - -# Register transfers -tax -txa - -# Returns -prev: ret a -end: ret #42 diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm.go deleted file mode 100644 index 73f57f1f7..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2016 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 bpf - -import ( - "errors" - "fmt" -) - -// A VM is an emulated BPF virtual machine. -type VM struct { - filter []Instruction -} - -// NewVM returns a new VM using the input BPF program. -func NewVM(filter []Instruction) (*VM, error) { - if len(filter) == 0 { - return nil, errors.New("one or more Instructions must be specified") - } - - for i, ins := range filter { - check := len(filter) - (i + 1) - switch ins := ins.(type) { - // Check for out-of-bounds jumps in instructions - case Jump: - if check <= int(ins.Skip) { - return nil, fmt.Errorf("cannot jump %d instructions; jumping past program bounds", ins.Skip) - } - case JumpIf: - if check <= int(ins.SkipTrue) { - return nil, fmt.Errorf("cannot jump %d instructions in true case; jumping past program bounds", ins.SkipTrue) - } - if check <= int(ins.SkipFalse) { - return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse) - } - case JumpIfX: - if check <= int(ins.SkipTrue) { - return nil, fmt.Errorf("cannot jump %d instructions in true case; jumping past program bounds", ins.SkipTrue) - } - if check <= int(ins.SkipFalse) { - return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse) - } - // Check for division or modulus by zero - case ALUOpConstant: - if ins.Val != 0 { - break - } - - switch ins.Op { - case ALUOpDiv, ALUOpMod: - return nil, errors.New("cannot divide by zero using ALUOpConstant") - } - // Check for unknown extensions - case LoadExtension: - switch ins.Num { - case ExtLen: - default: - return nil, fmt.Errorf("extension %d not implemented", ins.Num) - } - } - } - - // Make sure last instruction is a return instruction - switch filter[len(filter)-1].(type) { - case RetA, RetConstant: - default: - return nil, errors.New("BPF program must end with RetA or RetConstant") - } - - // Though our VM works using disassembled instructions, we - // attempt to assemble the input filter anyway to ensure it is compatible - // with an operating system VM. - _, err := Assemble(filter) - - return &VM{ - filter: filter, - }, err -} - -// Run runs the VM's BPF program against the input bytes. -// Run returns the number of bytes accepted by the BPF program, and any errors -// which occurred while processing the program. -func (v *VM) Run(in []byte) (int, error) { - var ( - // Registers of the virtual machine - regA uint32 - regX uint32 - regScratch [16]uint32 - - // OK is true if the program should continue processing the next - // instruction, or false if not, causing the loop to break - ok = true - ) - - // TODO(mdlayher): implement: - // - NegateA: - // - would require a change from uint32 registers to int32 - // registers - - // TODO(mdlayher): add interop tests that check signedness of ALU - // operations against kernel implementation, and make sure Go - // implementation matches behavior - - for i := 0; i < len(v.filter) && ok; i++ { - ins := v.filter[i] - - switch ins := ins.(type) { - case ALUOpConstant: - regA = aluOpConstant(ins, regA) - case ALUOpX: - regA, ok = aluOpX(ins, regA, regX) - case Jump: - i += int(ins.Skip) - case JumpIf: - jump := jumpIf(ins, regA) - i += jump - case JumpIfX: - jump := jumpIfX(ins, regA, regX) - i += jump - case LoadAbsolute: - regA, ok = loadAbsolute(ins, in) - case LoadConstant: - regA, regX = loadConstant(ins, regA, regX) - case LoadExtension: - regA = loadExtension(ins, in) - case LoadIndirect: - regA, ok = loadIndirect(ins, in, regX) - case LoadMemShift: - regX, ok = loadMemShift(ins, in) - case LoadScratch: - regA, regX = loadScratch(ins, regScratch, regA, regX) - case RetA: - return int(regA), nil - case RetConstant: - return int(ins.Val), nil - case StoreScratch: - regScratch = storeScratch(ins, regScratch, regA, regX) - case TAX: - regX = regA - case TXA: - regA = regX - default: - return 0, fmt.Errorf("unknown Instruction at index %d: %T", i, ins) - } - } - - return 0, nil -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_aluop_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_aluop_test.go deleted file mode 100644 index 16678244a..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_aluop_test.go +++ /dev/null @@ -1,512 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMALUOpAdd(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpAdd, - Val: 3, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 8, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 3, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpSub(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.TAX{}, - bpf.ALUOpX{ - Op: bpf.ALUOpSub, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpMul(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpMul, - Val: 2, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 6, 2, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpDiv(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpDiv, - Val: 2, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 20, 2, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpDivByZeroALUOpConstant(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.ALUOpConstant{ - Op: bpf.ALUOpDiv, - Val: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot divide by zero using ALUOpConstant" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMALUOpDivByZeroALUOpX(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 0 into X - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.TAX{}, - // Load byte 1 into A - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Attempt to perform 1/0 - bpf.ALUOpX{ - Op: bpf.ALUOpDiv, - }, - // Return 4 bytes if program does not terminate - bpf.LoadConstant{ - Val: 12, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpOr(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpOr, - Val: 0x01, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x00, 0x10, 0x03, 0x04, - 0x05, 0x06, 0x07, 0x08, - 0x09, 0xff, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 9, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpAnd(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpAnd, - Val: 0x0019, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0xaa, 0x09, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpShiftLeft(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpShiftLeft, - Val: 0x01, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x02, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0xaa, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpShiftRight(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpShiftRight, - Val: 0x01, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x04, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x08, 0xff, 0xff, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpMod(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpMod, - Val: 20, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 30, 0, 0, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpModByZeroALUOpConstant(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpMod, - Val: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot divide by zero using ALUOpConstant" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMALUOpModByZeroALUOpX(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 0 into X - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.TAX{}, - // Load byte 1 into A - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Attempt to perform 1%0 - bpf.ALUOpX{ - Op: bpf.ALUOpMod, - }, - // Return 4 bytes if program does not terminate - bpf.LoadConstant{ - Val: 12, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpXor(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpXor, - Val: 0x0a, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x01, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x0b, 0x00, 0x00, 0x00, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpUnknown(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpAdd, - Val: 1, - }, - // Verify that an unknown operation is a no-op - bpf.ALUOpConstant{ - Op: 100, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x02, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_bpf_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_bpf_test.go deleted file mode 100644 index 137eea160..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_bpf_test.go +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "net" - "runtime" - "testing" - "time" - - "golang.org/x/net/bpf" - "golang.org/x/net/ipv4" - "golang.org/x/net/ipv6" - "golang.org/x/net/nettest" -) - -// A virtualMachine is a BPF virtual machine which can process an -// input packet against a BPF program and render a verdict. -type virtualMachine interface { - Run(in []byte) (int, error) -} - -// canUseOSVM indicates if the OS BPF VM is available on this platform. -func canUseOSVM() bool { - // OS BPF VM can only be used on platforms where x/net/ipv4 supports - // attaching a BPF program to a socket. - switch runtime.GOOS { - case "linux": - return true - } - - return false -} - -// All BPF tests against both the Go VM and OS VM are assumed to -// be used with a UDP socket. As a result, the entire contents -// of a UDP datagram is sent through the BPF program, but only -// the body after the UDP header will ever be returned in output. - -// testVM sets up a Go BPF VM, and if available, a native OS BPF VM -// for integration testing. -func testVM(t *testing.T, filter []bpf.Instruction) (virtualMachine, func(), error) { - goVM, err := bpf.NewVM(filter) - if err != nil { - // Some tests expect an error, so this error must be returned - // instead of fatally exiting the test - return nil, nil, err - } - - mvm := &multiVirtualMachine{ - goVM: goVM, - - t: t, - } - - // If available, add the OS VM for tests which verify that both the Go - // VM and OS VM have exactly the same output for the same input program - // and packet. - done := func() {} - if canUseOSVM() { - osVM, osVMDone := testOSVM(t, filter) - done = func() { osVMDone() } - mvm.osVM = osVM - } - - return mvm, done, nil -} - -// udpHeaderLen is the length of a UDP header. -const udpHeaderLen = 8 - -// A multiVirtualMachine is a virtualMachine which can call out to both the Go VM -// and the native OS VM, if the OS VM is available. -type multiVirtualMachine struct { - goVM virtualMachine - osVM virtualMachine - - t *testing.T -} - -func (mvm *multiVirtualMachine) Run(in []byte) (int, error) { - if len(in) < udpHeaderLen { - mvm.t.Fatalf("input must be at least length of UDP header (%d), got: %d", - udpHeaderLen, len(in)) - } - - // All tests have a UDP header as part of input, because the OS VM - // packets always will. For the Go VM, this output is trimmed before - // being sent back to tests. - goOut, goErr := mvm.goVM.Run(in) - if goOut >= udpHeaderLen { - goOut -= udpHeaderLen - } - - // If Go output is larger than the size of the packet, packet filtering - // interop tests must trim the output bytes to the length of the packet. - // The BPF VM should not do this on its own, as other uses of it do - // not trim the output byte count. - trim := len(in) - udpHeaderLen - if goOut > trim { - goOut = trim - } - - // When the OS VM is not available, process using the Go VM alone - if mvm.osVM == nil { - return goOut, goErr - } - - // The OS VM will apply its own UDP header, so remove the pseudo header - // that the Go VM needs. - osOut, err := mvm.osVM.Run(in[udpHeaderLen:]) - if err != nil { - mvm.t.Fatalf("error while running OS VM: %v", err) - } - - // Verify both VMs return same number of bytes - var mismatch bool - if goOut != osOut { - mismatch = true - mvm.t.Logf("output byte count does not match:\n- go: %v\n- os: %v", goOut, osOut) - } - - if mismatch { - mvm.t.Fatal("Go BPF and OS BPF packet outputs do not match") - } - - return goOut, goErr -} - -// An osVirtualMachine is a virtualMachine which uses the OS's BPF VM for -// processing BPF programs. -type osVirtualMachine struct { - l net.PacketConn - s net.Conn -} - -// testOSVM creates a virtualMachine which uses the OS's BPF VM by injecting -// packets into a UDP listener with a BPF program attached to it. -func testOSVM(t *testing.T, filter []bpf.Instruction) (virtualMachine, func()) { - l, err := nettest.NewLocalPacketListener("udp") - if err != nil { - t.Fatalf("failed to open OS VM UDP listener: %v", err) - } - - prog, err := bpf.Assemble(filter) - if err != nil { - t.Fatalf("failed to compile BPF program: %v", err) - } - - ip := l.LocalAddr().(*net.UDPAddr).IP - if ip.To4() != nil && ip.To16() == nil { - err = ipv4.NewPacketConn(l).SetBPF(prog) - } else { - err = ipv6.NewPacketConn(l).SetBPF(prog) - } - if err != nil { - t.Fatalf("failed to attach BPF program to listener: %v", err) - } - - s, err := net.Dial(l.LocalAddr().Network(), l.LocalAddr().String()) - if err != nil { - t.Fatalf("failed to dial connection to listener: %v", err) - } - - done := func() { - _ = s.Close() - _ = l.Close() - } - - return &osVirtualMachine{ - l: l, - s: s, - }, done -} - -// Run sends the input bytes into the OS's BPF VM and returns its verdict. -func (vm *osVirtualMachine) Run(in []byte) (int, error) { - go func() { - _, _ = vm.s.Write(in) - }() - - vm.l.SetDeadline(time.Now().Add(50 * time.Millisecond)) - - var b [512]byte - n, _, err := vm.l.ReadFrom(b[:]) - if err != nil { - // A timeout indicates that BPF filtered out the packet, and thus, - // no input should be returned. - if nerr, ok := err.(net.Error); ok && nerr.Timeout() { - return n, nil - } - - return n, err - } - - return n, nil -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_extension_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_extension_test.go deleted file mode 100644 index 7a48c82f3..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_extension_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMLoadExtensionNotImplemented(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadExtension{ - Num: 100, - }, - bpf.RetA{}, - }) - if errStr(err) != "extension 100 not implemented" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadExtensionExtLen(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadExtension{ - Num: bpf.ExtLen, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_instructions.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_instructions.go deleted file mode 100644 index cf8947c33..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_instructions.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2016 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 bpf - -import ( - "encoding/binary" - "fmt" -) - -func aluOpConstant(ins ALUOpConstant, regA uint32) uint32 { - return aluOpCommon(ins.Op, regA, ins.Val) -} - -func aluOpX(ins ALUOpX, regA uint32, regX uint32) (uint32, bool) { - // Guard against division or modulus by zero by terminating - // the program, as the OS BPF VM does - if regX == 0 { - switch ins.Op { - case ALUOpDiv, ALUOpMod: - return 0, false - } - } - - return aluOpCommon(ins.Op, regA, regX), true -} - -func aluOpCommon(op ALUOp, regA uint32, value uint32) uint32 { - switch op { - case ALUOpAdd: - return regA + value - case ALUOpSub: - return regA - value - case ALUOpMul: - return regA * value - case ALUOpDiv: - // Division by zero not permitted by NewVM and aluOpX checks - return regA / value - case ALUOpOr: - return regA | value - case ALUOpAnd: - return regA & value - case ALUOpShiftLeft: - return regA << value - case ALUOpShiftRight: - return regA >> value - case ALUOpMod: - // Modulus by zero not permitted by NewVM and aluOpX checks - return regA % value - case ALUOpXor: - return regA ^ value - default: - return regA - } -} - -func jumpIf(ins JumpIf, regA uint32) int { - return jumpIfCommon(ins.Cond, ins.SkipTrue, ins.SkipFalse, regA, ins.Val) -} - -func jumpIfX(ins JumpIfX, regA uint32, regX uint32) int { - return jumpIfCommon(ins.Cond, ins.SkipTrue, ins.SkipFalse, regA, regX) -} - -func jumpIfCommon(cond JumpTest, skipTrue, skipFalse uint8, regA uint32, value uint32) int { - var ok bool - - switch cond { - case JumpEqual: - ok = regA == value - case JumpNotEqual: - ok = regA != value - case JumpGreaterThan: - ok = regA > value - case JumpLessThan: - ok = regA < value - case JumpGreaterOrEqual: - ok = regA >= value - case JumpLessOrEqual: - ok = regA <= value - case JumpBitsSet: - ok = (regA & value) != 0 - case JumpBitsNotSet: - ok = (regA & value) == 0 - } - - if ok { - return int(skipTrue) - } - - return int(skipFalse) -} - -func loadAbsolute(ins LoadAbsolute, in []byte) (uint32, bool) { - offset := int(ins.Off) - size := int(ins.Size) - - return loadCommon(in, offset, size) -} - -func loadConstant(ins LoadConstant, regA uint32, regX uint32) (uint32, uint32) { - switch ins.Dst { - case RegA: - regA = ins.Val - case RegX: - regX = ins.Val - } - - return regA, regX -} - -func loadExtension(ins LoadExtension, in []byte) uint32 { - switch ins.Num { - case ExtLen: - return uint32(len(in)) - default: - panic(fmt.Sprintf("unimplemented extension: %d", ins.Num)) - } -} - -func loadIndirect(ins LoadIndirect, in []byte, regX uint32) (uint32, bool) { - offset := int(ins.Off) + int(regX) - size := int(ins.Size) - - return loadCommon(in, offset, size) -} - -func loadMemShift(ins LoadMemShift, in []byte) (uint32, bool) { - offset := int(ins.Off) - - // Size of LoadMemShift is always 1 byte - if !inBounds(len(in), offset, 1) { - return 0, false - } - - // Mask off high 4 bits and multiply low 4 bits by 4 - return uint32(in[offset]&0x0f) * 4, true -} - -func inBounds(inLen int, offset int, size int) bool { - return offset+size <= inLen -} - -func loadCommon(in []byte, offset int, size int) (uint32, bool) { - if !inBounds(len(in), offset, size) { - return 0, false - } - - switch size { - case 1: - return uint32(in[offset]), true - case 2: - return uint32(binary.BigEndian.Uint16(in[offset : offset+size])), true - case 4: - return uint32(binary.BigEndian.Uint32(in[offset : offset+size])), true - default: - panic(fmt.Sprintf("invalid load size: %d", size)) - } -} - -func loadScratch(ins LoadScratch, regScratch [16]uint32, regA uint32, regX uint32) (uint32, uint32) { - switch ins.Dst { - case RegA: - regA = regScratch[ins.N] - case RegX: - regX = regScratch[ins.N] - } - - return regA, regX -} - -func storeScratch(ins StoreScratch, regScratch [16]uint32, regA uint32, regX uint32) [16]uint32 { - switch ins.Src { - case RegA: - regScratch[ins.N] = regA - case RegX: - regScratch[ins.N] = regX - } - - return regScratch -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_jump_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_jump_test.go deleted file mode 100644 index 77a2d4703..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_jump_test.go +++ /dev/null @@ -1,726 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMJumpOne(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.Jump{ - Skip: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.Jump{ - Skip: 1, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 1 instructions; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfTrueOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIf{ - Cond: bpf.JumpEqual, - SkipTrue: 2, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 2 instructions in true case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfFalseOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIf{ - Cond: bpf.JumpEqual, - SkipFalse: 3, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 3 instructions in false case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfXTrueOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIfX{ - Cond: bpf.JumpEqual, - SkipTrue: 2, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 2 instructions in true case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfXFalseOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIfX{ - Cond: bpf.JumpEqual, - SkipFalse: 3, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 3 instructions in false case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 1, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfNotEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.JumpIf{ - Cond: bpf.JumpNotEqual, - Val: 1, - SkipFalse: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfGreaterThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpGreaterThan, - Val: 0x00010202, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfLessThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpLessThan, - Val: 0xff010203, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfGreaterOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpGreaterOrEqual, - Val: 0x00010203, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfLessOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpLessOrEqual, - Val: 0xff010203, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfBitsSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.JumpIf{ - Cond: bpf.JumpBitsSet, - Val: 0x1122, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfBitsNotSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.JumpIf{ - Cond: bpf.JumpBitsNotSet, - Val: 0x1221, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 1, - }, - bpf.JumpIfX{ - Cond: bpf.JumpEqual, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXNotEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 1, - }, - bpf.JumpIfX{ - Cond: bpf.JumpNotEqual, - SkipFalse: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXGreaterThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x00010202, - }, - bpf.JumpIfX{ - Cond: bpf.JumpGreaterThan, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXLessThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0xff010203, - }, - bpf.JumpIfX{ - Cond: bpf.JumpLessThan, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXGreaterOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x00010203, - }, - bpf.JumpIfX{ - Cond: bpf.JumpGreaterOrEqual, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXLessOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0xff010203, - }, - bpf.JumpIfX{ - Cond: bpf.JumpLessOrEqual, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXBitsSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x1122, - }, - bpf.JumpIfX{ - Cond: bpf.JumpBitsSet, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXBitsNotSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x1221, - }, - bpf.JumpIfX{ - Cond: bpf.JumpBitsNotSet, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_load_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_load_test.go deleted file mode 100644 index d57e4af1e..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_load_test.go +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "net" - "testing" - - "golang.org/x/net/bpf" - "golang.org/x/net/ipv4" -) - -func TestVMLoadAbsoluteOffsetOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: uint32(len(pkt)), - Size: 1, - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadAbsoluteOffsetPlusSizeOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: uint32(len(pkt) - 1), - Size: 2, - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadAbsoluteBadInstructionSize(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Size: 5, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid load byte length 0" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadConstantOK(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 9, - }, - bpf.TXA{}, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadIndirectOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadIndirect{ - Off: uint32(len(pkt)), - Size: 1, - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadMemShiftOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadMemShift{ - Off: uint32(len(pkt)), - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -const ( - dhcp4Port = 53 -) - -func TestVMLoadMemShiftLoadIndirectNoResult(t *testing.T) { - vm, in, done := testDHCPv4(t) - defer done() - - // Append mostly empty UDP header with incorrect DHCPv4 port - in = append(in, []byte{ - 0, 0, - 0, dhcp4Port + 1, - 0, 0, - 0, 0, - }...) - - out, err := vm.Run(in) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadMemShiftLoadIndirectOK(t *testing.T) { - vm, in, done := testDHCPv4(t) - defer done() - - // Append mostly empty UDP header with correct DHCPv4 port - in = append(in, []byte{ - 0, 0, - 0, dhcp4Port, - 0, 0, - 0, 0, - }...) - - out, err := vm.Run(in) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := len(in)-8, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func testDHCPv4(t *testing.T) (virtualMachine, []byte, func()) { - // DHCPv4 test data courtesy of David Anderson: - // https://github.com/google/netboot/blob/master/dhcp4/conn_linux.go#L59-L70 - vm, done, err := testVM(t, []bpf.Instruction{ - // Load IPv4 packet length - bpf.LoadMemShift{Off: 8}, - // Get UDP dport - bpf.LoadIndirect{Off: 8 + 2, Size: 2}, - // Correct dport? - bpf.JumpIf{Cond: bpf.JumpEqual, Val: dhcp4Port, SkipFalse: 1}, - // Accept - bpf.RetConstant{Val: 1500}, - // Ignore - bpf.RetConstant{Val: 0}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - - // Minimal requirements to make a valid IPv4 header - h := &ipv4.Header{ - Len: ipv4.HeaderLen, - Src: net.IPv4(192, 168, 1, 1), - Dst: net.IPv4(192, 168, 1, 2), - } - hb, err := h.Marshal() - if err != nil { - t.Fatalf("failed to marshal IPv4 header: %v", err) - } - - hb = append([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - }, hb...) - - return vm, hb, done -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_ret_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_ret_test.go deleted file mode 100644 index 2d86eae3e..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_ret_test.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMRetA(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 9, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMRetALargerThanInput(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 255, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMRetConstant(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMRetConstantLargerThanInput(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.RetConstant{ - Val: 16, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_scratch_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_scratch_test.go deleted file mode 100644 index e600e3c28..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_scratch_test.go +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMStoreScratchInvalidScratchRegisterTooSmall(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.StoreScratch{ - Src: bpf.RegA, - N: -1, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot -1" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMStoreScratchInvalidScratchRegisterTooLarge(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.StoreScratch{ - Src: bpf.RegA, - N: 16, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot 16" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMStoreScratchUnknownSourceRegister(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.StoreScratch{ - Src: 100, - N: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid source register 100" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadScratchInvalidScratchRegisterTooSmall(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadScratch{ - Dst: bpf.RegX, - N: -1, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot -1" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadScratchInvalidScratchRegisterTooLarge(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadScratch{ - Dst: bpf.RegX, - N: 16, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot 16" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadScratchUnknownDestinationRegister(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadScratch{ - Dst: 100, - N: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid target register 100" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMStoreScratchLoadScratchOneValue(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 255 - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - // Copy to X and store in scratch[0] - bpf.TAX{}, - bpf.StoreScratch{ - Src: bpf.RegX, - N: 0, - }, - // Load byte 1 - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Overwrite 1 with 255 from scratch[0] - bpf.LoadScratch{ - Dst: bpf.RegA, - N: 0, - }, - // Return 255 - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 255, 1, 2, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 3, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMStoreScratchLoadScratchMultipleValues(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 10 - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - // Store in scratch[0] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 0, - }, - // Load byte 20 - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Store in scratch[1] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 1, - }, - // Load byte 30 - bpf.LoadAbsolute{ - Off: 10, - Size: 1, - }, - // Store in scratch[2] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 2, - }, - // Load byte 1 - bpf.LoadAbsolute{ - Off: 11, - Size: 1, - }, - // Store in scratch[3] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 3, - }, - // Load in byte 10 to X - bpf.LoadScratch{ - Dst: bpf.RegX, - N: 0, - }, - // Copy X -> A - bpf.TXA{}, - // Verify value is 10 - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 10, - SkipTrue: 1, - }, - // Fail test if incorrect - bpf.RetConstant{ - Val: 0, - }, - // Load in byte 20 to A - bpf.LoadScratch{ - Dst: bpf.RegA, - N: 1, - }, - // Verify value is 20 - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 20, - SkipTrue: 1, - }, - // Fail test if incorrect - bpf.RetConstant{ - Val: 0, - }, - // Load in byte 30 to A - bpf.LoadScratch{ - Dst: bpf.RegA, - N: 2, - }, - // Verify value is 30 - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 30, - SkipTrue: 1, - }, - // Fail test if incorrect - bpf.RetConstant{ - Val: 0, - }, - // Return first two bytes on success - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 10, 20, 30, 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_test.go deleted file mode 100644 index 6bd4dd5c3..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/bpf/vm_test.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2016 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 bpf_test - -import ( - "fmt" - "testing" - - "golang.org/x/net/bpf" -) - -var _ bpf.Instruction = unknown{} - -type unknown struct{} - -func (unknown) Assemble() (bpf.RawInstruction, error) { - return bpf.RawInstruction{}, nil -} - -func TestVMUnknownInstruction(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadConstant{ - Dst: bpf.RegA, - Val: 100, - }, - // Should terminate the program with an error immediately - unknown{}, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - defer done() - - _, err = vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, - }) - if errStr(err) != "unknown Instruction at index 1: bpf_test.unknown" { - t.Fatalf("unexpected error while running program: %v", err) - } -} - -func TestVMNoReturnInstruction(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadConstant{ - Dst: bpf.RegA, - Val: 1, - }, - }) - if errStr(err) != "BPF program must end with RetA or RetConstant" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMNoInputInstructions(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{}) - if errStr(err) != "one or more Instructions must be specified" { - t.Fatalf("unexpected error: %v", err) - } -} - -// ExampleNewVM demonstrates usage of a VM, using an Ethernet frame -// as input and checking its EtherType to determine if it should be accepted. -func ExampleNewVM() { - // Offset | Length | Comment - // ------------------------- - // 00 | 06 | Ethernet destination MAC address - // 06 | 06 | Ethernet source MAC address - // 12 | 02 | Ethernet EtherType - const ( - etOff = 12 - etLen = 2 - - etARP = 0x0806 - ) - - // Set up a VM to filter traffic based on if its EtherType - // matches the ARP EtherType. - vm, err := bpf.NewVM([]bpf.Instruction{ - // Load EtherType value from Ethernet header - bpf.LoadAbsolute{ - Off: etOff, - Size: etLen, - }, - // If EtherType is equal to the ARP EtherType, jump to allow - // packet to be accepted - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: etARP, - SkipTrue: 1, - }, - // EtherType does not match the ARP EtherType - bpf.RetConstant{ - Val: 0, - }, - // EtherType matches the ARP EtherType, accept up to 1500 - // bytes of packet - bpf.RetConstant{ - Val: 1500, - }, - }) - if err != nil { - panic(fmt.Sprintf("failed to load BPF program: %v", err)) - } - - // Create an Ethernet frame with the ARP EtherType for testing - frame := []byte{ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, - 0x08, 0x06, - // Payload omitted for brevity - } - - // Run our VM's BPF program using the Ethernet frame as input - out, err := vm.Run(frame) - if err != nil { - panic(fmt.Sprintf("failed to accept Ethernet frame: %v", err)) - } - - // BPF VM can return a byte count greater than the number of input - // bytes, so trim the output to match the input byte length - if out > len(frame) { - out = len(frame) - } - - fmt.Printf("out: %d bytes", out) - - // Output: - // out: 14 bytes -} - -// errStr returns the string representation of an error, or -// "" if it is nil. -func errStr(err error) string { - if err == nil { - return "" - } - - return err.Error() -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/codereview.cfg b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/codereview.cfg deleted file mode 100644 index 3f8b14b64..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/codereview.cfg +++ /dev/null @@ -1 +0,0 @@ -issuerepo: golang/go diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/context.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/context.go deleted file mode 100644 index a3c021d3f..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/context.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014 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 context defines the Context type, which carries deadlines, -// cancelation signals, and other request-scoped values across API boundaries -// and between processes. -// As of Go 1.7 this package is available in the standard library under the -// name context. https://golang.org/pkg/context. -// -// Incoming requests to a server should create a Context, and outgoing calls to -// servers should accept a Context. The chain of function calls between must -// propagate the Context, optionally replacing it with a modified copy created -// using WithDeadline, WithTimeout, WithCancel, or WithValue. -// -// Programs that use Contexts should follow these rules to keep interfaces -// consistent across packages and enable static analysis tools to check context -// propagation: -// -// Do not store Contexts inside a struct type; instead, pass a Context -// explicitly to each function that needs it. The Context should be the first -// parameter, typically named ctx: -// -// func DoSomething(ctx context.Context, arg Arg) error { -// // ... use ctx ... -// } -// -// Do not pass a nil Context, even if a function permits it. Pass context.TODO -// if you are unsure about which Context to use. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -// -// The same Context may be passed to functions running in different goroutines; -// Contexts are safe for simultaneous use by multiple goroutines. -// -// See http://blog.golang.org/context for example code for a server that uses -// Contexts. -package context // import "golang.org/x/net/context" - -// Background returns a non-nil, empty Context. It is never canceled, has no -// values, and has no deadline. It is typically used by the main function, -// initialization, and tests, and as the top-level Context for incoming -// requests. -func Background() Context { - return background -} - -// TODO returns a non-nil, empty Context. Code should use context.TODO when -// it's unclear which Context to use or it is not yet available (because the -// surrounding function has not yet been extended to accept a Context -// parameter). TODO is recognized by static analysis tools that determine -// whether Contexts are propagated correctly in a program. -func TODO() Context { - return todo -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/context_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/context_test.go deleted file mode 100644 index e7bf0acc2..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/context_test.go +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright 2014 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. - -//go:build !go1.7 -// +build !go1.7 - -package context - -import ( - "fmt" - "math/rand" - "runtime" - "strings" - "sync" - "testing" - "time" -) - -// otherContext is a Context that's not one of the types defined in context.go. -// This lets us test code paths that differ based on the underlying type of the -// Context. -type otherContext struct { - Context -} - -func TestBackground(t *testing.T) { - c := Background() - if c == nil { - t.Fatalf("Background returned nil") - } - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - if got, want := fmt.Sprint(c), "context.Background"; got != want { - t.Errorf("Background().String() = %q want %q", got, want) - } -} - -func TestTODO(t *testing.T) { - c := TODO() - if c == nil { - t.Fatalf("TODO returned nil") - } - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - if got, want := fmt.Sprint(c), "context.TODO"; got != want { - t.Errorf("TODO().String() = %q want %q", got, want) - } -} - -func TestWithCancel(t *testing.T) { - c1, cancel := WithCancel(Background()) - - if got, want := fmt.Sprint(c1), "context.Background.WithCancel"; got != want { - t.Errorf("c1.String() = %q want %q", got, want) - } - - o := otherContext{c1} - c2, _ := WithCancel(o) - contexts := []Context{c1, o, c2} - - for i, c := range contexts { - if d := c.Done(); d == nil { - t.Errorf("c[%d].Done() == %v want non-nil", i, d) - } - if e := c.Err(); e != nil { - t.Errorf("c[%d].Err() == %v want nil", i, e) - } - - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - } - - cancel() - time.Sleep(100 * time.Millisecond) // let cancelation propagate - - for i, c := range contexts { - select { - case <-c.Done(): - default: - t.Errorf("<-c[%d].Done() blocked, but shouldn't have", i) - } - if e := c.Err(); e != Canceled { - t.Errorf("c[%d].Err() == %v want %v", i, e, Canceled) - } - } -} - -func TestParentFinishesChild(t *testing.T) { - // Context tree: - // parent -> cancelChild - // parent -> valueChild -> timerChild - parent, cancel := WithCancel(Background()) - cancelChild, stop := WithCancel(parent) - defer stop() - valueChild := WithValue(parent, "key", "value") - timerChild, stop := WithTimeout(valueChild, 10000*time.Hour) - defer stop() - - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - case x := <-cancelChild.Done(): - t.Errorf("<-cancelChild.Done() == %v want nothing (it should block)", x) - case x := <-timerChild.Done(): - t.Errorf("<-timerChild.Done() == %v want nothing (it should block)", x) - case x := <-valueChild.Done(): - t.Errorf("<-valueChild.Done() == %v want nothing (it should block)", x) - default: - } - - // The parent's children should contain the two cancelable children. - pc := parent.(*cancelCtx) - cc := cancelChild.(*cancelCtx) - tc := timerChild.(*timerCtx) - pc.mu.Lock() - if len(pc.children) != 2 || !pc.children[cc] || !pc.children[tc] { - t.Errorf("bad linkage: pc.children = %v, want %v and %v", - pc.children, cc, tc) - } - pc.mu.Unlock() - - if p, ok := parentCancelCtx(cc.Context); !ok || p != pc { - t.Errorf("bad linkage: parentCancelCtx(cancelChild.Context) = %v, %v want %v, true", p, ok, pc) - } - if p, ok := parentCancelCtx(tc.Context); !ok || p != pc { - t.Errorf("bad linkage: parentCancelCtx(timerChild.Context) = %v, %v want %v, true", p, ok, pc) - } - - cancel() - - pc.mu.Lock() - if len(pc.children) != 0 { - t.Errorf("pc.cancel didn't clear pc.children = %v", pc.children) - } - pc.mu.Unlock() - - // parent and children should all be finished. - check := func(ctx Context, name string) { - select { - case <-ctx.Done(): - default: - t.Errorf("<-%s.Done() blocked, but shouldn't have", name) - } - if e := ctx.Err(); e != Canceled { - t.Errorf("%s.Err() == %v want %v", name, e, Canceled) - } - } - check(parent, "parent") - check(cancelChild, "cancelChild") - check(valueChild, "valueChild") - check(timerChild, "timerChild") - - // WithCancel should return a canceled context on a canceled parent. - precanceledChild := WithValue(parent, "key", "value") - select { - case <-precanceledChild.Done(): - default: - t.Errorf("<-precanceledChild.Done() blocked, but shouldn't have") - } - if e := precanceledChild.Err(); e != Canceled { - t.Errorf("precanceledChild.Err() == %v want %v", e, Canceled) - } -} - -func TestChildFinishesFirst(t *testing.T) { - cancelable, stop := WithCancel(Background()) - defer stop() - for _, parent := range []Context{Background(), cancelable} { - child, cancel := WithCancel(parent) - - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - case x := <-child.Done(): - t.Errorf("<-child.Done() == %v want nothing (it should block)", x) - default: - } - - cc := child.(*cancelCtx) - pc, pcok := parent.(*cancelCtx) // pcok == false when parent == Background() - if p, ok := parentCancelCtx(cc.Context); ok != pcok || (ok && pc != p) { - t.Errorf("bad linkage: parentCancelCtx(cc.Context) = %v, %v want %v, %v", p, ok, pc, pcok) - } - - if pcok { - pc.mu.Lock() - if len(pc.children) != 1 || !pc.children[cc] { - t.Errorf("bad linkage: pc.children = %v, cc = %v", pc.children, cc) - } - pc.mu.Unlock() - } - - cancel() - - if pcok { - pc.mu.Lock() - if len(pc.children) != 0 { - t.Errorf("child's cancel didn't remove self from pc.children = %v", pc.children) - } - pc.mu.Unlock() - } - - // child should be finished. - select { - case <-child.Done(): - default: - t.Errorf("<-child.Done() blocked, but shouldn't have") - } - if e := child.Err(); e != Canceled { - t.Errorf("child.Err() == %v want %v", e, Canceled) - } - - // parent should not be finished. - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - default: - } - if e := parent.Err(); e != nil { - t.Errorf("parent.Err() == %v want nil", e) - } - } -} - -func testDeadline(c Context, wait time.Duration, t *testing.T) { - select { - case <-time.After(wait): - t.Fatalf("context should have timed out") - case <-c.Done(): - } - if e := c.Err(); e != DeadlineExceeded { - t.Errorf("c.Err() == %v want %v", e, DeadlineExceeded) - } -} - -func TestDeadline(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithDeadline(Background(), time.Now().Add(1*timeUnit)) - if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { - t.Errorf("c.String() = %q want prefix %q", got, prefix) - } - testDeadline(c, 2*timeUnit, t) - - c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) - o := otherContext{c} - testDeadline(o, 2*timeUnit, t) - - c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) - o = otherContext{c} - c, _ = WithDeadline(o, time.Now().Add(3*timeUnit)) - testDeadline(c, 2*timeUnit, t) -} - -func TestTimeout(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithTimeout(Background(), 1*timeUnit) - if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { - t.Errorf("c.String() = %q want prefix %q", got, prefix) - } - testDeadline(c, 2*timeUnit, t) - - c, _ = WithTimeout(Background(), 1*timeUnit) - o := otherContext{c} - testDeadline(o, 2*timeUnit, t) - - c, _ = WithTimeout(Background(), 1*timeUnit) - o = otherContext{c} - c, _ = WithTimeout(o, 3*timeUnit) - testDeadline(c, 2*timeUnit, t) -} - -func TestCanceledTimeout(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithTimeout(Background(), 2*timeUnit) - o := otherContext{c} - c, cancel := WithTimeout(o, 4*timeUnit) - cancel() - time.Sleep(1 * timeUnit) // let cancelation propagate - select { - case <-c.Done(): - default: - t.Errorf("<-c.Done() blocked, but shouldn't have") - } - if e := c.Err(); e != Canceled { - t.Errorf("c.Err() == %v want %v", e, Canceled) - } -} - -type key1 int -type key2 int - -var k1 = key1(1) -var k2 = key2(1) // same int as k1, different type -var k3 = key2(3) // same type as k2, different int - -func TestValues(t *testing.T) { - check := func(c Context, nm, v1, v2, v3 string) { - if v, ok := c.Value(k1).(string); ok == (len(v1) == 0) || v != v1 { - t.Errorf(`%s.Value(k1).(string) = %q, %t want %q, %t`, nm, v, ok, v1, len(v1) != 0) - } - if v, ok := c.Value(k2).(string); ok == (len(v2) == 0) || v != v2 { - t.Errorf(`%s.Value(k2).(string) = %q, %t want %q, %t`, nm, v, ok, v2, len(v2) != 0) - } - if v, ok := c.Value(k3).(string); ok == (len(v3) == 0) || v != v3 { - t.Errorf(`%s.Value(k3).(string) = %q, %t want %q, %t`, nm, v, ok, v3, len(v3) != 0) - } - } - - c0 := Background() - check(c0, "c0", "", "", "") - - c1 := WithValue(Background(), k1, "c1k1") - check(c1, "c1", "c1k1", "", "") - - if got, want := fmt.Sprint(c1), `context.Background.WithValue(1, "c1k1")`; got != want { - t.Errorf("c.String() = %q want %q", got, want) - } - - c2 := WithValue(c1, k2, "c2k2") - check(c2, "c2", "c1k1", "c2k2", "") - - c3 := WithValue(c2, k3, "c3k3") - check(c3, "c2", "c1k1", "c2k2", "c3k3") - - c4 := WithValue(c3, k1, nil) - check(c4, "c4", "", "c2k2", "c3k3") - - o0 := otherContext{Background()} - check(o0, "o0", "", "", "") - - o1 := otherContext{WithValue(Background(), k1, "c1k1")} - check(o1, "o1", "c1k1", "", "") - - o2 := WithValue(o1, k2, "o2k2") - check(o2, "o2", "c1k1", "o2k2", "") - - o3 := otherContext{c4} - check(o3, "o3", "", "c2k2", "c3k3") - - o4 := WithValue(o3, k3, nil) - check(o4, "o4", "", "c2k2", "") -} - -func TestAllocs(t *testing.T) { - bg := Background() - for _, test := range []struct { - desc string - f func() - limit float64 - gccgoLimit float64 - }{ - { - desc: "Background()", - f: func() { Background() }, - limit: 0, - gccgoLimit: 0, - }, - { - desc: fmt.Sprintf("WithValue(bg, %v, nil)", k1), - f: func() { - c := WithValue(bg, k1, nil) - c.Value(k1) - }, - limit: 3, - gccgoLimit: 3, - }, - { - desc: "WithTimeout(bg, 15*time.Millisecond)", - f: func() { - c, _ := WithTimeout(bg, 15*time.Millisecond) - <-c.Done() - }, - limit: 8, - gccgoLimit: 16, - }, - { - desc: "WithCancel(bg)", - f: func() { - c, cancel := WithCancel(bg) - cancel() - <-c.Done() - }, - limit: 5, - gccgoLimit: 8, - }, - { - desc: "WithTimeout(bg, 100*time.Millisecond)", - f: func() { - c, cancel := WithTimeout(bg, 100*time.Millisecond) - cancel() - <-c.Done() - }, - limit: 8, - gccgoLimit: 25, - }, - } { - limit := test.limit - if runtime.Compiler == "gccgo" { - // gccgo does not yet do escape analysis. - // TODO(iant): Remove this when gccgo does do escape analysis. - limit = test.gccgoLimit - } - if n := testing.AllocsPerRun(100, test.f); n > limit { - t.Errorf("%s allocs = %f want %d", test.desc, n, int(limit)) - } - } -} - -func TestSimultaneousCancels(t *testing.T) { - root, cancel := WithCancel(Background()) - m := map[Context]CancelFunc{root: cancel} - q := []Context{root} - // Create a tree of contexts. - for len(q) != 0 && len(m) < 100 { - parent := q[0] - q = q[1:] - for i := 0; i < 4; i++ { - ctx, cancel := WithCancel(parent) - m[ctx] = cancel - q = append(q, ctx) - } - } - // Start all the cancels in a random order. - var wg sync.WaitGroup - wg.Add(len(m)) - for _, cancel := range m { - go func(cancel CancelFunc) { - cancel() - wg.Done() - }(cancel) - } - // Wait on all the contexts in a random order. - for ctx := range m { - select { - case <-ctx.Done(): - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for <-ctx.Done(); stacks:\n%s", buf[:n]) - } - } - // Wait for all the cancel functions to return. - done := make(chan struct{}) - go func() { - wg.Wait() - close(done) - }() - select { - case <-done: - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for cancel functions; stacks:\n%s", buf[:n]) - } -} - -func TestInterlockedCancels(t *testing.T) { - parent, cancelParent := WithCancel(Background()) - child, cancelChild := WithCancel(parent) - go func() { - parent.Done() - cancelChild() - }() - cancelParent() - select { - case <-child.Done(): - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for child.Done(); stacks:\n%s", buf[:n]) - } -} - -func TestLayersCancel(t *testing.T) { - testLayers(t, time.Now().UnixNano(), false) -} - -func TestLayersTimeout(t *testing.T) { - testLayers(t, time.Now().UnixNano(), true) -} - -func testLayers(t *testing.T, seed int64, testTimeout bool) { - rand.Seed(seed) - errorf := func(format string, a ...interface{}) { - t.Errorf(fmt.Sprintf("seed=%d: %s", seed, format), a...) - } - const ( - timeout = 200 * time.Millisecond - minLayers = 30 - ) - type value int - var ( - vals []*value - cancels []CancelFunc - numTimers int - ctx = Background() - ) - for i := 0; i < minLayers || numTimers == 0 || len(cancels) == 0 || len(vals) == 0; i++ { - switch rand.Intn(3) { - case 0: - v := new(value) - ctx = WithValue(ctx, v, v) - vals = append(vals, v) - case 1: - var cancel CancelFunc - ctx, cancel = WithCancel(ctx) - cancels = append(cancels, cancel) - case 2: - var cancel CancelFunc - ctx, cancel = WithTimeout(ctx, timeout) - cancels = append(cancels, cancel) - numTimers++ - } - } - checkValues := func(when string) { - for _, key := range vals { - if val := ctx.Value(key).(*value); key != val { - errorf("%s: ctx.Value(%p) = %p want %p", when, key, val, key) - } - } - } - select { - case <-ctx.Done(): - errorf("ctx should not be canceled yet") - default: - } - if s, prefix := fmt.Sprint(ctx), "context.Background."; !strings.HasPrefix(s, prefix) { - t.Errorf("ctx.String() = %q want prefix %q", s, prefix) - } - t.Log(ctx) - checkValues("before cancel") - if testTimeout { - select { - case <-ctx.Done(): - case <-time.After(timeout + 100*time.Millisecond): - errorf("ctx should have timed out") - } - checkValues("after timeout") - } else { - cancel := cancels[rand.Intn(len(cancels))] - cancel() - select { - case <-ctx.Done(): - default: - errorf("ctx should be canceled") - } - checkValues("after cancel") - } -} - -func TestCancelRemoves(t *testing.T) { - checkChildren := func(when string, ctx Context, want int) { - if got := len(ctx.(*cancelCtx).children); got != want { - t.Errorf("%s: context has %d children, want %d", when, got, want) - } - } - - ctx, _ := WithCancel(Background()) - checkChildren("after creation", ctx, 0) - _, cancel := WithCancel(ctx) - checkChildren("with WithCancel child ", ctx, 1) - cancel() - checkChildren("after cancelling WithCancel child", ctx, 0) - - ctx, _ = WithCancel(Background()) - checkChildren("after creation", ctx, 0) - _, cancel = WithTimeout(ctx, 60*time.Minute) - checkChildren("with WithTimeout child ", ctx, 1) - cancel() - checkChildren("after cancelling WithTimeout child", ctx, 0) -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/ctxhttp/ctxhttp.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/ctxhttp/ctxhttp.go deleted file mode 100644 index 37dc0cfdb..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/ctxhttp/ctxhttp.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 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 ctxhttp provides helper functions for performing context-aware HTTP requests. -package ctxhttp // import "golang.org/x/net/context/ctxhttp" - -import ( - "context" - "io" - "net/http" - "net/url" - "strings" -) - -// Do sends an HTTP request with the provided http.Client and returns -// an HTTP response. -// -// If the client is nil, http.DefaultClient is used. -// -// The provided ctx must be non-nil. If it is canceled or times out, -// ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - resp, err := client.Do(req.WithContext(ctx)) - // If we got an error, and the context has been canceled, - // the context's error is probably more useful. - if err != nil { - select { - case <-ctx.Done(): - err = ctx.Err() - default: - } - } - return resp, err -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/ctxhttp/ctxhttp_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/ctxhttp/ctxhttp_test.go deleted file mode 100644 index 21f7599cc..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/ctxhttp/ctxhttp_test.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2015 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. - -//go:build !plan9 -// +build !plan9 - -package ctxhttp - -import ( - "context" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - "time" -) - -func TestGo17Context(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "ok") - })) - defer ts.Close() - ctx := context.Background() - resp, err := Get(ctx, http.DefaultClient, ts.URL) - if resp == nil || err != nil { - t.Fatalf("error received from client: %v %v", err, resp) - } - resp.Body.Close() -} - -const ( - requestDuration = 100 * time.Millisecond - requestBody = "ok" -) - -func okHandler(w http.ResponseWriter, r *http.Request) { - time.Sleep(requestDuration) - io.WriteString(w, requestBody) -} - -func TestNoTimeout(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(okHandler)) - defer ts.Close() - - ctx := context.Background() - res, err := Get(ctx, nil, ts.URL) - if err != nil { - t.Fatal(err) - } - defer res.Body.Close() - slurp, err := ioutil.ReadAll(res.Body) - if err != nil { - t.Fatal(err) - } - if string(slurp) != requestBody { - t.Errorf("body = %q; want %q", slurp, requestBody) - } -} - -func TestCancelBeforeHeaders(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - - blockServer := make(chan struct{}) - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - cancel() - <-blockServer - io.WriteString(w, requestBody) - })) - defer ts.Close() - defer close(blockServer) - - res, err := Get(ctx, nil, ts.URL) - if err == nil { - res.Body.Close() - t.Fatal("Get returned unexpected nil error") - } - if err != context.Canceled { - t.Errorf("err = %v; want %v", err, context.Canceled) - } -} - -func TestCancelAfterHangingRequest(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.(http.Flusher).Flush() - <-w.(http.CloseNotifier).CloseNotify() - })) - defer ts.Close() - - ctx, cancel := context.WithCancel(context.Background()) - resp, err := Get(ctx, nil, ts.URL) - if err != nil { - t.Fatalf("unexpected error in Get: %v", err) - } - - // Cancel befer reading the body. - // Reading Request.Body should fail, since the request was - // canceled before anything was written. - cancel() - - done := make(chan struct{}) - - go func() { - b, err := ioutil.ReadAll(resp.Body) - if len(b) != 0 || err == nil { - t.Errorf(`Read got (%q, %v); want ("", error)`, b, err) - } - close(done) - }() - - select { - case <-time.After(1 * time.Second): - t.Errorf("Test timed out") - case <-done: - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/go17.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/go17.go deleted file mode 100644 index 344bd1433..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/go17.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 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. - -//go:build go1.7 -// +build go1.7 - -package context - -import ( - "context" // standard library's context, as of Go 1.7 - "time" -) - -var ( - todo = context.TODO() - background = context.Background() -) - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = context.Canceled - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = context.DeadlineExceeded - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - ctx, f := context.WithCancel(parent) - return ctx, CancelFunc(f) -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - ctx, f := context.WithDeadline(parent, deadline) - return ctx, CancelFunc(f) -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return context.WithValue(parent, key, val) -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/go19.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/go19.go deleted file mode 100644 index 64d31ecc3..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/go19.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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. - -//go:build go1.9 -// +build go1.9 - -package context - -import "context" // standard library's context, as of Go 1.7 - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context = context.Context - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc = context.CancelFunc diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/pre_go17.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/pre_go17.go deleted file mode 100644 index 5270db5db..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/pre_go17.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright 2014 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. - -//go:build !go1.7 -// +build !go1.7 - -package context - -import ( - "errors" - "fmt" - "sync" - "time" -) - -// An emptyCtx is never canceled, has no values, and has no deadline. It is not -// struct{}, since vars of this type must have distinct addresses. -type emptyCtx int - -func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { - return -} - -func (*emptyCtx) Done() <-chan struct{} { - return nil -} - -func (*emptyCtx) Err() error { - return nil -} - -func (*emptyCtx) Value(key interface{}) interface{} { - return nil -} - -func (e *emptyCtx) String() string { - switch e { - case background: - return "context.Background" - case todo: - return "context.TODO" - } - return "unknown empty Context" -} - -var ( - background = new(emptyCtx) - todo = new(emptyCtx) -) - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = errors.New("context canceled") - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = errors.New("context deadline exceeded") - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - c := newCancelCtx(parent) - propagateCancel(parent, c) - return c, func() { c.cancel(true, Canceled) } -} - -// newCancelCtx returns an initialized cancelCtx. -func newCancelCtx(parent Context) *cancelCtx { - return &cancelCtx{ - Context: parent, - done: make(chan struct{}), - } -} - -// propagateCancel arranges for child to be canceled when parent is. -func propagateCancel(parent Context, child canceler) { - if parent.Done() == nil { - return // parent is never canceled - } - if p, ok := parentCancelCtx(parent); ok { - p.mu.Lock() - if p.err != nil { - // parent has already been canceled - child.cancel(false, p.err) - } else { - if p.children == nil { - p.children = make(map[canceler]bool) - } - p.children[child] = true - } - p.mu.Unlock() - } else { - go func() { - select { - case <-parent.Done(): - child.cancel(false, parent.Err()) - case <-child.Done(): - } - }() - } -} - -// parentCancelCtx follows a chain of parent references until it finds a -// *cancelCtx. This function understands how each of the concrete types in this -// package represents its parent. -func parentCancelCtx(parent Context) (*cancelCtx, bool) { - for { - switch c := parent.(type) { - case *cancelCtx: - return c, true - case *timerCtx: - return c.cancelCtx, true - case *valueCtx: - parent = c.Context - default: - return nil, false - } - } -} - -// removeChild removes a context from its parent. -func removeChild(parent Context, child canceler) { - p, ok := parentCancelCtx(parent) - if !ok { - return - } - p.mu.Lock() - if p.children != nil { - delete(p.children, child) - } - p.mu.Unlock() -} - -// A canceler is a context type that can be canceled directly. The -// implementations are *cancelCtx and *timerCtx. -type canceler interface { - cancel(removeFromParent bool, err error) - Done() <-chan struct{} -} - -// A cancelCtx can be canceled. When canceled, it also cancels any children -// that implement canceler. -type cancelCtx struct { - Context - - done chan struct{} // closed by the first cancel call. - - mu sync.Mutex - children map[canceler]bool // set to nil by the first cancel call - err error // set to non-nil by the first cancel call -} - -func (c *cancelCtx) Done() <-chan struct{} { - return c.done -} - -func (c *cancelCtx) Err() error { - c.mu.Lock() - defer c.mu.Unlock() - return c.err -} - -func (c *cancelCtx) String() string { - return fmt.Sprintf("%v.WithCancel", c.Context) -} - -// cancel closes c.done, cancels each of c's children, and, if -// removeFromParent is true, removes c from its parent's children. -func (c *cancelCtx) cancel(removeFromParent bool, err error) { - if err == nil { - panic("context: internal error: missing cancel error") - } - c.mu.Lock() - if c.err != nil { - c.mu.Unlock() - return // already canceled - } - c.err = err - close(c.done) - for child := range c.children { - // NOTE: acquiring the child's lock while holding parent's lock. - child.cancel(false, err) - } - c.children = nil - c.mu.Unlock() - - if removeFromParent { - removeChild(c.Context, c) - } -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { - // The current deadline is already sooner than the new one. - return WithCancel(parent) - } - c := &timerCtx{ - cancelCtx: newCancelCtx(parent), - deadline: deadline, - } - propagateCancel(parent, c) - d := deadline.Sub(time.Now()) - if d <= 0 { - c.cancel(true, DeadlineExceeded) // deadline has already passed - return c, func() { c.cancel(true, Canceled) } - } - c.mu.Lock() - defer c.mu.Unlock() - if c.err == nil { - c.timer = time.AfterFunc(d, func() { - c.cancel(true, DeadlineExceeded) - }) - } - return c, func() { c.cancel(true, Canceled) } -} - -// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to -// implement Done and Err. It implements cancel by stopping its timer then -// delegating to cancelCtx.cancel. -type timerCtx struct { - *cancelCtx - timer *time.Timer // Under cancelCtx.mu. - - deadline time.Time -} - -func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { - return c.deadline, true -} - -func (c *timerCtx) String() string { - return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) -} - -func (c *timerCtx) cancel(removeFromParent bool, err error) { - c.cancelCtx.cancel(false, err) - if removeFromParent { - // Remove this timerCtx from its parent cancelCtx's children. - removeChild(c.cancelCtx.Context, c) - } - c.mu.Lock() - if c.timer != nil { - c.timer.Stop() - c.timer = nil - } - c.mu.Unlock() -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return &valueCtx{parent, key, val} -} - -// A valueCtx carries a key-value pair. It implements Value for that key and -// delegates all other calls to the embedded Context. -type valueCtx struct { - Context - key, val interface{} -} - -func (c *valueCtx) String() string { - return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) -} - -func (c *valueCtx) Value(key interface{}) interface{} { - if c.key == key { - return c.val - } - return c.Context.Value(key) -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/pre_go19.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/pre_go19.go deleted file mode 100644 index 1f9715341..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/pre_go19.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2014 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. - -//go:build !go1.9 -// +build !go1.9 - -package context - -import "time" - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - // - // WithCancel arranges for Done to be closed when cancel is called; - // WithDeadline arranges for Done to be closed when the deadline - // expires; WithTimeout arranges for Done to be closed when the timeout - // elapses. - // - // Done is provided for use in select statements: - // - // // Stream generates values with DoSomething and sends them to out - // // until DoSomething returns an error or ctx.Done is closed. - // func Stream(ctx context.Context, out chan<- Value) error { - // for { - // v, err := DoSomething(ctx) - // if err != nil { - // return err - // } - // select { - // case <-ctx.Done(): - // return ctx.Err() - // case out <- v: - // } - // } - // } - // - // See http://blog.golang.org/pipelines for more examples of how to use - // a Done channel for cancelation. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - // - // A key identifies a specific value in a Context. Functions that wish - // to store values in Context typically allocate a key in a global - // variable then use that key as the argument to context.WithValue and - // Context.Value. A key can be any type that supports equality; - // packages should define keys as an unexported type to avoid - // collisions. - // - // Packages that define a Context key should provide type-safe accessors - // for the values stores using that key: - // - // // Package user defines a User type that's stored in Contexts. - // package user - // - // import "golang.org/x/net/context" - // - // // User is the type of value stored in the Contexts. - // type User struct {...} - // - // // key is an unexported type for keys defined in this package. - // // This prevents collisions with keys defined in other packages. - // type key int - // - // // userKey is the key for user.User values in Contexts. It is - // // unexported; clients use user.NewContext and user.FromContext - // // instead of using this key directly. - // var userKey key = 0 - // - // // NewContext returns a new Context that carries value u. - // func NewContext(ctx context.Context, u *User) context.Context { - // return context.WithValue(ctx, userKey, u) - // } - // - // // FromContext returns the User value stored in ctx, if any. - // func FromContext(ctx context.Context) (*User, bool) { - // u, ok := ctx.Value(userKey).(*User) - // return u, ok - // } - Value(key interface{}) interface{} -} - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc func() diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/withtimeout_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/withtimeout_test.go deleted file mode 100644 index e6f56691d..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/context/withtimeout_test.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 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 context_test - -import ( - "fmt" - "time" - - "golang.org/x/net/context" -) - -// This example passes a context with a timeout to tell a blocking function that -// it should abandon its work after the timeout elapses. -func ExampleWithTimeout() { - // Pass a context with a timeout to tell a blocking function that it - // should abandon its work after the timeout elapses. - ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) - defer cancel() - - select { - case <-time.After(1 * time.Second): - fmt.Println("overslept") - case <-ctx.Done(): - fmt.Println(ctx.Err()) // prints "context deadline exceeded" - } - - // Output: - // context deadline exceeded -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dict/dict.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dict/dict.go deleted file mode 100644 index 93e65c03c..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dict/dict.go +++ /dev/null @@ -1,210 +0,0 @@ -// 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 dict implements the Dictionary Server Protocol -// as defined in RFC 2229. -package dict // import "golang.org/x/net/dict" - -import ( - "net/textproto" - "strconv" - "strings" -) - -// A Client represents a client connection to a dictionary server. -type Client struct { - text *textproto.Conn -} - -// Dial returns a new client connected to a dictionary server at -// addr on the given network. -func Dial(network, addr string) (*Client, error) { - text, err := textproto.Dial(network, addr) - if err != nil { - return nil, err - } - _, _, err = text.ReadCodeLine(220) - if err != nil { - text.Close() - return nil, err - } - return &Client{text: text}, nil -} - -// Close closes the connection to the dictionary server. -func (c *Client) Close() error { - return c.text.Close() -} - -// A Dict represents a dictionary available on the server. -type Dict struct { - Name string // short name of dictionary - Desc string // long description -} - -// Dicts returns a list of the dictionaries available on the server. -func (c *Client) Dicts() ([]Dict, error) { - id, err := c.text.Cmd("SHOW DB") - if err != nil { - return nil, err - } - - c.text.StartResponse(id) - defer c.text.EndResponse(id) - - _, _, err = c.text.ReadCodeLine(110) - if err != nil { - return nil, err - } - lines, err := c.text.ReadDotLines() - if err != nil { - return nil, err - } - _, _, err = c.text.ReadCodeLine(250) - - dicts := make([]Dict, len(lines)) - for i := range dicts { - d := &dicts[i] - a, _ := fields(lines[i]) - if len(a) < 2 { - return nil, textproto.ProtocolError("invalid dictionary: " + lines[i]) - } - d.Name = a[0] - d.Desc = a[1] - } - return dicts, err -} - -// A Defn represents a definition. -type Defn struct { - Dict Dict // Dict where definition was found - Word string // Word being defined - Text []byte // Definition text, typically multiple lines -} - -// Define requests the definition of the given word. -// The argument dict names the dictionary to use, -// the Name field of a Dict returned by Dicts. -// -// The special dictionary name "*" means to look in all the -// server's dictionaries. -// The special dictionary name "!" means to look in all the -// server's dictionaries in turn, stopping after finding the word -// in one of them. -func (c *Client) Define(dict, word string) ([]*Defn, error) { - id, err := c.text.Cmd("DEFINE %s %q", dict, word) - if err != nil { - return nil, err - } - - c.text.StartResponse(id) - defer c.text.EndResponse(id) - - _, line, err := c.text.ReadCodeLine(150) - if err != nil { - return nil, err - } - a, _ := fields(line) - if len(a) < 1 { - return nil, textproto.ProtocolError("malformed response: " + line) - } - n, err := strconv.Atoi(a[0]) - if err != nil { - return nil, textproto.ProtocolError("invalid definition count: " + a[0]) - } - def := make([]*Defn, n) - for i := 0; i < n; i++ { - _, line, err = c.text.ReadCodeLine(151) - if err != nil { - return nil, err - } - a, _ := fields(line) - if len(a) < 3 { - // skip it, to keep protocol in sync - i-- - n-- - def = def[0:n] - continue - } - d := &Defn{Word: a[0], Dict: Dict{a[1], a[2]}} - d.Text, err = c.text.ReadDotBytes() - if err != nil { - return nil, err - } - def[i] = d - } - _, _, err = c.text.ReadCodeLine(250) - return def, err -} - -// Fields returns the fields in s. -// Fields are space separated unquoted words -// or quoted with single or double quote. -func fields(s string) ([]string, error) { - var v []string - i := 0 - for { - for i < len(s) && (s[i] == ' ' || s[i] == '\t') { - i++ - } - if i >= len(s) { - break - } - if s[i] == '"' || s[i] == '\'' { - q := s[i] - // quoted string - var j int - for j = i + 1; ; j++ { - if j >= len(s) { - return nil, textproto.ProtocolError("malformed quoted string") - } - if s[j] == '\\' { - j++ - continue - } - if s[j] == q { - j++ - break - } - } - v = append(v, unquote(s[i+1:j-1])) - i = j - } else { - // atom - var j int - for j = i; j < len(s); j++ { - if s[j] == ' ' || s[j] == '\t' || s[j] == '\\' || s[j] == '"' || s[j] == '\'' { - break - } - } - v = append(v, s[i:j]) - i = j - } - if i < len(s) { - c := s[i] - if c != ' ' && c != '\t' { - return nil, textproto.ProtocolError("quotes not on word boundaries") - } - } - } - return v, nil -} - -func unquote(s string) string { - if strings.Index(s, "\\") < 0 { - return s - } - b := []byte(s) - w := 0 - for r := 0; r < len(b); r++ { - c := b[r] - if c == '\\' { - r++ - c = b[r] - } - b[w] = c - w++ - } - return string(b[0:w]) -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/example_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/example_test.go deleted file mode 100644 index 8600a6bc4..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2017 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 dnsmessage_test - -import ( - "fmt" - "net" - "strings" - - "golang.org/x/net/dns/dnsmessage" -) - -func mustNewName(name string) dnsmessage.Name { - n, err := dnsmessage.NewName(name) - if err != nil { - panic(err) - } - return n -} - -func ExampleParser() { - msg := dnsmessage.Message{ - Header: dnsmessage.Header{Response: true, Authoritative: true}, - Questions: []dnsmessage.Question{ - { - Name: mustNewName("foo.bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - { - Name: mustNewName("bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - }, - Answers: []dnsmessage.Resource{ - { - Header: dnsmessage.ResourceHeader{ - Name: mustNewName("foo.bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 1}}, - }, - { - Header: dnsmessage.ResourceHeader{ - Name: mustNewName("bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 2}}, - }, - }, - } - - buf, err := msg.Pack() - if err != nil { - panic(err) - } - - wantName := "bar.example.com." - - var p dnsmessage.Parser - if _, err := p.Start(buf); err != nil { - panic(err) - } - - for { - q, err := p.Question() - if err == dnsmessage.ErrSectionDone { - break - } - if err != nil { - panic(err) - } - - if q.Name.String() != wantName { - continue - } - - fmt.Println("Found question for name", wantName) - if err := p.SkipAllQuestions(); err != nil { - panic(err) - } - break - } - - var gotIPs []net.IP - for { - h, err := p.AnswerHeader() - if err == dnsmessage.ErrSectionDone { - break - } - if err != nil { - panic(err) - } - - if (h.Type != dnsmessage.TypeA && h.Type != dnsmessage.TypeAAAA) || h.Class != dnsmessage.ClassINET { - continue - } - - if !strings.EqualFold(h.Name.String(), wantName) { - if err := p.SkipAnswer(); err != nil { - panic(err) - } - continue - } - - switch h.Type { - case dnsmessage.TypeA: - r, err := p.AResource() - if err != nil { - panic(err) - } - gotIPs = append(gotIPs, r.A[:]) - case dnsmessage.TypeAAAA: - r, err := p.AAAAResource() - if err != nil { - panic(err) - } - gotIPs = append(gotIPs, r.AAAA[:]) - } - } - - fmt.Printf("Found A/AAAA records for name %s: %v\n", wantName, gotIPs) - - // Output: - // Found question for name bar.example.com. - // Found A/AAAA records for name bar.example.com.: [127.0.0.2] -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/message.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/message.go deleted file mode 100644 index 1736fc5d1..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/message.go +++ /dev/null @@ -1,2664 +0,0 @@ -// Copyright 2009 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 dnsmessage provides a mostly RFC 1035 compliant implementation of -// DNS message packing and unpacking. -// -// The package also supports messages with Extension Mechanisms for DNS -// (EDNS(0)) as defined in RFC 6891. -// -// This implementation is designed to minimize heap allocations and avoid -// unnecessary packing and unpacking as much as possible. -package dnsmessage - -import ( - "errors" -) - -// Message formats - -// A Type is a type of DNS request and response. -type Type uint16 - -const ( - // ResourceHeader.Type and Question.Type - TypeA Type = 1 - TypeNS Type = 2 - TypeCNAME Type = 5 - TypeSOA Type = 6 - TypePTR Type = 12 - TypeMX Type = 15 - TypeTXT Type = 16 - TypeAAAA Type = 28 - TypeSRV Type = 33 - TypeOPT Type = 41 - - // Question.Type - TypeWKS Type = 11 - TypeHINFO Type = 13 - TypeMINFO Type = 14 - TypeAXFR Type = 252 - TypeALL Type = 255 -) - -var typeNames = map[Type]string{ - TypeA: "TypeA", - TypeNS: "TypeNS", - TypeCNAME: "TypeCNAME", - TypeSOA: "TypeSOA", - TypePTR: "TypePTR", - TypeMX: "TypeMX", - TypeTXT: "TypeTXT", - TypeAAAA: "TypeAAAA", - TypeSRV: "TypeSRV", - TypeOPT: "TypeOPT", - TypeWKS: "TypeWKS", - TypeHINFO: "TypeHINFO", - TypeMINFO: "TypeMINFO", - TypeAXFR: "TypeAXFR", - TypeALL: "TypeALL", -} - -// String implements fmt.Stringer.String. -func (t Type) String() string { - if n, ok := typeNames[t]; ok { - return n - } - return printUint16(uint16(t)) -} - -// GoString implements fmt.GoStringer.GoString. -func (t Type) GoString() string { - if n, ok := typeNames[t]; ok { - return "dnsmessage." + n - } - return printUint16(uint16(t)) -} - -// A Class is a type of network. -type Class uint16 - -const ( - // ResourceHeader.Class and Question.Class - ClassINET Class = 1 - ClassCSNET Class = 2 - ClassCHAOS Class = 3 - ClassHESIOD Class = 4 - - // Question.Class - ClassANY Class = 255 -) - -var classNames = map[Class]string{ - ClassINET: "ClassINET", - ClassCSNET: "ClassCSNET", - ClassCHAOS: "ClassCHAOS", - ClassHESIOD: "ClassHESIOD", - ClassANY: "ClassANY", -} - -// String implements fmt.Stringer.String. -func (c Class) String() string { - if n, ok := classNames[c]; ok { - return n - } - return printUint16(uint16(c)) -} - -// GoString implements fmt.GoStringer.GoString. -func (c Class) GoString() string { - if n, ok := classNames[c]; ok { - return "dnsmessage." + n - } - return printUint16(uint16(c)) -} - -// An OpCode is a DNS operation code. -type OpCode uint16 - -// GoString implements fmt.GoStringer.GoString. -func (o OpCode) GoString() string { - return printUint16(uint16(o)) -} - -// An RCode is a DNS response status code. -type RCode uint16 - -const ( - // Message.Rcode - RCodeSuccess RCode = 0 - RCodeFormatError RCode = 1 - RCodeServerFailure RCode = 2 - RCodeNameError RCode = 3 - RCodeNotImplemented RCode = 4 - RCodeRefused RCode = 5 -) - -var rCodeNames = map[RCode]string{ - RCodeSuccess: "RCodeSuccess", - RCodeFormatError: "RCodeFormatError", - RCodeServerFailure: "RCodeServerFailure", - RCodeNameError: "RCodeNameError", - RCodeNotImplemented: "RCodeNotImplemented", - RCodeRefused: "RCodeRefused", -} - -// String implements fmt.Stringer.String. -func (r RCode) String() string { - if n, ok := rCodeNames[r]; ok { - return n - } - return printUint16(uint16(r)) -} - -// GoString implements fmt.GoStringer.GoString. -func (r RCode) GoString() string { - if n, ok := rCodeNames[r]; ok { - return "dnsmessage." + n - } - return printUint16(uint16(r)) -} - -func printPaddedUint8(i uint8) string { - b := byte(i) - return string([]byte{ - b/100 + '0', - b/10%10 + '0', - b%10 + '0', - }) -} - -func printUint8Bytes(buf []byte, i uint8) []byte { - b := byte(i) - if i >= 100 { - buf = append(buf, b/100+'0') - } - if i >= 10 { - buf = append(buf, b/10%10+'0') - } - return append(buf, b%10+'0') -} - -func printByteSlice(b []byte) string { - if len(b) == 0 { - return "" - } - buf := make([]byte, 0, 5*len(b)) - buf = printUint8Bytes(buf, uint8(b[0])) - for _, n := range b[1:] { - buf = append(buf, ',', ' ') - buf = printUint8Bytes(buf, uint8(n)) - } - return string(buf) -} - -const hexDigits = "0123456789abcdef" - -func printString(str []byte) string { - buf := make([]byte, 0, len(str)) - for i := 0; i < len(str); i++ { - c := str[i] - if c == '.' || c == '-' || c == ' ' || - 'A' <= c && c <= 'Z' || - 'a' <= c && c <= 'z' || - '0' <= c && c <= '9' { - buf = append(buf, c) - continue - } - - upper := c >> 4 - lower := (c << 4) >> 4 - buf = append( - buf, - '\\', - 'x', - hexDigits[upper], - hexDigits[lower], - ) - } - return string(buf) -} - -func printUint16(i uint16) string { - return printUint32(uint32(i)) -} - -func printUint32(i uint32) string { - // Max value is 4294967295. - buf := make([]byte, 10) - for b, d := buf, uint32(1000000000); d > 0; d /= 10 { - b[0] = byte(i/d%10 + '0') - if b[0] == '0' && len(b) == len(buf) && len(buf) > 1 { - buf = buf[1:] - } - b = b[1:] - i %= d - } - return string(buf) -} - -func printBool(b bool) string { - if b { - return "true" - } - return "false" -} - -var ( - // ErrNotStarted indicates that the prerequisite information isn't - // available yet because the previous records haven't been appropriately - // parsed, skipped or finished. - ErrNotStarted = errors.New("parsing/packing of this type isn't available yet") - - // ErrSectionDone indicated that all records in the section have been - // parsed or finished. - ErrSectionDone = errors.New("parsing/packing of this section has completed") - - errBaseLen = errors.New("insufficient data for base length type") - errCalcLen = errors.New("insufficient data for calculated length type") - errReserved = errors.New("segment prefix is reserved") - errTooManyPtr = errors.New("too many pointers (>10)") - errInvalidPtr = errors.New("invalid pointer") - errNilResouceBody = errors.New("nil resource body") - errResourceLen = errors.New("insufficient data for resource body length") - errSegTooLong = errors.New("segment length too long") - errZeroSegLen = errors.New("zero length segment") - errResTooLong = errors.New("resource length too long") - errTooManyQuestions = errors.New("too many Questions to pack (>65535)") - errTooManyAnswers = errors.New("too many Answers to pack (>65535)") - errTooManyAuthorities = errors.New("too many Authorities to pack (>65535)") - errTooManyAdditionals = errors.New("too many Additionals to pack (>65535)") - errNonCanonicalName = errors.New("name is not in canonical format (it must end with a .)") - errStringTooLong = errors.New("character string exceeds maximum length (255)") - errCompressedSRV = errors.New("compressed name in SRV resource data") -) - -// Internal constants. -const ( - // packStartingCap is the default initial buffer size allocated during - // packing. - // - // The starting capacity doesn't matter too much, but most DNS responses - // Will be <= 512 bytes as it is the limit for DNS over UDP. - packStartingCap = 512 - - // uint16Len is the length (in bytes) of a uint16. - uint16Len = 2 - - // uint32Len is the length (in bytes) of a uint32. - uint32Len = 4 - - // headerLen is the length (in bytes) of a DNS header. - // - // A header is comprised of 6 uint16s and no padding. - headerLen = 6 * uint16Len -) - -type nestedError struct { - // s is the current level's error message. - s string - - // err is the nested error. - err error -} - -// nestedError implements error.Error. -func (e *nestedError) Error() string { - return e.s + ": " + e.err.Error() -} - -// Header is a representation of a DNS message header. -type Header struct { - ID uint16 - Response bool - OpCode OpCode - Authoritative bool - Truncated bool - RecursionDesired bool - RecursionAvailable bool - RCode RCode -} - -func (m *Header) pack() (id uint16, bits uint16) { - id = m.ID - bits = uint16(m.OpCode)<<11 | uint16(m.RCode) - if m.RecursionAvailable { - bits |= headerBitRA - } - if m.RecursionDesired { - bits |= headerBitRD - } - if m.Truncated { - bits |= headerBitTC - } - if m.Authoritative { - bits |= headerBitAA - } - if m.Response { - bits |= headerBitQR - } - return -} - -// GoString implements fmt.GoStringer.GoString. -func (m *Header) GoString() string { - return "dnsmessage.Header{" + - "ID: " + printUint16(m.ID) + ", " + - "Response: " + printBool(m.Response) + ", " + - "OpCode: " + m.OpCode.GoString() + ", " + - "Authoritative: " + printBool(m.Authoritative) + ", " + - "Truncated: " + printBool(m.Truncated) + ", " + - "RecursionDesired: " + printBool(m.RecursionDesired) + ", " + - "RecursionAvailable: " + printBool(m.RecursionAvailable) + ", " + - "RCode: " + m.RCode.GoString() + "}" -} - -// Message is a representation of a DNS message. -type Message struct { - Header - Questions []Question - Answers []Resource - Authorities []Resource - Additionals []Resource -} - -type section uint8 - -const ( - sectionNotStarted section = iota - sectionHeader - sectionQuestions - sectionAnswers - sectionAuthorities - sectionAdditionals - sectionDone - - headerBitQR = 1 << 15 // query/response (response=1) - headerBitAA = 1 << 10 // authoritative - headerBitTC = 1 << 9 // truncated - headerBitRD = 1 << 8 // recursion desired - headerBitRA = 1 << 7 // recursion available -) - -var sectionNames = map[section]string{ - sectionHeader: "header", - sectionQuestions: "Question", - sectionAnswers: "Answer", - sectionAuthorities: "Authority", - sectionAdditionals: "Additional", -} - -// header is the wire format for a DNS message header. -type header struct { - id uint16 - bits uint16 - questions uint16 - answers uint16 - authorities uint16 - additionals uint16 -} - -func (h *header) count(sec section) uint16 { - switch sec { - case sectionQuestions: - return h.questions - case sectionAnswers: - return h.answers - case sectionAuthorities: - return h.authorities - case sectionAdditionals: - return h.additionals - } - return 0 -} - -// pack appends the wire format of the header to msg. -func (h *header) pack(msg []byte) []byte { - msg = packUint16(msg, h.id) - msg = packUint16(msg, h.bits) - msg = packUint16(msg, h.questions) - msg = packUint16(msg, h.answers) - msg = packUint16(msg, h.authorities) - return packUint16(msg, h.additionals) -} - -func (h *header) unpack(msg []byte, off int) (int, error) { - newOff := off - var err error - if h.id, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"id", err} - } - if h.bits, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"bits", err} - } - if h.questions, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"questions", err} - } - if h.answers, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"answers", err} - } - if h.authorities, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"authorities", err} - } - if h.additionals, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"additionals", err} - } - return newOff, nil -} - -func (h *header) header() Header { - return Header{ - ID: h.id, - Response: (h.bits & headerBitQR) != 0, - OpCode: OpCode(h.bits>>11) & 0xF, - Authoritative: (h.bits & headerBitAA) != 0, - Truncated: (h.bits & headerBitTC) != 0, - RecursionDesired: (h.bits & headerBitRD) != 0, - RecursionAvailable: (h.bits & headerBitRA) != 0, - RCode: RCode(h.bits & 0xF), - } -} - -// A Resource is a DNS resource record. -type Resource struct { - Header ResourceHeader - Body ResourceBody -} - -func (r *Resource) GoString() string { - return "dnsmessage.Resource{" + - "Header: " + r.Header.GoString() + - ", Body: &" + r.Body.GoString() + - "}" -} - -// A ResourceBody is a DNS resource record minus the header. -type ResourceBody interface { - // pack packs a Resource except for its header. - pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) - - // realType returns the actual type of the Resource. This is used to - // fill in the header Type field. - realType() Type - - // GoString implements fmt.GoStringer.GoString. - GoString() string -} - -// pack appends the wire format of the Resource to msg. -func (r *Resource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - if r.Body == nil { - return msg, errNilResouceBody - } - oldMsg := msg - r.Header.Type = r.Body.realType() - msg, lenOff, err := r.Header.pack(msg, compression, compressionOff) - if err != nil { - return msg, &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - msg, err = r.Body.pack(msg, compression, compressionOff) - if err != nil { - return msg, &nestedError{"content", err} - } - if err := r.Header.fixLen(msg, lenOff, preLen); err != nil { - return oldMsg, err - } - return msg, nil -} - -// A Parser allows incrementally parsing a DNS message. -// -// When parsing is started, the Header is parsed. Next, each Question can be -// either parsed or skipped. Alternatively, all Questions can be skipped at -// once. When all Questions have been parsed, attempting to parse Questions -// will return (nil, nil) and attempting to skip Questions will return -// (true, nil). After all Questions have been either parsed or skipped, all -// Answers, Authorities and Additionals can be either parsed or skipped in the -// same way, and each type of Resource must be fully parsed or skipped before -// proceeding to the next type of Resource. -// -// Note that there is no requirement to fully skip or parse the message. -type Parser struct { - msg []byte - header header - - section section - off int - index int - resHeaderValid bool - resHeader ResourceHeader -} - -// Start parses the header and enables the parsing of Questions. -func (p *Parser) Start(msg []byte) (Header, error) { - if p.msg != nil { - *p = Parser{} - } - p.msg = msg - var err error - if p.off, err = p.header.unpack(msg, 0); err != nil { - return Header{}, &nestedError{"unpacking header", err} - } - p.section = sectionQuestions - return p.header.header(), nil -} - -func (p *Parser) checkAdvance(sec section) error { - if p.section < sec { - return ErrNotStarted - } - if p.section > sec { - return ErrSectionDone - } - p.resHeaderValid = false - if p.index == int(p.header.count(sec)) { - p.index = 0 - p.section++ - return ErrSectionDone - } - return nil -} - -func (p *Parser) resource(sec section) (Resource, error) { - var r Resource - var err error - r.Header, err = p.resourceHeader(sec) - if err != nil { - return r, err - } - p.resHeaderValid = false - r.Body, p.off, err = unpackResourceBody(p.msg, p.off, r.Header) - if err != nil { - return Resource{}, &nestedError{"unpacking " + sectionNames[sec], err} - } - p.index++ - return r, nil -} - -func (p *Parser) resourceHeader(sec section) (ResourceHeader, error) { - if p.resHeaderValid { - return p.resHeader, nil - } - if err := p.checkAdvance(sec); err != nil { - return ResourceHeader{}, err - } - var hdr ResourceHeader - off, err := hdr.unpack(p.msg, p.off) - if err != nil { - return ResourceHeader{}, err - } - p.resHeaderValid = true - p.resHeader = hdr - p.off = off - return hdr, nil -} - -func (p *Parser) skipResource(sec section) error { - if p.resHeaderValid { - newOff := p.off + int(p.resHeader.Length) - if newOff > len(p.msg) { - return errResourceLen - } - p.off = newOff - p.resHeaderValid = false - p.index++ - return nil - } - if err := p.checkAdvance(sec); err != nil { - return err - } - var err error - p.off, err = skipResource(p.msg, p.off) - if err != nil { - return &nestedError{"skipping: " + sectionNames[sec], err} - } - p.index++ - return nil -} - -// Question parses a single Question. -func (p *Parser) Question() (Question, error) { - if err := p.checkAdvance(sectionQuestions); err != nil { - return Question{}, err - } - var name Name - off, err := name.unpack(p.msg, p.off) - if err != nil { - return Question{}, &nestedError{"unpacking Question.Name", err} - } - typ, off, err := unpackType(p.msg, off) - if err != nil { - return Question{}, &nestedError{"unpacking Question.Type", err} - } - class, off, err := unpackClass(p.msg, off) - if err != nil { - return Question{}, &nestedError{"unpacking Question.Class", err} - } - p.off = off - p.index++ - return Question{name, typ, class}, nil -} - -// AllQuestions parses all Questions. -func (p *Parser) AllQuestions() ([]Question, error) { - // Multiple questions are valid according to the spec, - // but servers don't actually support them. There will - // be at most one question here. - // - // Do not pre-allocate based on info in p.header, since - // the data is untrusted. - qs := []Question{} - for { - q, err := p.Question() - if err == ErrSectionDone { - return qs, nil - } - if err != nil { - return nil, err - } - qs = append(qs, q) - } -} - -// SkipQuestion skips a single Question. -func (p *Parser) SkipQuestion() error { - if err := p.checkAdvance(sectionQuestions); err != nil { - return err - } - off, err := skipName(p.msg, p.off) - if err != nil { - return &nestedError{"skipping Question Name", err} - } - if off, err = skipType(p.msg, off); err != nil { - return &nestedError{"skipping Question Type", err} - } - if off, err = skipClass(p.msg, off); err != nil { - return &nestedError{"skipping Question Class", err} - } - p.off = off - p.index++ - return nil -} - -// SkipAllQuestions skips all Questions. -func (p *Parser) SkipAllQuestions() error { - for { - if err := p.SkipQuestion(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// AnswerHeader parses a single Answer ResourceHeader. -func (p *Parser) AnswerHeader() (ResourceHeader, error) { - return p.resourceHeader(sectionAnswers) -} - -// Answer parses a single Answer Resource. -func (p *Parser) Answer() (Resource, error) { - return p.resource(sectionAnswers) -} - -// AllAnswers parses all Answer Resources. -func (p *Parser) AllAnswers() ([]Resource, error) { - // The most common query is for A/AAAA, which usually returns - // a handful of IPs. - // - // Pre-allocate up to a certain limit, since p.header is - // untrusted data. - n := int(p.header.answers) - if n > 20 { - n = 20 - } - as := make([]Resource, 0, n) - for { - a, err := p.Answer() - if err == ErrSectionDone { - return as, nil - } - if err != nil { - return nil, err - } - as = append(as, a) - } -} - -// SkipAnswer skips a single Answer Resource. -func (p *Parser) SkipAnswer() error { - return p.skipResource(sectionAnswers) -} - -// SkipAllAnswers skips all Answer Resources. -func (p *Parser) SkipAllAnswers() error { - for { - if err := p.SkipAnswer(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// AuthorityHeader parses a single Authority ResourceHeader. -func (p *Parser) AuthorityHeader() (ResourceHeader, error) { - return p.resourceHeader(sectionAuthorities) -} - -// Authority parses a single Authority Resource. -func (p *Parser) Authority() (Resource, error) { - return p.resource(sectionAuthorities) -} - -// AllAuthorities parses all Authority Resources. -func (p *Parser) AllAuthorities() ([]Resource, error) { - // Authorities contains SOA in case of NXDOMAIN and friends, - // otherwise it is empty. - // - // Pre-allocate up to a certain limit, since p.header is - // untrusted data. - n := int(p.header.authorities) - if n > 10 { - n = 10 - } - as := make([]Resource, 0, n) - for { - a, err := p.Authority() - if err == ErrSectionDone { - return as, nil - } - if err != nil { - return nil, err - } - as = append(as, a) - } -} - -// SkipAuthority skips a single Authority Resource. -func (p *Parser) SkipAuthority() error { - return p.skipResource(sectionAuthorities) -} - -// SkipAllAuthorities skips all Authority Resources. -func (p *Parser) SkipAllAuthorities() error { - for { - if err := p.SkipAuthority(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// AdditionalHeader parses a single Additional ResourceHeader. -func (p *Parser) AdditionalHeader() (ResourceHeader, error) { - return p.resourceHeader(sectionAdditionals) -} - -// Additional parses a single Additional Resource. -func (p *Parser) Additional() (Resource, error) { - return p.resource(sectionAdditionals) -} - -// AllAdditionals parses all Additional Resources. -func (p *Parser) AllAdditionals() ([]Resource, error) { - // Additionals usually contain OPT, and sometimes A/AAAA - // glue records. - // - // Pre-allocate up to a certain limit, since p.header is - // untrusted data. - n := int(p.header.additionals) - if n > 10 { - n = 10 - } - as := make([]Resource, 0, n) - for { - a, err := p.Additional() - if err == ErrSectionDone { - return as, nil - } - if err != nil { - return nil, err - } - as = append(as, a) - } -} - -// SkipAdditional skips a single Additional Resource. -func (p *Parser) SkipAdditional() error { - return p.skipResource(sectionAdditionals) -} - -// SkipAllAdditionals skips all Additional Resources. -func (p *Parser) SkipAllAdditionals() error { - for { - if err := p.SkipAdditional(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// CNAMEResource parses a single CNAMEResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) CNAMEResource() (CNAMEResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeCNAME { - return CNAMEResource{}, ErrNotStarted - } - r, err := unpackCNAMEResource(p.msg, p.off) - if err != nil { - return CNAMEResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// MXResource parses a single MXResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) MXResource() (MXResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeMX { - return MXResource{}, ErrNotStarted - } - r, err := unpackMXResource(p.msg, p.off) - if err != nil { - return MXResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// NSResource parses a single NSResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) NSResource() (NSResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeNS { - return NSResource{}, ErrNotStarted - } - r, err := unpackNSResource(p.msg, p.off) - if err != nil { - return NSResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// PTRResource parses a single PTRResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) PTRResource() (PTRResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypePTR { - return PTRResource{}, ErrNotStarted - } - r, err := unpackPTRResource(p.msg, p.off) - if err != nil { - return PTRResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// SOAResource parses a single SOAResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) SOAResource() (SOAResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeSOA { - return SOAResource{}, ErrNotStarted - } - r, err := unpackSOAResource(p.msg, p.off) - if err != nil { - return SOAResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// TXTResource parses a single TXTResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) TXTResource() (TXTResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeTXT { - return TXTResource{}, ErrNotStarted - } - r, err := unpackTXTResource(p.msg, p.off, p.resHeader.Length) - if err != nil { - return TXTResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// SRVResource parses a single SRVResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) SRVResource() (SRVResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeSRV { - return SRVResource{}, ErrNotStarted - } - r, err := unpackSRVResource(p.msg, p.off) - if err != nil { - return SRVResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// AResource parses a single AResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) AResource() (AResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeA { - return AResource{}, ErrNotStarted - } - r, err := unpackAResource(p.msg, p.off) - if err != nil { - return AResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// AAAAResource parses a single AAAAResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) AAAAResource() (AAAAResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeAAAA { - return AAAAResource{}, ErrNotStarted - } - r, err := unpackAAAAResource(p.msg, p.off) - if err != nil { - return AAAAResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// OPTResource parses a single OPTResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) OPTResource() (OPTResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeOPT { - return OPTResource{}, ErrNotStarted - } - r, err := unpackOPTResource(p.msg, p.off, p.resHeader.Length) - if err != nil { - return OPTResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// UnknownResource parses a single UnknownResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) UnknownResource() (UnknownResource, error) { - if !p.resHeaderValid { - return UnknownResource{}, ErrNotStarted - } - r, err := unpackUnknownResource(p.resHeader.Type, p.msg, p.off, p.resHeader.Length) - if err != nil { - return UnknownResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// Unpack parses a full Message. -func (m *Message) Unpack(msg []byte) error { - var p Parser - var err error - if m.Header, err = p.Start(msg); err != nil { - return err - } - if m.Questions, err = p.AllQuestions(); err != nil { - return err - } - if m.Answers, err = p.AllAnswers(); err != nil { - return err - } - if m.Authorities, err = p.AllAuthorities(); err != nil { - return err - } - if m.Additionals, err = p.AllAdditionals(); err != nil { - return err - } - return nil -} - -// Pack packs a full Message. -func (m *Message) Pack() ([]byte, error) { - return m.AppendPack(make([]byte, 0, packStartingCap)) -} - -// AppendPack is like Pack but appends the full Message to b and returns the -// extended buffer. -func (m *Message) AppendPack(b []byte) ([]byte, error) { - // Validate the lengths. It is very unlikely that anyone will try to - // pack more than 65535 of any particular type, but it is possible and - // we should fail gracefully. - if len(m.Questions) > int(^uint16(0)) { - return nil, errTooManyQuestions - } - if len(m.Answers) > int(^uint16(0)) { - return nil, errTooManyAnswers - } - if len(m.Authorities) > int(^uint16(0)) { - return nil, errTooManyAuthorities - } - if len(m.Additionals) > int(^uint16(0)) { - return nil, errTooManyAdditionals - } - - var h header - h.id, h.bits = m.Header.pack() - - h.questions = uint16(len(m.Questions)) - h.answers = uint16(len(m.Answers)) - h.authorities = uint16(len(m.Authorities)) - h.additionals = uint16(len(m.Additionals)) - - compressionOff := len(b) - msg := h.pack(b) - - // RFC 1035 allows (but does not require) compression for packing. RFC - // 1035 requires unpacking implementations to support compression, so - // unconditionally enabling it is fine. - // - // DNS lookups are typically done over UDP, and RFC 1035 states that UDP - // DNS messages can be a maximum of 512 bytes long. Without compression, - // many DNS response messages are over this limit, so enabling - // compression will help ensure compliance. - compression := map[string]int{} - - for i := range m.Questions { - var err error - if msg, err = m.Questions[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Question", err} - } - } - for i := range m.Answers { - var err error - if msg, err = m.Answers[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Answer", err} - } - } - for i := range m.Authorities { - var err error - if msg, err = m.Authorities[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Authority", err} - } - } - for i := range m.Additionals { - var err error - if msg, err = m.Additionals[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Additional", err} - } - } - - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (m *Message) GoString() string { - s := "dnsmessage.Message{Header: " + m.Header.GoString() + ", " + - "Questions: []dnsmessage.Question{" - if len(m.Questions) > 0 { - s += m.Questions[0].GoString() - for _, q := range m.Questions[1:] { - s += ", " + q.GoString() - } - } - s += "}, Answers: []dnsmessage.Resource{" - if len(m.Answers) > 0 { - s += m.Answers[0].GoString() - for _, a := range m.Answers[1:] { - s += ", " + a.GoString() - } - } - s += "}, Authorities: []dnsmessage.Resource{" - if len(m.Authorities) > 0 { - s += m.Authorities[0].GoString() - for _, a := range m.Authorities[1:] { - s += ", " + a.GoString() - } - } - s += "}, Additionals: []dnsmessage.Resource{" - if len(m.Additionals) > 0 { - s += m.Additionals[0].GoString() - for _, a := range m.Additionals[1:] { - s += ", " + a.GoString() - } - } - return s + "}}" -} - -// A Builder allows incrementally packing a DNS message. -// -// Example usage: -// buf := make([]byte, 2, 514) -// b := NewBuilder(buf, Header{...}) -// b.EnableCompression() -// // Optionally start a section and add things to that section. -// // Repeat adding sections as necessary. -// buf, err := b.Finish() -// // If err is nil, buf[2:] will contain the built bytes. -type Builder struct { - // msg is the storage for the message being built. - msg []byte - - // section keeps track of the current section being built. - section section - - // header keeps track of what should go in the header when Finish is - // called. - header header - - // start is the starting index of the bytes allocated in msg for header. - start int - - // compression is a mapping from name suffixes to their starting index - // in msg. - compression map[string]int -} - -// NewBuilder creates a new builder with compression disabled. -// -// Note: Most users will want to immediately enable compression with the -// EnableCompression method. See that method's comment for why you may or may -// not want to enable compression. -// -// The DNS message is appended to the provided initial buffer buf (which may be -// nil) as it is built. The final message is returned by the (*Builder).Finish -// method, which may return the same underlying array if there was sufficient -// capacity in the slice. -func NewBuilder(buf []byte, h Header) Builder { - if buf == nil { - buf = make([]byte, 0, packStartingCap) - } - b := Builder{msg: buf, start: len(buf)} - b.header.id, b.header.bits = h.pack() - var hb [headerLen]byte - b.msg = append(b.msg, hb[:]...) - b.section = sectionHeader - return b -} - -// EnableCompression enables compression in the Builder. -// -// Leaving compression disabled avoids compression related allocations, but can -// result in larger message sizes. Be careful with this mode as it can cause -// messages to exceed the UDP size limit. -// -// According to RFC 1035, section 4.1.4, the use of compression is optional, but -// all implementations must accept both compressed and uncompressed DNS -// messages. -// -// Compression should be enabled before any sections are added for best results. -func (b *Builder) EnableCompression() { - b.compression = map[string]int{} -} - -func (b *Builder) startCheck(s section) error { - if b.section <= sectionNotStarted { - return ErrNotStarted - } - if b.section > s { - return ErrSectionDone - } - return nil -} - -// StartQuestions prepares the builder for packing Questions. -func (b *Builder) StartQuestions() error { - if err := b.startCheck(sectionQuestions); err != nil { - return err - } - b.section = sectionQuestions - return nil -} - -// StartAnswers prepares the builder for packing Answers. -func (b *Builder) StartAnswers() error { - if err := b.startCheck(sectionAnswers); err != nil { - return err - } - b.section = sectionAnswers - return nil -} - -// StartAuthorities prepares the builder for packing Authorities. -func (b *Builder) StartAuthorities() error { - if err := b.startCheck(sectionAuthorities); err != nil { - return err - } - b.section = sectionAuthorities - return nil -} - -// StartAdditionals prepares the builder for packing Additionals. -func (b *Builder) StartAdditionals() error { - if err := b.startCheck(sectionAdditionals); err != nil { - return err - } - b.section = sectionAdditionals - return nil -} - -func (b *Builder) incrementSectionCount() error { - var count *uint16 - var err error - switch b.section { - case sectionQuestions: - count = &b.header.questions - err = errTooManyQuestions - case sectionAnswers: - count = &b.header.answers - err = errTooManyAnswers - case sectionAuthorities: - count = &b.header.authorities - err = errTooManyAuthorities - case sectionAdditionals: - count = &b.header.additionals - err = errTooManyAdditionals - } - if *count == ^uint16(0) { - return err - } - *count++ - return nil -} - -// Question adds a single Question. -func (b *Builder) Question(q Question) error { - if b.section < sectionQuestions { - return ErrNotStarted - } - if b.section > sectionQuestions { - return ErrSectionDone - } - msg, err := q.pack(b.msg, b.compression, b.start) - if err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -func (b *Builder) checkResourceSection() error { - if b.section < sectionAnswers { - return ErrNotStarted - } - if b.section > sectionAdditionals { - return ErrSectionDone - } - return nil -} - -// CNAMEResource adds a single CNAMEResource. -func (b *Builder) CNAMEResource(h ResourceHeader, r CNAMEResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"CNAMEResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// MXResource adds a single MXResource. -func (b *Builder) MXResource(h ResourceHeader, r MXResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"MXResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// NSResource adds a single NSResource. -func (b *Builder) NSResource(h ResourceHeader, r NSResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"NSResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// PTRResource adds a single PTRResource. -func (b *Builder) PTRResource(h ResourceHeader, r PTRResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"PTRResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// SOAResource adds a single SOAResource. -func (b *Builder) SOAResource(h ResourceHeader, r SOAResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"SOAResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// TXTResource adds a single TXTResource. -func (b *Builder) TXTResource(h ResourceHeader, r TXTResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"TXTResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// SRVResource adds a single SRVResource. -func (b *Builder) SRVResource(h ResourceHeader, r SRVResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"SRVResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// AResource adds a single AResource. -func (b *Builder) AResource(h ResourceHeader, r AResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"AResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// AAAAResource adds a single AAAAResource. -func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"AAAAResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// OPTResource adds a single OPTResource. -func (b *Builder) OPTResource(h ResourceHeader, r OPTResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"OPTResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// UnknownResource adds a single UnknownResource. -func (b *Builder) UnknownResource(h ResourceHeader, r UnknownResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"UnknownResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// Finish ends message building and generates a binary message. -func (b *Builder) Finish() ([]byte, error) { - if b.section < sectionHeader { - return nil, ErrNotStarted - } - b.section = sectionDone - // Space for the header was allocated in NewBuilder. - b.header.pack(b.msg[b.start:b.start]) - return b.msg, nil -} - -// A ResourceHeader is the header of a DNS resource record. There are -// many types of DNS resource records, but they all share the same header. -type ResourceHeader struct { - // Name is the domain name for which this resource record pertains. - Name Name - - // Type is the type of DNS resource record. - // - // This field will be set automatically during packing. - Type Type - - // Class is the class of network to which this DNS resource record - // pertains. - Class Class - - // TTL is the length of time (measured in seconds) which this resource - // record is valid for (time to live). All Resources in a set should - // have the same TTL (RFC 2181 Section 5.2). - TTL uint32 - - // Length is the length of data in the resource record after the header. - // - // This field will be set automatically during packing. - Length uint16 -} - -// GoString implements fmt.GoStringer.GoString. -func (h *ResourceHeader) GoString() string { - return "dnsmessage.ResourceHeader{" + - "Name: " + h.Name.GoString() + ", " + - "Type: " + h.Type.GoString() + ", " + - "Class: " + h.Class.GoString() + ", " + - "TTL: " + printUint32(h.TTL) + ", " + - "Length: " + printUint16(h.Length) + "}" -} - -// pack appends the wire format of the ResourceHeader to oldMsg. -// -// lenOff is the offset in msg where the Length field was packed. -func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]int, compressionOff int) (msg []byte, lenOff int, err error) { - msg = oldMsg - if msg, err = h.Name.pack(msg, compression, compressionOff); err != nil { - return oldMsg, 0, &nestedError{"Name", err} - } - msg = packType(msg, h.Type) - msg = packClass(msg, h.Class) - msg = packUint32(msg, h.TTL) - lenOff = len(msg) - msg = packUint16(msg, h.Length) - return msg, lenOff, nil -} - -func (h *ResourceHeader) unpack(msg []byte, off int) (int, error) { - newOff := off - var err error - if newOff, err = h.Name.unpack(msg, newOff); err != nil { - return off, &nestedError{"Name", err} - } - if h.Type, newOff, err = unpackType(msg, newOff); err != nil { - return off, &nestedError{"Type", err} - } - if h.Class, newOff, err = unpackClass(msg, newOff); err != nil { - return off, &nestedError{"Class", err} - } - if h.TTL, newOff, err = unpackUint32(msg, newOff); err != nil { - return off, &nestedError{"TTL", err} - } - if h.Length, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"Length", err} - } - return newOff, nil -} - -// fixLen updates a packed ResourceHeader to include the length of the -// ResourceBody. -// -// lenOff is the offset of the ResourceHeader.Length field in msg. -// -// preLen is the length that msg was before the ResourceBody was packed. -func (h *ResourceHeader) fixLen(msg []byte, lenOff int, preLen int) error { - conLen := len(msg) - preLen - if conLen > int(^uint16(0)) { - return errResTooLong - } - - // Fill in the length now that we know how long the content is. - packUint16(msg[lenOff:lenOff], uint16(conLen)) - h.Length = uint16(conLen) - - return nil -} - -// EDNS(0) wire constants. -const ( - edns0Version = 0 - - edns0DNSSECOK = 0x00008000 - ednsVersionMask = 0x00ff0000 - edns0DNSSECOKMask = 0x00ff8000 -) - -// SetEDNS0 configures h for EDNS(0). -// -// The provided extRCode must be an extedned RCode. -func (h *ResourceHeader) SetEDNS0(udpPayloadLen int, extRCode RCode, dnssecOK bool) error { - h.Name = Name{Data: [nameLen]byte{'.'}, Length: 1} // RFC 6891 section 6.1.2 - h.Type = TypeOPT - h.Class = Class(udpPayloadLen) - h.TTL = uint32(extRCode) >> 4 << 24 - if dnssecOK { - h.TTL |= edns0DNSSECOK - } - return nil -} - -// DNSSECAllowed reports whether the DNSSEC OK bit is set. -func (h *ResourceHeader) DNSSECAllowed() bool { - return h.TTL&edns0DNSSECOKMask == edns0DNSSECOK // RFC 6891 section 6.1.3 -} - -// ExtendedRCode returns an extended RCode. -// -// The provided rcode must be the RCode in DNS message header. -func (h *ResourceHeader) ExtendedRCode(rcode RCode) RCode { - if h.TTL&ednsVersionMask == edns0Version { // RFC 6891 section 6.1.3 - return RCode(h.TTL>>24<<4) | rcode - } - return rcode -} - -func skipResource(msg []byte, off int) (int, error) { - newOff, err := skipName(msg, off) - if err != nil { - return off, &nestedError{"Name", err} - } - if newOff, err = skipType(msg, newOff); err != nil { - return off, &nestedError{"Type", err} - } - if newOff, err = skipClass(msg, newOff); err != nil { - return off, &nestedError{"Class", err} - } - if newOff, err = skipUint32(msg, newOff); err != nil { - return off, &nestedError{"TTL", err} - } - length, newOff, err := unpackUint16(msg, newOff) - if err != nil { - return off, &nestedError{"Length", err} - } - if newOff += int(length); newOff > len(msg) { - return off, errResourceLen - } - return newOff, nil -} - -// packUint16 appends the wire format of field to msg. -func packUint16(msg []byte, field uint16) []byte { - return append(msg, byte(field>>8), byte(field)) -} - -func unpackUint16(msg []byte, off int) (uint16, int, error) { - if off+uint16Len > len(msg) { - return 0, off, errBaseLen - } - return uint16(msg[off])<<8 | uint16(msg[off+1]), off + uint16Len, nil -} - -func skipUint16(msg []byte, off int) (int, error) { - if off+uint16Len > len(msg) { - return off, errBaseLen - } - return off + uint16Len, nil -} - -// packType appends the wire format of field to msg. -func packType(msg []byte, field Type) []byte { - return packUint16(msg, uint16(field)) -} - -func unpackType(msg []byte, off int) (Type, int, error) { - t, o, err := unpackUint16(msg, off) - return Type(t), o, err -} - -func skipType(msg []byte, off int) (int, error) { - return skipUint16(msg, off) -} - -// packClass appends the wire format of field to msg. -func packClass(msg []byte, field Class) []byte { - return packUint16(msg, uint16(field)) -} - -func unpackClass(msg []byte, off int) (Class, int, error) { - c, o, err := unpackUint16(msg, off) - return Class(c), o, err -} - -func skipClass(msg []byte, off int) (int, error) { - return skipUint16(msg, off) -} - -// packUint32 appends the wire format of field to msg. -func packUint32(msg []byte, field uint32) []byte { - return append( - msg, - byte(field>>24), - byte(field>>16), - byte(field>>8), - byte(field), - ) -} - -func unpackUint32(msg []byte, off int) (uint32, int, error) { - if off+uint32Len > len(msg) { - return 0, off, errBaseLen - } - v := uint32(msg[off])<<24 | uint32(msg[off+1])<<16 | uint32(msg[off+2])<<8 | uint32(msg[off+3]) - return v, off + uint32Len, nil -} - -func skipUint32(msg []byte, off int) (int, error) { - if off+uint32Len > len(msg) { - return off, errBaseLen - } - return off + uint32Len, nil -} - -// packText appends the wire format of field to msg. -func packText(msg []byte, field string) ([]byte, error) { - l := len(field) - if l > 255 { - return nil, errStringTooLong - } - msg = append(msg, byte(l)) - msg = append(msg, field...) - - return msg, nil -} - -func unpackText(msg []byte, off int) (string, int, error) { - if off >= len(msg) { - return "", off, errBaseLen - } - beginOff := off + 1 - endOff := beginOff + int(msg[off]) - if endOff > len(msg) { - return "", off, errCalcLen - } - return string(msg[beginOff:endOff]), endOff, nil -} - -// packBytes appends the wire format of field to msg. -func packBytes(msg []byte, field []byte) []byte { - return append(msg, field...) -} - -func unpackBytes(msg []byte, off int, field []byte) (int, error) { - newOff := off + len(field) - if newOff > len(msg) { - return off, errBaseLen - } - copy(field, msg[off:newOff]) - return newOff, nil -} - -const nameLen = 255 - -// A Name is a non-encoded domain name. It is used instead of strings to avoid -// allocations. -type Name struct { - Data [nameLen]byte - Length uint8 -} - -// NewName creates a new Name from a string. -func NewName(name string) (Name, error) { - if len([]byte(name)) > nameLen { - return Name{}, errCalcLen - } - n := Name{Length: uint8(len(name))} - copy(n.Data[:], []byte(name)) - return n, nil -} - -// MustNewName creates a new Name from a string and panics on error. -func MustNewName(name string) Name { - n, err := NewName(name) - if err != nil { - panic("creating name: " + err.Error()) - } - return n -} - -// String implements fmt.Stringer.String. -func (n Name) String() string { - return string(n.Data[:n.Length]) -} - -// GoString implements fmt.GoStringer.GoString. -func (n *Name) GoString() string { - return `dnsmessage.MustNewName("` + printString(n.Data[:n.Length]) + `")` -} - -// pack appends the wire format of the Name to msg. -// -// Domain names are a sequence of counted strings split at the dots. They end -// with a zero-length string. Compression can be used to reuse domain suffixes. -// -// The compression map will be updated with new domain suffixes. If compression -// is nil, compression will not be used. -func (n *Name) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - - // Add a trailing dot to canonicalize name. - if n.Length == 0 || n.Data[n.Length-1] != '.' { - return oldMsg, errNonCanonicalName - } - - // Allow root domain. - if n.Data[0] == '.' && n.Length == 1 { - return append(msg, 0), nil - } - - // Emit sequence of counted strings, chopping at dots. - for i, begin := 0, 0; i < int(n.Length); i++ { - // Check for the end of the segment. - if n.Data[i] == '.' { - // The two most significant bits have special meaning. - // It isn't allowed for segments to be long enough to - // need them. - if i-begin >= 1<<6 { - return oldMsg, errSegTooLong - } - - // Segments must have a non-zero length. - if i-begin == 0 { - return oldMsg, errZeroSegLen - } - - msg = append(msg, byte(i-begin)) - - for j := begin; j < i; j++ { - msg = append(msg, n.Data[j]) - } - - begin = i + 1 - continue - } - - // We can only compress domain suffixes starting with a new - // segment. A pointer is two bytes with the two most significant - // bits set to 1 to indicate that it is a pointer. - if (i == 0 || n.Data[i-1] == '.') && compression != nil { - if ptr, ok := compression[string(n.Data[i:])]; ok { - // Hit. Emit a pointer instead of the rest of - // the domain. - return append(msg, byte(ptr>>8|0xC0), byte(ptr)), nil - } - - // Miss. Add the suffix to the compression table if the - // offset can be stored in the available 14 bytes. - if len(msg) <= int(^uint16(0)>>2) { - compression[string(n.Data[i:])] = len(msg) - compressionOff - } - } - } - return append(msg, 0), nil -} - -// unpack unpacks a domain name. -func (n *Name) unpack(msg []byte, off int) (int, error) { - return n.unpackCompressed(msg, off, true /* allowCompression */) -} - -func (n *Name) unpackCompressed(msg []byte, off int, allowCompression bool) (int, error) { - // currOff is the current working offset. - currOff := off - - // newOff is the offset where the next record will start. Pointers lead - // to data that belongs to other names and thus doesn't count towards to - // the usage of this name. - newOff := off - - // ptr is the number of pointers followed. - var ptr int - - // Name is a slice representation of the name data. - name := n.Data[:0] - -Loop: - for { - if currOff >= len(msg) { - return off, errBaseLen - } - c := int(msg[currOff]) - currOff++ - switch c & 0xC0 { - case 0x00: // String segment - if c == 0x00 { - // A zero length signals the end of the name. - break Loop - } - endOff := currOff + c - if endOff > len(msg) { - return off, errCalcLen - } - name = append(name, msg[currOff:endOff]...) - name = append(name, '.') - currOff = endOff - case 0xC0: // Pointer - if !allowCompression { - return off, errCompressedSRV - } - if currOff >= len(msg) { - return off, errInvalidPtr - } - c1 := msg[currOff] - currOff++ - if ptr == 0 { - newOff = currOff - } - // Don't follow too many pointers, maybe there's a loop. - if ptr++; ptr > 10 { - return off, errTooManyPtr - } - currOff = (c^0xC0)<<8 | int(c1) - default: - // Prefixes 0x80 and 0x40 are reserved. - return off, errReserved - } - } - if len(name) == 0 { - name = append(name, '.') - } - if len(name) > len(n.Data) { - return off, errCalcLen - } - n.Length = uint8(len(name)) - if ptr == 0 { - newOff = currOff - } - return newOff, nil -} - -func skipName(msg []byte, off int) (int, error) { - // newOff is the offset where the next record will start. Pointers lead - // to data that belongs to other names and thus doesn't count towards to - // the usage of this name. - newOff := off - -Loop: - for { - if newOff >= len(msg) { - return off, errBaseLen - } - c := int(msg[newOff]) - newOff++ - switch c & 0xC0 { - case 0x00: - if c == 0x00 { - // A zero length signals the end of the name. - break Loop - } - // literal string - newOff += c - if newOff > len(msg) { - return off, errCalcLen - } - case 0xC0: - // Pointer to somewhere else in msg. - - // Pointers are two bytes. - newOff++ - - // Don't follow the pointer as the data here has ended. - break Loop - default: - // Prefixes 0x80 and 0x40 are reserved. - return off, errReserved - } - } - - return newOff, nil -} - -// A Question is a DNS query. -type Question struct { - Name Name - Type Type - Class Class -} - -// pack appends the wire format of the Question to msg. -func (q *Question) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - msg, err := q.Name.pack(msg, compression, compressionOff) - if err != nil { - return msg, &nestedError{"Name", err} - } - msg = packType(msg, q.Type) - return packClass(msg, q.Class), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (q *Question) GoString() string { - return "dnsmessage.Question{" + - "Name: " + q.Name.GoString() + ", " + - "Type: " + q.Type.GoString() + ", " + - "Class: " + q.Class.GoString() + "}" -} - -func unpackResourceBody(msg []byte, off int, hdr ResourceHeader) (ResourceBody, int, error) { - var ( - r ResourceBody - err error - name string - ) - switch hdr.Type { - case TypeA: - var rb AResource - rb, err = unpackAResource(msg, off) - r = &rb - name = "A" - case TypeNS: - var rb NSResource - rb, err = unpackNSResource(msg, off) - r = &rb - name = "NS" - case TypeCNAME: - var rb CNAMEResource - rb, err = unpackCNAMEResource(msg, off) - r = &rb - name = "CNAME" - case TypeSOA: - var rb SOAResource - rb, err = unpackSOAResource(msg, off) - r = &rb - name = "SOA" - case TypePTR: - var rb PTRResource - rb, err = unpackPTRResource(msg, off) - r = &rb - name = "PTR" - case TypeMX: - var rb MXResource - rb, err = unpackMXResource(msg, off) - r = &rb - name = "MX" - case TypeTXT: - var rb TXTResource - rb, err = unpackTXTResource(msg, off, hdr.Length) - r = &rb - name = "TXT" - case TypeAAAA: - var rb AAAAResource - rb, err = unpackAAAAResource(msg, off) - r = &rb - name = "AAAA" - case TypeSRV: - var rb SRVResource - rb, err = unpackSRVResource(msg, off) - r = &rb - name = "SRV" - case TypeOPT: - var rb OPTResource - rb, err = unpackOPTResource(msg, off, hdr.Length) - r = &rb - name = "OPT" - default: - var rb UnknownResource - rb, err = unpackUnknownResource(hdr.Type, msg, off, hdr.Length) - r = &rb - name = "Unknown" - } - if err != nil { - return nil, off, &nestedError{name + " record", err} - } - return r, off + int(hdr.Length), nil -} - -// A CNAMEResource is a CNAME Resource record. -type CNAMEResource struct { - CNAME Name -} - -func (r *CNAMEResource) realType() Type { - return TypeCNAME -} - -// pack appends the wire format of the CNAMEResource to msg. -func (r *CNAMEResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return r.CNAME.pack(msg, compression, compressionOff) -} - -// GoString implements fmt.GoStringer.GoString. -func (r *CNAMEResource) GoString() string { - return "dnsmessage.CNAMEResource{CNAME: " + r.CNAME.GoString() + "}" -} - -func unpackCNAMEResource(msg []byte, off int) (CNAMEResource, error) { - var cname Name - if _, err := cname.unpack(msg, off); err != nil { - return CNAMEResource{}, err - } - return CNAMEResource{cname}, nil -} - -// An MXResource is an MX Resource record. -type MXResource struct { - Pref uint16 - MX Name -} - -func (r *MXResource) realType() Type { - return TypeMX -} - -// pack appends the wire format of the MXResource to msg. -func (r *MXResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - msg = packUint16(msg, r.Pref) - msg, err := r.MX.pack(msg, compression, compressionOff) - if err != nil { - return oldMsg, &nestedError{"MXResource.MX", err} - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *MXResource) GoString() string { - return "dnsmessage.MXResource{" + - "Pref: " + printUint16(r.Pref) + ", " + - "MX: " + r.MX.GoString() + "}" -} - -func unpackMXResource(msg []byte, off int) (MXResource, error) { - pref, off, err := unpackUint16(msg, off) - if err != nil { - return MXResource{}, &nestedError{"Pref", err} - } - var mx Name - if _, err := mx.unpack(msg, off); err != nil { - return MXResource{}, &nestedError{"MX", err} - } - return MXResource{pref, mx}, nil -} - -// An NSResource is an NS Resource record. -type NSResource struct { - NS Name -} - -func (r *NSResource) realType() Type { - return TypeNS -} - -// pack appends the wire format of the NSResource to msg. -func (r *NSResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return r.NS.pack(msg, compression, compressionOff) -} - -// GoString implements fmt.GoStringer.GoString. -func (r *NSResource) GoString() string { - return "dnsmessage.NSResource{NS: " + r.NS.GoString() + "}" -} - -func unpackNSResource(msg []byte, off int) (NSResource, error) { - var ns Name - if _, err := ns.unpack(msg, off); err != nil { - return NSResource{}, err - } - return NSResource{ns}, nil -} - -// A PTRResource is a PTR Resource record. -type PTRResource struct { - PTR Name -} - -func (r *PTRResource) realType() Type { - return TypePTR -} - -// pack appends the wire format of the PTRResource to msg. -func (r *PTRResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return r.PTR.pack(msg, compression, compressionOff) -} - -// GoString implements fmt.GoStringer.GoString. -func (r *PTRResource) GoString() string { - return "dnsmessage.PTRResource{PTR: " + r.PTR.GoString() + "}" -} - -func unpackPTRResource(msg []byte, off int) (PTRResource, error) { - var ptr Name - if _, err := ptr.unpack(msg, off); err != nil { - return PTRResource{}, err - } - return PTRResource{ptr}, nil -} - -// An SOAResource is an SOA Resource record. -type SOAResource struct { - NS Name - MBox Name - Serial uint32 - Refresh uint32 - Retry uint32 - Expire uint32 - - // MinTTL the is the default TTL of Resources records which did not - // contain a TTL value and the TTL of negative responses. (RFC 2308 - // Section 4) - MinTTL uint32 -} - -func (r *SOAResource) realType() Type { - return TypeSOA -} - -// pack appends the wire format of the SOAResource to msg. -func (r *SOAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - msg, err := r.NS.pack(msg, compression, compressionOff) - if err != nil { - return oldMsg, &nestedError{"SOAResource.NS", err} - } - msg, err = r.MBox.pack(msg, compression, compressionOff) - if err != nil { - return oldMsg, &nestedError{"SOAResource.MBox", err} - } - msg = packUint32(msg, r.Serial) - msg = packUint32(msg, r.Refresh) - msg = packUint32(msg, r.Retry) - msg = packUint32(msg, r.Expire) - return packUint32(msg, r.MinTTL), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *SOAResource) GoString() string { - return "dnsmessage.SOAResource{" + - "NS: " + r.NS.GoString() + ", " + - "MBox: " + r.MBox.GoString() + ", " + - "Serial: " + printUint32(r.Serial) + ", " + - "Refresh: " + printUint32(r.Refresh) + ", " + - "Retry: " + printUint32(r.Retry) + ", " + - "Expire: " + printUint32(r.Expire) + ", " + - "MinTTL: " + printUint32(r.MinTTL) + "}" -} - -func unpackSOAResource(msg []byte, off int) (SOAResource, error) { - var ns Name - off, err := ns.unpack(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"NS", err} - } - var mbox Name - if off, err = mbox.unpack(msg, off); err != nil { - return SOAResource{}, &nestedError{"MBox", err} - } - serial, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Serial", err} - } - refresh, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Refresh", err} - } - retry, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Retry", err} - } - expire, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Expire", err} - } - minTTL, _, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"MinTTL", err} - } - return SOAResource{ns, mbox, serial, refresh, retry, expire, minTTL}, nil -} - -// A TXTResource is a TXT Resource record. -type TXTResource struct { - TXT []string -} - -func (r *TXTResource) realType() Type { - return TypeTXT -} - -// pack appends the wire format of the TXTResource to msg. -func (r *TXTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - for _, s := range r.TXT { - var err error - msg, err = packText(msg, s) - if err != nil { - return oldMsg, err - } - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *TXTResource) GoString() string { - s := "dnsmessage.TXTResource{TXT: []string{" - if len(r.TXT) == 0 { - return s + "}}" - } - s += `"` + printString([]byte(r.TXT[0])) - for _, t := range r.TXT[1:] { - s += `", "` + printString([]byte(t)) - } - return s + `"}}` -} - -func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) { - txts := make([]string, 0, 1) - for n := uint16(0); n < length; { - var t string - var err error - if t, off, err = unpackText(msg, off); err != nil { - return TXTResource{}, &nestedError{"text", err} - } - // Check if we got too many bytes. - if length-n < uint16(len(t))+1 { - return TXTResource{}, errCalcLen - } - n += uint16(len(t)) + 1 - txts = append(txts, t) - } - return TXTResource{txts}, nil -} - -// An SRVResource is an SRV Resource record. -type SRVResource struct { - Priority uint16 - Weight uint16 - Port uint16 - Target Name // Not compressed as per RFC 2782. -} - -func (r *SRVResource) realType() Type { - return TypeSRV -} - -// pack appends the wire format of the SRVResource to msg. -func (r *SRVResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - msg = packUint16(msg, r.Priority) - msg = packUint16(msg, r.Weight) - msg = packUint16(msg, r.Port) - msg, err := r.Target.pack(msg, nil, compressionOff) - if err != nil { - return oldMsg, &nestedError{"SRVResource.Target", err} - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *SRVResource) GoString() string { - return "dnsmessage.SRVResource{" + - "Priority: " + printUint16(r.Priority) + ", " + - "Weight: " + printUint16(r.Weight) + ", " + - "Port: " + printUint16(r.Port) + ", " + - "Target: " + r.Target.GoString() + "}" -} - -func unpackSRVResource(msg []byte, off int) (SRVResource, error) { - priority, off, err := unpackUint16(msg, off) - if err != nil { - return SRVResource{}, &nestedError{"Priority", err} - } - weight, off, err := unpackUint16(msg, off) - if err != nil { - return SRVResource{}, &nestedError{"Weight", err} - } - port, off, err := unpackUint16(msg, off) - if err != nil { - return SRVResource{}, &nestedError{"Port", err} - } - var target Name - if _, err := target.unpackCompressed(msg, off, false /* allowCompression */); err != nil { - return SRVResource{}, &nestedError{"Target", err} - } - return SRVResource{priority, weight, port, target}, nil -} - -// An AResource is an A Resource record. -type AResource struct { - A [4]byte -} - -func (r *AResource) realType() Type { - return TypeA -} - -// pack appends the wire format of the AResource to msg. -func (r *AResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return packBytes(msg, r.A[:]), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *AResource) GoString() string { - return "dnsmessage.AResource{" + - "A: [4]byte{" + printByteSlice(r.A[:]) + "}}" -} - -func unpackAResource(msg []byte, off int) (AResource, error) { - var a [4]byte - if _, err := unpackBytes(msg, off, a[:]); err != nil { - return AResource{}, err - } - return AResource{a}, nil -} - -// An AAAAResource is an AAAA Resource record. -type AAAAResource struct { - AAAA [16]byte -} - -func (r *AAAAResource) realType() Type { - return TypeAAAA -} - -// GoString implements fmt.GoStringer.GoString. -func (r *AAAAResource) GoString() string { - return "dnsmessage.AAAAResource{" + - "AAAA: [16]byte{" + printByteSlice(r.AAAA[:]) + "}}" -} - -// pack appends the wire format of the AAAAResource to msg. -func (r *AAAAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return packBytes(msg, r.AAAA[:]), nil -} - -func unpackAAAAResource(msg []byte, off int) (AAAAResource, error) { - var aaaa [16]byte - if _, err := unpackBytes(msg, off, aaaa[:]); err != nil { - return AAAAResource{}, err - } - return AAAAResource{aaaa}, nil -} - -// An OPTResource is an OPT pseudo Resource record. -// -// The pseudo resource record is part of the extension mechanisms for DNS -// as defined in RFC 6891. -type OPTResource struct { - Options []Option -} - -// An Option represents a DNS message option within OPTResource. -// -// The message option is part of the extension mechanisms for DNS as -// defined in RFC 6891. -type Option struct { - Code uint16 // option code - Data []byte -} - -// GoString implements fmt.GoStringer.GoString. -func (o *Option) GoString() string { - return "dnsmessage.Option{" + - "Code: " + printUint16(o.Code) + ", " + - "Data: []byte{" + printByteSlice(o.Data) + "}}" -} - -func (r *OPTResource) realType() Type { - return TypeOPT -} - -func (r *OPTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - for _, opt := range r.Options { - msg = packUint16(msg, opt.Code) - l := uint16(len(opt.Data)) - msg = packUint16(msg, l) - msg = packBytes(msg, opt.Data) - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *OPTResource) GoString() string { - s := "dnsmessage.OPTResource{Options: []dnsmessage.Option{" - if len(r.Options) == 0 { - return s + "}}" - } - s += r.Options[0].GoString() - for _, o := range r.Options[1:] { - s += ", " + o.GoString() - } - return s + "}}" -} - -func unpackOPTResource(msg []byte, off int, length uint16) (OPTResource, error) { - var opts []Option - for oldOff := off; off < oldOff+int(length); { - var err error - var o Option - o.Code, off, err = unpackUint16(msg, off) - if err != nil { - return OPTResource{}, &nestedError{"Code", err} - } - var l uint16 - l, off, err = unpackUint16(msg, off) - if err != nil { - return OPTResource{}, &nestedError{"Data", err} - } - o.Data = make([]byte, l) - if copy(o.Data, msg[off:]) != int(l) { - return OPTResource{}, &nestedError{"Data", errCalcLen} - } - off += int(l) - opts = append(opts, o) - } - return OPTResource{opts}, nil -} - -// An UnknownResource is a catch-all container for unknown record types. -type UnknownResource struct { - Type Type - Data []byte -} - -func (r *UnknownResource) realType() Type { - return r.Type -} - -// pack appends the wire format of the UnknownResource to msg. -func (r *UnknownResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return packBytes(msg, r.Data[:]), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *UnknownResource) GoString() string { - return "dnsmessage.UnknownResource{" + - "Type: " + r.Type.GoString() + ", " + - "Data: []byte{" + printByteSlice(r.Data) + "}}" -} - -func unpackUnknownResource(recordType Type, msg []byte, off int, length uint16) (UnknownResource, error) { - parsed := UnknownResource{ - Type: recordType, - Data: make([]byte, length), - } - if _, err := unpackBytes(msg, off, parsed.Data); err != nil { - return UnknownResource{}, err - } - return parsed, nil -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/message_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/message_test.go deleted file mode 100644 index 3cddfca99..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/dns/dnsmessage/message_test.go +++ /dev/null @@ -1,1601 +0,0 @@ -// Copyright 2009 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 dnsmessage - -import ( - "bytes" - "fmt" - "io/ioutil" - "path/filepath" - "reflect" - "strings" - "testing" -) - -const ( - // This type was selected randomly from the IANA-assigned private use - // range of RR TYPEs. - privateUseType Type = 65362 -) - -func TestPrintPaddedUint8(t *testing.T) { - tests := []struct { - num uint8 - want string - }{ - {0, "000"}, - {1, "001"}, - {9, "009"}, - {10, "010"}, - {99, "099"}, - {100, "100"}, - {124, "124"}, - {104, "104"}, - {120, "120"}, - {255, "255"}, - } - - for _, test := range tests { - if got := printPaddedUint8(test.num); got != test.want { - t.Errorf("got printPaddedUint8(%d) = %s, want = %s", test.num, got, test.want) - } - } -} - -func TestPrintUint8Bytes(t *testing.T) { - tests := []uint8{ - 0, - 1, - 9, - 10, - 99, - 100, - 124, - 104, - 120, - 255, - } - - for _, test := range tests { - if got, want := string(printUint8Bytes(nil, test)), fmt.Sprint(test); got != want { - t.Errorf("got printUint8Bytes(%d) = %s, want = %s", test, got, want) - } - } -} - -func TestPrintUint16(t *testing.T) { - tests := []uint16{ - 65535, - 0, - 1, - 10, - 100, - 1000, - 10000, - 324, - 304, - 320, - } - - for _, test := range tests { - if got, want := printUint16(test), fmt.Sprint(test); got != want { - t.Errorf("got printUint16(%d) = %s, want = %s", test, got, want) - } - } -} - -func TestPrintUint32(t *testing.T) { - tests := []uint32{ - 4294967295, - 65535, - 0, - 1, - 10, - 100, - 1000, - 10000, - 100000, - 1000000, - 10000000, - 100000000, - 1000000000, - 324, - 304, - 320, - } - - for _, test := range tests { - if got, want := printUint32(test), fmt.Sprint(test); got != want { - t.Errorf("got printUint32(%d) = %s, want = %s", test, got, want) - } - } -} - -func mustEDNS0ResourceHeader(l int, extrc RCode, do bool) ResourceHeader { - h := ResourceHeader{Class: ClassINET} - if err := h.SetEDNS0(l, extrc, do); err != nil { - panic(err) - } - return h -} - -func (m *Message) String() string { - s := fmt.Sprintf("Message: %#v\n", &m.Header) - if len(m.Questions) > 0 { - s += "-- Questions\n" - for _, q := range m.Questions { - s += fmt.Sprintf("%#v\n", q) - } - } - if len(m.Answers) > 0 { - s += "-- Answers\n" - for _, a := range m.Answers { - s += fmt.Sprintf("%#v\n", a) - } - } - if len(m.Authorities) > 0 { - s += "-- Authorities\n" - for _, ns := range m.Authorities { - s += fmt.Sprintf("%#v\n", ns) - } - } - if len(m.Additionals) > 0 { - s += "-- Additionals\n" - for _, e := range m.Additionals { - s += fmt.Sprintf("%#v\n", e) - } - } - return s -} - -func TestNameString(t *testing.T) { - want := "foo" - name := MustNewName(want) - if got := fmt.Sprint(name); got != want { - t.Errorf("got fmt.Sprint(%#v) = %s, want = %s", name, got, want) - } -} - -func TestQuestionPackUnpack(t *testing.T) { - want := Question{ - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - } - buf, err := want.pack(make([]byte, 1, 50), map[string]int{}, 1) - if err != nil { - t.Fatal("Question.pack() =", err) - } - var p Parser - p.msg = buf - p.header.questions = 1 - p.section = sectionQuestions - p.off = 1 - got, err := p.Question() - if err != nil { - t.Fatalf("Parser{%q}.Question() = %v", string(buf[1:]), err) - } - if p.off != len(buf) { - t.Errorf("unpacked different amount than packed: got = %d, want = %d", p.off, len(buf)) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("got from Parser.Question() = %+v, want = %+v", got, want) - } -} - -func TestName(t *testing.T) { - tests := []string{ - "", - ".", - "google..com", - "google.com", - "google..com.", - "google.com.", - ".google.com.", - "www..google.com.", - "www.google.com.", - } - - for _, test := range tests { - n, err := NewName(test) - if err != nil { - t.Errorf("NewName(%q) = %v", test, err) - continue - } - if ns := n.String(); ns != test { - t.Errorf("got %#v.String() = %q, want = %q", n, ns, test) - continue - } - } -} - -func TestNamePackUnpack(t *testing.T) { - tests := []struct { - in string - want string - err error - }{ - {"", "", errNonCanonicalName}, - {".", ".", nil}, - {"google..com", "", errNonCanonicalName}, - {"google.com", "", errNonCanonicalName}, - {"google..com.", "", errZeroSegLen}, - {"google.com.", "google.com.", nil}, - {".google.com.", "", errZeroSegLen}, - {"www..google.com.", "", errZeroSegLen}, - {"www.google.com.", "www.google.com.", nil}, - } - - for _, test := range tests { - in := MustNewName(test.in) - want := MustNewName(test.want) - buf, err := in.pack(make([]byte, 0, 30), map[string]int{}, 0) - if err != test.err { - t.Errorf("got %q.pack() = %v, want = %v", test.in, err, test.err) - continue - } - if test.err != nil { - continue - } - var got Name - n, err := got.unpack(buf, 0) - if err != nil { - t.Errorf("%q.unpack() = %v", test.in, err) - continue - } - if n != len(buf) { - t.Errorf( - "unpacked different amount than packed for %q: got = %d, want = %d", - test.in, - n, - len(buf), - ) - } - if got != want { - t.Errorf("unpacking packing of %q: got = %#v, want = %#v", test.in, got, want) - } - } -} - -func TestIncompressibleName(t *testing.T) { - name := MustNewName("example.com.") - compression := map[string]int{} - buf, err := name.pack(make([]byte, 0, 100), compression, 0) - if err != nil { - t.Fatal("first Name.pack() =", err) - } - buf, err = name.pack(buf, compression, 0) - if err != nil { - t.Fatal("second Name.pack() =", err) - } - var n1 Name - off, err := n1.unpackCompressed(buf, 0, false /* allowCompression */) - if err != nil { - t.Fatal("unpacking incompressible name without pointers failed:", err) - } - var n2 Name - if _, err := n2.unpackCompressed(buf, off, false /* allowCompression */); err != errCompressedSRV { - t.Errorf("unpacking compressed incompressible name with pointers: got %v, want = %v", err, errCompressedSRV) - } -} - -func checkErrorPrefix(err error, prefix string) bool { - e, ok := err.(*nestedError) - return ok && e.s == prefix -} - -func TestHeaderUnpackError(t *testing.T) { - wants := []string{ - "id", - "bits", - "questions", - "answers", - "authorities", - "additionals", - } - var buf []byte - var h header - for _, want := range wants { - n, err := h.unpack(buf, 0) - if n != 0 || !checkErrorPrefix(err, want) { - t.Errorf("got header.unpack([%d]byte, 0) = %d, %v, want = 0, %s", len(buf), n, err, want) - } - buf = append(buf, 0, 0) - } -} - -func TestParserStart(t *testing.T) { - const want = "unpacking header" - var p Parser - for i := 0; i <= 1; i++ { - _, err := p.Start([]byte{}) - if !checkErrorPrefix(err, want) { - t.Errorf("got Parser.Start(nil) = _, %v, want = _, %s", err, want) - } - } -} - -func TestResourceNotStarted(t *testing.T) { - tests := []struct { - name string - fn func(*Parser) error - }{ - {"CNAMEResource", func(p *Parser) error { _, err := p.CNAMEResource(); return err }}, - {"MXResource", func(p *Parser) error { _, err := p.MXResource(); return err }}, - {"NSResource", func(p *Parser) error { _, err := p.NSResource(); return err }}, - {"PTRResource", func(p *Parser) error { _, err := p.PTRResource(); return err }}, - {"SOAResource", func(p *Parser) error { _, err := p.SOAResource(); return err }}, - {"TXTResource", func(p *Parser) error { _, err := p.TXTResource(); return err }}, - {"SRVResource", func(p *Parser) error { _, err := p.SRVResource(); return err }}, - {"AResource", func(p *Parser) error { _, err := p.AResource(); return err }}, - {"AAAAResource", func(p *Parser) error { _, err := p.AAAAResource(); return err }}, - {"UnknownResource", func(p *Parser) error { _, err := p.UnknownResource(); return err }}, - } - - for _, test := range tests { - if err := test.fn(&Parser{}); err != ErrNotStarted { - t.Errorf("got Parser.%s() = _ , %v, want = _, %v", test.name, err, ErrNotStarted) - } - } -} - -func TestDNSPackUnpack(t *testing.T) { - wants := []Message{ - { - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Answers: []Resource{}, - Authorities: []Resource{}, - Additionals: []Resource{}, - }, - largeTestMsg(), - } - for i, want := range wants { - b, err := want.Pack() - if err != nil { - t.Fatalf("%d: Message.Pack() = %v", i, err) - } - var got Message - err = got.Unpack(b) - if err != nil { - t.Fatalf("%d: Message.Unapck() = %v", i, err) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("%d: Message.Pack/Unpack() roundtrip: got = %+v, want = %+v", i, &got, &want) - } - } -} - -func TestDNSAppendPackUnpack(t *testing.T) { - wants := []Message{ - { - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Answers: []Resource{}, - Authorities: []Resource{}, - Additionals: []Resource{}, - }, - largeTestMsg(), - } - for i, want := range wants { - b := make([]byte, 2, 514) - b, err := want.AppendPack(b) - if err != nil { - t.Fatalf("%d: Message.AppendPack() = %v", i, err) - } - b = b[2:] - var got Message - err = got.Unpack(b) - if err != nil { - t.Fatalf("%d: Message.Unapck() = %v", i, err) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("%d: Message.AppendPack/Unpack() roundtrip: got = %+v, want = %+v", i, &got, &want) - } - } -} - -func TestSkipAll(t *testing.T) { - msg := largeTestMsg() - buf, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - var p Parser - if _, err := p.Start(buf); err != nil { - t.Fatal("Parser.Start(non-nil) =", err) - } - - tests := []struct { - name string - f func() error - }{ - {"SkipAllQuestions", p.SkipAllQuestions}, - {"SkipAllAnswers", p.SkipAllAnswers}, - {"SkipAllAuthorities", p.SkipAllAuthorities}, - {"SkipAllAdditionals", p.SkipAllAdditionals}, - } - for _, test := range tests { - for i := 1; i <= 3; i++ { - if err := test.f(); err != nil { - t.Errorf("%d: Parser.%s() = %v", i, test.name, err) - } - } - } -} - -func TestSkipEach(t *testing.T) { - msg := smallTestMsg() - - buf, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - var p Parser - if _, err := p.Start(buf); err != nil { - t.Fatal("Parser.Start(non-nil) =", err) - } - - tests := []struct { - name string - f func() error - }{ - {"SkipQuestion", p.SkipQuestion}, - {"SkipAnswer", p.SkipAnswer}, - {"SkipAuthority", p.SkipAuthority}, - {"SkipAdditional", p.SkipAdditional}, - } - for _, test := range tests { - if err := test.f(); err != nil { - t.Errorf("first Parser.%s() = %v, want = nil", test.name, err) - } - if err := test.f(); err != ErrSectionDone { - t.Errorf("second Parser.%s() = %v, want = %v", test.name, err, ErrSectionDone) - } - } -} - -func TestSkipAfterRead(t *testing.T) { - msg := smallTestMsg() - - buf, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - var p Parser - if _, err := p.Start(buf); err != nil { - t.Fatal("Parser.Srart(non-nil) =", err) - } - - tests := []struct { - name string - skip func() error - read func() error - }{ - {"Question", p.SkipQuestion, func() error { _, err := p.Question(); return err }}, - {"Answer", p.SkipAnswer, func() error { _, err := p.Answer(); return err }}, - {"Authority", p.SkipAuthority, func() error { _, err := p.Authority(); return err }}, - {"Additional", p.SkipAdditional, func() error { _, err := p.Additional(); return err }}, - } - for _, test := range tests { - if err := test.read(); err != nil { - t.Errorf("got Parser.%s() = _, %v, want = _, nil", test.name, err) - } - if err := test.skip(); err != ErrSectionDone { - t.Errorf("got Parser.Skip%s() = %v, want = %v", test.name, err, ErrSectionDone) - } - } -} - -func TestSkipNotStarted(t *testing.T) { - var p Parser - - tests := []struct { - name string - f func() error - }{ - {"SkipAllQuestions", p.SkipAllQuestions}, - {"SkipAllAnswers", p.SkipAllAnswers}, - {"SkipAllAuthorities", p.SkipAllAuthorities}, - {"SkipAllAdditionals", p.SkipAllAdditionals}, - } - for _, test := range tests { - if err := test.f(); err != ErrNotStarted { - t.Errorf("got Parser.%s() = %v, want = %v", test.name, err, ErrNotStarted) - } - } -} - -func TestTooManyRecords(t *testing.T) { - const recs = int(^uint16(0)) + 1 - tests := []struct { - name string - msg Message - want error - }{ - { - "Questions", - Message{ - Questions: make([]Question, recs), - }, - errTooManyQuestions, - }, - { - "Answers", - Message{ - Answers: make([]Resource, recs), - }, - errTooManyAnswers, - }, - { - "Authorities", - Message{ - Authorities: make([]Resource, recs), - }, - errTooManyAuthorities, - }, - { - "Additionals", - Message{ - Additionals: make([]Resource, recs), - }, - errTooManyAdditionals, - }, - } - - for _, test := range tests { - if _, got := test.msg.Pack(); got != test.want { - t.Errorf("got Message.Pack() for %d %s = %v, want = %v", recs, test.name, got, test.want) - } - } -} - -func TestVeryLongTxt(t *testing.T) { - want := Resource{ - ResourceHeader{ - Name: MustNewName("foo.bar.example.com."), - Type: TypeTXT, - Class: ClassINET, - }, - &TXTResource{[]string{ - "", - "", - "foo bar", - "", - "www.example.com", - "www.example.com.", - strings.Repeat(".", 255), - }}, - } - buf, err := want.pack(make([]byte, 0, 8000), map[string]int{}, 0) - if err != nil { - t.Fatal("Resource.pack() =", err) - } - var got Resource - off, err := got.Header.unpack(buf, 0) - if err != nil { - t.Fatal("ResourceHeader.unpack() =", err) - } - body, n, err := unpackResourceBody(buf, off, got.Header) - if err != nil { - t.Fatal("unpackResourceBody() =", err) - } - got.Body = body - if n != len(buf) { - t.Errorf("unpacked different amount than packed: got = %d, want = %d", n, len(buf)) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("Resource.pack/unpack() roundtrip: got = %#v, want = %#v", got, want) - } -} - -func TestTooLongTxt(t *testing.T) { - rb := TXTResource{[]string{strings.Repeat(".", 256)}} - if _, err := rb.pack(make([]byte, 0, 8000), map[string]int{}, 0); err != errStringTooLong { - t.Errorf("packing TXTResource with 256 character string: got err = %v, want = %v", err, errStringTooLong) - } -} - -func TestStartAppends(t *testing.T) { - buf := make([]byte, 2, 514) - wantBuf := []byte{4, 44} - copy(buf, wantBuf) - - b := NewBuilder(buf, Header{}) - b.EnableCompression() - - buf, err := b.Finish() - if err != nil { - t.Fatal("Builder.Finish() =", err) - } - if got, want := len(buf), headerLen+2; got != want { - t.Errorf("got len(buf) = %d, want = %d", got, want) - } - if string(buf[:2]) != string(wantBuf) { - t.Errorf("original data not preserved, got = %#v, want = %#v", buf[:2], wantBuf) - } -} - -func TestStartError(t *testing.T) { - tests := []struct { - name string - fn func(*Builder) error - }{ - {"Questions", func(b *Builder) error { return b.StartQuestions() }}, - {"Answers", func(b *Builder) error { return b.StartAnswers() }}, - {"Authorities", func(b *Builder) error { return b.StartAuthorities() }}, - {"Additionals", func(b *Builder) error { return b.StartAdditionals() }}, - } - - envs := []struct { - name string - fn func() *Builder - want error - }{ - {"sectionNotStarted", func() *Builder { return &Builder{section: sectionNotStarted} }, ErrNotStarted}, - {"sectionDone", func() *Builder { return &Builder{section: sectionDone} }, ErrSectionDone}, - } - - for _, env := range envs { - for _, test := range tests { - if got := test.fn(env.fn()); got != env.want { - t.Errorf("got Builder{%s}.Start%s() = %v, want = %v", env.name, test.name, got, env.want) - } - } - } -} - -func TestBuilderResourceError(t *testing.T) { - tests := []struct { - name string - fn func(*Builder) error - }{ - {"CNAMEResource", func(b *Builder) error { return b.CNAMEResource(ResourceHeader{}, CNAMEResource{}) }}, - {"MXResource", func(b *Builder) error { return b.MXResource(ResourceHeader{}, MXResource{}) }}, - {"NSResource", func(b *Builder) error { return b.NSResource(ResourceHeader{}, NSResource{}) }}, - {"PTRResource", func(b *Builder) error { return b.PTRResource(ResourceHeader{}, PTRResource{}) }}, - {"SOAResource", func(b *Builder) error { return b.SOAResource(ResourceHeader{}, SOAResource{}) }}, - {"TXTResource", func(b *Builder) error { return b.TXTResource(ResourceHeader{}, TXTResource{}) }}, - {"SRVResource", func(b *Builder) error { return b.SRVResource(ResourceHeader{}, SRVResource{}) }}, - {"AResource", func(b *Builder) error { return b.AResource(ResourceHeader{}, AResource{}) }}, - {"AAAAResource", func(b *Builder) error { return b.AAAAResource(ResourceHeader{}, AAAAResource{}) }}, - {"OPTResource", func(b *Builder) error { return b.OPTResource(ResourceHeader{}, OPTResource{}) }}, - {"UnknownResource", func(b *Builder) error { return b.UnknownResource(ResourceHeader{}, UnknownResource{}) }}, - } - - envs := []struct { - name string - fn func() *Builder - want error - }{ - {"sectionNotStarted", func() *Builder { return &Builder{section: sectionNotStarted} }, ErrNotStarted}, - {"sectionHeader", func() *Builder { return &Builder{section: sectionHeader} }, ErrNotStarted}, - {"sectionQuestions", func() *Builder { return &Builder{section: sectionQuestions} }, ErrNotStarted}, - {"sectionDone", func() *Builder { return &Builder{section: sectionDone} }, ErrSectionDone}, - } - - for _, env := range envs { - for _, test := range tests { - if got := test.fn(env.fn()); got != env.want { - t.Errorf("got Builder{%s}.%s() = %v, want = %v", env.name, test.name, got, env.want) - } - } - } -} - -func TestFinishError(t *testing.T) { - var b Builder - want := ErrNotStarted - if _, got := b.Finish(); got != want { - t.Errorf("got Builder.Finish() = %v, want = %v", got, want) - } -} - -func TestBuilder(t *testing.T) { - msg := largeTestMsg() - want, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - - b := NewBuilder(nil, msg.Header) - b.EnableCompression() - - if err := b.StartQuestions(); err != nil { - t.Fatal("Builder.StartQuestions() =", err) - } - for _, q := range msg.Questions { - if err := b.Question(q); err != nil { - t.Fatalf("Builder.Question(%#v) = %v", q, err) - } - } - - if err := b.StartAnswers(); err != nil { - t.Fatal("Builder.StartAnswers() =", err) - } - for _, a := range msg.Answers { - switch a.Header.Type { - case TypeA: - if err := b.AResource(a.Header, *a.Body.(*AResource)); err != nil { - t.Fatalf("Builder.AResource(%#v) = %v", a, err) - } - case TypeNS: - if err := b.NSResource(a.Header, *a.Body.(*NSResource)); err != nil { - t.Fatalf("Builder.NSResource(%#v) = %v", a, err) - } - case TypeCNAME: - if err := b.CNAMEResource(a.Header, *a.Body.(*CNAMEResource)); err != nil { - t.Fatalf("Builder.CNAMEResource(%#v) = %v", a, err) - } - case TypeSOA: - if err := b.SOAResource(a.Header, *a.Body.(*SOAResource)); err != nil { - t.Fatalf("Builder.SOAResource(%#v) = %v", a, err) - } - case TypePTR: - if err := b.PTRResource(a.Header, *a.Body.(*PTRResource)); err != nil { - t.Fatalf("Builder.PTRResource(%#v) = %v", a, err) - } - case TypeMX: - if err := b.MXResource(a.Header, *a.Body.(*MXResource)); err != nil { - t.Fatalf("Builder.MXResource(%#v) = %v", a, err) - } - case TypeTXT: - if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { - t.Fatalf("Builder.TXTResource(%#v) = %v", a, err) - } - case TypeAAAA: - if err := b.AAAAResource(a.Header, *a.Body.(*AAAAResource)); err != nil { - t.Fatalf("Builder.AAAAResource(%#v) = %v", a, err) - } - case TypeSRV: - if err := b.SRVResource(a.Header, *a.Body.(*SRVResource)); err != nil { - t.Fatalf("Builder.SRVResource(%#v) = %v", a, err) - } - case privateUseType: - if err := b.UnknownResource(a.Header, *a.Body.(*UnknownResource)); err != nil { - t.Fatalf("Builder.UnknownResource(%#v) = %v", a, err) - } - } - } - - if err := b.StartAuthorities(); err != nil { - t.Fatal("Builder.StartAuthorities() =", err) - } - for _, a := range msg.Authorities { - if err := b.NSResource(a.Header, *a.Body.(*NSResource)); err != nil { - t.Fatalf("Builder.NSResource(%#v) = %v", a, err) - } - } - - if err := b.StartAdditionals(); err != nil { - t.Fatal("Builder.StartAdditionals() =", err) - } - for _, a := range msg.Additionals { - switch a.Body.(type) { - case *TXTResource: - if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { - t.Fatalf("Builder.TXTResource(%#v) = %v", a, err) - } - case *OPTResource: - if err := b.OPTResource(a.Header, *a.Body.(*OPTResource)); err != nil { - t.Fatalf("Builder.OPTResource(%#v) = %v", a, err) - } - } - } - - got, err := b.Finish() - if err != nil { - t.Fatal("Builder.Finish() =", err) - } - if !bytes.Equal(got, want) { - t.Fatalf("got from Builder.Finish() = %#v\nwant = %#v", got, want) - } -} - -func TestResourcePack(t *testing.T) { - for _, tt := range []struct { - m Message - err error - }{ - { - Message{ - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Answers: []Resource{{ResourceHeader{}, nil}}, - }, - &nestedError{"packing Answer", errNilResouceBody}, - }, - { - Message{ - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Authorities: []Resource{{ResourceHeader{}, (*NSResource)(nil)}}, - }, - &nestedError{"packing Authority", - &nestedError{"ResourceHeader", - &nestedError{"Name", errNonCanonicalName}, - }, - }, - }, - { - Message{ - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - }, - }, - Additionals: []Resource{{ResourceHeader{}, nil}}, - }, - &nestedError{"packing Additional", errNilResouceBody}, - }, - } { - _, err := tt.m.Pack() - if !reflect.DeepEqual(err, tt.err) { - t.Errorf("got Message{%v}.Pack() = %v, want %v", tt.m, err, tt.err) - } - } -} - -func TestResourcePackLength(t *testing.T) { - r := Resource{ - ResourceHeader{ - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 2}}, - } - - hb, _, err := r.Header.pack(nil, nil, 0) - if err != nil { - t.Fatal("ResourceHeader.pack() =", err) - } - buf := make([]byte, 0, len(hb)) - buf, err = r.pack(buf, nil, 0) - if err != nil { - t.Fatal("Resource.pack() =", err) - } - - var hdr ResourceHeader - if _, err := hdr.unpack(buf, 0); err != nil { - t.Fatal("ResourceHeader.unpack() =", err) - } - - if got, want := int(hdr.Length), len(buf)-len(hb); got != want { - t.Errorf("got hdr.Length = %d, want = %d", got, want) - } -} - -func TestOptionPackUnpack(t *testing.T) { - for _, tt := range []struct { - name string - w []byte // wire format of m.Additionals - m Message - dnssecOK bool - extRCode RCode - }{ - { - name: "without EDNS(0) options", - w: []byte{ - 0x00, 0x00, 0x29, 0x10, 0x00, 0xfe, 0x00, 0x80, - 0x00, 0x00, 0x00, - }, - m: Message{ - Header: Header{RCode: RCodeFormatError}, - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - }, - }, - Additionals: []Resource{ - { - mustEDNS0ResourceHeader(4096, 0xfe0|RCodeFormatError, true), - &OPTResource{}, - }, - }, - }, - dnssecOK: true, - extRCode: 0xfe0 | RCodeFormatError, - }, - { - name: "with EDNS(0) options", - w: []byte{ - 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x0b, 0x00, 0x02, 0x12, 0x34, - }, - m: Message{ - Header: Header{RCode: RCodeServerFailure}, - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Additionals: []Resource{ - { - mustEDNS0ResourceHeader(4096, 0xff0|RCodeServerFailure, false), - &OPTResource{ - Options: []Option{ - { - Code: 12, // see RFC 7828 - Data: []byte{0x00, 0x00}, - }, - { - Code: 11, // see RFC 7830 - Data: []byte{0x12, 0x34}, - }, - }, - }, - }, - }, - }, - dnssecOK: false, - extRCode: 0xff0 | RCodeServerFailure, - }, - { - // Containing multiple OPT resources in a - // message is invalid, but it's necessary for - // protocol conformance testing. - name: "with multiple OPT resources", - w: []byte{ - 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x02, 0x12, - 0x34, 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x02, - 0x00, 0x00, - }, - m: Message{ - Header: Header{RCode: RCodeNameError}, - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Additionals: []Resource{ - { - mustEDNS0ResourceHeader(4096, 0xff0|RCodeNameError, false), - &OPTResource{ - Options: []Option{ - { - Code: 11, // see RFC 7830 - Data: []byte{0x12, 0x34}, - }, - }, - }, - }, - { - mustEDNS0ResourceHeader(4096, 0xff0|RCodeNameError, false), - &OPTResource{ - Options: []Option{ - { - Code: 12, // see RFC 7828 - Data: []byte{0x00, 0x00}, - }, - }, - }, - }, - }, - }, - }, - } { - w, err := tt.m.Pack() - if err != nil { - t.Errorf("Message.Pack() for %s = %v", tt.name, err) - continue - } - if !bytes.Equal(w[len(w)-len(tt.w):], tt.w) { - t.Errorf("got Message.Pack() for %s = %#v, want %#v", tt.name, w[len(w)-len(tt.w):], tt.w) - continue - } - var m Message - if err := m.Unpack(w); err != nil { - t.Errorf("Message.Unpack() for %s = %v", tt.name, err) - continue - } - if !reflect.DeepEqual(m.Additionals, tt.m.Additionals) { - t.Errorf("got Message.Pack/Unpack() roundtrip for %s = %+v, want %+v", tt.name, m, tt.m) - continue - } - } -} - -func smallTestMsgWithUnknownResource() Message { - return Message{ - Questions: []Question{}, - Answers: []Resource{ - { - Header: ResourceHeader{ - Name: MustNewName("."), - Type: privateUseType, - Class: ClassINET, - TTL: uint32(123), - }, - Body: &UnknownResource{ - // The realType() method is called, when - // packing, so Type must match the type - // claimed by the Header above. - Type: privateUseType, - Data: []byte{42, 42, 42, 42}, - }, - }, - }, - } -} - -func TestUnknownPackUnpack(t *testing.T) { - msg := smallTestMsgWithUnknownResource() - packed, err := msg.Pack() - if err != nil { - t.Fatalf("Failed to pack UnknownResource: %v", err) - } - - var receivedMsg Message - err = receivedMsg.Unpack(packed) - if err != nil { - t.Fatalf("Failed to unpack UnknownResource: %v", err) - } - - if len(receivedMsg.Answers) != 1 { - t.Fatalf("Got %d answers, wanted 1", len(receivedMsg.Answers)) - } - - unknownResource, ok := receivedMsg.Answers[0].Body.(*UnknownResource) - if !ok { - t.Fatalf("Parsed a %T, wanted an UnknownResource", receivedMsg.Answers[0].Body) - } - - wantBody := msg.Answers[0].Body - if !reflect.DeepEqual(wantBody, unknownResource) { - t.Fatalf("Unpacked resource does not match: %v vs %v", wantBody, unknownResource) - } -} - -func TestParseUnknownResource(t *testing.T) { - msg := smallTestMsgWithUnknownResource() - packed, err := msg.Pack() - if err != nil { - t.Fatalf("Failed to pack UnknownResource: %v", err) - } - - var p Parser - if _, err = p.Start(packed); err != nil { - t.Fatalf("Parser failed to start: %s", err) - } - if _, err = p.AllQuestions(); err != nil { - t.Fatalf("Failed to parse questions: %s", err) - } - - parsedHeader, err := p.AnswerHeader() - if err != nil { - t.Fatalf("Error reading answer header: %s", err) - } - wantHeader := msg.Answers[0].Header - if !reflect.DeepEqual(wantHeader, parsedHeader) { - t.Fatalf("Parsed header does not match: %v vs %v", wantHeader, wantHeader) - } - - parsedUnknownResource, err := p.UnknownResource() - if err != nil { - t.Fatalf("Failed to parse UnknownResource: %s", err) - } - wantBody := msg.Answers[0].Body - if !reflect.DeepEqual(wantBody, &parsedUnknownResource) { - t.Fatalf("Parsed resource does not match: %v vs %v", wantBody, &parsedUnknownResource) - } - - // Finish parsing the rest of the message to ensure that - // (*Parser).UnknownResource() leaves the parser in a consistent state. - if _, err = p.AnswerHeader(); err != ErrSectionDone { - t.Fatalf("Answer section should be fully parsed") - } - if _, err = p.AllAuthorities(); err != nil { - t.Fatalf("Failed to parse authorities: %s", err) - } - if _, err = p.AllAdditionals(); err != nil { - t.Fatalf("Failed to parse additionals: %s", err) - } -} - -// TestGoString tests that Message.GoString produces Go code that compiles to -// reproduce the Message. -// -// This test was produced as follows: -// 1. Run (*Message).GoString on largeTestMsg(). -// 2. Remove "dnsmessage." from the output. -// 3. Paste the result in the test to store it in msg. -// 4. Also put the original output in the test to store in want. -func TestGoString(t *testing.T) { - msg := Message{Header: Header{ID: 0, Response: true, OpCode: 0, Authoritative: true, Truncated: false, RecursionDesired: false, RecursionAvailable: false, RCode: RCodeSuccess}, Questions: []Question{Question{Name: MustNewName("foo.bar.example.com."), Type: TypeA, Class: ClassINET}}, Answers: []Resource{Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeA, Class: ClassINET, TTL: 0, Length: 0}, Body: &AResource{A: [4]byte{127, 0, 0, 1}}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeA, Class: ClassINET, TTL: 0, Length: 0}, Body: &AResource{A: [4]byte{127, 0, 0, 2}}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeAAAA, Class: ClassINET, TTL: 0, Length: 0}, Body: &AAAAResource{AAAA: [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeCNAME, Class: ClassINET, TTL: 0, Length: 0}, Body: &CNAMEResource{CNAME: MustNewName("alias.example.com.")}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeSOA, Class: ClassINET, TTL: 0, Length: 0}, Body: &SOAResource{NS: MustNewName("ns1.example.com."), MBox: MustNewName("mb.example.com."), Serial: 1, Refresh: 2, Retry: 3, Expire: 4, MinTTL: 5}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypePTR, Class: ClassINET, TTL: 0, Length: 0}, Body: &PTRResource{PTR: MustNewName("ptr.example.com.")}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeMX, Class: ClassINET, TTL: 0, Length: 0}, Body: &MXResource{Pref: 7, MX: MustNewName("mx.example.com.")}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeSRV, Class: ClassINET, TTL: 0, Length: 0}, Body: &SRVResource{Priority: 8, Weight: 9, Port: 11, Target: MustNewName("srv.example.com.")}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: 65362, Class: ClassINET, TTL: 0, Length: 0}, Body: &UnknownResource{Type: 65362, Data: []byte{42, 0, 43, 44}}}}, Authorities: []Resource{Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeNS, Class: ClassINET, TTL: 0, Length: 0}, Body: &NSResource{NS: MustNewName("ns1.example.com.")}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeNS, Class: ClassINET, TTL: 0, Length: 0}, Body: &NSResource{NS: MustNewName("ns2.example.com.")}}}, Additionals: []Resource{Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeTXT, Class: ClassINET, TTL: 0, Length: 0}, Body: &TXTResource{TXT: []string{"So Long\x2c and Thanks for All the Fish"}}}, Resource{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeTXT, Class: ClassINET, TTL: 0, Length: 0}, Body: &TXTResource{TXT: []string{"Hamster Huey and the Gooey Kablooie"}}}, Resource{Header: ResourceHeader{Name: MustNewName("."), Type: TypeOPT, Class: 4096, TTL: 4261412864, Length: 0}, Body: &OPTResource{Options: []Option{Option{Code: 10, Data: []byte{1, 35, 69, 103, 137, 171, 205, 239}}}}}}} - - if !reflect.DeepEqual(msg, largeTestMsg()) { - t.Error("Message.GoString lost information or largeTestMsg changed: msg != largeTestMsg()") - } - got := msg.GoString() - - want := `dnsmessage.Message{Header: dnsmessage.Header{ID: 0, Response: true, OpCode: 0, Authoritative: true, Truncated: false, RecursionDesired: false, RecursionAvailable: false, RCode: dnsmessage.RCodeSuccess}, Questions: []dnsmessage.Question{dnsmessage.Question{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET}}, Answers: []dnsmessage.Resource{dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 1}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 2}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeAAAA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.AAAAResource{AAAA: [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeCNAME, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.CNAMEResource{CNAME: dnsmessage.MustNewName("alias.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeSOA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.SOAResource{NS: dnsmessage.MustNewName("ns1.example.com."), MBox: dnsmessage.MustNewName("mb.example.com."), Serial: 1, Refresh: 2, Retry: 3, Expire: 4, MinTTL: 5}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypePTR, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.PTRResource{PTR: dnsmessage.MustNewName("ptr.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeMX, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.MXResource{Pref: 7, MX: dnsmessage.MustNewName("mx.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeSRV, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.SRVResource{Priority: 8, Weight: 9, Port: 11, Target: dnsmessage.MustNewName("srv.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: 65362, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.UnknownResource{Type: 65362, Data: []byte{42, 0, 43, 44}}}}, Authorities: []dnsmessage.Resource{dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeNS, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.NSResource{NS: dnsmessage.MustNewName("ns1.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeNS, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.NSResource{NS: dnsmessage.MustNewName("ns2.example.com.")}}}, Additionals: []dnsmessage.Resource{dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeTXT, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.TXTResource{TXT: []string{"So Long\x2c and Thanks for All the Fish"}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeTXT, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.TXTResource{TXT: []string{"Hamster Huey and the Gooey Kablooie"}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("."), Type: dnsmessage.TypeOPT, Class: 4096, TTL: 4261412864, Length: 0}, Body: &dnsmessage.OPTResource{Options: []dnsmessage.Option{dnsmessage.Option{Code: 10, Data: []byte{1, 35, 69, 103, 137, 171, 205, 239}}}}}}}` - - if got != want { - t.Errorf("got msg1.GoString() = %s\nwant = %s", got, want) - } -} - -func benchmarkParsingSetup() ([]byte, error) { - name := MustNewName("foo.bar.example.com.") - msg := Message{ - Header: Header{Response: true, Authoritative: true}, - Questions: []Question{ - { - Name: name, - Type: TypeA, - Class: ClassINET, - }, - }, - Answers: []Resource{ - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &AResource{[4]byte{}}, - }, - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &AAAAResource{[16]byte{}}, - }, - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &CNAMEResource{name}, - }, - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &NSResource{name}, - }, - }, - } - - buf, err := msg.Pack() - if err != nil { - return nil, fmt.Errorf("Message.Pack() = %v", err) - } - return buf, nil -} - -func benchmarkParsing(tb testing.TB, buf []byte) { - var p Parser - if _, err := p.Start(buf); err != nil { - tb.Fatal("Parser.Start(non-nil) =", err) - } - - for { - _, err := p.Question() - if err == ErrSectionDone { - break - } - if err != nil { - tb.Fatal("Parser.Question() =", err) - } - } - - for { - h, err := p.AnswerHeader() - if err == ErrSectionDone { - break - } - if err != nil { - tb.Fatal("Parser.AnswerHeader() =", err) - } - - switch h.Type { - case TypeA: - if _, err := p.AResource(); err != nil { - tb.Fatal("Parser.AResource() =", err) - } - case TypeAAAA: - if _, err := p.AAAAResource(); err != nil { - tb.Fatal("Parser.AAAAResource() =", err) - } - case TypeCNAME: - if _, err := p.CNAMEResource(); err != nil { - tb.Fatal("Parser.CNAMEResource() =", err) - } - case TypeNS: - if _, err := p.NSResource(); err != nil { - tb.Fatal("Parser.NSResource() =", err) - } - case TypeOPT: - if _, err := p.OPTResource(); err != nil { - tb.Fatal("Parser.OPTResource() =", err) - } - default: - tb.Fatalf("got unknown type: %T", h) - } - } -} - -func BenchmarkParsing(b *testing.B) { - buf, err := benchmarkParsingSetup() - if err != nil { - b.Fatal(err) - } - - b.ReportAllocs() - for i := 0; i < b.N; i++ { - benchmarkParsing(b, buf) - } -} - -func TestParsingAllocs(t *testing.T) { - buf, err := benchmarkParsingSetup() - if err != nil { - t.Fatal(err) - } - - if allocs := testing.AllocsPerRun(100, func() { benchmarkParsing(t, buf) }); allocs > 0.5 { - t.Errorf("allocations during parsing: got = %f, want ~0", allocs) - } -} - -func benchmarkBuildingSetup() (Name, []byte) { - name := MustNewName("foo.bar.example.com.") - buf := make([]byte, 0, packStartingCap) - return name, buf -} - -func benchmarkBuilding(tb testing.TB, name Name, buf []byte) { - bld := NewBuilder(buf, Header{Response: true, Authoritative: true}) - - if err := bld.StartQuestions(); err != nil { - tb.Fatal("Builder.StartQuestions() =", err) - } - q := Question{ - Name: name, - Type: TypeA, - Class: ClassINET, - } - if err := bld.Question(q); err != nil { - tb.Fatalf("Builder.Question(%+v) = %v", q, err) - } - - hdr := ResourceHeader{ - Name: name, - Class: ClassINET, - } - if err := bld.StartAnswers(); err != nil { - tb.Fatal("Builder.StartQuestions() =", err) - } - - ar := AResource{[4]byte{}} - if err := bld.AResource(hdr, ar); err != nil { - tb.Fatalf("Builder.AResource(%+v, %+v) = %v", hdr, ar, err) - } - - aaar := AAAAResource{[16]byte{}} - if err := bld.AAAAResource(hdr, aaar); err != nil { - tb.Fatalf("Builder.AAAAResource(%+v, %+v) = %v", hdr, aaar, err) - } - - cnr := CNAMEResource{name} - if err := bld.CNAMEResource(hdr, cnr); err != nil { - tb.Fatalf("Builder.CNAMEResource(%+v, %+v) = %v", hdr, cnr, err) - } - - nsr := NSResource{name} - if err := bld.NSResource(hdr, nsr); err != nil { - tb.Fatalf("Builder.NSResource(%+v, %+v) = %v", hdr, nsr, err) - } - - extrc := 0xfe0 | RCodeNotImplemented - if err := (&hdr).SetEDNS0(4096, extrc, true); err != nil { - tb.Fatalf("ResourceHeader.SetEDNS0(4096, %#x, true) = %v", extrc, err) - } - optr := OPTResource{} - if err := bld.OPTResource(hdr, optr); err != nil { - tb.Fatalf("Builder.OPTResource(%+v, %+v) = %v", hdr, optr, err) - } - - if _, err := bld.Finish(); err != nil { - tb.Fatal("Builder.Finish() =", err) - } -} - -func BenchmarkBuilding(b *testing.B) { - name, buf := benchmarkBuildingSetup() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - benchmarkBuilding(b, name, buf) - } -} - -func TestBuildingAllocs(t *testing.T) { - name, buf := benchmarkBuildingSetup() - if allocs := testing.AllocsPerRun(100, func() { benchmarkBuilding(t, name, buf) }); allocs > 0.5 { - t.Errorf("allocations during building: got = %f, want ~0", allocs) - } -} - -func smallTestMsg() Message { - name := MustNewName("example.com.") - return Message{ - Header: Header{Response: true, Authoritative: true}, - Questions: []Question{ - { - Name: name, - Type: TypeA, - Class: ClassINET, - }, - }, - Answers: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - }, - Authorities: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - }, - Additionals: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - }, - } -} - -func BenchmarkPack(b *testing.B) { - msg := largeTestMsg() - - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - if _, err := msg.Pack(); err != nil { - b.Fatal("Message.Pack() =", err) - } - } -} - -func BenchmarkAppendPack(b *testing.B) { - msg := largeTestMsg() - buf := make([]byte, 0, packStartingCap) - - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - if _, err := msg.AppendPack(buf[:0]); err != nil { - b.Fatal("Message.AppendPack() = ", err) - } - } -} - -func largeTestMsg() Message { - name := MustNewName("foo.bar.example.com.") - return Message{ - Header: Header{Response: true, Authoritative: true}, - Questions: []Question{ - { - Name: name, - Type: TypeA, - Class: ClassINET, - }, - }, - Answers: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 2}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeAAAA, - Class: ClassINET, - }, - &AAAAResource{[16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeCNAME, - Class: ClassINET, - }, - &CNAMEResource{MustNewName("alias.example.com.")}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeSOA, - Class: ClassINET, - }, - &SOAResource{ - NS: MustNewName("ns1.example.com."), - MBox: MustNewName("mb.example.com."), - Serial: 1, - Refresh: 2, - Retry: 3, - Expire: 4, - MinTTL: 5, - }, - }, - { - ResourceHeader{ - Name: name, - Type: TypePTR, - Class: ClassINET, - }, - &PTRResource{MustNewName("ptr.example.com.")}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeMX, - Class: ClassINET, - }, - &MXResource{ - 7, - MustNewName("mx.example.com."), - }, - }, - { - ResourceHeader{ - Name: name, - Type: TypeSRV, - Class: ClassINET, - }, - &SRVResource{ - 8, - 9, - 11, - MustNewName("srv.example.com."), - }, - }, - { - ResourceHeader{ - Name: name, - Type: privateUseType, - Class: ClassINET, - }, - &UnknownResource{ - Type: privateUseType, - Data: []byte{42, 0, 43, 44}, - }, - }, - }, - Authorities: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeNS, - Class: ClassINET, - }, - &NSResource{MustNewName("ns1.example.com.")}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeNS, - Class: ClassINET, - }, - &NSResource{MustNewName("ns2.example.com.")}, - }, - }, - Additionals: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeTXT, - Class: ClassINET, - }, - &TXTResource{[]string{"So Long, and Thanks for All the Fish"}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeTXT, - Class: ClassINET, - }, - &TXTResource{[]string{"Hamster Huey and the Gooey Kablooie"}}, - }, - { - mustEDNS0ResourceHeader(4096, 0xfe0|RCodeSuccess, false), - &OPTResource{ - Options: []Option{ - { - Code: 10, // see RFC 7873 - Data: []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - }, - }, - }, - }, - }, - } -} - -// This package is imported by the standard library net package -// and therefore must not use fmt. We'll catch a mistake when vendored -// into the standard library, but this test catches the mistake earlier. -func TestNoFmt(t *testing.T) { - files, err := filepath.Glob("*.go") - if err != nil { - t.Fatal(err) - } - for _, file := range files { - if strings.HasSuffix(file, "_test.go") { - continue - } - // Could use something complex like go/build or x/tools/go/packages, - // but there's no reason for "fmt" to appear (in quotes) in the source - // otherwise, so just use a simple substring search. - data, err := ioutil.ReadFile(file) - if err != nil { - t.Fatal(err) - } - if bytes.Contains(data, []byte(`"fmt"`)) { - t.Errorf(`%s: cannot import "fmt"`, file) - } - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/go.mod b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/go.mod deleted file mode 100644 index 7fd3c796a..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module golang.org/x/net - -go 1.17 - -require ( - golang.org/x/sys v0.0.0-20210423082822-04245dca01da - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 - golang.org/x/text v0.3.6 -) diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/go.sum b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/go.sum deleted file mode 100644 index 634dd68c5..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/go.sum +++ /dev/null @@ -1,8 +0,0 @@ -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/atom.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/atom.go deleted file mode 100644 index cd0a8ac15..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/atom.go +++ /dev/null @@ -1,78 +0,0 @@ -// 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) -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/atom_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/atom_test.go deleted file mode 100644 index 6e33704dd..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/atom_test.go +++ /dev/null @@ -1,109 +0,0 @@ -// 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 - -import ( - "sort" - "testing" -) - -func TestKnown(t *testing.T) { - for _, s := range testAtomList { - if atom := Lookup([]byte(s)); atom.String() != s { - t.Errorf("Lookup(%q) = %#x (%q)", s, uint32(atom), atom.String()) - } - } -} - -func TestHits(t *testing.T) { - for _, a := range table { - if a == 0 { - continue - } - got := Lookup([]byte(a.String())) - if got != a { - t.Errorf("Lookup(%q) = %#x, want %#x", a.String(), uint32(got), uint32(a)) - } - } -} - -func TestMisses(t *testing.T) { - testCases := []string{ - "", - "\x00", - "\xff", - "A", - "DIV", - "Div", - "dIV", - "aa", - "a\x00", - "ab", - "abb", - "abbr0", - "abbr ", - " abbr", - " a", - "acceptcharset", - "acceptCharset", - "accept_charset", - "h0", - "h1h2", - "h7", - "onClick", - "λ", - // The following string has the same hash (0xa1d7fab7) as "onmouseover". - "\x00\x00\x00\x00\x00\x50\x18\xae\x38\xd0\xb7", - } - for _, tc := range testCases { - got := Lookup([]byte(tc)) - if got != 0 { - t.Errorf("Lookup(%q): got %d, want 0", tc, got) - } - } -} - -func TestForeignObject(t *testing.T) { - const ( - afo = Foreignobject - afO = ForeignObject - sfo = "foreignobject" - sfO = "foreignObject" - ) - if got := Lookup([]byte(sfo)); got != afo { - t.Errorf("Lookup(%q): got %#v, want %#v", sfo, got, afo) - } - if got := Lookup([]byte(sfO)); got != afO { - t.Errorf("Lookup(%q): got %#v, want %#v", sfO, got, afO) - } - if got := afo.String(); got != sfo { - t.Errorf("Atom(%#v).String(): got %q, want %q", afo, got, sfo) - } - if got := afO.String(); got != sfO { - t.Errorf("Atom(%#v).String(): got %q, want %q", afO, got, sfO) - } -} - -func BenchmarkLookup(b *testing.B) { - sortedTable := make([]string, 0, len(table)) - for _, a := range table { - if a != 0 { - sortedTable = append(sortedTable, a.String()) - } - } - sort.Strings(sortedTable) - - x := make([][]byte, 1000) - for i := range x { - x[i] = []byte(sortedTable[i%len(sortedTable)]) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - for _, s := range x { - Lookup(s) - } - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/gen.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/gen.go deleted file mode 100644 index 5b0aaf737..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/gen.go +++ /dev/null @@ -1,713 +0,0 @@ -// 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. - -//go:build ignore -// +build ignore - -//go:generate go run gen.go -//go:generate go run gen.go -test - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "io/ioutil" - "math/rand" - "os" - "sort" - "strings" -) - -// identifier converts s to a Go exported identifier. -// It converts "div" to "Div" and "accept-charset" to "AcceptCharset". -func identifier(s string) string { - b := make([]byte, 0, len(s)) - cap := true - for _, c := range s { - if c == '-' { - cap = true - continue - } - if cap && 'a' <= c && c <= 'z' { - c -= 'a' - 'A' - } - cap = false - b = append(b, byte(c)) - } - return string(b) -} - -var test = flag.Bool("test", false, "generate table_test.go") - -func genFile(name string, buf *bytes.Buffer) { - b, err := format.Source(buf.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile(name, b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - var all []string - all = append(all, elements...) - all = append(all, attributes...) - all = append(all, eventHandlers...) - all = append(all, extra...) - sort.Strings(all) - - // uniq - lists have dups - w := 0 - for _, s := range all { - if w == 0 || all[w-1] != s { - all[w] = s - w++ - } - } - all = all[:w] - - if *test { - var buf bytes.Buffer - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n") - fmt.Fprintln(&buf, "package atom\n") - fmt.Fprintln(&buf, "var testAtomList = []string{") - for _, s := range all { - fmt.Fprintf(&buf, "\t%q,\n", s) - } - fmt.Fprintln(&buf, "}") - - genFile("table_test.go", &buf) - return - } - - // Find hash that minimizes table size. - var best *table - for i := 0; i < 1000000; i++ { - if best != nil && 1<<(best.k-1) < len(all) { - break - } - h := rand.Uint32() - for k := uint(0); k <= 16; k++ { - if best != nil && k >= best.k { - break - } - var t table - if t.init(h, k, all) { - best = &t - break - } - } - } - if best == nil { - fmt.Fprintf(os.Stderr, "failed to construct string table\n") - os.Exit(1) - } - - // Lay out strings, using overlaps when possible. - layout := append([]string{}, all...) - - // Remove strings that are substrings of other strings - for changed := true; changed; { - changed = false - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i != j && t != "" && strings.Contains(s, t) { - changed = true - layout[j] = "" - } - } - } - } - - // Join strings where one suffix matches another prefix. - for { - // Find best i, j, k such that layout[i][len-k:] == layout[j][:k], - // maximizing overlap length k. - besti := -1 - bestj := -1 - bestk := 0 - for i, s := range layout { - if s == "" { - continue - } - for j, t := range layout { - if i == j { - continue - } - for k := bestk + 1; k <= len(s) && k <= len(t); k++ { - if s[len(s)-k:] == t[:k] { - besti = i - bestj = j - bestk = k - } - } - } - } - if bestk > 0 { - layout[besti] += layout[bestj][bestk:] - layout[bestj] = "" - continue - } - break - } - - text := strings.Join(layout, "") - - atom := map[string]uint32{} - for _, s := range all { - off := strings.Index(text, s) - if off < 0 { - panic("lost string " + s) - } - atom[s] = uint32(off<<8 | len(s)) - } - - var buf bytes.Buffer - // Generate the Go code. - fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n") - fmt.Fprintln(&buf, "//go:generate go run gen.go\n") - fmt.Fprintln(&buf, "package atom\n\nconst (") - - // compute max len - maxLen := 0 - for _, s := range all { - if maxLen < len(s) { - maxLen = len(s) - } - fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s]) - } - fmt.Fprintln(&buf, ")\n") - - fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0) - fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen) - - fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k) - for i, s := range best.tab { - if s == "" { - continue - } - fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s) - } - fmt.Fprintf(&buf, "}\n") - datasize := (1 << best.k) * 4 - - fmt.Fprintln(&buf, "const atomText =") - textsize := len(text) - for len(text) > 60 { - fmt.Fprintf(&buf, "\t%q +\n", text[:60]) - text = text[60:] - } - fmt.Fprintf(&buf, "\t%q\n\n", text) - - genFile("table.go", &buf) - - fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize) -} - -type byLen []string - -func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) } -func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byLen) Len() int { return len(x) } - -// fnv computes the FNV hash with an arbitrary starting value h. -func fnv(h uint32, s string) uint32 { - for i := 0; i < len(s); i++ { - h ^= uint32(s[i]) - h *= 16777619 - } - return h -} - -// A table represents an attempt at constructing the lookup table. -// The lookup table uses cuckoo hashing, meaning that each string -// can be found in one of two positions. -type table struct { - h0 uint32 - k uint - mask uint32 - tab []string -} - -// hash returns the two hashes for s. -func (t *table) hash(s string) (h1, h2 uint32) { - h := fnv(t.h0, s) - h1 = h & t.mask - h2 = (h >> 16) & t.mask - return -} - -// init initializes the table with the given parameters. -// h0 is the initial hash value, -// k is the number of bits of hash value to use, and -// x is the list of strings to store in the table. -// init returns false if the table cannot be constructed. -func (t *table) init(h0 uint32, k uint, x []string) bool { - t.h0 = h0 - t.k = k - t.tab = make([]string, 1< len(t.tab) { - return false - } - s := t.tab[i] - h1, h2 := t.hash(s) - j := h1 + h2 - i - if t.tab[j] != "" && !t.push(j, depth+1) { - return false - } - t.tab[j] = s - return true -} - -// The lists of element names and attribute keys were taken from -// https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 16 April 2018" version. - -// "command", "keygen" and "menuitem" have been removed from the spec, -// but are kept here for backwards compatibility. -var elements = []string{ - "a", - "abbr", - "address", - "area", - "article", - "aside", - "audio", - "b", - "base", - "bdi", - "bdo", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "cite", - "code", - "col", - "colgroup", - "command", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "div", - "dl", - "dt", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "footer", - "form", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "img", - "input", - "ins", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "main", - "map", - "mark", - "menu", - "menuitem", - "meta", - "meter", - "nav", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "pre", - "progress", - "q", - "rp", - "rt", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "slot", - "small", - "source", - "span", - "strong", - "style", - "sub", - "summary", - "sup", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "u", - "ul", - "var", - "video", - "wbr", -} - -// https://html.spec.whatwg.org/multipage/indices.html#attributes-3 -// -// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup", -// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec, -// but are kept here for backwards compatibility. -var attributes = []string{ - "abbr", - "accept", - "accept-charset", - "accesskey", - "action", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "as", - "async", - "autocomplete", - "autofocus", - "autoplay", - "challenge", - "charset", - "checked", - "cite", - "class", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datetime", - "default", - "defer", - "dir", - "dirname", - "disabled", - "download", - "draggable", - "dropzone", - "enctype", - "for", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "headers", - "height", - "hidden", - "high", - "href", - "hreflang", - "http-equiv", - "icon", - "id", - "inputmode", - "integrity", - "is", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "keytype", - "kind", - "label", - "lang", - "list", - "loop", - "low", - "manifest", - "max", - "maxlength", - "media", - "mediagroup", - "method", - "min", - "minlength", - "multiple", - "muted", - "name", - "nomodule", - "nonce", - "novalidate", - "open", - "optimum", - "pattern", - "ping", - "placeholder", - "playsinline", - "poster", - "preload", - "radiogroup", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "sandbox", - "spellcheck", - "scope", - "scoped", - "seamless", - "selected", - "shape", - "size", - "sizes", - "sortable", - "sorted", - "slot", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "style", - "tabindex", - "target", - "title", - "translate", - "type", - "typemustmatch", - "updateviacache", - "usemap", - "value", - "width", - "workertype", - "wrap", -} - -// "onautocomplete", "onautocompleteerror", "onmousewheel", -// "onshow" and "onsort" have been removed from the spec, -// but are kept here for backwards compatibility. -var eventHandlers = []string{ - "onabort", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onafterprint", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onwheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onreset", - "onresize", - "onrejectionhandled", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", -} - -// extra are ad-hoc values not covered by any of the lists above. -var extra = []string{ - "acronym", - "align", - "annotation", - "annotation-xml", - "applet", - "basefont", - "bgsound", - "big", - "blink", - "center", - "color", - "desc", - "face", - "font", - "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive. - "foreignobject", - "frame", - "frameset", - "image", - "isindex", // "isindex" has been removed from the spec, but are kept here for backwards compatibility. - "listing", - "malignmark", - "marquee", - "math", - "mglyph", - "mi", - "mn", - "mo", - "ms", - "mtext", - "nobr", - "noembed", - "noframes", - "plaintext", - "prompt", - "public", - "rb", - "rtc", - "spacer", - "strike", - "svg", - "system", - "tt", - "xmp", -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/table.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/table.go deleted file mode 100644 index 2a938864c..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/table.go +++ /dev/null @@ -1,783 +0,0 @@ -// 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" diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/table_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/table_test.go deleted file mode 100644 index 8a30762ec..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/atom/table_test.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by go generate gen.go; DO NOT EDIT. - -//go:generate go run gen.go -test - -package atom - -var testAtomList = []string{ - "a", - "abbr", - "accept", - "accept-charset", - "accesskey", - "acronym", - "action", - "address", - "align", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "annotation", - "annotation-xml", - "applet", - "area", - "article", - "as", - "aside", - "async", - "audio", - "autocomplete", - "autofocus", - "autoplay", - "b", - "base", - "basefont", - "bdi", - "bdo", - "bgsound", - "big", - "blink", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "center", - "challenge", - "charset", - "checked", - "cite", - "class", - "code", - "col", - "colgroup", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datalist", - "datetime", - "dd", - "default", - "defer", - "del", - "desc", - "details", - "dfn", - "dialog", - "dir", - "dirname", - "disabled", - "div", - "dl", - "download", - "draggable", - "dropzone", - "dt", - "em", - "embed", - "enctype", - "face", - "fieldset", - "figcaption", - "figure", - "font", - "footer", - "for", - "foreignObject", - "foreignobject", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "frame", - "frameset", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "headers", - "height", - "hgroup", - "hidden", - "high", - "hr", - "href", - "hreflang", - "html", - "http-equiv", - "i", - "icon", - "id", - "iframe", - "image", - "img", - "input", - "inputmode", - "ins", - "integrity", - "is", - "isindex", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "kbd", - "keygen", - "keytype", - "kind", - "label", - "lang", - "legend", - "li", - "link", - "list", - "listing", - "loop", - "low", - "main", - "malignmark", - "manifest", - "map", - "mark", - "marquee", - "math", - "max", - "maxlength", - "media", - "mediagroup", - "menu", - "menuitem", - "meta", - "meter", - "method", - "mglyph", - "mi", - "min", - "minlength", - "mn", - "mo", - "ms", - "mtext", - "multiple", - "muted", - "name", - "nav", - "nobr", - "noembed", - "noframes", - "nomodule", - "nonce", - "noscript", - "novalidate", - "object", - "ol", - "onabort", - "onafterprint", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onrejectionhandled", - "onreset", - "onresize", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", - "onwheel", - "open", - "optgroup", - "optimum", - "option", - "output", - "p", - "param", - "pattern", - "picture", - "ping", - "placeholder", - "plaintext", - "playsinline", - "poster", - "pre", - "preload", - "progress", - "prompt", - "public", - "q", - "radiogroup", - "rb", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "rp", - "rt", - "rtc", - "ruby", - "s", - "samp", - "sandbox", - "scope", - "scoped", - "script", - "seamless", - "section", - "select", - "selected", - "shape", - "size", - "sizes", - "slot", - "small", - "sortable", - "sorted", - "source", - "spacer", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "strike", - "strong", - "style", - "sub", - "summary", - "sup", - "svg", - "system", - "tabindex", - "table", - "target", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "translate", - "tt", - "type", - "typemustmatch", - "u", - "ul", - "updateviacache", - "usemap", - "value", - "var", - "video", - "wbr", - "width", - "workertype", - "wrap", - "xmp", -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/charset.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/charset.go deleted file mode 100644 index 13bed1599..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/charset.go +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright 2013 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 charset provides common text encodings for HTML documents. -// -// The mapping from encoding labels to encodings is defined at -// https://encoding.spec.whatwg.org/. -package charset // import "golang.org/x/net/html/charset" - -import ( - "bytes" - "fmt" - "io" - "mime" - "strings" - "unicode/utf8" - - "golang.org/x/net/html" - "golang.org/x/text/encoding" - "golang.org/x/text/encoding/charmap" - "golang.org/x/text/encoding/htmlindex" - "golang.org/x/text/transform" -) - -// Lookup returns the encoding with the specified label, and its canonical -// name. It returns nil and the empty string if label is not one of the -// standard encodings for HTML. Matching is case-insensitive and ignores -// leading and trailing whitespace. Encoders will use HTML escape sequences for -// runes that are not supported by the character set. -func Lookup(label string) (e encoding.Encoding, name string) { - e, err := htmlindex.Get(label) - if err != nil { - return nil, "" - } - name, _ = htmlindex.Name(e) - return &htmlEncoding{e}, name -} - -type htmlEncoding struct{ encoding.Encoding } - -func (h *htmlEncoding) NewEncoder() *encoding.Encoder { - // HTML requires a non-terminating legacy encoder. We use HTML escapes to - // substitute unsupported code points. - return encoding.HTMLEscapeUnsupported(h.Encoding.NewEncoder()) -} - -// DetermineEncoding determines the encoding of an HTML document by examining -// up to the first 1024 bytes of content and the declared Content-Type. -// -// See http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding -func DetermineEncoding(content []byte, contentType string) (e encoding.Encoding, name string, certain bool) { - if len(content) > 1024 { - content = content[:1024] - } - - for _, b := range boms { - if bytes.HasPrefix(content, b.bom) { - e, name = Lookup(b.enc) - return e, name, true - } - } - - if _, params, err := mime.ParseMediaType(contentType); err == nil { - if cs, ok := params["charset"]; ok { - if e, name = Lookup(cs); e != nil { - return e, name, true - } - } - } - - if len(content) > 0 { - e, name = prescan(content) - if e != nil { - return e, name, false - } - } - - // Try to detect UTF-8. - // First eliminate any partial rune at the end. - for i := len(content) - 1; i >= 0 && i > len(content)-4; i-- { - b := content[i] - if b < 0x80 { - break - } - if utf8.RuneStart(b) { - content = content[:i] - break - } - } - hasHighBit := false - for _, c := range content { - if c >= 0x80 { - hasHighBit = true - break - } - } - if hasHighBit && utf8.Valid(content) { - return encoding.Nop, "utf-8", false - } - - // TODO: change default depending on user's locale? - return charmap.Windows1252, "windows-1252", false -} - -// NewReader returns an io.Reader that converts the content of r to UTF-8. -// It calls DetermineEncoding to find out what r's encoding is. -func NewReader(r io.Reader, contentType string) (io.Reader, error) { - preview := make([]byte, 1024) - n, err := io.ReadFull(r, preview) - switch { - case err == io.ErrUnexpectedEOF: - preview = preview[:n] - r = bytes.NewReader(preview) - case err != nil: - return nil, err - default: - r = io.MultiReader(bytes.NewReader(preview), r) - } - - if e, _, _ := DetermineEncoding(preview, contentType); e != encoding.Nop { - r = transform.NewReader(r, e.NewDecoder()) - } - return r, nil -} - -// NewReaderLabel returns a reader that converts from the specified charset to -// UTF-8. It uses Lookup to find the encoding that corresponds to label, and -// returns an error if Lookup returns nil. It is suitable for use as -// encoding/xml.Decoder's CharsetReader function. -func NewReaderLabel(label string, input io.Reader) (io.Reader, error) { - e, _ := Lookup(label) - if e == nil { - return nil, fmt.Errorf("unsupported charset: %q", label) - } - return transform.NewReader(input, e.NewDecoder()), nil -} - -func prescan(content []byte) (e encoding.Encoding, name string) { - z := html.NewTokenizer(bytes.NewReader(content)) - for { - switch z.Next() { - case html.ErrorToken: - return nil, "" - - case html.StartTagToken, html.SelfClosingTagToken: - tagName, hasAttr := z.TagName() - if !bytes.Equal(tagName, []byte("meta")) { - continue - } - attrList := make(map[string]bool) - gotPragma := false - - const ( - dontKnow = iota - doNeedPragma - doNotNeedPragma - ) - needPragma := dontKnow - - name = "" - e = nil - for hasAttr { - var key, val []byte - key, val, hasAttr = z.TagAttr() - ks := string(key) - if attrList[ks] { - continue - } - attrList[ks] = true - for i, c := range val { - if 'A' <= c && c <= 'Z' { - val[i] = c + 0x20 - } - } - - switch ks { - case "http-equiv": - if bytes.Equal(val, []byte("content-type")) { - gotPragma = true - } - - case "content": - if e == nil { - name = fromMetaElement(string(val)) - if name != "" { - e, name = Lookup(name) - if e != nil { - needPragma = doNeedPragma - } - } - } - - case "charset": - e, name = Lookup(string(val)) - needPragma = doNotNeedPragma - } - } - - if needPragma == dontKnow || needPragma == doNeedPragma && !gotPragma { - continue - } - - if strings.HasPrefix(name, "utf-16") { - name = "utf-8" - e = encoding.Nop - } - - if e != nil { - return e, name - } - } - } -} - -func fromMetaElement(s string) string { - for s != "" { - csLoc := strings.Index(s, "charset") - if csLoc == -1 { - return "" - } - s = s[csLoc+len("charset"):] - s = strings.TrimLeft(s, " \t\n\f\r") - if !strings.HasPrefix(s, "=") { - continue - } - s = s[1:] - s = strings.TrimLeft(s, " \t\n\f\r") - if s == "" { - return "" - } - if q := s[0]; q == '"' || q == '\'' { - s = s[1:] - closeQuote := strings.IndexRune(s, rune(q)) - if closeQuote == -1 { - return "" - } - return s[:closeQuote] - } - - end := strings.IndexAny(s, "; \t\n\f\r") - if end == -1 { - end = len(s) - } - return s[:end] - } - return "" -} - -var boms = []struct { - bom []byte - enc string -}{ - {[]byte{0xfe, 0xff}, "utf-16be"}, - {[]byte{0xff, 0xfe}, "utf-16le"}, - {[]byte{0xef, 0xbb, 0xbf}, "utf-8"}, -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/charset_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/charset_test.go deleted file mode 100644 index b71eb43f7..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/charset_test.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2013 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 charset - -import ( - "bytes" - "encoding/xml" - "io/ioutil" - "runtime" - "strings" - "testing" - - "golang.org/x/text/transform" -) - -func transformString(t transform.Transformer, s string) (string, error) { - r := transform.NewReader(strings.NewReader(s), t) - b, err := ioutil.ReadAll(r) - return string(b), err -} - -type testCase struct { - utf8, other, otherEncoding string -} - -// testCases for encoding and decoding. -var testCases = []testCase{ - {"Résumé", "Résumé", "utf8"}, - {"Résumé", "R\xe9sum\xe9", "latin1"}, - {"これは漢字です。", "S0\x8c0o0\"oW[g0Y0\x020", "UTF-16LE"}, - {"これは漢字です。", "0S0\x8c0oo\"[W0g0Y0\x02", "UTF-16BE"}, - {"Hello, world", "Hello, world", "ASCII"}, - {"Gdańsk", "Gda\xf1sk", "ISO-8859-2"}, - {"Ââ Čč Đđ Ŋŋ Õõ Šš Žž Åå Ää", "\xc2\xe2 \xc8\xe8 \xa9\xb9 \xaf\xbf \xd5\xf5 \xaa\xba \xac\xbc \xc5\xe5 \xc4\xe4", "ISO-8859-10"}, - {"สำหรับ", "\xca\xd3\xcb\xc3\u047a", "ISO-8859-11"}, - {"latviešu", "latvie\xf0u", "ISO-8859-13"}, - {"Seònaid", "Se\xf2naid", "ISO-8859-14"}, - {"€1 is cheap", "\xa41 is cheap", "ISO-8859-15"}, - {"românește", "rom\xe2ne\xbate", "ISO-8859-16"}, - {"nutraĵo", "nutra\xbco", "ISO-8859-3"}, - {"Kalâdlit", "Kal\xe2dlit", "ISO-8859-4"}, - {"русский", "\xe0\xe3\xe1\xe1\xda\xd8\xd9", "ISO-8859-5"}, - {"ελληνικά", "\xe5\xeb\xeb\xe7\xed\xe9\xea\xdc", "ISO-8859-7"}, - {"Kağan", "Ka\xf0an", "ISO-8859-9"}, - {"Résumé", "R\x8esum\x8e", "macintosh"}, - {"Gdańsk", "Gda\xf1sk", "windows-1250"}, - {"русский", "\xf0\xf3\xf1\xf1\xea\xe8\xe9", "windows-1251"}, - {"Résumé", "R\xe9sum\xe9", "windows-1252"}, - {"ελληνικά", "\xe5\xeb\xeb\xe7\xed\xe9\xea\xdc", "windows-1253"}, - {"Kağan", "Ka\xf0an", "windows-1254"}, - {"עִבְרִית", "\xf2\xc4\xe1\xc0\xf8\xc4\xe9\xfa", "windows-1255"}, - {"العربية", "\xc7\xe1\xda\xd1\xc8\xed\xc9", "windows-1256"}, - {"latviešu", "latvie\xf0u", "windows-1257"}, - {"Việt", "Vi\xea\xf2t", "windows-1258"}, - {"สำหรับ", "\xca\xd3\xcb\xc3\u047a", "windows-874"}, - {"русский", "\xd2\xd5\xd3\xd3\xcb\xc9\xca", "KOI8-R"}, - {"українська", "\xd5\xcb\xd2\xc1\xa7\xce\xd3\xd8\xcb\xc1", "KOI8-U"}, - {"Hello 常用國字標準字體表", "Hello \xb1`\xa5\u03b0\xea\xa6r\xbc\u0437\u01e6r\xc5\xe9\xaa\xed", "big5"}, - {"Hello 常用國字標準字體表", "Hello \xb3\xa3\xd3\xc3\x87\xf8\xd7\xd6\x98\xcb\x9c\xca\xd7\xd6\xf3\x77\xb1\xed", "gbk"}, - {"Hello 常用國字標準字體表", "Hello \xb3\xa3\xd3\xc3\x87\xf8\xd7\xd6\x98\xcb\x9c\xca\xd7\xd6\xf3\x77\xb1\xed", "gb18030"}, - {"עִבְרִית", "\x81\x30\xfb\x30\x81\x30\xf6\x34\x81\x30\xf9\x33\x81\x30\xf6\x30\x81\x30\xfb\x36\x81\x30\xf6\x34\x81\x30\xfa\x31\x81\x30\xfb\x38", "gb18030"}, - {"㧯", "\x82\x31\x89\x38", "gb18030"}, - {"これは漢字です。", "\x82\xb1\x82\xea\x82\xcd\x8a\xbf\x8e\x9a\x82\xc5\x82\xb7\x81B", "SJIS"}, - {"Hello, 世界!", "Hello, \x90\xa2\x8aE!", "SJIS"}, - {"イウエオカ", "\xb2\xb3\xb4\xb5\xb6", "SJIS"}, - {"これは漢字です。", "\xa4\xb3\xa4\xec\xa4\u03f4\xc1\xbb\xfa\xa4\u01e4\xb9\xa1\xa3", "EUC-JP"}, - {"Hello, 世界!", "Hello, \x1b$B@$3&\x1b(B!", "ISO-2022-JP"}, - {"다음과 같은 조건을 따라야 합니다: 저작자표시", "\xb4\xd9\xc0\xbd\xb0\xfa \xb0\xb0\xc0\xba \xc1\xb6\xb0\xc7\xc0\xbb \xb5\xfb\xb6\xf3\xbe\xdf \xc7մϴ\xd9: \xc0\xfa\xc0\xdb\xc0\xdaǥ\xbd\xc3", "EUC-KR"}, -} - -func TestDecode(t *testing.T) { - testCases := append(testCases, []testCase{ - // Replace multi-byte maximum subpart of ill-formed subsequence with - // single replacement character (WhatWG requirement). - {"Rés\ufffdumé", "Rés\xe1\x80umé", "utf8"}, - }...) - for _, tc := range testCases { - e, _ := Lookup(tc.otherEncoding) - if e == nil { - t.Errorf("%s: not found", tc.otherEncoding) - continue - } - s, err := transformString(e.NewDecoder(), tc.other) - if err != nil { - t.Errorf("%s: decode %q: %v", tc.otherEncoding, tc.other, err) - continue - } - if s != tc.utf8 { - t.Errorf("%s: got %q, want %q", tc.otherEncoding, s, tc.utf8) - } - } -} - -func TestEncode(t *testing.T) { - testCases := append(testCases, []testCase{ - // Use Go-style replacement. - {"Rés\xe1\x80umé", "Rés\ufffd\ufffdumé", "utf8"}, - // U+0144 LATIN SMALL LETTER N WITH ACUTE not supported by encoding. - {"Gdańsk", "Gdańsk", "ISO-8859-11"}, - {"\ufffd", "�", "ISO-8859-11"}, - {"a\xe1\x80b", "a��b", "ISO-8859-11"}, - }...) - for _, tc := range testCases { - e, _ := Lookup(tc.otherEncoding) - if e == nil { - t.Errorf("%s: not found", tc.otherEncoding) - continue - } - s, err := transformString(e.NewEncoder(), tc.utf8) - if err != nil { - t.Errorf("%s: encode %q: %s", tc.otherEncoding, tc.utf8, err) - continue - } - if s != tc.other { - t.Errorf("%s: got %q, want %q", tc.otherEncoding, s, tc.other) - } - } -} - -var sniffTestCases = []struct { - filename, declared, want string -}{ - {"HTTP-charset.html", "text/html; charset=iso-8859-15", "iso-8859-15"}, - {"UTF-16LE-BOM.html", "", "utf-16le"}, - {"UTF-16BE-BOM.html", "", "utf-16be"}, - {"meta-content-attribute.html", "text/html", "iso-8859-15"}, - {"meta-charset-attribute.html", "text/html", "iso-8859-15"}, - {"No-encoding-declaration.html", "text/html", "utf-8"}, - {"HTTP-vs-UTF-8-BOM.html", "text/html; charset=iso-8859-15", "utf-8"}, - {"HTTP-vs-meta-content.html", "text/html; charset=iso-8859-15", "iso-8859-15"}, - {"HTTP-vs-meta-charset.html", "text/html; charset=iso-8859-15", "iso-8859-15"}, - {"UTF-8-BOM-vs-meta-content.html", "text/html", "utf-8"}, - {"UTF-8-BOM-vs-meta-charset.html", "text/html", "utf-8"}, -} - -func TestSniff(t *testing.T) { - switch runtime.GOOS { - case "nacl": // platforms that don't permit direct file system access - t.Skipf("not supported on %q", runtime.GOOS) - } - - for _, tc := range sniffTestCases { - content, err := ioutil.ReadFile("testdata/" + tc.filename) - if err != nil { - t.Errorf("%s: error reading file: %v", tc.filename, err) - continue - } - - _, name, _ := DetermineEncoding(content, tc.declared) - if name != tc.want { - t.Errorf("%s: got %q, want %q", tc.filename, name, tc.want) - continue - } - } -} - -func TestReader(t *testing.T) { - switch runtime.GOOS { - case "nacl": // platforms that don't permit direct file system access - t.Skipf("not supported on %q", runtime.GOOS) - } - - for _, tc := range sniffTestCases { - content, err := ioutil.ReadFile("testdata/" + tc.filename) - if err != nil { - t.Errorf("%s: error reading file: %v", tc.filename, err) - continue - } - - r, err := NewReader(bytes.NewReader(content), tc.declared) - if err != nil { - t.Errorf("%s: error creating reader: %v", tc.filename, err) - continue - } - - got, err := ioutil.ReadAll(r) - if err != nil { - t.Errorf("%s: error reading from charset.NewReader: %v", tc.filename, err) - continue - } - - e, _ := Lookup(tc.want) - want, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader(content), e.NewDecoder())) - if err != nil { - t.Errorf("%s: error decoding with hard-coded charset name: %v", tc.filename, err) - continue - } - - if !bytes.Equal(got, want) { - t.Errorf("%s: got %q, want %q", tc.filename, got, want) - continue - } - } -} - -var metaTestCases = []struct { - meta, want string -}{ - {"", ""}, - {"text/html", ""}, - {"text/html; charset utf-8", ""}, - {"text/html; charset=latin-2", "latin-2"}, - {"text/html; charset; charset = utf-8", "utf-8"}, - {`charset="big5"`, "big5"}, - {"charset='shift_jis'", "shift_jis"}, -} - -func TestFromMeta(t *testing.T) { - for _, tc := range metaTestCases { - got := fromMetaElement(tc.meta) - if got != tc.want { - t.Errorf("%q: got %q, want %q", tc.meta, got, tc.want) - } - } -} - -func TestXML(t *testing.T) { - const s = "r\xe9sum\xe9" - - d := xml.NewDecoder(strings.NewReader(s)) - d.CharsetReader = NewReaderLabel - - var a struct { - Word string - } - if err := d.Decode(&a); err != nil { - t.Fatalf("Decode: %v", err) - } - - want := "résumé" - if a.Word != want { - t.Errorf("got %q, want %q", a.Word, want) - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-charset.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-charset.html deleted file mode 100644 index 9915fa0ee..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-charset.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - HTTP charset - - - - - - - - - - - -

              HTTP charset

              - - -
              - - -
               
              - - - - - -
              -

              The character encoding of a page can be set using the HTTP header charset declaration.

              -

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

              The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-001
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-UTF-8-BOM.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-UTF-8-BOM.html deleted file mode 100644 index 26e5d8b4e..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-UTF-8-BOM.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - HTTP vs UTF-8 BOM - - - - - - - - - - - -

              HTTP vs UTF-8 BOM

              - - -
              - - -
               
              - - - - - -
              -

              A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.

              -

              The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

              If the test is unsuccessful, the characters  should appear at the top of the page. These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-034
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-meta-charset.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-meta-charset.html deleted file mode 100644 index 2f07e9515..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-meta-charset.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - HTTP vs meta charset - - - - - - - - - - - -

              HTTP vs meta charset

              - - -
              - - -
               
              - - - - - -
              -

              The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.

              -

              The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-018
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-meta-content.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-meta-content.html deleted file mode 100644 index 6853cddec..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/HTTP-vs-meta-content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - HTTP vs meta content - - - - - - - - - - - -

              HTTP vs meta content

              - - -
              - - -
               
              - - - - - -
              -

              The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.

              -

              The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-016
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/No-encoding-declaration.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/No-encoding-declaration.html deleted file mode 100644 index 612e26c6c..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/No-encoding-declaration.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - No encoding declaration - - - - - - - - - - - -

              No encoding declaration

              - - -
              - - -
               
              - - - - - -
              -

              A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.

              -

              The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-015
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/README b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/README deleted file mode 100644 index 38ef0f9f1..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/README +++ /dev/null @@ -1,9 +0,0 @@ -These test cases come from -http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics - -Distributed under both the W3C Test Suite License -(http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) -and the W3C 3-clause BSD License -(http://www.w3.org/Consortium/Legal/2008/03-bsd-license). -To contribute to a W3C Test Suite, see the policies and contribution -forms (http://www.w3.org/2004/10/27-testcases). diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-16BE-BOM.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-16BE-BOM.html deleted file mode 100644 index 3abf7a934..000000000 Binary files a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-16BE-BOM.html and /dev/null differ diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-16LE-BOM.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-16LE-BOM.html deleted file mode 100644 index 76254c980..000000000 Binary files a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-16LE-BOM.html and /dev/null differ diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html deleted file mode 100644 index 83de43338..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - UTF-8 BOM vs meta charset - - - - - - - - - - - -

              UTF-8 BOM vs meta charset

              - - -
              - - -
               
              - - - - - -
              -

              A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.

              -

              The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-038
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-8-BOM-vs-meta-content.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-8-BOM-vs-meta-content.html deleted file mode 100644 index 501aac2d6..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/UTF-8-BOM-vs-meta-content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - UTF-8 BOM vs meta content - - - - - - - - - - - -

              UTF-8 BOM vs meta content

              - - -
              - - -
               
              - - - - - -
              -

              A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.

              -

              The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-037
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/meta-charset-attribute.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/meta-charset-attribute.html deleted file mode 100644 index 2d7d25aba..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/meta-charset-attribute.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - meta charset attribute - - - - - - - - - - - -

              meta charset attribute

              - - -
              - - -
               
              - - - - - -
              -

              The character encoding of the page can be set by a meta element with charset attribute.

              -

              The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-009
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/meta-content-attribute.html b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/meta-content-attribute.html deleted file mode 100644 index 1c3f228e7..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/charset/testdata/meta-content-attribute.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - meta content attribute - - - - - - - - - - - -

              meta content attribute

              - - -
              - - -
               
              - - - - - -
              -

              The character encoding of the page can be set by a meta element with http-equiv and content attributes.

              -

              The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.

              The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

              -
              -
              -
              HTML5
              -

              the-input-byte-stream-007
              Result summary & related tests
              Detailed results for this test
              Link to spec

              -
              Assumptions:
              • The default encoding for the browser you are testing is not set to ISO 8859-15.
              • -
              • The test is read from a server that supports HTTP.
              -
              - - - - - - diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/const.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/const.go deleted file mode 100644 index ff7acf2d5..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/const.go +++ /dev/null @@ -1,111 +0,0 @@ -// 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 -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/doc.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/doc.go deleted file mode 100644 index 822ed42a0..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/doc.go +++ /dev/null @@ -1,106 +0,0 @@ -// 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 -*/ -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? diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/doctype.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/doctype.go deleted file mode 100644 index c484e5a94..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/doctype.go +++ /dev/null @@ -1,156 +0,0 @@ -// 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//", -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/entity.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/entity.go deleted file mode 100644 index b628880a0..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/entity.go +++ /dev/null @@ -1,2253 +0,0 @@ -// 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 - -// All entities that do not end with ';' are 6 or fewer bytes long. -const longestEntityWithoutSemicolon = 6 - -// entity is a map from HTML entity names to their values. The semicolon matters: -// https://html.spec.whatwg.org/multipage/syntax.html#named-character-references -// lists both "amp" and "amp;" as two separate entries. -// -// Note that the HTML5 list is larger than the HTML4 list at -// http://www.w3.org/TR/html4/sgml/entities.html -var entity = map[string]rune{ - "AElig;": '\U000000C6', - "AMP;": '\U00000026', - "Aacute;": '\U000000C1', - "Abreve;": '\U00000102', - "Acirc;": '\U000000C2', - "Acy;": '\U00000410', - "Afr;": '\U0001D504', - "Agrave;": '\U000000C0', - "Alpha;": '\U00000391', - "Amacr;": '\U00000100', - "And;": '\U00002A53', - "Aogon;": '\U00000104', - "Aopf;": '\U0001D538', - "ApplyFunction;": '\U00002061', - "Aring;": '\U000000C5', - "Ascr;": '\U0001D49C', - "Assign;": '\U00002254', - "Atilde;": '\U000000C3', - "Auml;": '\U000000C4', - "Backslash;": '\U00002216', - "Barv;": '\U00002AE7', - "Barwed;": '\U00002306', - "Bcy;": '\U00000411', - "Because;": '\U00002235', - "Bernoullis;": '\U0000212C', - "Beta;": '\U00000392', - "Bfr;": '\U0001D505', - "Bopf;": '\U0001D539', - "Breve;": '\U000002D8', - "Bscr;": '\U0000212C', - "Bumpeq;": '\U0000224E', - "CHcy;": '\U00000427', - "COPY;": '\U000000A9', - "Cacute;": '\U00000106', - "Cap;": '\U000022D2', - "CapitalDifferentialD;": '\U00002145', - "Cayleys;": '\U0000212D', - "Ccaron;": '\U0000010C', - "Ccedil;": '\U000000C7', - "Ccirc;": '\U00000108', - "Cconint;": '\U00002230', - "Cdot;": '\U0000010A', - "Cedilla;": '\U000000B8', - "CenterDot;": '\U000000B7', - "Cfr;": '\U0000212D', - "Chi;": '\U000003A7', - "CircleDot;": '\U00002299', - "CircleMinus;": '\U00002296', - "CirclePlus;": '\U00002295', - "CircleTimes;": '\U00002297', - "ClockwiseContourIntegral;": '\U00002232', - "CloseCurlyDoubleQuote;": '\U0000201D', - "CloseCurlyQuote;": '\U00002019', - "Colon;": '\U00002237', - "Colone;": '\U00002A74', - "Congruent;": '\U00002261', - "Conint;": '\U0000222F', - "ContourIntegral;": '\U0000222E', - "Copf;": '\U00002102', - "Coproduct;": '\U00002210', - "CounterClockwiseContourIntegral;": '\U00002233', - "Cross;": '\U00002A2F', - "Cscr;": '\U0001D49E', - "Cup;": '\U000022D3', - "CupCap;": '\U0000224D', - "DD;": '\U00002145', - "DDotrahd;": '\U00002911', - "DJcy;": '\U00000402', - "DScy;": '\U00000405', - "DZcy;": '\U0000040F', - "Dagger;": '\U00002021', - "Darr;": '\U000021A1', - "Dashv;": '\U00002AE4', - "Dcaron;": '\U0000010E', - "Dcy;": '\U00000414', - "Del;": '\U00002207', - "Delta;": '\U00000394', - "Dfr;": '\U0001D507', - "DiacriticalAcute;": '\U000000B4', - "DiacriticalDot;": '\U000002D9', - "DiacriticalDoubleAcute;": '\U000002DD', - "DiacriticalGrave;": '\U00000060', - "DiacriticalTilde;": '\U000002DC', - "Diamond;": '\U000022C4', - "DifferentialD;": '\U00002146', - "Dopf;": '\U0001D53B', - "Dot;": '\U000000A8', - "DotDot;": '\U000020DC', - "DotEqual;": '\U00002250', - "DoubleContourIntegral;": '\U0000222F', - "DoubleDot;": '\U000000A8', - "DoubleDownArrow;": '\U000021D3', - "DoubleLeftArrow;": '\U000021D0', - "DoubleLeftRightArrow;": '\U000021D4', - "DoubleLeftTee;": '\U00002AE4', - "DoubleLongLeftArrow;": '\U000027F8', - "DoubleLongLeftRightArrow;": '\U000027FA', - "DoubleLongRightArrow;": '\U000027F9', - "DoubleRightArrow;": '\U000021D2', - "DoubleRightTee;": '\U000022A8', - "DoubleUpArrow;": '\U000021D1', - "DoubleUpDownArrow;": '\U000021D5', - "DoubleVerticalBar;": '\U00002225', - "DownArrow;": '\U00002193', - "DownArrowBar;": '\U00002913', - "DownArrowUpArrow;": '\U000021F5', - "DownBreve;": '\U00000311', - "DownLeftRightVector;": '\U00002950', - "DownLeftTeeVector;": '\U0000295E', - "DownLeftVector;": '\U000021BD', - "DownLeftVectorBar;": '\U00002956', - "DownRightTeeVector;": '\U0000295F', - "DownRightVector;": '\U000021C1', - "DownRightVectorBar;": '\U00002957', - "DownTee;": '\U000022A4', - "DownTeeArrow;": '\U000021A7', - "Downarrow;": '\U000021D3', - "Dscr;": '\U0001D49F', - "Dstrok;": '\U00000110', - "ENG;": '\U0000014A', - "ETH;": '\U000000D0', - "Eacute;": '\U000000C9', - "Ecaron;": '\U0000011A', - "Ecirc;": '\U000000CA', - "Ecy;": '\U0000042D', - "Edot;": '\U00000116', - "Efr;": '\U0001D508', - "Egrave;": '\U000000C8', - "Element;": '\U00002208', - "Emacr;": '\U00000112', - "EmptySmallSquare;": '\U000025FB', - "EmptyVerySmallSquare;": '\U000025AB', - "Eogon;": '\U00000118', - "Eopf;": '\U0001D53C', - "Epsilon;": '\U00000395', - "Equal;": '\U00002A75', - "EqualTilde;": '\U00002242', - "Equilibrium;": '\U000021CC', - "Escr;": '\U00002130', - "Esim;": '\U00002A73', - "Eta;": '\U00000397', - "Euml;": '\U000000CB', - "Exists;": '\U00002203', - "ExponentialE;": '\U00002147', - "Fcy;": '\U00000424', - "Ffr;": '\U0001D509', - "FilledSmallSquare;": '\U000025FC', - "FilledVerySmallSquare;": '\U000025AA', - "Fopf;": '\U0001D53D', - "ForAll;": '\U00002200', - "Fouriertrf;": '\U00002131', - "Fscr;": '\U00002131', - "GJcy;": '\U00000403', - "GT;": '\U0000003E', - "Gamma;": '\U00000393', - "Gammad;": '\U000003DC', - "Gbreve;": '\U0000011E', - "Gcedil;": '\U00000122', - "Gcirc;": '\U0000011C', - "Gcy;": '\U00000413', - "Gdot;": '\U00000120', - "Gfr;": '\U0001D50A', - "Gg;": '\U000022D9', - "Gopf;": '\U0001D53E', - "GreaterEqual;": '\U00002265', - "GreaterEqualLess;": '\U000022DB', - "GreaterFullEqual;": '\U00002267', - "GreaterGreater;": '\U00002AA2', - "GreaterLess;": '\U00002277', - "GreaterSlantEqual;": '\U00002A7E', - "GreaterTilde;": '\U00002273', - "Gscr;": '\U0001D4A2', - "Gt;": '\U0000226B', - "HARDcy;": '\U0000042A', - "Hacek;": '\U000002C7', - "Hat;": '\U0000005E', - "Hcirc;": '\U00000124', - "Hfr;": '\U0000210C', - "HilbertSpace;": '\U0000210B', - "Hopf;": '\U0000210D', - "HorizontalLine;": '\U00002500', - "Hscr;": '\U0000210B', - "Hstrok;": '\U00000126', - "HumpDownHump;": '\U0000224E', - "HumpEqual;": '\U0000224F', - "IEcy;": '\U00000415', - "IJlig;": '\U00000132', - "IOcy;": '\U00000401', - "Iacute;": '\U000000CD', - "Icirc;": '\U000000CE', - "Icy;": '\U00000418', - "Idot;": '\U00000130', - "Ifr;": '\U00002111', - "Igrave;": '\U000000CC', - "Im;": '\U00002111', - "Imacr;": '\U0000012A', - "ImaginaryI;": '\U00002148', - "Implies;": '\U000021D2', - "Int;": '\U0000222C', - "Integral;": '\U0000222B', - "Intersection;": '\U000022C2', - "InvisibleComma;": '\U00002063', - "InvisibleTimes;": '\U00002062', - "Iogon;": '\U0000012E', - "Iopf;": '\U0001D540', - "Iota;": '\U00000399', - "Iscr;": '\U00002110', - "Itilde;": '\U00000128', - "Iukcy;": '\U00000406', - "Iuml;": '\U000000CF', - "Jcirc;": '\U00000134', - "Jcy;": '\U00000419', - "Jfr;": '\U0001D50D', - "Jopf;": '\U0001D541', - "Jscr;": '\U0001D4A5', - "Jsercy;": '\U00000408', - "Jukcy;": '\U00000404', - "KHcy;": '\U00000425', - "KJcy;": '\U0000040C', - "Kappa;": '\U0000039A', - "Kcedil;": '\U00000136', - "Kcy;": '\U0000041A', - "Kfr;": '\U0001D50E', - "Kopf;": '\U0001D542', - "Kscr;": '\U0001D4A6', - "LJcy;": '\U00000409', - "LT;": '\U0000003C', - "Lacute;": '\U00000139', - "Lambda;": '\U0000039B', - "Lang;": '\U000027EA', - "Laplacetrf;": '\U00002112', - "Larr;": '\U0000219E', - "Lcaron;": '\U0000013D', - "Lcedil;": '\U0000013B', - "Lcy;": '\U0000041B', - "LeftAngleBracket;": '\U000027E8', - "LeftArrow;": '\U00002190', - "LeftArrowBar;": '\U000021E4', - "LeftArrowRightArrow;": '\U000021C6', - "LeftCeiling;": '\U00002308', - "LeftDoubleBracket;": '\U000027E6', - "LeftDownTeeVector;": '\U00002961', - "LeftDownVector;": '\U000021C3', - "LeftDownVectorBar;": '\U00002959', - "LeftFloor;": '\U0000230A', - "LeftRightArrow;": '\U00002194', - "LeftRightVector;": '\U0000294E', - "LeftTee;": '\U000022A3', - "LeftTeeArrow;": '\U000021A4', - "LeftTeeVector;": '\U0000295A', - "LeftTriangle;": '\U000022B2', - "LeftTriangleBar;": '\U000029CF', - "LeftTriangleEqual;": '\U000022B4', - "LeftUpDownVector;": '\U00002951', - "LeftUpTeeVector;": '\U00002960', - "LeftUpVector;": '\U000021BF', - "LeftUpVectorBar;": '\U00002958', - "LeftVector;": '\U000021BC', - "LeftVectorBar;": '\U00002952', - "Leftarrow;": '\U000021D0', - "Leftrightarrow;": '\U000021D4', - "LessEqualGreater;": '\U000022DA', - "LessFullEqual;": '\U00002266', - "LessGreater;": '\U00002276', - "LessLess;": '\U00002AA1', - "LessSlantEqual;": '\U00002A7D', - "LessTilde;": '\U00002272', - "Lfr;": '\U0001D50F', - "Ll;": '\U000022D8', - "Lleftarrow;": '\U000021DA', - "Lmidot;": '\U0000013F', - "LongLeftArrow;": '\U000027F5', - "LongLeftRightArrow;": '\U000027F7', - "LongRightArrow;": '\U000027F6', - "Longleftarrow;": '\U000027F8', - "Longleftrightarrow;": '\U000027FA', - "Longrightarrow;": '\U000027F9', - "Lopf;": '\U0001D543', - "LowerLeftArrow;": '\U00002199', - "LowerRightArrow;": '\U00002198', - "Lscr;": '\U00002112', - "Lsh;": '\U000021B0', - "Lstrok;": '\U00000141', - "Lt;": '\U0000226A', - "Map;": '\U00002905', - "Mcy;": '\U0000041C', - "MediumSpace;": '\U0000205F', - "Mellintrf;": '\U00002133', - "Mfr;": '\U0001D510', - "MinusPlus;": '\U00002213', - "Mopf;": '\U0001D544', - "Mscr;": '\U00002133', - "Mu;": '\U0000039C', - "NJcy;": '\U0000040A', - "Nacute;": '\U00000143', - "Ncaron;": '\U00000147', - "Ncedil;": '\U00000145', - "Ncy;": '\U0000041D', - "NegativeMediumSpace;": '\U0000200B', - "NegativeThickSpace;": '\U0000200B', - "NegativeThinSpace;": '\U0000200B', - "NegativeVeryThinSpace;": '\U0000200B', - "NestedGreaterGreater;": '\U0000226B', - "NestedLessLess;": '\U0000226A', - "NewLine;": '\U0000000A', - "Nfr;": '\U0001D511', - "NoBreak;": '\U00002060', - "NonBreakingSpace;": '\U000000A0', - "Nopf;": '\U00002115', - "Not;": '\U00002AEC', - "NotCongruent;": '\U00002262', - "NotCupCap;": '\U0000226D', - "NotDoubleVerticalBar;": '\U00002226', - "NotElement;": '\U00002209', - "NotEqual;": '\U00002260', - "NotExists;": '\U00002204', - "NotGreater;": '\U0000226F', - "NotGreaterEqual;": '\U00002271', - "NotGreaterLess;": '\U00002279', - "NotGreaterTilde;": '\U00002275', - "NotLeftTriangle;": '\U000022EA', - "NotLeftTriangleEqual;": '\U000022EC', - "NotLess;": '\U0000226E', - "NotLessEqual;": '\U00002270', - "NotLessGreater;": '\U00002278', - "NotLessTilde;": '\U00002274', - "NotPrecedes;": '\U00002280', - "NotPrecedesSlantEqual;": '\U000022E0', - "NotReverseElement;": '\U0000220C', - "NotRightTriangle;": '\U000022EB', - "NotRightTriangleEqual;": '\U000022ED', - "NotSquareSubsetEqual;": '\U000022E2', - "NotSquareSupersetEqual;": '\U000022E3', - "NotSubsetEqual;": '\U00002288', - "NotSucceeds;": '\U00002281', - "NotSucceedsSlantEqual;": '\U000022E1', - "NotSupersetEqual;": '\U00002289', - "NotTilde;": '\U00002241', - "NotTildeEqual;": '\U00002244', - "NotTildeFullEqual;": '\U00002247', - "NotTildeTilde;": '\U00002249', - "NotVerticalBar;": '\U00002224', - "Nscr;": '\U0001D4A9', - "Ntilde;": '\U000000D1', - "Nu;": '\U0000039D', - "OElig;": '\U00000152', - "Oacute;": '\U000000D3', - "Ocirc;": '\U000000D4', - "Ocy;": '\U0000041E', - "Odblac;": '\U00000150', - "Ofr;": '\U0001D512', - "Ograve;": '\U000000D2', - "Omacr;": '\U0000014C', - "Omega;": '\U000003A9', - "Omicron;": '\U0000039F', - "Oopf;": '\U0001D546', - "OpenCurlyDoubleQuote;": '\U0000201C', - "OpenCurlyQuote;": '\U00002018', - "Or;": '\U00002A54', - "Oscr;": '\U0001D4AA', - "Oslash;": '\U000000D8', - "Otilde;": '\U000000D5', - "Otimes;": '\U00002A37', - "Ouml;": '\U000000D6', - "OverBar;": '\U0000203E', - "OverBrace;": '\U000023DE', - "OverBracket;": '\U000023B4', - "OverParenthesis;": '\U000023DC', - "PartialD;": '\U00002202', - "Pcy;": '\U0000041F', - "Pfr;": '\U0001D513', - "Phi;": '\U000003A6', - "Pi;": '\U000003A0', - "PlusMinus;": '\U000000B1', - "Poincareplane;": '\U0000210C', - "Popf;": '\U00002119', - "Pr;": '\U00002ABB', - "Precedes;": '\U0000227A', - "PrecedesEqual;": '\U00002AAF', - "PrecedesSlantEqual;": '\U0000227C', - "PrecedesTilde;": '\U0000227E', - "Prime;": '\U00002033', - "Product;": '\U0000220F', - "Proportion;": '\U00002237', - "Proportional;": '\U0000221D', - "Pscr;": '\U0001D4AB', - "Psi;": '\U000003A8', - "QUOT;": '\U00000022', - "Qfr;": '\U0001D514', - "Qopf;": '\U0000211A', - "Qscr;": '\U0001D4AC', - "RBarr;": '\U00002910', - "REG;": '\U000000AE', - "Racute;": '\U00000154', - "Rang;": '\U000027EB', - "Rarr;": '\U000021A0', - "Rarrtl;": '\U00002916', - "Rcaron;": '\U00000158', - "Rcedil;": '\U00000156', - "Rcy;": '\U00000420', - "Re;": '\U0000211C', - "ReverseElement;": '\U0000220B', - "ReverseEquilibrium;": '\U000021CB', - "ReverseUpEquilibrium;": '\U0000296F', - "Rfr;": '\U0000211C', - "Rho;": '\U000003A1', - "RightAngleBracket;": '\U000027E9', - "RightArrow;": '\U00002192', - "RightArrowBar;": '\U000021E5', - "RightArrowLeftArrow;": '\U000021C4', - "RightCeiling;": '\U00002309', - "RightDoubleBracket;": '\U000027E7', - "RightDownTeeVector;": '\U0000295D', - "RightDownVector;": '\U000021C2', - "RightDownVectorBar;": '\U00002955', - "RightFloor;": '\U0000230B', - "RightTee;": '\U000022A2', - "RightTeeArrow;": '\U000021A6', - "RightTeeVector;": '\U0000295B', - "RightTriangle;": '\U000022B3', - "RightTriangleBar;": '\U000029D0', - "RightTriangleEqual;": '\U000022B5', - "RightUpDownVector;": '\U0000294F', - "RightUpTeeVector;": '\U0000295C', - "RightUpVector;": '\U000021BE', - "RightUpVectorBar;": '\U00002954', - "RightVector;": '\U000021C0', - "RightVectorBar;": '\U00002953', - "Rightarrow;": '\U000021D2', - "Ropf;": '\U0000211D', - "RoundImplies;": '\U00002970', - "Rrightarrow;": '\U000021DB', - "Rscr;": '\U0000211B', - "Rsh;": '\U000021B1', - "RuleDelayed;": '\U000029F4', - "SHCHcy;": '\U00000429', - "SHcy;": '\U00000428', - "SOFTcy;": '\U0000042C', - "Sacute;": '\U0000015A', - "Sc;": '\U00002ABC', - "Scaron;": '\U00000160', - "Scedil;": '\U0000015E', - "Scirc;": '\U0000015C', - "Scy;": '\U00000421', - "Sfr;": '\U0001D516', - "ShortDownArrow;": '\U00002193', - "ShortLeftArrow;": '\U00002190', - "ShortRightArrow;": '\U00002192', - "ShortUpArrow;": '\U00002191', - "Sigma;": '\U000003A3', - "SmallCircle;": '\U00002218', - "Sopf;": '\U0001D54A', - "Sqrt;": '\U0000221A', - "Square;": '\U000025A1', - "SquareIntersection;": '\U00002293', - "SquareSubset;": '\U0000228F', - "SquareSubsetEqual;": '\U00002291', - "SquareSuperset;": '\U00002290', - "SquareSupersetEqual;": '\U00002292', - "SquareUnion;": '\U00002294', - "Sscr;": '\U0001D4AE', - "Star;": '\U000022C6', - "Sub;": '\U000022D0', - "Subset;": '\U000022D0', - "SubsetEqual;": '\U00002286', - "Succeeds;": '\U0000227B', - "SucceedsEqual;": '\U00002AB0', - "SucceedsSlantEqual;": '\U0000227D', - "SucceedsTilde;": '\U0000227F', - "SuchThat;": '\U0000220B', - "Sum;": '\U00002211', - "Sup;": '\U000022D1', - "Superset;": '\U00002283', - "SupersetEqual;": '\U00002287', - "Supset;": '\U000022D1', - "THORN;": '\U000000DE', - "TRADE;": '\U00002122', - "TSHcy;": '\U0000040B', - "TScy;": '\U00000426', - "Tab;": '\U00000009', - "Tau;": '\U000003A4', - "Tcaron;": '\U00000164', - "Tcedil;": '\U00000162', - "Tcy;": '\U00000422', - "Tfr;": '\U0001D517', - "Therefore;": '\U00002234', - "Theta;": '\U00000398', - "ThinSpace;": '\U00002009', - "Tilde;": '\U0000223C', - "TildeEqual;": '\U00002243', - "TildeFullEqual;": '\U00002245', - "TildeTilde;": '\U00002248', - "Topf;": '\U0001D54B', - "TripleDot;": '\U000020DB', - "Tscr;": '\U0001D4AF', - "Tstrok;": '\U00000166', - "Uacute;": '\U000000DA', - "Uarr;": '\U0000219F', - "Uarrocir;": '\U00002949', - "Ubrcy;": '\U0000040E', - "Ubreve;": '\U0000016C', - "Ucirc;": '\U000000DB', - "Ucy;": '\U00000423', - "Udblac;": '\U00000170', - "Ufr;": '\U0001D518', - "Ugrave;": '\U000000D9', - "Umacr;": '\U0000016A', - "UnderBar;": '\U0000005F', - "UnderBrace;": '\U000023DF', - "UnderBracket;": '\U000023B5', - "UnderParenthesis;": '\U000023DD', - "Union;": '\U000022C3', - "UnionPlus;": '\U0000228E', - "Uogon;": '\U00000172', - "Uopf;": '\U0001D54C', - "UpArrow;": '\U00002191', - "UpArrowBar;": '\U00002912', - "UpArrowDownArrow;": '\U000021C5', - "UpDownArrow;": '\U00002195', - "UpEquilibrium;": '\U0000296E', - "UpTee;": '\U000022A5', - "UpTeeArrow;": '\U000021A5', - "Uparrow;": '\U000021D1', - "Updownarrow;": '\U000021D5', - "UpperLeftArrow;": '\U00002196', - "UpperRightArrow;": '\U00002197', - "Upsi;": '\U000003D2', - "Upsilon;": '\U000003A5', - "Uring;": '\U0000016E', - "Uscr;": '\U0001D4B0', - "Utilde;": '\U00000168', - "Uuml;": '\U000000DC', - "VDash;": '\U000022AB', - "Vbar;": '\U00002AEB', - "Vcy;": '\U00000412', - "Vdash;": '\U000022A9', - "Vdashl;": '\U00002AE6', - "Vee;": '\U000022C1', - "Verbar;": '\U00002016', - "Vert;": '\U00002016', - "VerticalBar;": '\U00002223', - "VerticalLine;": '\U0000007C', - "VerticalSeparator;": '\U00002758', - "VerticalTilde;": '\U00002240', - "VeryThinSpace;": '\U0000200A', - "Vfr;": '\U0001D519', - "Vopf;": '\U0001D54D', - "Vscr;": '\U0001D4B1', - "Vvdash;": '\U000022AA', - "Wcirc;": '\U00000174', - "Wedge;": '\U000022C0', - "Wfr;": '\U0001D51A', - "Wopf;": '\U0001D54E', - "Wscr;": '\U0001D4B2', - "Xfr;": '\U0001D51B', - "Xi;": '\U0000039E', - "Xopf;": '\U0001D54F', - "Xscr;": '\U0001D4B3', - "YAcy;": '\U0000042F', - "YIcy;": '\U00000407', - "YUcy;": '\U0000042E', - "Yacute;": '\U000000DD', - "Ycirc;": '\U00000176', - "Ycy;": '\U0000042B', - "Yfr;": '\U0001D51C', - "Yopf;": '\U0001D550', - "Yscr;": '\U0001D4B4', - "Yuml;": '\U00000178', - "ZHcy;": '\U00000416', - "Zacute;": '\U00000179', - "Zcaron;": '\U0000017D', - "Zcy;": '\U00000417', - "Zdot;": '\U0000017B', - "ZeroWidthSpace;": '\U0000200B', - "Zeta;": '\U00000396', - "Zfr;": '\U00002128', - "Zopf;": '\U00002124', - "Zscr;": '\U0001D4B5', - "aacute;": '\U000000E1', - "abreve;": '\U00000103', - "ac;": '\U0000223E', - "acd;": '\U0000223F', - "acirc;": '\U000000E2', - "acute;": '\U000000B4', - "acy;": '\U00000430', - "aelig;": '\U000000E6', - "af;": '\U00002061', - "afr;": '\U0001D51E', - "agrave;": '\U000000E0', - "alefsym;": '\U00002135', - "aleph;": '\U00002135', - "alpha;": '\U000003B1', - "amacr;": '\U00000101', - "amalg;": '\U00002A3F', - "amp;": '\U00000026', - "and;": '\U00002227', - "andand;": '\U00002A55', - "andd;": '\U00002A5C', - "andslope;": '\U00002A58', - "andv;": '\U00002A5A', - "ang;": '\U00002220', - "ange;": '\U000029A4', - "angle;": '\U00002220', - "angmsd;": '\U00002221', - "angmsdaa;": '\U000029A8', - "angmsdab;": '\U000029A9', - "angmsdac;": '\U000029AA', - "angmsdad;": '\U000029AB', - "angmsdae;": '\U000029AC', - "angmsdaf;": '\U000029AD', - "angmsdag;": '\U000029AE', - "angmsdah;": '\U000029AF', - "angrt;": '\U0000221F', - "angrtvb;": '\U000022BE', - "angrtvbd;": '\U0000299D', - "angsph;": '\U00002222', - "angst;": '\U000000C5', - "angzarr;": '\U0000237C', - "aogon;": '\U00000105', - "aopf;": '\U0001D552', - "ap;": '\U00002248', - "apE;": '\U00002A70', - "apacir;": '\U00002A6F', - "ape;": '\U0000224A', - "apid;": '\U0000224B', - "apos;": '\U00000027', - "approx;": '\U00002248', - "approxeq;": '\U0000224A', - "aring;": '\U000000E5', - "ascr;": '\U0001D4B6', - "ast;": '\U0000002A', - "asymp;": '\U00002248', - "asympeq;": '\U0000224D', - "atilde;": '\U000000E3', - "auml;": '\U000000E4', - "awconint;": '\U00002233', - "awint;": '\U00002A11', - "bNot;": '\U00002AED', - "backcong;": '\U0000224C', - "backepsilon;": '\U000003F6', - "backprime;": '\U00002035', - "backsim;": '\U0000223D', - "backsimeq;": '\U000022CD', - "barvee;": '\U000022BD', - "barwed;": '\U00002305', - "barwedge;": '\U00002305', - "bbrk;": '\U000023B5', - "bbrktbrk;": '\U000023B6', - "bcong;": '\U0000224C', - "bcy;": '\U00000431', - "bdquo;": '\U0000201E', - "becaus;": '\U00002235', - "because;": '\U00002235', - "bemptyv;": '\U000029B0', - "bepsi;": '\U000003F6', - "bernou;": '\U0000212C', - "beta;": '\U000003B2', - "beth;": '\U00002136', - "between;": '\U0000226C', - "bfr;": '\U0001D51F', - "bigcap;": '\U000022C2', - "bigcirc;": '\U000025EF', - "bigcup;": '\U000022C3', - "bigodot;": '\U00002A00', - "bigoplus;": '\U00002A01', - "bigotimes;": '\U00002A02', - "bigsqcup;": '\U00002A06', - "bigstar;": '\U00002605', - "bigtriangledown;": '\U000025BD', - "bigtriangleup;": '\U000025B3', - "biguplus;": '\U00002A04', - "bigvee;": '\U000022C1', - "bigwedge;": '\U000022C0', - "bkarow;": '\U0000290D', - "blacklozenge;": '\U000029EB', - "blacksquare;": '\U000025AA', - "blacktriangle;": '\U000025B4', - "blacktriangledown;": '\U000025BE', - "blacktriangleleft;": '\U000025C2', - "blacktriangleright;": '\U000025B8', - "blank;": '\U00002423', - "blk12;": '\U00002592', - "blk14;": '\U00002591', - "blk34;": '\U00002593', - "block;": '\U00002588', - "bnot;": '\U00002310', - "bopf;": '\U0001D553', - "bot;": '\U000022A5', - "bottom;": '\U000022A5', - "bowtie;": '\U000022C8', - "boxDL;": '\U00002557', - "boxDR;": '\U00002554', - "boxDl;": '\U00002556', - "boxDr;": '\U00002553', - "boxH;": '\U00002550', - "boxHD;": '\U00002566', - "boxHU;": '\U00002569', - "boxHd;": '\U00002564', - "boxHu;": '\U00002567', - "boxUL;": '\U0000255D', - "boxUR;": '\U0000255A', - "boxUl;": '\U0000255C', - "boxUr;": '\U00002559', - "boxV;": '\U00002551', - "boxVH;": '\U0000256C', - "boxVL;": '\U00002563', - "boxVR;": '\U00002560', - "boxVh;": '\U0000256B', - "boxVl;": '\U00002562', - "boxVr;": '\U0000255F', - "boxbox;": '\U000029C9', - "boxdL;": '\U00002555', - "boxdR;": '\U00002552', - "boxdl;": '\U00002510', - "boxdr;": '\U0000250C', - "boxh;": '\U00002500', - "boxhD;": '\U00002565', - "boxhU;": '\U00002568', - "boxhd;": '\U0000252C', - "boxhu;": '\U00002534', - "boxminus;": '\U0000229F', - "boxplus;": '\U0000229E', - "boxtimes;": '\U000022A0', - "boxuL;": '\U0000255B', - "boxuR;": '\U00002558', - "boxul;": '\U00002518', - "boxur;": '\U00002514', - "boxv;": '\U00002502', - "boxvH;": '\U0000256A', - "boxvL;": '\U00002561', - "boxvR;": '\U0000255E', - "boxvh;": '\U0000253C', - "boxvl;": '\U00002524', - "boxvr;": '\U0000251C', - "bprime;": '\U00002035', - "breve;": '\U000002D8', - "brvbar;": '\U000000A6', - "bscr;": '\U0001D4B7', - "bsemi;": '\U0000204F', - "bsim;": '\U0000223D', - "bsime;": '\U000022CD', - "bsol;": '\U0000005C', - "bsolb;": '\U000029C5', - "bsolhsub;": '\U000027C8', - "bull;": '\U00002022', - "bullet;": '\U00002022', - "bump;": '\U0000224E', - "bumpE;": '\U00002AAE', - "bumpe;": '\U0000224F', - "bumpeq;": '\U0000224F', - "cacute;": '\U00000107', - "cap;": '\U00002229', - "capand;": '\U00002A44', - "capbrcup;": '\U00002A49', - "capcap;": '\U00002A4B', - "capcup;": '\U00002A47', - "capdot;": '\U00002A40', - "caret;": '\U00002041', - "caron;": '\U000002C7', - "ccaps;": '\U00002A4D', - "ccaron;": '\U0000010D', - "ccedil;": '\U000000E7', - "ccirc;": '\U00000109', - "ccups;": '\U00002A4C', - "ccupssm;": '\U00002A50', - "cdot;": '\U0000010B', - "cedil;": '\U000000B8', - "cemptyv;": '\U000029B2', - "cent;": '\U000000A2', - "centerdot;": '\U000000B7', - "cfr;": '\U0001D520', - "chcy;": '\U00000447', - "check;": '\U00002713', - "checkmark;": '\U00002713', - "chi;": '\U000003C7', - "cir;": '\U000025CB', - "cirE;": '\U000029C3', - "circ;": '\U000002C6', - "circeq;": '\U00002257', - "circlearrowleft;": '\U000021BA', - "circlearrowright;": '\U000021BB', - "circledR;": '\U000000AE', - "circledS;": '\U000024C8', - "circledast;": '\U0000229B', - "circledcirc;": '\U0000229A', - "circleddash;": '\U0000229D', - "cire;": '\U00002257', - "cirfnint;": '\U00002A10', - "cirmid;": '\U00002AEF', - "cirscir;": '\U000029C2', - "clubs;": '\U00002663', - "clubsuit;": '\U00002663', - "colon;": '\U0000003A', - "colone;": '\U00002254', - "coloneq;": '\U00002254', - "comma;": '\U0000002C', - "commat;": '\U00000040', - "comp;": '\U00002201', - "compfn;": '\U00002218', - "complement;": '\U00002201', - "complexes;": '\U00002102', - "cong;": '\U00002245', - "congdot;": '\U00002A6D', - "conint;": '\U0000222E', - "copf;": '\U0001D554', - "coprod;": '\U00002210', - "copy;": '\U000000A9', - "copysr;": '\U00002117', - "crarr;": '\U000021B5', - "cross;": '\U00002717', - "cscr;": '\U0001D4B8', - "csub;": '\U00002ACF', - "csube;": '\U00002AD1', - "csup;": '\U00002AD0', - "csupe;": '\U00002AD2', - "ctdot;": '\U000022EF', - "cudarrl;": '\U00002938', - "cudarrr;": '\U00002935', - "cuepr;": '\U000022DE', - "cuesc;": '\U000022DF', - "cularr;": '\U000021B6', - "cularrp;": '\U0000293D', - "cup;": '\U0000222A', - "cupbrcap;": '\U00002A48', - "cupcap;": '\U00002A46', - "cupcup;": '\U00002A4A', - "cupdot;": '\U0000228D', - "cupor;": '\U00002A45', - "curarr;": '\U000021B7', - "curarrm;": '\U0000293C', - "curlyeqprec;": '\U000022DE', - "curlyeqsucc;": '\U000022DF', - "curlyvee;": '\U000022CE', - "curlywedge;": '\U000022CF', - "curren;": '\U000000A4', - "curvearrowleft;": '\U000021B6', - "curvearrowright;": '\U000021B7', - "cuvee;": '\U000022CE', - "cuwed;": '\U000022CF', - "cwconint;": '\U00002232', - "cwint;": '\U00002231', - "cylcty;": '\U0000232D', - "dArr;": '\U000021D3', - "dHar;": '\U00002965', - "dagger;": '\U00002020', - "daleth;": '\U00002138', - "darr;": '\U00002193', - "dash;": '\U00002010', - "dashv;": '\U000022A3', - "dbkarow;": '\U0000290F', - "dblac;": '\U000002DD', - "dcaron;": '\U0000010F', - "dcy;": '\U00000434', - "dd;": '\U00002146', - "ddagger;": '\U00002021', - "ddarr;": '\U000021CA', - "ddotseq;": '\U00002A77', - "deg;": '\U000000B0', - "delta;": '\U000003B4', - "demptyv;": '\U000029B1', - "dfisht;": '\U0000297F', - "dfr;": '\U0001D521', - "dharl;": '\U000021C3', - "dharr;": '\U000021C2', - "diam;": '\U000022C4', - "diamond;": '\U000022C4', - "diamondsuit;": '\U00002666', - "diams;": '\U00002666', - "die;": '\U000000A8', - "digamma;": '\U000003DD', - "disin;": '\U000022F2', - "div;": '\U000000F7', - "divide;": '\U000000F7', - "divideontimes;": '\U000022C7', - "divonx;": '\U000022C7', - "djcy;": '\U00000452', - "dlcorn;": '\U0000231E', - "dlcrop;": '\U0000230D', - "dollar;": '\U00000024', - "dopf;": '\U0001D555', - "dot;": '\U000002D9', - "doteq;": '\U00002250', - "doteqdot;": '\U00002251', - "dotminus;": '\U00002238', - "dotplus;": '\U00002214', - "dotsquare;": '\U000022A1', - "doublebarwedge;": '\U00002306', - "downarrow;": '\U00002193', - "downdownarrows;": '\U000021CA', - "downharpoonleft;": '\U000021C3', - "downharpoonright;": '\U000021C2', - "drbkarow;": '\U00002910', - "drcorn;": '\U0000231F', - "drcrop;": '\U0000230C', - "dscr;": '\U0001D4B9', - "dscy;": '\U00000455', - "dsol;": '\U000029F6', - "dstrok;": '\U00000111', - "dtdot;": '\U000022F1', - "dtri;": '\U000025BF', - "dtrif;": '\U000025BE', - "duarr;": '\U000021F5', - "duhar;": '\U0000296F', - "dwangle;": '\U000029A6', - "dzcy;": '\U0000045F', - "dzigrarr;": '\U000027FF', - "eDDot;": '\U00002A77', - "eDot;": '\U00002251', - "eacute;": '\U000000E9', - "easter;": '\U00002A6E', - "ecaron;": '\U0000011B', - "ecir;": '\U00002256', - "ecirc;": '\U000000EA', - "ecolon;": '\U00002255', - "ecy;": '\U0000044D', - "edot;": '\U00000117', - "ee;": '\U00002147', - "efDot;": '\U00002252', - "efr;": '\U0001D522', - "eg;": '\U00002A9A', - "egrave;": '\U000000E8', - "egs;": '\U00002A96', - "egsdot;": '\U00002A98', - "el;": '\U00002A99', - "elinters;": '\U000023E7', - "ell;": '\U00002113', - "els;": '\U00002A95', - "elsdot;": '\U00002A97', - "emacr;": '\U00000113', - "empty;": '\U00002205', - "emptyset;": '\U00002205', - "emptyv;": '\U00002205', - "emsp;": '\U00002003', - "emsp13;": '\U00002004', - "emsp14;": '\U00002005', - "eng;": '\U0000014B', - "ensp;": '\U00002002', - "eogon;": '\U00000119', - "eopf;": '\U0001D556', - "epar;": '\U000022D5', - "eparsl;": '\U000029E3', - "eplus;": '\U00002A71', - "epsi;": '\U000003B5', - "epsilon;": '\U000003B5', - "epsiv;": '\U000003F5', - "eqcirc;": '\U00002256', - "eqcolon;": '\U00002255', - "eqsim;": '\U00002242', - "eqslantgtr;": '\U00002A96', - "eqslantless;": '\U00002A95', - "equals;": '\U0000003D', - "equest;": '\U0000225F', - "equiv;": '\U00002261', - "equivDD;": '\U00002A78', - "eqvparsl;": '\U000029E5', - "erDot;": '\U00002253', - "erarr;": '\U00002971', - "escr;": '\U0000212F', - "esdot;": '\U00002250', - "esim;": '\U00002242', - "eta;": '\U000003B7', - "eth;": '\U000000F0', - "euml;": '\U000000EB', - "euro;": '\U000020AC', - "excl;": '\U00000021', - "exist;": '\U00002203', - "expectation;": '\U00002130', - "exponentiale;": '\U00002147', - "fallingdotseq;": '\U00002252', - "fcy;": '\U00000444', - "female;": '\U00002640', - "ffilig;": '\U0000FB03', - "fflig;": '\U0000FB00', - "ffllig;": '\U0000FB04', - "ffr;": '\U0001D523', - "filig;": '\U0000FB01', - "flat;": '\U0000266D', - "fllig;": '\U0000FB02', - "fltns;": '\U000025B1', - "fnof;": '\U00000192', - "fopf;": '\U0001D557', - "forall;": '\U00002200', - "fork;": '\U000022D4', - "forkv;": '\U00002AD9', - "fpartint;": '\U00002A0D', - "frac12;": '\U000000BD', - "frac13;": '\U00002153', - "frac14;": '\U000000BC', - "frac15;": '\U00002155', - "frac16;": '\U00002159', - "frac18;": '\U0000215B', - "frac23;": '\U00002154', - "frac25;": '\U00002156', - "frac34;": '\U000000BE', - "frac35;": '\U00002157', - "frac38;": '\U0000215C', - "frac45;": '\U00002158', - "frac56;": '\U0000215A', - "frac58;": '\U0000215D', - "frac78;": '\U0000215E', - "frasl;": '\U00002044', - "frown;": '\U00002322', - "fscr;": '\U0001D4BB', - "gE;": '\U00002267', - "gEl;": '\U00002A8C', - "gacute;": '\U000001F5', - "gamma;": '\U000003B3', - "gammad;": '\U000003DD', - "gap;": '\U00002A86', - "gbreve;": '\U0000011F', - "gcirc;": '\U0000011D', - "gcy;": '\U00000433', - "gdot;": '\U00000121', - "ge;": '\U00002265', - "gel;": '\U000022DB', - "geq;": '\U00002265', - "geqq;": '\U00002267', - "geqslant;": '\U00002A7E', - "ges;": '\U00002A7E', - "gescc;": '\U00002AA9', - "gesdot;": '\U00002A80', - "gesdoto;": '\U00002A82', - "gesdotol;": '\U00002A84', - "gesles;": '\U00002A94', - "gfr;": '\U0001D524', - "gg;": '\U0000226B', - "ggg;": '\U000022D9', - "gimel;": '\U00002137', - "gjcy;": '\U00000453', - "gl;": '\U00002277', - "glE;": '\U00002A92', - "gla;": '\U00002AA5', - "glj;": '\U00002AA4', - "gnE;": '\U00002269', - "gnap;": '\U00002A8A', - "gnapprox;": '\U00002A8A', - "gne;": '\U00002A88', - "gneq;": '\U00002A88', - "gneqq;": '\U00002269', - "gnsim;": '\U000022E7', - "gopf;": '\U0001D558', - "grave;": '\U00000060', - "gscr;": '\U0000210A', - "gsim;": '\U00002273', - "gsime;": '\U00002A8E', - "gsiml;": '\U00002A90', - "gt;": '\U0000003E', - "gtcc;": '\U00002AA7', - "gtcir;": '\U00002A7A', - "gtdot;": '\U000022D7', - "gtlPar;": '\U00002995', - "gtquest;": '\U00002A7C', - "gtrapprox;": '\U00002A86', - "gtrarr;": '\U00002978', - "gtrdot;": '\U000022D7', - "gtreqless;": '\U000022DB', - "gtreqqless;": '\U00002A8C', - "gtrless;": '\U00002277', - "gtrsim;": '\U00002273', - "hArr;": '\U000021D4', - "hairsp;": '\U0000200A', - "half;": '\U000000BD', - "hamilt;": '\U0000210B', - "hardcy;": '\U0000044A', - "harr;": '\U00002194', - "harrcir;": '\U00002948', - "harrw;": '\U000021AD', - "hbar;": '\U0000210F', - "hcirc;": '\U00000125', - "hearts;": '\U00002665', - "heartsuit;": '\U00002665', - "hellip;": '\U00002026', - "hercon;": '\U000022B9', - "hfr;": '\U0001D525', - "hksearow;": '\U00002925', - "hkswarow;": '\U00002926', - "hoarr;": '\U000021FF', - "homtht;": '\U0000223B', - "hookleftarrow;": '\U000021A9', - "hookrightarrow;": '\U000021AA', - "hopf;": '\U0001D559', - "horbar;": '\U00002015', - "hscr;": '\U0001D4BD', - "hslash;": '\U0000210F', - "hstrok;": '\U00000127', - "hybull;": '\U00002043', - "hyphen;": '\U00002010', - "iacute;": '\U000000ED', - "ic;": '\U00002063', - "icirc;": '\U000000EE', - "icy;": '\U00000438', - "iecy;": '\U00000435', - "iexcl;": '\U000000A1', - "iff;": '\U000021D4', - "ifr;": '\U0001D526', - "igrave;": '\U000000EC', - "ii;": '\U00002148', - "iiiint;": '\U00002A0C', - "iiint;": '\U0000222D', - "iinfin;": '\U000029DC', - "iiota;": '\U00002129', - "ijlig;": '\U00000133', - "imacr;": '\U0000012B', - "image;": '\U00002111', - "imagline;": '\U00002110', - "imagpart;": '\U00002111', - "imath;": '\U00000131', - "imof;": '\U000022B7', - "imped;": '\U000001B5', - "in;": '\U00002208', - "incare;": '\U00002105', - "infin;": '\U0000221E', - "infintie;": '\U000029DD', - "inodot;": '\U00000131', - "int;": '\U0000222B', - "intcal;": '\U000022BA', - "integers;": '\U00002124', - "intercal;": '\U000022BA', - "intlarhk;": '\U00002A17', - "intprod;": '\U00002A3C', - "iocy;": '\U00000451', - "iogon;": '\U0000012F', - "iopf;": '\U0001D55A', - "iota;": '\U000003B9', - "iprod;": '\U00002A3C', - "iquest;": '\U000000BF', - "iscr;": '\U0001D4BE', - "isin;": '\U00002208', - "isinE;": '\U000022F9', - "isindot;": '\U000022F5', - "isins;": '\U000022F4', - "isinsv;": '\U000022F3', - "isinv;": '\U00002208', - "it;": '\U00002062', - "itilde;": '\U00000129', - "iukcy;": '\U00000456', - "iuml;": '\U000000EF', - "jcirc;": '\U00000135', - "jcy;": '\U00000439', - "jfr;": '\U0001D527', - "jmath;": '\U00000237', - "jopf;": '\U0001D55B', - "jscr;": '\U0001D4BF', - "jsercy;": '\U00000458', - "jukcy;": '\U00000454', - "kappa;": '\U000003BA', - "kappav;": '\U000003F0', - "kcedil;": '\U00000137', - "kcy;": '\U0000043A', - "kfr;": '\U0001D528', - "kgreen;": '\U00000138', - "khcy;": '\U00000445', - "kjcy;": '\U0000045C', - "kopf;": '\U0001D55C', - "kscr;": '\U0001D4C0', - "lAarr;": '\U000021DA', - "lArr;": '\U000021D0', - "lAtail;": '\U0000291B', - "lBarr;": '\U0000290E', - "lE;": '\U00002266', - "lEg;": '\U00002A8B', - "lHar;": '\U00002962', - "lacute;": '\U0000013A', - "laemptyv;": '\U000029B4', - "lagran;": '\U00002112', - "lambda;": '\U000003BB', - "lang;": '\U000027E8', - "langd;": '\U00002991', - "langle;": '\U000027E8', - "lap;": '\U00002A85', - "laquo;": '\U000000AB', - "larr;": '\U00002190', - "larrb;": '\U000021E4', - "larrbfs;": '\U0000291F', - "larrfs;": '\U0000291D', - "larrhk;": '\U000021A9', - "larrlp;": '\U000021AB', - "larrpl;": '\U00002939', - "larrsim;": '\U00002973', - "larrtl;": '\U000021A2', - "lat;": '\U00002AAB', - "latail;": '\U00002919', - "late;": '\U00002AAD', - "lbarr;": '\U0000290C', - "lbbrk;": '\U00002772', - "lbrace;": '\U0000007B', - "lbrack;": '\U0000005B', - "lbrke;": '\U0000298B', - "lbrksld;": '\U0000298F', - "lbrkslu;": '\U0000298D', - "lcaron;": '\U0000013E', - "lcedil;": '\U0000013C', - "lceil;": '\U00002308', - "lcub;": '\U0000007B', - "lcy;": '\U0000043B', - "ldca;": '\U00002936', - "ldquo;": '\U0000201C', - "ldquor;": '\U0000201E', - "ldrdhar;": '\U00002967', - "ldrushar;": '\U0000294B', - "ldsh;": '\U000021B2', - "le;": '\U00002264', - "leftarrow;": '\U00002190', - "leftarrowtail;": '\U000021A2', - "leftharpoondown;": '\U000021BD', - "leftharpoonup;": '\U000021BC', - "leftleftarrows;": '\U000021C7', - "leftrightarrow;": '\U00002194', - "leftrightarrows;": '\U000021C6', - "leftrightharpoons;": '\U000021CB', - "leftrightsquigarrow;": '\U000021AD', - "leftthreetimes;": '\U000022CB', - "leg;": '\U000022DA', - "leq;": '\U00002264', - "leqq;": '\U00002266', - "leqslant;": '\U00002A7D', - "les;": '\U00002A7D', - "lescc;": '\U00002AA8', - "lesdot;": '\U00002A7F', - "lesdoto;": '\U00002A81', - "lesdotor;": '\U00002A83', - "lesges;": '\U00002A93', - "lessapprox;": '\U00002A85', - "lessdot;": '\U000022D6', - "lesseqgtr;": '\U000022DA', - "lesseqqgtr;": '\U00002A8B', - "lessgtr;": '\U00002276', - "lesssim;": '\U00002272', - "lfisht;": '\U0000297C', - "lfloor;": '\U0000230A', - "lfr;": '\U0001D529', - "lg;": '\U00002276', - "lgE;": '\U00002A91', - "lhard;": '\U000021BD', - "lharu;": '\U000021BC', - "lharul;": '\U0000296A', - "lhblk;": '\U00002584', - "ljcy;": '\U00000459', - "ll;": '\U0000226A', - "llarr;": '\U000021C7', - "llcorner;": '\U0000231E', - "llhard;": '\U0000296B', - "lltri;": '\U000025FA', - "lmidot;": '\U00000140', - "lmoust;": '\U000023B0', - "lmoustache;": '\U000023B0', - "lnE;": '\U00002268', - "lnap;": '\U00002A89', - "lnapprox;": '\U00002A89', - "lne;": '\U00002A87', - "lneq;": '\U00002A87', - "lneqq;": '\U00002268', - "lnsim;": '\U000022E6', - "loang;": '\U000027EC', - "loarr;": '\U000021FD', - "lobrk;": '\U000027E6', - "longleftarrow;": '\U000027F5', - "longleftrightarrow;": '\U000027F7', - "longmapsto;": '\U000027FC', - "longrightarrow;": '\U000027F6', - "looparrowleft;": '\U000021AB', - "looparrowright;": '\U000021AC', - "lopar;": '\U00002985', - "lopf;": '\U0001D55D', - "loplus;": '\U00002A2D', - "lotimes;": '\U00002A34', - "lowast;": '\U00002217', - "lowbar;": '\U0000005F', - "loz;": '\U000025CA', - "lozenge;": '\U000025CA', - "lozf;": '\U000029EB', - "lpar;": '\U00000028', - "lparlt;": '\U00002993', - "lrarr;": '\U000021C6', - "lrcorner;": '\U0000231F', - "lrhar;": '\U000021CB', - "lrhard;": '\U0000296D', - "lrm;": '\U0000200E', - "lrtri;": '\U000022BF', - "lsaquo;": '\U00002039', - "lscr;": '\U0001D4C1', - "lsh;": '\U000021B0', - "lsim;": '\U00002272', - "lsime;": '\U00002A8D', - "lsimg;": '\U00002A8F', - "lsqb;": '\U0000005B', - "lsquo;": '\U00002018', - "lsquor;": '\U0000201A', - "lstrok;": '\U00000142', - "lt;": '\U0000003C', - "ltcc;": '\U00002AA6', - "ltcir;": '\U00002A79', - "ltdot;": '\U000022D6', - "lthree;": '\U000022CB', - "ltimes;": '\U000022C9', - "ltlarr;": '\U00002976', - "ltquest;": '\U00002A7B', - "ltrPar;": '\U00002996', - "ltri;": '\U000025C3', - "ltrie;": '\U000022B4', - "ltrif;": '\U000025C2', - "lurdshar;": '\U0000294A', - "luruhar;": '\U00002966', - "mDDot;": '\U0000223A', - "macr;": '\U000000AF', - "male;": '\U00002642', - "malt;": '\U00002720', - "maltese;": '\U00002720', - "map;": '\U000021A6', - "mapsto;": '\U000021A6', - "mapstodown;": '\U000021A7', - "mapstoleft;": '\U000021A4', - "mapstoup;": '\U000021A5', - "marker;": '\U000025AE', - "mcomma;": '\U00002A29', - "mcy;": '\U0000043C', - "mdash;": '\U00002014', - "measuredangle;": '\U00002221', - "mfr;": '\U0001D52A', - "mho;": '\U00002127', - "micro;": '\U000000B5', - "mid;": '\U00002223', - "midast;": '\U0000002A', - "midcir;": '\U00002AF0', - "middot;": '\U000000B7', - "minus;": '\U00002212', - "minusb;": '\U0000229F', - "minusd;": '\U00002238', - "minusdu;": '\U00002A2A', - "mlcp;": '\U00002ADB', - "mldr;": '\U00002026', - "mnplus;": '\U00002213', - "models;": '\U000022A7', - "mopf;": '\U0001D55E', - "mp;": '\U00002213', - "mscr;": '\U0001D4C2', - "mstpos;": '\U0000223E', - "mu;": '\U000003BC', - "multimap;": '\U000022B8', - "mumap;": '\U000022B8', - "nLeftarrow;": '\U000021CD', - "nLeftrightarrow;": '\U000021CE', - "nRightarrow;": '\U000021CF', - "nVDash;": '\U000022AF', - "nVdash;": '\U000022AE', - "nabla;": '\U00002207', - "nacute;": '\U00000144', - "nap;": '\U00002249', - "napos;": '\U00000149', - "napprox;": '\U00002249', - "natur;": '\U0000266E', - "natural;": '\U0000266E', - "naturals;": '\U00002115', - "nbsp;": '\U000000A0', - "ncap;": '\U00002A43', - "ncaron;": '\U00000148', - "ncedil;": '\U00000146', - "ncong;": '\U00002247', - "ncup;": '\U00002A42', - "ncy;": '\U0000043D', - "ndash;": '\U00002013', - "ne;": '\U00002260', - "neArr;": '\U000021D7', - "nearhk;": '\U00002924', - "nearr;": '\U00002197', - "nearrow;": '\U00002197', - "nequiv;": '\U00002262', - "nesear;": '\U00002928', - "nexist;": '\U00002204', - "nexists;": '\U00002204', - "nfr;": '\U0001D52B', - "nge;": '\U00002271', - "ngeq;": '\U00002271', - "ngsim;": '\U00002275', - "ngt;": '\U0000226F', - "ngtr;": '\U0000226F', - "nhArr;": '\U000021CE', - "nharr;": '\U000021AE', - "nhpar;": '\U00002AF2', - "ni;": '\U0000220B', - "nis;": '\U000022FC', - "nisd;": '\U000022FA', - "niv;": '\U0000220B', - "njcy;": '\U0000045A', - "nlArr;": '\U000021CD', - "nlarr;": '\U0000219A', - "nldr;": '\U00002025', - "nle;": '\U00002270', - "nleftarrow;": '\U0000219A', - "nleftrightarrow;": '\U000021AE', - "nleq;": '\U00002270', - "nless;": '\U0000226E', - "nlsim;": '\U00002274', - "nlt;": '\U0000226E', - "nltri;": '\U000022EA', - "nltrie;": '\U000022EC', - "nmid;": '\U00002224', - "nopf;": '\U0001D55F', - "not;": '\U000000AC', - "notin;": '\U00002209', - "notinva;": '\U00002209', - "notinvb;": '\U000022F7', - "notinvc;": '\U000022F6', - "notni;": '\U0000220C', - "notniva;": '\U0000220C', - "notnivb;": '\U000022FE', - "notnivc;": '\U000022FD', - "npar;": '\U00002226', - "nparallel;": '\U00002226', - "npolint;": '\U00002A14', - "npr;": '\U00002280', - "nprcue;": '\U000022E0', - "nprec;": '\U00002280', - "nrArr;": '\U000021CF', - "nrarr;": '\U0000219B', - "nrightarrow;": '\U0000219B', - "nrtri;": '\U000022EB', - "nrtrie;": '\U000022ED', - "nsc;": '\U00002281', - "nsccue;": '\U000022E1', - "nscr;": '\U0001D4C3', - "nshortmid;": '\U00002224', - "nshortparallel;": '\U00002226', - "nsim;": '\U00002241', - "nsime;": '\U00002244', - "nsimeq;": '\U00002244', - "nsmid;": '\U00002224', - "nspar;": '\U00002226', - "nsqsube;": '\U000022E2', - "nsqsupe;": '\U000022E3', - "nsub;": '\U00002284', - "nsube;": '\U00002288', - "nsubseteq;": '\U00002288', - "nsucc;": '\U00002281', - "nsup;": '\U00002285', - "nsupe;": '\U00002289', - "nsupseteq;": '\U00002289', - "ntgl;": '\U00002279', - "ntilde;": '\U000000F1', - "ntlg;": '\U00002278', - "ntriangleleft;": '\U000022EA', - "ntrianglelefteq;": '\U000022EC', - "ntriangleright;": '\U000022EB', - "ntrianglerighteq;": '\U000022ED', - "nu;": '\U000003BD', - "num;": '\U00000023', - "numero;": '\U00002116', - "numsp;": '\U00002007', - "nvDash;": '\U000022AD', - "nvHarr;": '\U00002904', - "nvdash;": '\U000022AC', - "nvinfin;": '\U000029DE', - "nvlArr;": '\U00002902', - "nvrArr;": '\U00002903', - "nwArr;": '\U000021D6', - "nwarhk;": '\U00002923', - "nwarr;": '\U00002196', - "nwarrow;": '\U00002196', - "nwnear;": '\U00002927', - "oS;": '\U000024C8', - "oacute;": '\U000000F3', - "oast;": '\U0000229B', - "ocir;": '\U0000229A', - "ocirc;": '\U000000F4', - "ocy;": '\U0000043E', - "odash;": '\U0000229D', - "odblac;": '\U00000151', - "odiv;": '\U00002A38', - "odot;": '\U00002299', - "odsold;": '\U000029BC', - "oelig;": '\U00000153', - "ofcir;": '\U000029BF', - "ofr;": '\U0001D52C', - "ogon;": '\U000002DB', - "ograve;": '\U000000F2', - "ogt;": '\U000029C1', - "ohbar;": '\U000029B5', - "ohm;": '\U000003A9', - "oint;": '\U0000222E', - "olarr;": '\U000021BA', - "olcir;": '\U000029BE', - "olcross;": '\U000029BB', - "oline;": '\U0000203E', - "olt;": '\U000029C0', - "omacr;": '\U0000014D', - "omega;": '\U000003C9', - "omicron;": '\U000003BF', - "omid;": '\U000029B6', - "ominus;": '\U00002296', - "oopf;": '\U0001D560', - "opar;": '\U000029B7', - "operp;": '\U000029B9', - "oplus;": '\U00002295', - "or;": '\U00002228', - "orarr;": '\U000021BB', - "ord;": '\U00002A5D', - "order;": '\U00002134', - "orderof;": '\U00002134', - "ordf;": '\U000000AA', - "ordm;": '\U000000BA', - "origof;": '\U000022B6', - "oror;": '\U00002A56', - "orslope;": '\U00002A57', - "orv;": '\U00002A5B', - "oscr;": '\U00002134', - "oslash;": '\U000000F8', - "osol;": '\U00002298', - "otilde;": '\U000000F5', - "otimes;": '\U00002297', - "otimesas;": '\U00002A36', - "ouml;": '\U000000F6', - "ovbar;": '\U0000233D', - "par;": '\U00002225', - "para;": '\U000000B6', - "parallel;": '\U00002225', - "parsim;": '\U00002AF3', - "parsl;": '\U00002AFD', - "part;": '\U00002202', - "pcy;": '\U0000043F', - "percnt;": '\U00000025', - "period;": '\U0000002E', - "permil;": '\U00002030', - "perp;": '\U000022A5', - "pertenk;": '\U00002031', - "pfr;": '\U0001D52D', - "phi;": '\U000003C6', - "phiv;": '\U000003D5', - "phmmat;": '\U00002133', - "phone;": '\U0000260E', - "pi;": '\U000003C0', - "pitchfork;": '\U000022D4', - "piv;": '\U000003D6', - "planck;": '\U0000210F', - "planckh;": '\U0000210E', - "plankv;": '\U0000210F', - "plus;": '\U0000002B', - "plusacir;": '\U00002A23', - "plusb;": '\U0000229E', - "pluscir;": '\U00002A22', - "plusdo;": '\U00002214', - "plusdu;": '\U00002A25', - "pluse;": '\U00002A72', - "plusmn;": '\U000000B1', - "plussim;": '\U00002A26', - "plustwo;": '\U00002A27', - "pm;": '\U000000B1', - "pointint;": '\U00002A15', - "popf;": '\U0001D561', - "pound;": '\U000000A3', - "pr;": '\U0000227A', - "prE;": '\U00002AB3', - "prap;": '\U00002AB7', - "prcue;": '\U0000227C', - "pre;": '\U00002AAF', - "prec;": '\U0000227A', - "precapprox;": '\U00002AB7', - "preccurlyeq;": '\U0000227C', - "preceq;": '\U00002AAF', - "precnapprox;": '\U00002AB9', - "precneqq;": '\U00002AB5', - "precnsim;": '\U000022E8', - "precsim;": '\U0000227E', - "prime;": '\U00002032', - "primes;": '\U00002119', - "prnE;": '\U00002AB5', - "prnap;": '\U00002AB9', - "prnsim;": '\U000022E8', - "prod;": '\U0000220F', - "profalar;": '\U0000232E', - "profline;": '\U00002312', - "profsurf;": '\U00002313', - "prop;": '\U0000221D', - "propto;": '\U0000221D', - "prsim;": '\U0000227E', - "prurel;": '\U000022B0', - "pscr;": '\U0001D4C5', - "psi;": '\U000003C8', - "puncsp;": '\U00002008', - "qfr;": '\U0001D52E', - "qint;": '\U00002A0C', - "qopf;": '\U0001D562', - "qprime;": '\U00002057', - "qscr;": '\U0001D4C6', - "quaternions;": '\U0000210D', - "quatint;": '\U00002A16', - "quest;": '\U0000003F', - "questeq;": '\U0000225F', - "quot;": '\U00000022', - "rAarr;": '\U000021DB', - "rArr;": '\U000021D2', - "rAtail;": '\U0000291C', - "rBarr;": '\U0000290F', - "rHar;": '\U00002964', - "racute;": '\U00000155', - "radic;": '\U0000221A', - "raemptyv;": '\U000029B3', - "rang;": '\U000027E9', - "rangd;": '\U00002992', - "range;": '\U000029A5', - "rangle;": '\U000027E9', - "raquo;": '\U000000BB', - "rarr;": '\U00002192', - "rarrap;": '\U00002975', - "rarrb;": '\U000021E5', - "rarrbfs;": '\U00002920', - "rarrc;": '\U00002933', - "rarrfs;": '\U0000291E', - "rarrhk;": '\U000021AA', - "rarrlp;": '\U000021AC', - "rarrpl;": '\U00002945', - "rarrsim;": '\U00002974', - "rarrtl;": '\U000021A3', - "rarrw;": '\U0000219D', - "ratail;": '\U0000291A', - "ratio;": '\U00002236', - "rationals;": '\U0000211A', - "rbarr;": '\U0000290D', - "rbbrk;": '\U00002773', - "rbrace;": '\U0000007D', - "rbrack;": '\U0000005D', - "rbrke;": '\U0000298C', - "rbrksld;": '\U0000298E', - "rbrkslu;": '\U00002990', - "rcaron;": '\U00000159', - "rcedil;": '\U00000157', - "rceil;": '\U00002309', - "rcub;": '\U0000007D', - "rcy;": '\U00000440', - "rdca;": '\U00002937', - "rdldhar;": '\U00002969', - "rdquo;": '\U0000201D', - "rdquor;": '\U0000201D', - "rdsh;": '\U000021B3', - "real;": '\U0000211C', - "realine;": '\U0000211B', - "realpart;": '\U0000211C', - "reals;": '\U0000211D', - "rect;": '\U000025AD', - "reg;": '\U000000AE', - "rfisht;": '\U0000297D', - "rfloor;": '\U0000230B', - "rfr;": '\U0001D52F', - "rhard;": '\U000021C1', - "rharu;": '\U000021C0', - "rharul;": '\U0000296C', - "rho;": '\U000003C1', - "rhov;": '\U000003F1', - "rightarrow;": '\U00002192', - "rightarrowtail;": '\U000021A3', - "rightharpoondown;": '\U000021C1', - "rightharpoonup;": '\U000021C0', - "rightleftarrows;": '\U000021C4', - "rightleftharpoons;": '\U000021CC', - "rightrightarrows;": '\U000021C9', - "rightsquigarrow;": '\U0000219D', - "rightthreetimes;": '\U000022CC', - "ring;": '\U000002DA', - "risingdotseq;": '\U00002253', - "rlarr;": '\U000021C4', - "rlhar;": '\U000021CC', - "rlm;": '\U0000200F', - "rmoust;": '\U000023B1', - "rmoustache;": '\U000023B1', - "rnmid;": '\U00002AEE', - "roang;": '\U000027ED', - "roarr;": '\U000021FE', - "robrk;": '\U000027E7', - "ropar;": '\U00002986', - "ropf;": '\U0001D563', - "roplus;": '\U00002A2E', - "rotimes;": '\U00002A35', - "rpar;": '\U00000029', - "rpargt;": '\U00002994', - "rppolint;": '\U00002A12', - "rrarr;": '\U000021C9', - "rsaquo;": '\U0000203A', - "rscr;": '\U0001D4C7', - "rsh;": '\U000021B1', - "rsqb;": '\U0000005D', - "rsquo;": '\U00002019', - "rsquor;": '\U00002019', - "rthree;": '\U000022CC', - "rtimes;": '\U000022CA', - "rtri;": '\U000025B9', - "rtrie;": '\U000022B5', - "rtrif;": '\U000025B8', - "rtriltri;": '\U000029CE', - "ruluhar;": '\U00002968', - "rx;": '\U0000211E', - "sacute;": '\U0000015B', - "sbquo;": '\U0000201A', - "sc;": '\U0000227B', - "scE;": '\U00002AB4', - "scap;": '\U00002AB8', - "scaron;": '\U00000161', - "sccue;": '\U0000227D', - "sce;": '\U00002AB0', - "scedil;": '\U0000015F', - "scirc;": '\U0000015D', - "scnE;": '\U00002AB6', - "scnap;": '\U00002ABA', - "scnsim;": '\U000022E9', - "scpolint;": '\U00002A13', - "scsim;": '\U0000227F', - "scy;": '\U00000441', - "sdot;": '\U000022C5', - "sdotb;": '\U000022A1', - "sdote;": '\U00002A66', - "seArr;": '\U000021D8', - "searhk;": '\U00002925', - "searr;": '\U00002198', - "searrow;": '\U00002198', - "sect;": '\U000000A7', - "semi;": '\U0000003B', - "seswar;": '\U00002929', - "setminus;": '\U00002216', - "setmn;": '\U00002216', - "sext;": '\U00002736', - "sfr;": '\U0001D530', - "sfrown;": '\U00002322', - "sharp;": '\U0000266F', - "shchcy;": '\U00000449', - "shcy;": '\U00000448', - "shortmid;": '\U00002223', - "shortparallel;": '\U00002225', - "shy;": '\U000000AD', - "sigma;": '\U000003C3', - "sigmaf;": '\U000003C2', - "sigmav;": '\U000003C2', - "sim;": '\U0000223C', - "simdot;": '\U00002A6A', - "sime;": '\U00002243', - "simeq;": '\U00002243', - "simg;": '\U00002A9E', - "simgE;": '\U00002AA0', - "siml;": '\U00002A9D', - "simlE;": '\U00002A9F', - "simne;": '\U00002246', - "simplus;": '\U00002A24', - "simrarr;": '\U00002972', - "slarr;": '\U00002190', - "smallsetminus;": '\U00002216', - "smashp;": '\U00002A33', - "smeparsl;": '\U000029E4', - "smid;": '\U00002223', - "smile;": '\U00002323', - "smt;": '\U00002AAA', - "smte;": '\U00002AAC', - "softcy;": '\U0000044C', - "sol;": '\U0000002F', - "solb;": '\U000029C4', - "solbar;": '\U0000233F', - "sopf;": '\U0001D564', - "spades;": '\U00002660', - "spadesuit;": '\U00002660', - "spar;": '\U00002225', - "sqcap;": '\U00002293', - "sqcup;": '\U00002294', - "sqsub;": '\U0000228F', - "sqsube;": '\U00002291', - "sqsubset;": '\U0000228F', - "sqsubseteq;": '\U00002291', - "sqsup;": '\U00002290', - "sqsupe;": '\U00002292', - "sqsupset;": '\U00002290', - "sqsupseteq;": '\U00002292', - "squ;": '\U000025A1', - "square;": '\U000025A1', - "squarf;": '\U000025AA', - "squf;": '\U000025AA', - "srarr;": '\U00002192', - "sscr;": '\U0001D4C8', - "ssetmn;": '\U00002216', - "ssmile;": '\U00002323', - "sstarf;": '\U000022C6', - "star;": '\U00002606', - "starf;": '\U00002605', - "straightepsilon;": '\U000003F5', - "straightphi;": '\U000003D5', - "strns;": '\U000000AF', - "sub;": '\U00002282', - "subE;": '\U00002AC5', - "subdot;": '\U00002ABD', - "sube;": '\U00002286', - "subedot;": '\U00002AC3', - "submult;": '\U00002AC1', - "subnE;": '\U00002ACB', - "subne;": '\U0000228A', - "subplus;": '\U00002ABF', - "subrarr;": '\U00002979', - "subset;": '\U00002282', - "subseteq;": '\U00002286', - "subseteqq;": '\U00002AC5', - "subsetneq;": '\U0000228A', - "subsetneqq;": '\U00002ACB', - "subsim;": '\U00002AC7', - "subsub;": '\U00002AD5', - "subsup;": '\U00002AD3', - "succ;": '\U0000227B', - "succapprox;": '\U00002AB8', - "succcurlyeq;": '\U0000227D', - "succeq;": '\U00002AB0', - "succnapprox;": '\U00002ABA', - "succneqq;": '\U00002AB6', - "succnsim;": '\U000022E9', - "succsim;": '\U0000227F', - "sum;": '\U00002211', - "sung;": '\U0000266A', - "sup;": '\U00002283', - "sup1;": '\U000000B9', - "sup2;": '\U000000B2', - "sup3;": '\U000000B3', - "supE;": '\U00002AC6', - "supdot;": '\U00002ABE', - "supdsub;": '\U00002AD8', - "supe;": '\U00002287', - "supedot;": '\U00002AC4', - "suphsol;": '\U000027C9', - "suphsub;": '\U00002AD7', - "suplarr;": '\U0000297B', - "supmult;": '\U00002AC2', - "supnE;": '\U00002ACC', - "supne;": '\U0000228B', - "supplus;": '\U00002AC0', - "supset;": '\U00002283', - "supseteq;": '\U00002287', - "supseteqq;": '\U00002AC6', - "supsetneq;": '\U0000228B', - "supsetneqq;": '\U00002ACC', - "supsim;": '\U00002AC8', - "supsub;": '\U00002AD4', - "supsup;": '\U00002AD6', - "swArr;": '\U000021D9', - "swarhk;": '\U00002926', - "swarr;": '\U00002199', - "swarrow;": '\U00002199', - "swnwar;": '\U0000292A', - "szlig;": '\U000000DF', - "target;": '\U00002316', - "tau;": '\U000003C4', - "tbrk;": '\U000023B4', - "tcaron;": '\U00000165', - "tcedil;": '\U00000163', - "tcy;": '\U00000442', - "tdot;": '\U000020DB', - "telrec;": '\U00002315', - "tfr;": '\U0001D531', - "there4;": '\U00002234', - "therefore;": '\U00002234', - "theta;": '\U000003B8', - "thetasym;": '\U000003D1', - "thetav;": '\U000003D1', - "thickapprox;": '\U00002248', - "thicksim;": '\U0000223C', - "thinsp;": '\U00002009', - "thkap;": '\U00002248', - "thksim;": '\U0000223C', - "thorn;": '\U000000FE', - "tilde;": '\U000002DC', - "times;": '\U000000D7', - "timesb;": '\U000022A0', - "timesbar;": '\U00002A31', - "timesd;": '\U00002A30', - "tint;": '\U0000222D', - "toea;": '\U00002928', - "top;": '\U000022A4', - "topbot;": '\U00002336', - "topcir;": '\U00002AF1', - "topf;": '\U0001D565', - "topfork;": '\U00002ADA', - "tosa;": '\U00002929', - "tprime;": '\U00002034', - "trade;": '\U00002122', - "triangle;": '\U000025B5', - "triangledown;": '\U000025BF', - "triangleleft;": '\U000025C3', - "trianglelefteq;": '\U000022B4', - "triangleq;": '\U0000225C', - "triangleright;": '\U000025B9', - "trianglerighteq;": '\U000022B5', - "tridot;": '\U000025EC', - "trie;": '\U0000225C', - "triminus;": '\U00002A3A', - "triplus;": '\U00002A39', - "trisb;": '\U000029CD', - "tritime;": '\U00002A3B', - "trpezium;": '\U000023E2', - "tscr;": '\U0001D4C9', - "tscy;": '\U00000446', - "tshcy;": '\U0000045B', - "tstrok;": '\U00000167', - "twixt;": '\U0000226C', - "twoheadleftarrow;": '\U0000219E', - "twoheadrightarrow;": '\U000021A0', - "uArr;": '\U000021D1', - "uHar;": '\U00002963', - "uacute;": '\U000000FA', - "uarr;": '\U00002191', - "ubrcy;": '\U0000045E', - "ubreve;": '\U0000016D', - "ucirc;": '\U000000FB', - "ucy;": '\U00000443', - "udarr;": '\U000021C5', - "udblac;": '\U00000171', - "udhar;": '\U0000296E', - "ufisht;": '\U0000297E', - "ufr;": '\U0001D532', - "ugrave;": '\U000000F9', - "uharl;": '\U000021BF', - "uharr;": '\U000021BE', - "uhblk;": '\U00002580', - "ulcorn;": '\U0000231C', - "ulcorner;": '\U0000231C', - "ulcrop;": '\U0000230F', - "ultri;": '\U000025F8', - "umacr;": '\U0000016B', - "uml;": '\U000000A8', - "uogon;": '\U00000173', - "uopf;": '\U0001D566', - "uparrow;": '\U00002191', - "updownarrow;": '\U00002195', - "upharpoonleft;": '\U000021BF', - "upharpoonright;": '\U000021BE', - "uplus;": '\U0000228E', - "upsi;": '\U000003C5', - "upsih;": '\U000003D2', - "upsilon;": '\U000003C5', - "upuparrows;": '\U000021C8', - "urcorn;": '\U0000231D', - "urcorner;": '\U0000231D', - "urcrop;": '\U0000230E', - "uring;": '\U0000016F', - "urtri;": '\U000025F9', - "uscr;": '\U0001D4CA', - "utdot;": '\U000022F0', - "utilde;": '\U00000169', - "utri;": '\U000025B5', - "utrif;": '\U000025B4', - "uuarr;": '\U000021C8', - "uuml;": '\U000000FC', - "uwangle;": '\U000029A7', - "vArr;": '\U000021D5', - "vBar;": '\U00002AE8', - "vBarv;": '\U00002AE9', - "vDash;": '\U000022A8', - "vangrt;": '\U0000299C', - "varepsilon;": '\U000003F5', - "varkappa;": '\U000003F0', - "varnothing;": '\U00002205', - "varphi;": '\U000003D5', - "varpi;": '\U000003D6', - "varpropto;": '\U0000221D', - "varr;": '\U00002195', - "varrho;": '\U000003F1', - "varsigma;": '\U000003C2', - "vartheta;": '\U000003D1', - "vartriangleleft;": '\U000022B2', - "vartriangleright;": '\U000022B3', - "vcy;": '\U00000432', - "vdash;": '\U000022A2', - "vee;": '\U00002228', - "veebar;": '\U000022BB', - "veeeq;": '\U0000225A', - "vellip;": '\U000022EE', - "verbar;": '\U0000007C', - "vert;": '\U0000007C', - "vfr;": '\U0001D533', - "vltri;": '\U000022B2', - "vopf;": '\U0001D567', - "vprop;": '\U0000221D', - "vrtri;": '\U000022B3', - "vscr;": '\U0001D4CB', - "vzigzag;": '\U0000299A', - "wcirc;": '\U00000175', - "wedbar;": '\U00002A5F', - "wedge;": '\U00002227', - "wedgeq;": '\U00002259', - "weierp;": '\U00002118', - "wfr;": '\U0001D534', - "wopf;": '\U0001D568', - "wp;": '\U00002118', - "wr;": '\U00002240', - "wreath;": '\U00002240', - "wscr;": '\U0001D4CC', - "xcap;": '\U000022C2', - "xcirc;": '\U000025EF', - "xcup;": '\U000022C3', - "xdtri;": '\U000025BD', - "xfr;": '\U0001D535', - "xhArr;": '\U000027FA', - "xharr;": '\U000027F7', - "xi;": '\U000003BE', - "xlArr;": '\U000027F8', - "xlarr;": '\U000027F5', - "xmap;": '\U000027FC', - "xnis;": '\U000022FB', - "xodot;": '\U00002A00', - "xopf;": '\U0001D569', - "xoplus;": '\U00002A01', - "xotime;": '\U00002A02', - "xrArr;": '\U000027F9', - "xrarr;": '\U000027F6', - "xscr;": '\U0001D4CD', - "xsqcup;": '\U00002A06', - "xuplus;": '\U00002A04', - "xutri;": '\U000025B3', - "xvee;": '\U000022C1', - "xwedge;": '\U000022C0', - "yacute;": '\U000000FD', - "yacy;": '\U0000044F', - "ycirc;": '\U00000177', - "ycy;": '\U0000044B', - "yen;": '\U000000A5', - "yfr;": '\U0001D536', - "yicy;": '\U00000457', - "yopf;": '\U0001D56A', - "yscr;": '\U0001D4CE', - "yucy;": '\U0000044E', - "yuml;": '\U000000FF', - "zacute;": '\U0000017A', - "zcaron;": '\U0000017E', - "zcy;": '\U00000437', - "zdot;": '\U0000017C', - "zeetrf;": '\U00002128', - "zeta;": '\U000003B6', - "zfr;": '\U0001D537', - "zhcy;": '\U00000436', - "zigrarr;": '\U000021DD', - "zopf;": '\U0001D56B', - "zscr;": '\U0001D4CF', - "zwj;": '\U0000200D', - "zwnj;": '\U0000200C', - "AElig": '\U000000C6', - "AMP": '\U00000026', - "Aacute": '\U000000C1', - "Acirc": '\U000000C2', - "Agrave": '\U000000C0', - "Aring": '\U000000C5', - "Atilde": '\U000000C3', - "Auml": '\U000000C4', - "COPY": '\U000000A9', - "Ccedil": '\U000000C7', - "ETH": '\U000000D0', - "Eacute": '\U000000C9', - "Ecirc": '\U000000CA', - "Egrave": '\U000000C8', - "Euml": '\U000000CB', - "GT": '\U0000003E', - "Iacute": '\U000000CD', - "Icirc": '\U000000CE', - "Igrave": '\U000000CC', - "Iuml": '\U000000CF', - "LT": '\U0000003C', - "Ntilde": '\U000000D1', - "Oacute": '\U000000D3', - "Ocirc": '\U000000D4', - "Ograve": '\U000000D2', - "Oslash": '\U000000D8', - "Otilde": '\U000000D5', - "Ouml": '\U000000D6', - "QUOT": '\U00000022', - "REG": '\U000000AE', - "THORN": '\U000000DE', - "Uacute": '\U000000DA', - "Ucirc": '\U000000DB', - "Ugrave": '\U000000D9', - "Uuml": '\U000000DC', - "Yacute": '\U000000DD', - "aacute": '\U000000E1', - "acirc": '\U000000E2', - "acute": '\U000000B4', - "aelig": '\U000000E6', - "agrave": '\U000000E0', - "amp": '\U00000026', - "aring": '\U000000E5', - "atilde": '\U000000E3', - "auml": '\U000000E4', - "brvbar": '\U000000A6', - "ccedil": '\U000000E7', - "cedil": '\U000000B8', - "cent": '\U000000A2', - "copy": '\U000000A9', - "curren": '\U000000A4', - "deg": '\U000000B0', - "divide": '\U000000F7', - "eacute": '\U000000E9', - "ecirc": '\U000000EA', - "egrave": '\U000000E8', - "eth": '\U000000F0', - "euml": '\U000000EB', - "frac12": '\U000000BD', - "frac14": '\U000000BC', - "frac34": '\U000000BE', - "gt": '\U0000003E', - "iacute": '\U000000ED', - "icirc": '\U000000EE', - "iexcl": '\U000000A1', - "igrave": '\U000000EC', - "iquest": '\U000000BF', - "iuml": '\U000000EF', - "laquo": '\U000000AB', - "lt": '\U0000003C', - "macr": '\U000000AF', - "micro": '\U000000B5', - "middot": '\U000000B7', - "nbsp": '\U000000A0', - "not": '\U000000AC', - "ntilde": '\U000000F1', - "oacute": '\U000000F3', - "ocirc": '\U000000F4', - "ograve": '\U000000F2', - "ordf": '\U000000AA', - "ordm": '\U000000BA', - "oslash": '\U000000F8', - "otilde": '\U000000F5', - "ouml": '\U000000F6', - "para": '\U000000B6', - "plusmn": '\U000000B1', - "pound": '\U000000A3', - "quot": '\U00000022', - "raquo": '\U000000BB', - "reg": '\U000000AE', - "sect": '\U000000A7', - "shy": '\U000000AD', - "sup1": '\U000000B9', - "sup2": '\U000000B2', - "sup3": '\U000000B3', - "szlig": '\U000000DF', - "thorn": '\U000000FE', - "times": '\U000000D7', - "uacute": '\U000000FA', - "ucirc": '\U000000FB', - "ugrave": '\U000000F9', - "uml": '\U000000A8', - "uuml": '\U000000FC', - "yacute": '\U000000FD', - "yen": '\U000000A5', - "yuml": '\U000000FF', -} - -// HTML entities that are two unicode codepoints. -var entity2 = map[string][2]rune{ - // TODO(nigeltao): Handle replacements that are wider than their names. - // "nLt;": {'\u226A', '\u20D2'}, - // "nGt;": {'\u226B', '\u20D2'}, - "NotEqualTilde;": {'\u2242', '\u0338'}, - "NotGreaterFullEqual;": {'\u2267', '\u0338'}, - "NotGreaterGreater;": {'\u226B', '\u0338'}, - "NotGreaterSlantEqual;": {'\u2A7E', '\u0338'}, - "NotHumpDownHump;": {'\u224E', '\u0338'}, - "NotHumpEqual;": {'\u224F', '\u0338'}, - "NotLeftTriangleBar;": {'\u29CF', '\u0338'}, - "NotLessLess;": {'\u226A', '\u0338'}, - "NotLessSlantEqual;": {'\u2A7D', '\u0338'}, - "NotNestedGreaterGreater;": {'\u2AA2', '\u0338'}, - "NotNestedLessLess;": {'\u2AA1', '\u0338'}, - "NotPrecedesEqual;": {'\u2AAF', '\u0338'}, - "NotRightTriangleBar;": {'\u29D0', '\u0338'}, - "NotSquareSubset;": {'\u228F', '\u0338'}, - "NotSquareSuperset;": {'\u2290', '\u0338'}, - "NotSubset;": {'\u2282', '\u20D2'}, - "NotSucceedsEqual;": {'\u2AB0', '\u0338'}, - "NotSucceedsTilde;": {'\u227F', '\u0338'}, - "NotSuperset;": {'\u2283', '\u20D2'}, - "ThickSpace;": {'\u205F', '\u200A'}, - "acE;": {'\u223E', '\u0333'}, - "bne;": {'\u003D', '\u20E5'}, - "bnequiv;": {'\u2261', '\u20E5'}, - "caps;": {'\u2229', '\uFE00'}, - "cups;": {'\u222A', '\uFE00'}, - "fjlig;": {'\u0066', '\u006A'}, - "gesl;": {'\u22DB', '\uFE00'}, - "gvertneqq;": {'\u2269', '\uFE00'}, - "gvnE;": {'\u2269', '\uFE00'}, - "lates;": {'\u2AAD', '\uFE00'}, - "lesg;": {'\u22DA', '\uFE00'}, - "lvertneqq;": {'\u2268', '\uFE00'}, - "lvnE;": {'\u2268', '\uFE00'}, - "nGg;": {'\u22D9', '\u0338'}, - "nGtv;": {'\u226B', '\u0338'}, - "nLl;": {'\u22D8', '\u0338'}, - "nLtv;": {'\u226A', '\u0338'}, - "nang;": {'\u2220', '\u20D2'}, - "napE;": {'\u2A70', '\u0338'}, - "napid;": {'\u224B', '\u0338'}, - "nbump;": {'\u224E', '\u0338'}, - "nbumpe;": {'\u224F', '\u0338'}, - "ncongdot;": {'\u2A6D', '\u0338'}, - "nedot;": {'\u2250', '\u0338'}, - "nesim;": {'\u2242', '\u0338'}, - "ngE;": {'\u2267', '\u0338'}, - "ngeqq;": {'\u2267', '\u0338'}, - "ngeqslant;": {'\u2A7E', '\u0338'}, - "nges;": {'\u2A7E', '\u0338'}, - "nlE;": {'\u2266', '\u0338'}, - "nleqq;": {'\u2266', '\u0338'}, - "nleqslant;": {'\u2A7D', '\u0338'}, - "nles;": {'\u2A7D', '\u0338'}, - "notinE;": {'\u22F9', '\u0338'}, - "notindot;": {'\u22F5', '\u0338'}, - "nparsl;": {'\u2AFD', '\u20E5'}, - "npart;": {'\u2202', '\u0338'}, - "npre;": {'\u2AAF', '\u0338'}, - "npreceq;": {'\u2AAF', '\u0338'}, - "nrarrc;": {'\u2933', '\u0338'}, - "nrarrw;": {'\u219D', '\u0338'}, - "nsce;": {'\u2AB0', '\u0338'}, - "nsubE;": {'\u2AC5', '\u0338'}, - "nsubset;": {'\u2282', '\u20D2'}, - "nsubseteqq;": {'\u2AC5', '\u0338'}, - "nsucceq;": {'\u2AB0', '\u0338'}, - "nsupE;": {'\u2AC6', '\u0338'}, - "nsupset;": {'\u2283', '\u20D2'}, - "nsupseteqq;": {'\u2AC6', '\u0338'}, - "nvap;": {'\u224D', '\u20D2'}, - "nvge;": {'\u2265', '\u20D2'}, - "nvgt;": {'\u003E', '\u20D2'}, - "nvle;": {'\u2264', '\u20D2'}, - "nvlt;": {'\u003C', '\u20D2'}, - "nvltrie;": {'\u22B4', '\u20D2'}, - "nvrtrie;": {'\u22B5', '\u20D2'}, - "nvsim;": {'\u223C', '\u20D2'}, - "race;": {'\u223D', '\u0331'}, - "smtes;": {'\u2AAC', '\uFE00'}, - "sqcaps;": {'\u2293', '\uFE00'}, - "sqcups;": {'\u2294', '\uFE00'}, - "varsubsetneq;": {'\u228A', '\uFE00'}, - "varsubsetneqq;": {'\u2ACB', '\uFE00'}, - "varsupsetneq;": {'\u228B', '\uFE00'}, - "varsupsetneqq;": {'\u2ACC', '\uFE00'}, - "vnsub;": {'\u2282', '\u20D2'}, - "vnsup;": {'\u2283', '\u20D2'}, - "vsubnE;": {'\u2ACB', '\uFE00'}, - "vsubne;": {'\u228A', '\uFE00'}, - "vsupnE;": {'\u2ACC', '\uFE00'}, - "vsupne;": {'\u228B', '\uFE00'}, -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/entity_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/entity_test.go deleted file mode 100644 index b53f866fa..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/entity_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// 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 ( - "testing" - "unicode/utf8" -) - -func TestEntityLength(t *testing.T) { - // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key). - // The +1 comes from the leading "&". This property implies that the length of - // unescaped text is <= the length of escaped text. - for k, v := range entity { - if 1+len(k) < utf8.RuneLen(v) { - t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v)) - } - if len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' { - t.Errorf("entity name %s is %d characters, but longestEntityWithoutSemicolon=%d", k, len(k), longestEntityWithoutSemicolon) - } - } - for k, v := range entity2 { - if 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) { - t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v[0]) + string(v[1])) - } - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/escape.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/escape.go deleted file mode 100644 index d85613962..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/escape.go +++ /dev/null @@ -1,258 +0,0 @@ -// 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': - 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 -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/escape_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/escape_test.go deleted file mode 100644 index b405d4b4a..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/escape_test.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2013 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 "testing" - -type unescapeTest struct { - // A short description of the test case. - desc string - // The HTML text. - html string - // The unescaped text. - unescaped string -} - -var unescapeTests = []unescapeTest{ - // Handle no entities. - { - "copy", - "A\ttext\nstring", - "A\ttext\nstring", - }, - // Handle simple named entities. - { - "simple", - "& > <", - "& > <", - }, - // Handle hitting the end of the string. - { - "stringEnd", - "& &", - "& &", - }, - // Handle entities with two codepoints. - { - "multiCodepoint", - "text ⋛︀ blah", - "text \u22db\ufe00 blah", - }, - // Handle decimal numeric entities. - { - "decimalEntity", - "Delta = Δ ", - "Delta = Δ ", - }, - // Handle hexadecimal numeric entities. - { - "hexadecimalEntity", - "Lambda = λ = λ ", - "Lambda = λ = λ ", - }, - // Handle numeric early termination. - { - "numericEnds", - "&# &#x €43 © = ©f = ©", - "&# &#x €43 © = ©f = ©", - }, - // Handle numeric ISO-8859-1 entity replacements. - { - "numericReplacements", - "Footnote‡", - "Footnote‡", - }, -} - -func TestUnescape(t *testing.T) { - for _, tt := range unescapeTests { - unescaped := UnescapeString(tt.html) - if unescaped != tt.unescaped { - t.Errorf("TestUnescape %s: want %q, got %q", tt.desc, tt.unescaped, unescaped) - } - } -} - -func TestUnescapeEscape(t *testing.T) { - ss := []string{ - ``, - `abc def`, - `a & b`, - `a&b`, - `a & b`, - `"`, - `"`, - `"<&>"`, - `"<&>"`, - `3&5==1 && 0<1, "0<1", a+acute=á`, - `The special characters are: <, >, &, ' and "`, - } - for _, s := range ss { - if got := UnescapeString(EscapeString(s)); got != s { - t.Errorf("got %q want %q", got, s) - } - } -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/example_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/example_test.go deleted file mode 100644 index 0b06ed773..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -// This example demonstrates parsing HTML data and walking the resulting tree. -package html_test - -import ( - "fmt" - "log" - "strings" - - "golang.org/x/net/html" -) - -func ExampleParse() { - s := `

              Links:

              ` - doc, err := html.Parse(strings.NewReader(s)) - if err != nil { - log.Fatal(err) - } - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.ElementNode && n.Data == "a" { - for _, a := range n.Attr { - if a.Key == "href" { - fmt.Println(a.Val) - break - } - } - } - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - f(doc) - // Output: - // foo - // /bar/baz -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/foreign.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/foreign.go deleted file mode 100644 index 9da9e9dc4..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/foreign.go +++ /dev/null @@ -1,222 +0,0 @@ -// 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", -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/node.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/node.go deleted file mode 100644 index 1350eef22..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/node.go +++ /dev/null @@ -1,225 +0,0 @@ -// 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 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 -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/node_test.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/node_test.go deleted file mode 100644 index 471102f3a..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/node_test.go +++ /dev/null @@ -1,146 +0,0 @@ -// 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 ( - "fmt" -) - -// checkTreeConsistency checks that a node and its descendants are all -// consistent in their parent/child/sibling relationships. -func checkTreeConsistency(n *Node) error { - return checkTreeConsistency1(n, 0) -} - -func checkTreeConsistency1(n *Node, depth int) error { - if depth == 1e4 { - return fmt.Errorf("html: tree looks like it contains a cycle") - } - if err := checkNodeConsistency(n); err != nil { - return err - } - for c := n.FirstChild; c != nil; c = c.NextSibling { - if err := checkTreeConsistency1(c, depth+1); err != nil { - return err - } - } - return nil -} - -// checkNodeConsistency checks that a node's parent/child/sibling relationships -// are consistent. -func checkNodeConsistency(n *Node) error { - if n == nil { - return nil - } - - nParent := 0 - for p := n.Parent; p != nil; p = p.Parent { - nParent++ - if nParent == 1e4 { - return fmt.Errorf("html: parent list looks like an infinite loop") - } - } - - nForward := 0 - for c := n.FirstChild; c != nil; c = c.NextSibling { - nForward++ - if nForward == 1e6 { - return fmt.Errorf("html: forward list of children looks like an infinite loop") - } - if c.Parent != n { - return fmt.Errorf("html: inconsistent child/parent relationship") - } - } - - nBackward := 0 - for c := n.LastChild; c != nil; c = c.PrevSibling { - nBackward++ - if nBackward == 1e6 { - return fmt.Errorf("html: backward list of children looks like an infinite loop") - } - if c.Parent != n { - return fmt.Errorf("html: inconsistent child/parent relationship") - } - } - - if n.Parent != nil { - if n.Parent == n { - return fmt.Errorf("html: inconsistent parent relationship") - } - if n.Parent == n.FirstChild { - return fmt.Errorf("html: inconsistent parent/first relationship") - } - if n.Parent == n.LastChild { - return fmt.Errorf("html: inconsistent parent/last relationship") - } - if n.Parent == n.PrevSibling { - return fmt.Errorf("html: inconsistent parent/prev relationship") - } - if n.Parent == n.NextSibling { - return fmt.Errorf("html: inconsistent parent/next relationship") - } - - parentHasNAsAChild := false - for c := n.Parent.FirstChild; c != nil; c = c.NextSibling { - if c == n { - parentHasNAsAChild = true - break - } - } - if !parentHasNAsAChild { - return fmt.Errorf("html: inconsistent parent/child relationship") - } - } - - if n.PrevSibling != nil && n.PrevSibling.NextSibling != n { - return fmt.Errorf("html: inconsistent prev/next relationship") - } - if n.NextSibling != nil && n.NextSibling.PrevSibling != n { - return fmt.Errorf("html: inconsistent next/prev relationship") - } - - if (n.FirstChild == nil) != (n.LastChild == nil) { - return fmt.Errorf("html: inconsistent first/last relationship") - } - if n.FirstChild != nil && n.FirstChild == n.LastChild { - // We have a sole child. - if n.FirstChild.PrevSibling != nil || n.FirstChild.NextSibling != nil { - return fmt.Errorf("html: inconsistent sole child's sibling relationship") - } - } - - seen := map[*Node]bool{} - - var last *Node - for c := n.FirstChild; c != nil; c = c.NextSibling { - if seen[c] { - return fmt.Errorf("html: inconsistent repeated child") - } - seen[c] = true - last = c - } - if last != n.LastChild { - return fmt.Errorf("html: inconsistent last relationship") - } - - var first *Node - for c := n.LastChild; c != nil; c = c.PrevSibling { - if !seen[c] { - return fmt.Errorf("html: inconsistent missing child") - } - delete(seen, c) - first = c - } - if first != n.FirstChild { - return fmt.Errorf("html: inconsistent first relationship") - } - - if len(seen) != 0 { - return fmt.Errorf("html: inconsistent forwards/backwards child list") - } - - return nil -} diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/parse.go b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/parse.go deleted file mode 100644 index 038941d70..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/parse.go +++ /dev/null @@ -1,2460 +0,0 @@ -// 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 ( - "errors" - "fmt" - "io" - "strings" - - a "golang.org/x/net/html/atom" -) - -// A parser implements the HTML5 parsing algorithm: -// https://html.spec.whatwg.org/multipage/syntax.html#tree-construction -type parser struct { - // tokenizer provides the tokens for the parser. - tokenizer *Tokenizer - // tok is the most recently read token. - tok Token - // Self-closing tags like
              are treated as start tags, except that - // hasSelfClosingToken is set while they are being processed. - hasSelfClosingToken bool - // doc is the document root element. - doc *Node - // The stack of open elements (section 12.2.4.2) and active formatting - // elements (section 12.2.4.3). - oe, afe nodeStack - // Element pointers (section 12.2.4.4). - head, form *Node - // Other parsing state flags (section 12.2.4.5). - scripting, framesetOK bool - // The stack of template insertion modes - templateStack insertionModeStack - // im is the current insertion mode. - im insertionMode - // originalIM is the insertion mode to go back to after completing a text - // or inTableText insertion mode. - originalIM insertionMode - // fosterParenting is whether new elements should be inserted according to - // the foster parenting rules (section 12.2.6.1). - fosterParenting bool - // quirks is whether the parser is operating in "quirks mode." - quirks bool - // fragment is whether the parser is parsing an HTML fragment. - fragment bool - // context is the context element when parsing an HTML fragment - // (section 12.4). - context *Node -} - -func (p *parser) top() *Node { - if n := p.oe.top(); n != nil { - return n - } - return p.doc -} - -// Stop tags for use in popUntil. These come from section 12.2.4.2. -var ( - defaultScopeStopTags = map[string][]a.Atom{ - "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, - "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, - "svg": {a.Desc, a.ForeignObject, a.Title}, - } -) - -type scope int - -const ( - defaultScope scope = iota - listItemScope - buttonScope - tableScope - tableRowScope - tableBodyScope - selectScope -) - -// popUntil pops the stack of open elements at the highest element whose tag -// is in matchTags, provided there is no higher element in the scope's stop -// tags (as defined in section 12.2.4.2). It returns whether or not there was -// such an element. If there was not, popUntil leaves the stack unchanged. -// -// For example, the set of stop tags for table scope is: "html", "table". If -// the stack was: -// ["html", "body", "font", "table", "b", "i", "u"] -// then popUntil(tableScope, "font") would return false, but -// popUntil(tableScope, "i") would return true and the stack would become: -// ["html", "body", "font", "table", "b"] -// -// If an element's tag is in both the stop tags and matchTags, then the stack -// will be popped and the function returns true (provided, of course, there was -// no higher element in the stack that was also in the stop tags). For example, -// popUntil(tableScope, "table") returns true and leaves: -// ["html", "body", "font"] -func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { - if i := p.indexOfElementInScope(s, matchTags...); i != -1 { - p.oe = p.oe[:i] - return true - } - return false -} - -// indexOfElementInScope returns the index in p.oe of the highest element whose -// tag is in matchTags that is in scope. If no matching element is in scope, it -// returns -1. -func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - if p.oe[i].Namespace == "" { - for _, t := range matchTags { - if t == tagAtom { - return i - } - } - switch s { - case defaultScope: - // No-op. - case listItemScope: - if tagAtom == a.Ol || tagAtom == a.Ul { - return -1 - } - case buttonScope: - if tagAtom == a.Button { - return -1 - } - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { - return -1 - } - case selectScope: - if tagAtom != a.Optgroup && tagAtom != a.Option { - return -1 - } - default: - panic("unreachable") - } - } - switch s { - case defaultScope, listItemScope, buttonScope: - for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { - if t == tagAtom { - return -1 - } - } - } - } - return -1 -} - -// elementInScope is like popUntil, except that it doesn't modify the stack of -// open elements. -func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { - return p.indexOfElementInScope(s, matchTags...) != -1 -} - -// clearStackToContext pops elements off the stack of open elements until a -// scope-defined element is found. -func (p *parser) clearStackToContext(s scope) { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - switch s { - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { - p.oe = p.oe[:i+1] - return - } - case tableRowScope: - if tagAtom == a.Html || tagAtom == a.Tr || tagAtom == a.Template { - p.oe = p.oe[:i+1] - return - } - case tableBodyScope: - if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead || tagAtom == a.Template { - p.oe = p.oe[:i+1] - return - } - default: - panic("unreachable") - } - } -} - -// parseGenericRawTextElements implements the generic raw text element parsing -// algorithm defined in 12.2.6.2. -// https://html.spec.whatwg.org/multipage/parsing.html#parsing-elements-that-contain-only-text -// TODO: Since both RAWTEXT and RCDATA states are treated as tokenizer's part -// officially, need to make tokenizer consider both states. -func (p *parser) parseGenericRawTextElement() { - p.addElement() - p.originalIM = p.im - p.im = textIM -} - -// generateImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of dd, dt, li, optgroup, option, p, rb, rp, rt or rtc. -// If exceptions are specified, nodes with that name will not be popped off. -func (p *parser) generateImpliedEndTags(exceptions ...string) { - var i int -loop: - for i = len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if n.Type != ElementNode { - break - } - switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc: - for _, except := range exceptions { - if n.Data == except { - break loop - } - } - continue - } - break - } - - p.oe = p.oe[:i+1] -} - -// addChild adds a child node n to the top element, and pushes n onto the stack -// of open elements if it is an element node. -func (p *parser) addChild(n *Node) { - if p.shouldFosterParent() { - p.fosterParent(n) - } else { - p.top().AppendChild(n) - } - - if n.Type == ElementNode { - p.oe = append(p.oe, n) - } -} - -// shouldFosterParent returns whether the next node to be added should be -// foster parented. -func (p *parser) shouldFosterParent() bool { - if p.fosterParenting { - switch p.top().DataAtom { - case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: - return true - } - } - return false -} - -// fosterParent adds a child node according to the foster parenting rules. -// Section 12.2.6.1, "foster parenting". -func (p *parser) fosterParent(n *Node) { - var table, parent, prev, template *Node - var i int - for i = len(p.oe) - 1; i >= 0; i-- { - if p.oe[i].DataAtom == a.Table { - table = p.oe[i] - break - } - } - - var j int - for j = len(p.oe) - 1; j >= 0; j-- { - if p.oe[j].DataAtom == a.Template { - template = p.oe[j] - break - } - } - - if template != nil && (table == nil || j > i) { - template.AppendChild(n) - return - } - - if table == nil { - // The foster parent is the html element. - parent = p.oe[0] - } else { - parent = table.Parent - } - if parent == nil { - parent = p.oe[i-1] - } - - if table != nil { - prev = table.PrevSibling - } else { - prev = parent.LastChild - } - if prev != nil && prev.Type == TextNode && n.Type == TextNode { - prev.Data += n.Data - return - } - - parent.InsertBefore(n, table) -} - -// addText adds text to the preceding node if it is a text node, or else it -// calls addChild with a new text node. -func (p *parser) addText(text string) { - if text == "" { - return - } - - if p.shouldFosterParent() { - p.fosterParent(&Node{ - Type: TextNode, - Data: text, - }) - return - } - - t := p.top() - if n := t.LastChild; n != nil && n.Type == TextNode { - n.Data += text - return - } - p.addChild(&Node{ - Type: TextNode, - Data: text, - }) -} - -// addElement adds a child element based on the current token. -func (p *parser) addElement() { - p.addChild(&Node{ - Type: ElementNode, - DataAtom: p.tok.DataAtom, - Data: p.tok.Data, - Attr: p.tok.Attr, - }) -} - -// Section 12.2.4.3. -func (p *parser) addFormattingElement() { - tagAtom, attr := p.tok.DataAtom, p.tok.Attr - p.addElement() - - // Implement the Noah's Ark clause, but with three per family instead of two. - identicalElements := 0 -findIdenticalElements: - for i := len(p.afe) - 1; i >= 0; i-- { - n := p.afe[i] - if n.Type == scopeMarkerNode { - break - } - if n.Type != ElementNode { - continue - } - if n.Namespace != "" { - continue - } - if n.DataAtom != tagAtom { - continue - } - if len(n.Attr) != len(attr) { - continue - } - compareAttributes: - for _, t0 := range n.Attr { - for _, t1 := range attr { - if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { - // Found a match for this attribute, continue with the next attribute. - continue compareAttributes - } - } - // If we get here, there is no attribute that matches a. - // Therefore the element is not identical to the new one. - continue findIdenticalElements - } - - identicalElements++ - if identicalElements >= 3 { - p.afe.remove(n) - } - } - - p.afe = append(p.afe, p.top()) -} - -// Section 12.2.4.3. -func (p *parser) clearActiveFormattingElements() { - for { - if n := p.afe.pop(); len(p.afe) == 0 || n.Type == scopeMarkerNode { - return - } - } -} - -// Section 12.2.4.3. -func (p *parser) reconstructActiveFormattingElements() { - n := p.afe.top() - if n == nil { - return - } - if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { - return - } - i := len(p.afe) - 1 - for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { - if i == 0 { - i = -1 - break - } - i-- - n = p.afe[i] - } - for { - i++ - clone := p.afe[i].clone() - p.addChild(clone) - p.afe[i] = clone - if i == len(p.afe)-1 { - break - } - } -} - -// Section 12.2.5. -func (p *parser) acknowledgeSelfClosingTag() { - p.hasSelfClosingToken = false -} - -// An insertion mode (section 12.2.4.1) is the state transition function from -// a particular state in the HTML5 parser's state machine. It updates the -// parser's fields depending on parser.tok (where ErrorToken means EOF). -// It returns whether the token was consumed. -type insertionMode func(*parser) bool - -// setOriginalIM sets the insertion mode to return to after completing a text or -// inTableText insertion mode. -// Section 12.2.4.1, "using the rules for". -func (p *parser) setOriginalIM() { - if p.originalIM != nil { - panic("html: bad parser state: originalIM was set twice") - } - p.originalIM = p.im -} - -// Section 12.2.4.1, "reset the insertion mode". -func (p *parser) resetInsertionMode() { - for i := len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - last := i == 0 - if last && p.context != nil { - n = p.context - } - - switch n.DataAtom { - case a.Select: - if !last { - for ancestor, first := n, p.oe[0]; ancestor != first; { - ancestor = p.oe[p.oe.index(ancestor)-1] - switch ancestor.DataAtom { - case a.Template: - p.im = inSelectIM - return - case a.Table: - p.im = inSelectInTableIM - return - } - } - } - p.im = inSelectIM - case a.Td, a.Th: - // TODO: remove this divergence from the HTML5 spec. - // - // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 - p.im = inCellIM - case a.Tr: - p.im = inRowIM - case a.Tbody, a.Thead, a.Tfoot: - p.im = inTableBodyIM - case a.Caption: - p.im = inCaptionIM - case a.Colgroup: - p.im = inColumnGroupIM - case a.Table: - p.im = inTableIM - case a.Template: - // TODO: remove this divergence from the HTML5 spec. - if n.Namespace != "" { - continue - } - p.im = p.templateStack.top() - case a.Head: - // TODO: remove this divergence from the HTML5 spec. - // - // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 - p.im = inHeadIM - case a.Body: - p.im = inBodyIM - case a.Frameset: - p.im = inFramesetIM - case a.Html: - if p.head == nil { - p.im = beforeHeadIM - } else { - p.im = afterHeadIM - } - default: - if last { - p.im = inBodyIM - return - } - continue - } - return - } -} - -const whitespace = " \t\r\n\f" - -// Section 12.2.6.4.1. -func initialIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - n, quirks := parseDoctype(p.tok.Data) - p.doc.AppendChild(n) - p.quirks = quirks - p.im = beforeHTMLIM - return true - } - p.quirks = true - p.im = beforeHTMLIM - return false -} - -// Section 12.2.6.4.2. -func beforeHTMLIM(p *parser) bool { - switch p.tok.Type { - case DoctypeToken: - // Ignore the token. - return true - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - if p.tok.DataAtom == a.Html { - p.addElement() - p.im = beforeHeadIM - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - } - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false -} - -// Section 12.2.6.4.3. -func beforeHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Head: - p.addElement() - p.head = p.top() - p.im = inHeadIM - return true - case a.Html: - return inBodyIM(p) - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.6.4.4. -func inHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta: - p.addElement() - p.oe.pop() - p.acknowledgeSelfClosingTag() - return true - case a.Noscript: - if p.scripting { - p.parseGenericRawTextElement() - return true - } - p.addElement() - p.im = inHeadNoscriptIM - // Don't let the tokenizer go into raw text mode when scripting is disabled. - p.tokenizer.NextIsNotRawText() - return true - case a.Script, a.Title: - p.addElement() - p.setOriginalIM() - p.im = textIM - return true - case a.Noframes, a.Style: - p.parseGenericRawTextElement() - return true - case a.Head: - // Ignore the token. - return true - case a.Template: - // TODO: remove this divergence from the HTML5 spec. - // - // We don't handle all of the corner cases when mixing foreign - // content (i.e. or ) with tag. - case a.Template: - return inHeadIM(p) - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) - p.framesetOK = true - return false -} - -// copyAttributes copies attributes of src not found on dst to dst. -func copyAttributes(dst *Node, src Token) { - if len(src.Attr) == 0 { - return - } - attr := map[string]string{} - for _, t := range dst.Attr { - attr[t.Key] = t.Val - } - for _, t := range src.Attr { - if _, ok := attr[t.Key]; !ok { - dst.Attr = append(dst.Attr, t) - attr[t.Key] = t.Val - } - } -} - -// Section 12.2.6.4.7. -func inBodyIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - d := p.tok.Data - switch n := p.oe.top(); n.DataAtom { - case a.Pre, a.Listing: - if n.FirstChild == nil { - // Ignore a newline at the start of a
               block.
              -				if d != "" && d[0] == '\r' {
              -					d = d[1:]
              -				}
              -				if d != "" && d[0] == '\n' {
              -					d = d[1:]
              -				}
              -			}
              -		}
              -		d = strings.Replace(d, "\x00", "", -1)
              -		if d == "" {
              -			return true
              -		}
              -		p.reconstructActiveFormattingElements()
              -		p.addText(d)
              -		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
              -			// There were non-whitespace characters inserted.
              -			p.framesetOK = false
              -		}
              -	case StartTagToken:
              -		switch p.tok.DataAtom {
              -		case a.Html:
              -			if p.oe.contains(a.Template) {
              -				return true
              -			}
              -			copyAttributes(p.oe[0], p.tok)
              -		case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title:
              -			return inHeadIM(p)
              -		case a.Body:
              -			if p.oe.contains(a.Template) {
              -				return true
              -			}
              -			if len(p.oe) >= 2 {
              -				body := p.oe[1]
              -				if body.Type == ElementNode && body.DataAtom == a.Body {
              -					p.framesetOK = false
              -					copyAttributes(body, p.tok)
              -				}
              -			}
              -		case a.Frameset:
              -			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
              -				// Ignore the token.
              -				return true
              -			}
              -			body := p.oe[1]
              -			if body.Parent != nil {
              -				body.Parent.RemoveChild(body)
              -			}
              -			p.oe = p.oe[:1]
              -			p.addElement()
              -			p.im = inFramesetIM
              -			return true
              -		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dialog, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Main, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
              -			p.popUntil(buttonScope, a.P)
              -			switch n := p.top(); n.DataAtom {
              -			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
              -				p.oe.pop()
              -			}
              -			p.addElement()
              -		case a.Pre, a.Listing:
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -			// The newline, if any, will be dealt with by the TextToken case.
              -			p.framesetOK = false
              -		case a.Form:
              -			if p.form != nil && !p.oe.contains(a.Template) {
              -				// Ignore the token
              -				return true
              -			}
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -			if !p.oe.contains(a.Template) {
              -				p.form = p.top()
              -			}
              -		case a.Li:
              -			p.framesetOK = false
              -			for i := len(p.oe) - 1; i >= 0; i-- {
              -				node := p.oe[i]
              -				switch node.DataAtom {
              -				case a.Li:
              -					p.oe = p.oe[:i]
              -				case a.Address, a.Div, a.P:
              -					continue
              -				default:
              -					if !isSpecialElement(node) {
              -						continue
              -					}
              -				}
              -				break
              -			}
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -		case a.Dd, a.Dt:
              -			p.framesetOK = false
              -			for i := len(p.oe) - 1; i >= 0; i-- {
              -				node := p.oe[i]
              -				switch node.DataAtom {
              -				case a.Dd, a.Dt:
              -					p.oe = p.oe[:i]
              -				case a.Address, a.Div, a.P:
              -					continue
              -				default:
              -					if !isSpecialElement(node) {
              -						continue
              -					}
              -				}
              -				break
              -			}
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -		case a.Plaintext:
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -		case a.Button:
              -			p.popUntil(defaultScope, a.Button)
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -			p.framesetOK = false
              -		case a.A:
              -			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
              -				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
              -					p.inBodyEndTagFormatting(a.A, "a")
              -					p.oe.remove(n)
              -					p.afe.remove(n)
              -					break
              -				}
              -			}
              -			p.reconstructActiveFormattingElements()
              -			p.addFormattingElement()
              -		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
              -			p.reconstructActiveFormattingElements()
              -			p.addFormattingElement()
              -		case a.Nobr:
              -			p.reconstructActiveFormattingElements()
              -			if p.elementInScope(defaultScope, a.Nobr) {
              -				p.inBodyEndTagFormatting(a.Nobr, "nobr")
              -				p.reconstructActiveFormattingElements()
              -			}
              -			p.addFormattingElement()
              -		case a.Applet, a.Marquee, a.Object:
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -			p.afe = append(p.afe, &scopeMarker)
              -			p.framesetOK = false
              -		case a.Table:
              -			if !p.quirks {
              -				p.popUntil(buttonScope, a.P)
              -			}
              -			p.addElement()
              -			p.framesetOK = false
              -			p.im = inTableIM
              -			return true
              -		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -			p.oe.pop()
              -			p.acknowledgeSelfClosingTag()
              -			if p.tok.DataAtom == a.Input {
              -				for _, t := range p.tok.Attr {
              -					if t.Key == "type" {
              -						if strings.ToLower(t.Val) == "hidden" {
              -							// Skip setting framesetOK = false
              -							return true
              -						}
              -					}
              -				}
              -			}
              -			p.framesetOK = false
              -		case a.Param, a.Source, a.Track:
              -			p.addElement()
              -			p.oe.pop()
              -			p.acknowledgeSelfClosingTag()
              -		case a.Hr:
              -			p.popUntil(buttonScope, a.P)
              -			p.addElement()
              -			p.oe.pop()
              -			p.acknowledgeSelfClosingTag()
              -			p.framesetOK = false
              -		case a.Image:
              -			p.tok.DataAtom = a.Img
              -			p.tok.Data = a.Img.String()
              -			return false
              -		case a.Textarea:
              -			p.addElement()
              -			p.setOriginalIM()
              -			p.framesetOK = false
              -			p.im = textIM
              -		case a.Xmp:
              -			p.popUntil(buttonScope, a.P)
              -			p.reconstructActiveFormattingElements()
              -			p.framesetOK = false
              -			p.parseGenericRawTextElement()
              -		case a.Iframe:
              -			p.framesetOK = false
              -			p.parseGenericRawTextElement()
              -		case a.Noembed:
              -			p.parseGenericRawTextElement()
              -		case a.Noscript:
              -			if p.scripting {
              -				p.parseGenericRawTextElement()
              -				return true
              -			}
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -			// Don't let the tokenizer go into raw text mode when scripting is disabled.
              -			p.tokenizer.NextIsNotRawText()
              -		case a.Select:
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -			p.framesetOK = false
              -			p.im = inSelectIM
              -			return true
              -		case a.Optgroup, a.Option:
              -			if p.top().DataAtom == a.Option {
              -				p.oe.pop()
              -			}
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -		case a.Rb, a.Rtc:
              -			if p.elementInScope(defaultScope, a.Ruby) {
              -				p.generateImpliedEndTags()
              -			}
              -			p.addElement()
              -		case a.Rp, a.Rt:
              -			if p.elementInScope(defaultScope, a.Ruby) {
              -				p.generateImpliedEndTags("rtc")
              -			}
              -			p.addElement()
              -		case a.Math, a.Svg:
              -			p.reconstructActiveFormattingElements()
              -			if p.tok.DataAtom == a.Math {
              -				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
              -			} else {
              -				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
              -			}
              -			adjustForeignAttributes(p.tok.Attr)
              -			p.addElement()
              -			p.top().Namespace = p.tok.Data
              -			if p.hasSelfClosingToken {
              -				p.oe.pop()
              -				p.acknowledgeSelfClosingTag()
              -			}
              -			return true
              -		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
              -			// Ignore the token.
              -		default:
              -			p.reconstructActiveFormattingElements()
              -			p.addElement()
              -		}
              -	case EndTagToken:
              -		switch p.tok.DataAtom {
              -		case a.Body:
              -			if p.elementInScope(defaultScope, a.Body) {
              -				p.im = afterBodyIM
              -			}
              -		case a.Html:
              -			if p.elementInScope(defaultScope, a.Body) {
              -				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
              -				return false
              -			}
              -			return true
              -		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dialog, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Main, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
              -			p.popUntil(defaultScope, p.tok.DataAtom)
              -		case a.Form:
              -			if p.oe.contains(a.Template) {
              -				i := p.indexOfElementInScope(defaultScope, a.Form)
              -				if i == -1 {
              -					// Ignore the token.
              -					return true
              -				}
              -				p.generateImpliedEndTags()
              -				if p.oe[i].DataAtom != a.Form {
              -					// Ignore the token.
              -					return true
              -				}
              -				p.popUntil(defaultScope, a.Form)
              -			} else {
              -				node := p.form
              -				p.form = nil
              -				i := p.indexOfElementInScope(defaultScope, a.Form)
              -				if node == nil || i == -1 || p.oe[i] != node {
              -					// Ignore the token.
              -					return true
              -				}
              -				p.generateImpliedEndTags()
              -				p.oe.remove(node)
              -			}
              -		case a.P:
              -			if !p.elementInScope(buttonScope, a.P) {
              -				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
              -			}
              -			p.popUntil(buttonScope, a.P)
              -		case a.Li:
              -			p.popUntil(listItemScope, a.Li)
              -		case a.Dd, a.Dt:
              -			p.popUntil(defaultScope, p.tok.DataAtom)
              -		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
              -			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
              -		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
              -			p.inBodyEndTagFormatting(p.tok.DataAtom, p.tok.Data)
              -		case a.Applet, a.Marquee, a.Object:
              -			if p.popUntil(defaultScope, p.tok.DataAtom) {
              -				p.clearActiveFormattingElements()
              -			}
              -		case a.Br:
              -			p.tok.Type = StartTagToken
              -			return false
              -		case a.Template:
              -			return inHeadIM(p)
              -		default:
              -			p.inBodyEndTagOther(p.tok.DataAtom, p.tok.Data)
              -		}
              -	case CommentToken:
              -		p.addChild(&Node{
              -			Type: CommentNode,
              -			Data: p.tok.Data,
              -		})
              -	case ErrorToken:
              -		// TODO: remove this divergence from the HTML5 spec.
              -		if len(p.templateStack) > 0 {
              -			p.im = inTemplateIM
              -			return false
              -		}
              -		for _, e := range p.oe {
              -			switch e.DataAtom {
              -			case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc, a.Tbody, a.Td, a.Tfoot, a.Th,
              -				a.Thead, a.Tr, a.Body, a.Html:
              -			default:
              -				return true
              -			}
              -		}
              -	}
              -
              -	return true
              -}
              -
              -func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom, tagName string) {
              -	// This is the "adoption agency" algorithm, described at
              -	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
              -
              -	// TODO: this is a fairly literal line-by-line translation of that algorithm.
              -	// Once the code successfully parses the comprehensive test suite, we should
              -	// refactor this code to be more idiomatic.
              -
              -	// Steps 1-2
              -	if current := p.oe.top(); current.Data == tagName && p.afe.index(current) == -1 {
              -		p.oe.pop()
              -		return
              -	}
              -
              -	// Steps 3-5. The outer loop.
              -	for i := 0; i < 8; i++ {
              -		// Step 6. Find the formatting element.
              -		var formattingElement *Node
              -		for j := len(p.afe) - 1; j >= 0; j-- {
              -			if p.afe[j].Type == scopeMarkerNode {
              -				break
              -			}
              -			if p.afe[j].DataAtom == tagAtom {
              -				formattingElement = p.afe[j]
              -				break
              -			}
              -		}
              -		if formattingElement == nil {
              -			p.inBodyEndTagOther(tagAtom, tagName)
              -			return
              -		}
              -
              -		// Step 7. Ignore the tag if formatting element is not in the stack of open elements.
              -		feIndex := p.oe.index(formattingElement)
              -		if feIndex == -1 {
              -			p.afe.remove(formattingElement)
              -			return
              -		}
              -		// Step 8. Ignore the tag if formatting element is not in the scope.
              -		if !p.elementInScope(defaultScope, tagAtom) {
              -			// Ignore the tag.
              -			return
              -		}
              -
              -		// Step 9. This step is omitted because it's just a parse error but no need to return.
              -
              -		// Steps 10-11. Find the furthest block.
              -		var furthestBlock *Node
              -		for _, e := range p.oe[feIndex:] {
              -			if isSpecialElement(e) {
              -				furthestBlock = e
              -				break
              -			}
              -		}
              -		if furthestBlock == nil {
              -			e := p.oe.pop()
              -			for e != formattingElement {
              -				e = p.oe.pop()
              -			}
              -			p.afe.remove(e)
              -			return
              -		}
              -
              -		// Steps 12-13. Find the common ancestor and bookmark node.
              -		commonAncestor := p.oe[feIndex-1]
              -		bookmark := p.afe.index(formattingElement)
              -
              -		// Step 14. The inner loop. Find the lastNode to reparent.
              -		lastNode := furthestBlock
              -		node := furthestBlock
              -		x := p.oe.index(node)
              -		// Step 14.1.
              -		j := 0
              -		for {
              -			// Step 14.2.
              -			j++
              -			// Step. 14.3.
              -			x--
              -			node = p.oe[x]
              -			// Step 14.4. Go to the next step if node is formatting element.
              -			if node == formattingElement {
              -				break
              -			}
              -			// Step 14.5. Remove node from the list of active formatting elements if
              -			// inner loop counter is greater than three and node is in the list of
              -			// active formatting elements.
              -			if ni := p.afe.index(node); j > 3 && ni > -1 {
              -				p.afe.remove(node)
              -				// If any element of the list of active formatting elements is removed,
              -				// we need to take care whether bookmark should be decremented or not.
              -				// This is because the value of bookmark may exceed the size of the
              -				// list by removing elements from the list.
              -				if ni <= bookmark {
              -					bookmark--
              -				}
              -				continue
              -			}
              -			// Step 14.6. Continue the next inner loop if node is not in the list of
              -			// active formatting elements.
              -			if p.afe.index(node) == -1 {
              -				p.oe.remove(node)
              -				continue
              -			}
              -			// Step 14.7.
              -			clone := node.clone()
              -			p.afe[p.afe.index(node)] = clone
              -			p.oe[p.oe.index(node)] = clone
              -			node = clone
              -			// Step 14.8.
              -			if lastNode == furthestBlock {
              -				bookmark = p.afe.index(node) + 1
              -			}
              -			// Step 14.9.
              -			if lastNode.Parent != nil {
              -				lastNode.Parent.RemoveChild(lastNode)
              -			}
              -			node.AppendChild(lastNode)
              -			// Step 14.10.
              -			lastNode = node
              -		}
              -
              -		// Step 15. Reparent lastNode to the common ancestor,
              -		// or for misnested table nodes, to the foster parent.
              -		if lastNode.Parent != nil {
              -			lastNode.Parent.RemoveChild(lastNode)
              -		}
              -		switch commonAncestor.DataAtom {
              -		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
              -			p.fosterParent(lastNode)
              -		default:
              -			commonAncestor.AppendChild(lastNode)
              -		}
              -
              -		// Steps 16-18. Reparent nodes from the furthest block's children
              -		// to a clone of the formatting element.
              -		clone := formattingElement.clone()
              -		reparentChildren(clone, furthestBlock)
              -		furthestBlock.AppendChild(clone)
              -
              -		// Step 19. Fix up the list of active formatting elements.
              -		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
              -			// Move the bookmark with the rest of the list.
              -			bookmark--
              -		}
              -		p.afe.remove(formattingElement)
              -		p.afe.insert(bookmark, clone)
              -
              -		// Step 20. Fix up the stack of open elements.
              -		p.oe.remove(formattingElement)
              -		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
              -	}
              -}
              -
              -// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
              -// "Any other end tag" handling from 12.2.6.5 The rules for parsing tokens in foreign content
              -// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
              -func (p *parser) inBodyEndTagOther(tagAtom a.Atom, tagName string) {
              -	for i := len(p.oe) - 1; i >= 0; i-- {
              -		// Two element nodes have the same tag if they have the same Data (a
              -		// string-typed field). As an optimization, for common HTML tags, each
              -		// Data string is assigned a unique, non-zero DataAtom (a uint32-typed
              -		// field), since integer comparison is faster than string comparison.
              -		// Uncommon (custom) tags get a zero DataAtom.
              -		//
              -		// The if condition here is equivalent to (p.oe[i].Data == tagName).
              -		if (p.oe[i].DataAtom == tagAtom) &&
              -			((tagAtom != 0) || (p.oe[i].Data == tagName)) {
              -			p.oe = p.oe[:i]
              -			break
              -		}
              -		if isSpecialElement(p.oe[i]) {
              -			break
              -		}
              -	}
              -}
              -
              -// Section 12.2.6.4.8.
              -func textIM(p *parser) bool {
              -	switch p.tok.Type {
              -	case ErrorToken:
              -		p.oe.pop()
              -	case TextToken:
              -		d := p.tok.Data
              -		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
              -			// Ignore a newline at the start of a -->
              -#errors
              -(1,10): expected-doctype-but-got-start-tag
              -(1,39): unexpected-end-tag
              -#document
              -| 
              -|   
              -|   
              -|     -->
              -#errors
              -(1,10): expected-doctype-but-got-start-tag
              -#document
              -| 
              -|   
              -|   
              -|     
              -#errors
              -(1,10): expected-doctype-but-got-start-tag
              -#document
              -| 
              -|   
              -|   
              -|     
              -#errors
              -(1,9): expected-doctype-but-got-end-tag
              -(1,9): unexpected-end-tag-before-html
              -(1,13): unexpected-end-tag-before-html
              -(1,18): unexpected-end-tag-before-html
              -(1,22): unexpected-end-tag-before-html
              -(1,26): unexpected-end-tag-before-html
              -(1,35): unexpected-end-tag-before-html
              -(1,39): unexpected-end-tag-before-html
              -(1,47): unexpected-end-tag-before-html
              -(1,52): unexpected-end-tag-before-html
              -(1,58): unexpected-end-tag-before-html
              -(1,64): unexpected-end-tag-before-html
              -(1,72): unexpected-end-tag-before-html
              -(1,79): unexpected-end-tag-before-html
              -(1,88): unexpected-end-tag-before-html
              -(1,93): unexpected-end-tag-before-html
              -(1,98): unexpected-end-tag-before-html
              -(1,103): unexpected-end-tag-before-html
              -(1,108): unexpected-end-tag-before-html
              -(1,113): unexpected-end-tag-before-html
              -(1,118): unexpected-end-tag-before-html
              -(1,130): unexpected-end-tag-after-body
              -(1,130): unexpected-end-tag-treated-as
              -(1,134): unexpected-end-tag
              -(1,140): unexpected-end-tag
              -(1,148): unexpected-end-tag
              -(1,155): unexpected-end-tag
              -(1,163): unexpected-end-tag
              -(1,172): unexpected-end-tag
              -(1,180): unexpected-end-tag
              -(1,185): unexpected-end-tag
              -(1,190): unexpected-end-tag
              -(1,195): unexpected-end-tag
              -(1,203): unexpected-end-tag
              -(1,210): unexpected-end-tag
              -(1,217): unexpected-end-tag
              -(1,225): unexpected-end-tag
              -(1,230): unexpected-end-tag
              -(1,238): unexpected-end-tag
              -(1,244): unexpected-end-tag
              -(1,251): unexpected-end-tag
              -(1,258): unexpected-end-tag
              -(1,269): unexpected-end-tag
              -(1,279): unexpected-end-tag
              -(1,287): unexpected-end-tag
              -(1,296): unexpected-end-tag
              -(1,300): unexpected-end-tag
              -(1,305): unexpected-end-tag
              -(1,310): unexpected-end-tag
              -(1,320): unexpected-end-tag
              -(1,331): unexpected-end-tag
              -(1,339): unexpected-end-tag
              -(1,347): unexpected-end-tag
              -(1,355): unexpected-end-tag
              -(1,365): end-tag-too-early
              -(1,378): end-tag-too-early
              -(1,387): end-tag-too-early
              -(1,393): end-tag-too-early
              -(1,399): end-tag-too-early
              -(1,404): end-tag-too-early
              -(1,415): end-tag-too-early
              -(1,425): end-tag-too-early
              -(1,432): end-tag-too-early
              -(1,437): end-tag-too-early
              -(1,442): end-tag-too-early
              -(1,447): unexpected-end-tag
              -(1,454): unexpected-end-tag
              -(1,460): unexpected-end-tag
              -(1,467): unexpected-end-tag
              -(1,476): end-tag-too-early
              -(1,486): end-tag-too-early
              -(1,495): end-tag-too-early
              -(1,513): expected-eof-but-got-end-tag
              -(1,513): unexpected-end-tag
              -(1,520): unexpected-end-tag
              -(1,529): unexpected-end-tag
              -(1,537): unexpected-end-tag
              -(1,547): unexpected-end-tag
              -(1,557): unexpected-end-tag
              -(1,568): unexpected-end-tag
              -(1,579): unexpected-end-tag
              -(1,590): unexpected-end-tag
              -(1,599): unexpected-end-tag
              -(1,611): unexpected-end-tag
              -(1,622): unexpected-end-tag
              -#document
              -| 
              -|   
              -|   
              -|     
              -|

              - -#data -

              ')
              -		r.writeLines(w, source, n)
              -	} else {
              -		_, _ = w.WriteString("
        -#errors -(1,7): expected-doctype-but-got-start-tag -(1,20): unexpected-end-tag-implies-table-voodoo -(1,20): unexpected-end-tag -(1,24): unexpected-end-tag-implies-table-voodoo -(1,24): unexpected-end-tag -(1,29): unexpected-end-tag-implies-table-voodoo -(1,29): unexpected-end-tag -(1,33): unexpected-end-tag-implies-table-voodoo -(1,33): unexpected-end-tag -(1,37): unexpected-end-tag-implies-table-voodoo -(1,37): unexpected-end-tag -(1,46): unexpected-end-tag-implies-table-voodoo -(1,46): unexpected-end-tag -(1,50): unexpected-end-tag-implies-table-voodoo -(1,50): unexpected-end-tag -(1,58): unexpected-end-tag-implies-table-voodoo -(1,58): unexpected-end-tag -(1,63): unexpected-end-tag-implies-table-voodoo -(1,63): unexpected-end-tag -(1,69): unexpected-end-tag-implies-table-voodoo -(1,69): end-tag-too-early -(1,75): unexpected-end-tag-implies-table-voodoo -(1,75): unexpected-end-tag -(1,83): unexpected-end-tag-implies-table-voodoo -(1,83): unexpected-end-tag -(1,90): unexpected-end-tag-implies-table-voodoo -(1,90): unexpected-end-tag -(1,99): unexpected-end-tag-implies-table-voodoo -(1,99): unexpected-end-tag -(1,104): unexpected-end-tag-implies-table-voodoo -(1,104): end-tag-too-early -(1,109): unexpected-end-tag-implies-table-voodoo -(1,109): end-tag-too-early -(1,114): unexpected-end-tag-implies-table-voodoo -(1,114): end-tag-too-early -(1,119): unexpected-end-tag-implies-table-voodoo -(1,119): end-tag-too-early -(1,124): unexpected-end-tag-implies-table-voodoo -(1,124): end-tag-too-early -(1,129): unexpected-end-tag-implies-table-voodoo -(1,129): end-tag-too-early -(1,136): unexpected-end-tag-in-table-row -(1,141): unexpected-end-tag-implies-table-voodoo -(1,141): unexpected-end-tag-treated-as -(1,145): unexpected-end-tag-implies-table-voodoo -(1,145): unexpected-end-tag -(1,151): unexpected-end-tag-implies-table-voodoo -(1,151): unexpected-end-tag -(1,159): unexpected-end-tag-implies-table-voodoo -(1,159): unexpected-end-tag -(1,166): unexpected-end-tag-implies-table-voodoo -(1,166): unexpected-end-tag -(1,174): unexpected-end-tag-implies-table-voodoo -(1,174): unexpected-end-tag -(1,183): unexpected-end-tag-implies-table-voodoo -(1,183): unexpected-end-tag -(1,196): unexpected-end-tag -(1,201): unexpected-end-tag -(1,206): unexpected-end-tag -(1,214): unexpected-end-tag -(1,221): unexpected-end-tag -(1,228): unexpected-end-tag -(1,236): unexpected-end-tag -(1,241): unexpected-end-tag -(1,249): unexpected-end-tag -(1,255): unexpected-end-tag -(1,262): unexpected-end-tag -(1,269): unexpected-end-tag -(1,280): unexpected-end-tag -(1,290): unexpected-end-tag -(1,298): unexpected-end-tag -(1,307): unexpected-end-tag -(1,311): unexpected-end-tag -(1,316): unexpected-end-tag -(1,321): unexpected-end-tag -(1,331): unexpected-end-tag -(1,342): unexpected-end-tag -(1,350): unexpected-end-tag -(1,358): unexpected-end-tag -(1,366): unexpected-end-tag -(1,376): end-tag-too-early -(1,389): end-tag-too-early -(1,398): end-tag-too-early -(1,404): end-tag-too-early -(1,410): end-tag-too-early -(1,415): end-tag-too-early -(1,426): end-tag-too-early -(1,436): end-tag-too-early -(1,443): end-tag-too-early -(1,448): end-tag-too-early -(1,453): end-tag-too-early -(1,458): unexpected-end-tag -(1,465): unexpected-end-tag -(1,471): unexpected-end-tag -(1,478): unexpected-end-tag -(1,487): end-tag-too-early -(1,497): end-tag-too-early -(1,506): end-tag-too-early -(1,524): expected-eof-but-got-end-tag -(1,524): unexpected-end-tag -(1,531): unexpected-end-tag -(1,540): unexpected-end-tag -(1,548): unexpected-end-tag -(1,558): unexpected-end-tag -(1,568): unexpected-end-tag -(1,579): unexpected-end-tag -(1,590): unexpected-end-tag -(1,601): unexpected-end-tag -(1,610): unexpected-end-tag -(1,622): unexpected-end-tag -(1,633): unexpected-end-tag -#document -| -| -| -|
        -| -| -| -|

        - -#data - -#errors -(1,10): expected-doctype-but-got-start-tag -(1,10): eof-in-frameset -#document -| -| -| diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests10.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests10.dat deleted file mode 100644 index f84e2d546..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests10.dat +++ /dev/null @@ -1,849 +0,0 @@ -#data - -#errors -#document -| -| -| -| -| - -#data -a -#errors -(1,28) expected-dashes-or-doctype -#new-errors -(1:35) cdata-in-html-content -#document -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| - -#data - -#errors -(1,34) unexpected-start-tag-in-select -(1,40) unexpected-end-tag-in-select -#document -| -| -| -| -| -#errors -(1,42) unexpected-start-tag-in-select -(1,48) unexpected-end-tag-in-select -#document -| -| -| -| -|

        -#errors -(1,33) foster-parenting-start-tag -#document -| -| -| -| -| -| - -#data -
        foo
        -#errors -(1,33) foster-parenting-start-tag -#document -| -| -| -| -| -| -| "foo" -| - -#data -
        foobar
        -#errors -(1,33) foster-parenting-start-tag -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -| - -#data -
        foobar
        -#errors -(1,40) foster-parenting-start-tag -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -| -| - -#data -
        foobar
        -#errors -(1,44) foster-parenting-start-tag -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -| -| -| - -#data -
        foobar
        -#errors -#document -| -| -| -| -| -| -| -|
        -| -| -| "foo" -| -| "bar" - -#data -
        foobar

        baz

        -#errors -#document -| -| -| -| -| -| -| -|
        -| -| -| "foo" -| -| "bar" -|

        -| "baz" - -#data -
        foobar

        baz

        -#errors -#document -| -| -| -| -| -|
        -| -| -| "foo" -| -| "bar" -|

        -| "baz" - -#data -
        foobar

        baz

        quux -#errors -(1,65) unexpected-html-element-in-foreign-content -#document -| -| -| -| -| -|
        -| -| -| "foo" -| -| "bar" -|

        -| "baz" -|

        -| "quux" - -#data -
        foobarbaz

        quux -#errors -(1,73) unexpected-end-tag -(1,73) expected-one-end-tag-but-got-another -#document -| -| -| -| -| -|
        -| -| -| "foo" -| -| "bar" -| "baz" -|

        -| "quux" - -#data -foobar

        baz

        quux -#errors -(1,43) foster-parenting-start-tag svg -(1,66) unexpected HTML-like start tag token in foreign content -(1,66) foster-parenting-start-tag -(1,67) foster-parenting-character -(1,68) foster-parenting-character -(1,69) foster-parenting-character -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -|

        -| "baz" -| -| -|

        -| "quux" - -#data -

        quux -#errors -(1,49) unexpected-start-tag-in-select -(1,52) unexpected-start-tag-in-select -(1,59) unexpected-end-tag-in-select -(1,62) unexpected-start-tag-in-select -(1,69) unexpected-end-tag-in-select -(1,72) unexpected-start-tag-in-select -(1,83) unexpected-table-element-end-tag-in-select-in-table -#document -| -| -| -| -| -| -| -|
        -|

        quux -#errors -(1,36) unexpected-start-tag-implies-table-voodoo -(1,41) unexpected-start-tag-in-select -(1,44) unexpected-start-tag-in-select -(1,51) unexpected-end-tag-in-select -(1,54) unexpected-start-tag-in-select -(1,61) unexpected-end-tag-in-select -(1,64) unexpected-start-tag-in-select -(1,75) unexpected-table-element-end-tag-in-select-in-table -#document -| -| -| -| -| -|

        -| "quux" - -#data -foobar

        baz -#errors -(1,40) expected-eof-but-got-start-tag -(1,63) unexpected-html-element-in-foreign-content -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -|

        -| "baz" - -#data -foobar

        baz -#errors -(1,33) unexpected-start-tag-after-body -(1,56) unexpected-html-element-in-foreign-content -#document -| -| -| -| -| -| -| "foo" -| -| "bar" -|

        -| "baz" - -#data -

        -#errors -(1,30) unexpected-start-tag-in-frameset -(1,33) unexpected-start-tag-in-frameset -(1,37) unexpected-end-tag-in-frameset -(1,40) unexpected-start-tag-in-frameset -(1,44) unexpected-end-tag-in-frameset -(1,47) unexpected-start-tag-in-frameset -(1,53) unexpected-start-tag-in-frameset -(1,53) eof-in-frameset -#document -| -| -| -| - -#data -

        -#errors -(1,41) unexpected-start-tag-after-frameset -(1,44) unexpected-start-tag-after-frameset -(1,48) unexpected-end-tag-after-frameset -(1,51) unexpected-start-tag-after-frameset -(1,55) unexpected-end-tag-after-frameset -(1,58) unexpected-start-tag-after-frameset -(1,64) unexpected-start-tag-after-frameset -#document -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| xlink:href="foo" -| -| xlink href="foo" - -#data - -#errors -#document -| -| -| -| -| xlink:href="foo" -| xml:lang="en" -| -| -| xlink href="foo" -| xml lang="en" - -#data - -#errors -#document -| -| -| -| -| xlink:href="foo" -| xml:lang="en" -| -| -| xlink href="foo" -| xml lang="en" - -#data -bar -#errors -#document -| -| -| -| -| xlink:href="foo" -| xml:lang="en" -| -| -| xlink href="foo" -| xml lang="en" -| "bar" - -#data - -#errors -(1,5) expected-doctype-but-got-start-tag -(1,12) unexpected-end-tag -(1,12) unexpected-end-tag -(1,12) expected-closing-tag-but-got-eof -#document -| -| -| -| - -#data -

        a -#errors -(1,5) expected-doctype-but-got-start-tag -(1,16) unexpected-end-tag -(1,16) end-tag-too-early -#document -| -| -| -|
        -| -| "a" - -#data -
        a -#errors -(1,5) expected-doctype-but-got-start-tag -(1,22) unexpected-end-tag -(1,22) end-tag-too-early -#document -| -| -| -|
        -| -| -| "a" - -#data -
        -#errors -(1,5) expected-doctype-but-got-start-tag -(1,22) unexpected-end-tag -(1,28) expected-closing-tag-but-got-eof -#document -| -| -| -|
        -| -| -| - -#data -
        a -#errors -(1,5) expected-doctype-but-got-start-tag -(1,43) unexpected-end-tag -(1,43) end-tag-too-early -(1,44) expected-closing-tag-but-got-eof -#document -| -| -| -|
        -| -| -| -| -| "a" - -#data -

        a -#errors -(1,5) expected-doctype-but-got-start-tag -(1,40) end-tag-too-early -(1,41) expected-closing-tag-but-got-eof -#document -| -| -| -|

        -| -| -| -|

        -| "a" - -#data -
          a -#errors -(1,40) unexpected-html-element-in-foreign-content -(1,41) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| -|
          -| -|
            -| "a" - -#data -
              a -#errors -(1,35) unexpected-html-element-in-foreign-content -(1,36) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| -| -|
                -| "a" - -#data -

                -#errors -(1,32) expected-closing-tag-but-got-eof -#document -| -| -| -| -|

                -| -| -|

                - -#data -

                -#errors -(1,33) expected-closing-tag-but-got-eof -#document -| -| -| -| -|

                -| -| -|

                - -#data -

                -#errors -(1,5) expected-doctype-but-got-start-tag -(1,50) unexpected-end-tag -(1,53) expected-closing-tag-but-got-eof -#document -| -| -| -|

                -| -| -| -|

                -|

                - -#data -
                -#errors -(1,6) expected-doctype-but-got-start-tag -(1,71) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -|
                -| -|
                -| -| - -#data -
                -#errors -(1,6) expected-doctype-but-got-start-tag -(1,83) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| -| -|
                -|
                -| - -#data - -#errors -(1,5) expected-doctype-but-got-start-tag -(1,28) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data -

        -#errors -(1,7) expected-doctype-but-got-start-tag -(1,12) unexpected-start-tag-implies-table-voodoo -(1,22) eof-in-table -#document -| -| -| -| -|
        -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,18) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,22) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,18) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,22) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,18) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,22) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,18) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,22) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,21) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,25) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,54) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| -| - -#data -
        -#errors -(1,6) expected-doctype-but-got-start-tag -(1,144) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| -| -|
        -| -| -| -| -| - -#data - -#errors -(1,6) expected-doctype-but-got-start-tag -(1,153) expected-closing-tag-but-got-eof -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests11.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests11.dat deleted file mode 100644 index b9901e79e..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests11.dat +++ /dev/null @@ -1,523 +0,0 @@ -#data - -#errors -#document -| -| -| -| -| -| attributeName="" -| attributeType="" -| baseFrequency="" -| baseProfile="" -| calcMode="" -| clipPathUnits="" -| diffuseConstant="" -| edgeMode="" -| filterUnits="" -| glyphRef="" -| gradientTransform="" -| gradientUnits="" -| kernelMatrix="" -| kernelUnitLength="" -| keyPoints="" -| keySplines="" -| keyTimes="" -| lengthAdjust="" -| limitingConeAngle="" -| markerHeight="" -| markerUnits="" -| markerWidth="" -| maskContentUnits="" -| maskUnits="" -| numOctaves="" -| pathLength="" -| patternContentUnits="" -| patternTransform="" -| patternUnits="" -| pointsAtX="" -| pointsAtY="" -| pointsAtZ="" -| preserveAlpha="" -| preserveAspectRatio="" -| primitiveUnits="" -| refX="" -| refY="" -| repeatCount="" -| repeatDur="" -| requiredExtensions="" -| requiredFeatures="" -| specularConstant="" -| specularExponent="" -| spreadMethod="" -| startOffset="" -| stdDeviation="" -| stitchTiles="" -| surfaceScale="" -| systemLanguage="" -| tableValues="" -| targetX="" -| targetY="" -| textLength="" -| viewBox="" -| viewTarget="" -| xChannelSelector="" -| yChannelSelector="" -| zoomAndPan="" - -#data - -#errors -#document -| -| -| -| -| -| attributeName="" -| attributeType="" -| baseFrequency="" -| baseProfile="" -| calcMode="" -| clipPathUnits="" -| diffuseConstant="" -| edgeMode="" -| filterUnits="" -| glyphRef="" -| gradientTransform="" -| gradientUnits="" -| kernelMatrix="" -| kernelUnitLength="" -| keyPoints="" -| keySplines="" -| keyTimes="" -| lengthAdjust="" -| limitingConeAngle="" -| markerHeight="" -| markerUnits="" -| markerWidth="" -| maskContentUnits="" -| maskUnits="" -| numOctaves="" -| pathLength="" -| patternContentUnits="" -| patternTransform="" -| patternUnits="" -| pointsAtX="" -| pointsAtY="" -| pointsAtZ="" -| preserveAlpha="" -| preserveAspectRatio="" -| primitiveUnits="" -| refX="" -| refY="" -| repeatCount="" -| repeatDur="" -| requiredExtensions="" -| requiredFeatures="" -| specularConstant="" -| specularExponent="" -| spreadMethod="" -| startOffset="" -| stdDeviation="" -| stitchTiles="" -| surfaceScale="" -| systemLanguage="" -| tableValues="" -| targetX="" -| targetY="" -| textLength="" -| viewBox="" -| viewTarget="" -| xChannelSelector="" -| yChannelSelector="" -| zoomAndPan="" - -#data - -#errors -#document -| -| -| -| -| -| attributeName="" -| attributeType="" -| baseFrequency="" -| baseProfile="" -| calcMode="" -| clipPathUnits="" -| diffuseConstant="" -| edgeMode="" -| filterUnits="" -| filterres="" -| glyphRef="" -| gradientTransform="" -| gradientUnits="" -| kernelMatrix="" -| kernelUnitLength="" -| keyPoints="" -| keySplines="" -| keyTimes="" -| lengthAdjust="" -| limitingConeAngle="" -| markerHeight="" -| markerUnits="" -| markerWidth="" -| maskContentUnits="" -| maskUnits="" -| numOctaves="" -| pathLength="" -| patternContentUnits="" -| patternTransform="" -| patternUnits="" -| pointsAtX="" -| pointsAtY="" -| pointsAtZ="" -| preserveAlpha="" -| preserveAspectRatio="" -| primitiveUnits="" -| refX="" -| refY="" -| repeatCount="" -| repeatDur="" -| requiredExtensions="" -| requiredFeatures="" -| specularConstant="" -| specularExponent="" -| spreadMethod="" -| startOffset="" -| stdDeviation="" -| stitchTiles="" -| surfaceScale="" -| systemLanguage="" -| tableValues="" -| targetX="" -| targetY="" -| textLength="" -| viewBox="" -| viewTarget="" -| xChannelSelector="" -| yChannelSelector="" -| zoomAndPan="" - -#data - -#errors -#document -| -| -| -| -| -| attributename="" -| attributetype="" -| basefrequency="" -| baseprofile="" -| calcmode="" -| clippathunits="" -| diffuseconstant="" -| edgemode="" -| filterunits="" -| glyphref="" -| gradienttransform="" -| gradientunits="" -| kernelmatrix="" -| kernelunitlength="" -| keypoints="" -| keysplines="" -| keytimes="" -| lengthadjust="" -| limitingconeangle="" -| markerheight="" -| markerunits="" -| markerwidth="" -| maskcontentunits="" -| maskunits="" -| numoctaves="" -| pathlength="" -| patterncontentunits="" -| patterntransform="" -| patternunits="" -| pointsatx="" -| pointsaty="" -| pointsatz="" -| preservealpha="" -| preserveaspectratio="" -| primitiveunits="" -| refx="" -| refy="" -| repeatcount="" -| repeatdur="" -| requiredextensions="" -| requiredfeatures="" -| specularconstant="" -| specularexponent="" -| spreadmethod="" -| startoffset="" -| stddeviation="" -| stitchtiles="" -| surfacescale="" -| systemlanguage="" -| tablevalues="" -| targetx="" -| targety="" -| textlength="" -| viewbox="" -| viewtarget="" -| xchannelselector="" -| ychannelselector="" -| zoomandpan="" - -#data - -#errors -#document -| -| -| -| -| -| contentscripttype="" -| contentstyletype="" -| externalresourcesrequired="" -| filterres="" - -#data - -#errors -#document -| -| -| -| -| -| contentscripttype="" -| contentstyletype="" -| externalresourcesrequired="" -| filterres="" - -#data - -#errors -#document -| -| -| -| -| -| contentscripttype="" -| contentstyletype="" -| externalresourcesrequired="" -| filterres="" - -#data - -#errors -#document -| -| -| -| -| -| contentscripttype="" -| contentstyletype="" -| externalresourcesrequired="" -| filterres="" - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests12.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests12.dat deleted file mode 100644 index 63107d277..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests12.dat +++ /dev/null @@ -1,62 +0,0 @@ -#data -

        foobazeggs

        spam

        quuxbar -#errors -#document -| -| -| -| -|

        -| "foo" -| -| -| -| "baz" -| -| -| -| -| "eggs" -| -| -|

        -| "spam" -| -| -| -|
        -| -| -| "quux" -| "bar" - -#data -foobazeggs

        spam
        quuxbar -#errors -#document -| -| -| -| -| "foo" -| -| -| -| "baz" -| -| -| -| -| "eggs" -| -| -|

        -| "spam" -| -| -| -|
        -| -| -| "quux" -| "bar" diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests14.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests14.dat deleted file mode 100644 index a08b7649e..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests14.dat +++ /dev/null @@ -1,75 +0,0 @@ -#data - -#errors -#document -| -| -| -| -| - -#data - -#errors -#document -| -| -| -| -| -| - -#data - -#errors -(1,38): non-html-root -#document -| -| -| abc:def="gh" -| -| -| - -#data - -#errors -(1,53): non-html-root -#document -| -| -| xml:lang="bar" -| -| - -#data - -#errors -#document -| -| -| 123="456" -| -| - -#data - -#errors -(1,43): non-html-root -#document -| -| -| 123="456" -| 789="012" -| -| - -#data - -#errors -#document -| -| -| -| -| 789="012" diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests15.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests15.dat deleted file mode 100644 index 93d06a871..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests15.dat +++ /dev/null @@ -1,216 +0,0 @@ -#data -

        X -#errors -(1,31): unexpected-end-tag -(1,36): expected-closing-tag-but-got-eof -#document -| -| -| -| -|

        -| -| -| -| -| -| -| " " -|

        -| "X" - -#data -

        -

        X -#errors -(1,3): expected-doctype-but-got-start-tag -(1,16): unexpected-end-tag -(2,4): expected-closing-tag-but-got-eof -#document -| -| -| -|

        -| -| -| -| -| -| -| " -" -|

        -| "X" - -#data - -#errors -(1,29): expected-eof-but-got-start-tag -(1,29): unexpected-start-tag-ignored -#document -| -| -| -| -| " " - -#data - -#errors -(1,28): unexpected-start-tag-after-body -#document -| -| -| -| -| - -#data - -#errors -(1,6): expected-doctype-but-got-start-tag -#document -| -| -| -| - -#data -X -#errors -(1,29): unexpected-start-tag-after-body -#document -| -| -| -| -| -| "X" - -#data -<!doctype html><table> X<meta></table> -#errors -(1,23): foster-parenting-character -(1,24): foster-parenting-character -(1,30): foster-parenting-start-character -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " X" -| <meta> -| <table> - -#data -<!doctype html><table> x</table> -#errors -(1,23): foster-parenting-character -(1,24): foster-parenting-character -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " x" -| <table> - -#data -<!doctype html><table> x </table> -#errors -(1,23): foster-parenting-character -(1,24): foster-parenting-character -(1,25): foster-parenting-character -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " x " -| <table> - -#data -<!doctype html><table><tr> x</table> -#errors -(1,27): foster-parenting-character -(1,28): foster-parenting-character -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " x" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table>X<style> <tr>x </style> </table> -#errors -(1,23): foster-parenting-character -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "X" -| <table> -| <style> -| " <tr>x " -| " " - -#data -<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div> -#errors -(1,30): foster-parenting-start-tag -(1,31): foster-parenting-character -(1,32): foster-parenting-character -(1,33): foster-parenting-character -(1,37): foster-parenting-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> -| <a> -| "foo" -| <table> -| " " -| <tbody> -| <tr> -| <td> -| "bar" -| " " - -#data -<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,7): unexpected-start-tag-ignored -(1,15): unexpected-end-tag -(1,23): unexpected-end-tag -(1,33): unexpected-start-tag -(1,99): expected-named-closing-tag-but-got-eof -(1,99): eof-in-frameset -#document -| <html> -| <head> -| <frameset> -| <frame> -| <frameset> -| <frame> -| <noframes> -| "</frameset><noframes>" - -#data -<!DOCTYPE html><object></html> -#errors -(1,30): expected-body-in-scope -(1,30): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <object> diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests16.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests16.dat deleted file mode 100644 index cea7340a0..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests16.dat +++ /dev/null @@ -1,2604 +0,0 @@ -#data -<!doctype html><script> -#errors -(1,23): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| <body> - -#data -<!doctype html><script>a -#errors -(1,24): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "a" -| <body> - -#data -<!doctype html><script>< -#errors -(1,24): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<" -| <body> - -#data -<!doctype html><script></ -#errors -(1,25): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</" -| <body> - -#data -<!doctype html><script></S -#errors -(1,26): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</S" -| <body> - -#data -<!doctype html><script></SC -#errors -(1,27): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SC" -| <body> - -#data -<!doctype html><script></SCR -#errors -(1,28): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCR" -| <body> - -#data -<!doctype html><script></SCRI -#errors -(1,29): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCRI" -| <body> - -#data -<!doctype html><script></SCRIP -#errors -(1,30): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCRIP" -| <body> - -#data -<!doctype html><script></SCRIPT -#errors -(1,31): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</SCRIPT" -| <body> - -#data -<!doctype html><script></SCRIPT -#errors -(1,32): expected-attribute-name-but-got-eof -(1,32): expected-named-closing-tag-but-got-eof -#new-errors -(1:33) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| <body> - -#data -<!doctype html><script></s -#errors -(1,26): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</s" -| <body> - -#data -<!doctype html><script></sc -#errors -(1,27): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</sc" -| <body> - -#data -<!doctype html><script></scr -#errors -(1,28): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</scr" -| <body> - -#data -<!doctype html><script></scri -#errors -(1,29): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</scri" -| <body> - -#data -<!doctype html><script></scrip -#errors -(1,30): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</scrip" -| <body> - -#data -<!doctype html><script></script -#errors -(1,31): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "</script" -| <body> - -#data -<!doctype html><script></script -#errors -(1,32): expected-attribute-name-but-got-eof -(1,32): expected-named-closing-tag-but-got-eof -#new-errors -(1:33) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| <body> - -#data -<!doctype html><script><! -#errors -(1,25): expected-script-data-but-got-eof -(1,25): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!" -| <body> - -#data -<!doctype html><script><!a -#errors -(1,26): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!a" -| <body> - -#data -<!doctype html><script><!- -#errors -(1,26): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!-" -| <body> - -#data -<!doctype html><script><!-a -#errors -(1,27): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!-a" -| <body> - -#data -<!doctype html><script><!-- -#errors -(1,27): expected-named-closing-tag-but-got-eof -(1,27): unexpected-eof-in-text-mode -#new-errors -(1:28) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<!doctype html><script><!--a -#errors -(1,28): expected-named-closing-tag-but-got-eof -(1,28): unexpected-eof-in-text-mode -#new-errors -(1:29) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--a" -| <body> - -#data -<!doctype html><script><!--< -#errors -(1,28): expected-named-closing-tag-but-got-eof -(1,28): unexpected-eof-in-text-mode -#new-errors -(1:29) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<" -| <body> - -#data -<!doctype html><script><!--<a -#errors -(1,29): expected-named-closing-tag-but-got-eof -(1,29): unexpected-eof-in-text-mode -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<a" -| <body> - -#data -<!doctype html><script><!--</ -#errors -(1,29): expected-named-closing-tag-but-got-eof -(1,29): unexpected-eof-in-text-mode -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--</" -| <body> - -#data -<!doctype html><script><!--</script -#errors -(1,35): expected-named-closing-tag-but-got-eof -(1,35): unexpected-eof-in-text-mode -#new-errors -(1:36) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--</script" -| <body> - -#data -<!doctype html><script><!--</script -#errors -(1,36): expected-attribute-name-but-got-eof -(1,36): expected-named-closing-tag-but-got-eof -#new-errors -(1:37) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<!doctype html><script><!--<s -#errors -(1,29): expected-named-closing-tag-but-got-eof -(1,29): unexpected-eof-in-text-mode -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<s" -| <body> - -#data -<!doctype html><script><!--<script -#errors -(1,34): expected-named-closing-tag-but-got-eof -(1,34): unexpected-eof-in-text-mode -#new-errors -(1:35) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script" -| <body> - -#data -<!doctype html><script><!--<script -#errors -(1,35): eof-in-script-in-script -(1,35): expected-named-closing-tag-but-got-eof -#new-errors -(1:36) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script " -| <body> - -#data -<!doctype html><script><!--<script < -#errors -(1,36): eof-in-script-in-script -(1,36): expected-named-closing-tag-but-got-eof -#new-errors -(1:37) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script <" -| <body> - -#data -<!doctype html><script><!--<script <a -#errors -(1,37): eof-in-script-in-script -(1,37): expected-named-closing-tag-but-got-eof -#new-errors -(1:38) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script <a" -| <body> - -#data -<!doctype html><script><!--<script </ -#errors -(1,37): eof-in-script-in-script -(1,37): expected-named-closing-tag-but-got-eof -#new-errors -(1:38) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </" -| <body> - -#data -<!doctype html><script><!--<script </s -#errors -(1,38): eof-in-script-in-script -(1,38): expected-named-closing-tag-but-got-eof -#new-errors -(1:39) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </s" -| <body> - -#data -<!doctype html><script><!--<script </script -#errors -(1,43): eof-in-script-in-script -(1,43): expected-named-closing-tag-but-got-eof -#new-errors -(1:44) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script" -| <body> - -#data -<!doctype html><script><!--<script </scripta -#errors -(1,44): eof-in-script-in-script -(1,44): expected-named-closing-tag-but-got-eof -#new-errors -(1:45) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </scripta" -| <body> - -#data -<!doctype html><script><!--<script </script -#errors -(1,44): expected-named-closing-tag-but-got-eof -(1,44): unexpected-eof-in-text-mode -#new-errors -(1:45) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script </script> -#errors -(1,44): expected-named-closing-tag-but-got-eof -(1,44): unexpected-eof-in-text-mode -#new-errors -(1:45) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script>" -| <body> - -#data -<!doctype html><script><!--<script </script/ -#errors -(1,44): expected-named-closing-tag-but-got-eof -(1,44): unexpected-eof-in-text-mode -#new-errors -(1:45) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script/" -| <body> - -#data -<!doctype html><script><!--<script </script < -#errors -(1,45): expected-named-closing-tag-but-got-eof -(1,45): unexpected-eof-in-text-mode -#new-errors -(1:46) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script <" -| <body> - -#data -<!doctype html><script><!--<script </script <a -#errors -(1,46): expected-named-closing-tag-but-got-eof -(1,46): unexpected-eof-in-text-mode -#new-errors -(1:47) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script <a" -| <body> - -#data -<!doctype html><script><!--<script </script </ -#errors -(1,46): expected-named-closing-tag-but-got-eof -(1,46): unexpected-eof-in-text-mode -#new-errors -(1:47) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script </" -| <body> - -#data -<!doctype html><script><!--<script </script </script -#errors -(1,52): expected-named-closing-tag-but-got-eof -(1,52): unexpected-eof-in-text-mode -#new-errors -(1:53) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script </script" -| <body> - -#data -<!doctype html><script><!--<script </script </script -#errors -(1,53): expected-attribute-name-but-got-eof -(1,53): expected-named-closing-tag-but-got-eof -#new-errors -(1:54) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script </script </script/ -#errors -(1,53): unexpected-EOF-after-solidus-in-tag -(1,53): expected-named-closing-tag-but-got-eof -#new-errors -(1:54) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script </script </script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<!doctype html><script><!--<script - -#errors -(1,36): eof-in-script-in-script -(1,36): expected-named-closing-tag-but-got-eof -#new-errors -(1:37) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -" -| <body> - -#data -<!doctype html><script><!--<script -a -#errors -(1,37): eof-in-script-in-script -(1,37): expected-named-closing-tag-but-got-eof -#new-errors -(1:38) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -a" -| <body> - -#data -<!doctype html><script><!--<script -< -#errors -(1,37): eof-in-script-in-script -(1,37): expected-named-closing-tag-but-got-eof -#new-errors -(1:38) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -<" -| <body> - -#data -<!doctype html><script><!--<script -- -#errors -(1,37): eof-in-script-in-script -(1,37): expected-named-closing-tag-but-got-eof -#new-errors -(1:38) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --" -| <body> - -#data -<!doctype html><script><!--<script --a -#errors -(1,38): eof-in-script-in-script -(1,38): expected-named-closing-tag-but-got-eof -#new-errors -(1:39) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --a" -| <body> - -#data -<!doctype html><script><!--<script --< -#errors -(1,38): eof-in-script-in-script -(1,38): expected-named-closing-tag-but-got-eof -#new-errors -(1:39) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --<" -| <body> - -#data -<!doctype html><script><!--<script --> -#errors -(1,38): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script -->< -#errors -(1,39): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --><" -| <body> - -#data -<!doctype html><script><!--<script --></ -#errors -(1,40): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --></" -| <body> - -#data -<!doctype html><script><!--<script --></script -#errors -(1,46): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script --></script" -| <body> - -#data -<!doctype html><script><!--<script --></script -#errors -(1,47): expected-attribute-name-but-got-eof -(1,47): expected-named-closing-tag-but-got-eof -#new-errors -(1:48) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script --></script/ -#errors -(1,47): unexpected-EOF-after-solidus-in-tag -(1,47): expected-named-closing-tag-but-got-eof -#new-errors -(1:48) eof-in-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script --></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<!doctype html><script><!--<script><\/script>--></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script><\/script>-->" -| <body> - -#data -<!doctype html><script><!--<script></scr'+'ipt>--></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt>-->" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>--><!--</script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>--><!--" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>-- ></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>-- >" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>- -></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- ->" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>- - ></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- - >" -| <body> - -#data -<!doctype html><script><!--<script></script><script></script>-></script> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>->" -| <body> - -#data -<!doctype html><script><!--<script>--!></script>X -#errors -(1,49): expected-named-closing-tag-but-got-eof -(1,49): unexpected-EOF-in-text-mode -#new-errors -(1:50) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script>--!></script>X" -| <body> - -#data -<!doctype html><script><!--<scr'+'ipt></script>--></script> -#errors -(1,59): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<scr'+'ipt>" -| <body> -| "-->" - -#data -<!doctype html><script><!--<script></scr'+'ipt></script>X -#errors -(1,57): expected-named-closing-tag-but-got-eof -(1,57): unexpected-eof-in-text-mode -#new-errors -(1:58) eof-in-script-html-comment-like-text -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt></script>X" -| <body> - -#data -<!doctype html><style><!--<style></style>--></style> -#errors -(1,52): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--<style>" -| <body> -| "-->" - -#data -<!doctype html><style><!--</style>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--" -| <body> -| "X" - -#data -<!doctype html><style><!--...</style>...--></style> -#errors -(1,51): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--..." -| <body> -| "...-->" - -#data -<!doctype html><style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" -| <body> -| "X" - -#data -<!doctype html><style><!--...<style><!--...--!></style>--></style> -#errors -(1,66): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--...<style><!--...--!>" -| <body> -| "-->" - -#data -<!doctype html><style><!--...</style><!-- --><style>@import ...</style> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "<!--..." -| <!-- --> -| <style> -| "@import ..." -| <body> - -#data -<!doctype html><style>...<style><!--...</style><!-- --></style> -#errors -(1,63): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "...<style><!--..." -| <!-- --> -| <body> - -#data -<!doctype html><style>...<!--[if IE]><style>...</style>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <style> -| "...<!--[if IE]><style>..." -| <body> -| "X" - -#data -<!doctype html><title><!--<title>--> -#errors -(1,52): unexpected-end-tag -#document -| -| -| -| -| "<!--<title>" -| <body> -| "-->" - -#data -<!doctype html><title></title> -#errors -#document -| -| -| -| -| "" -| - -#data -foo/title><link></head><body>X -#errors -(1,52): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <title> -| "foo/title><link></head><body>X" -| <body> - -#data -<!doctype html><noscript><!--<noscript></noscript>--></noscript> -#errors -(1,64): unexpected-end-tag -#script-on -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| "<!--<noscript>" -| <body> -| "-->" - -#data -<!doctype html><noscript><!--<noscript></noscript>--></noscript> -#errors -#script-off -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| <!-- <noscript></noscript> --> -| <body> - -#data -<!doctype html><noscript><!--</noscript>X<noscript>--></noscript> -#errors -#script-on -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| "<!--" -| <body> -| "X" -| <noscript> -| "-->" - -#data -<!doctype html><noscript><!--</noscript>X<noscript>--></noscript> -#errors -#script-off -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| <!-- </noscript>X<noscript> --> -| <body> - -#data -<!doctype html><noscript><iframe></noscript>X -#errors -#script-on -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| "<iframe>" -| <body> -| "X" - -#data -<!doctype html><noscript><iframe></noscript>X -#errors - * (1,34) unexpected token in head noscript - * (1,46) unexpected EOF -#script-off -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| <body> -| <iframe> -| "</noscript>X" - -#data -<!doctype html><noframes><!--<noframes></noframes>--></noframes> -#errors -(1,64): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noframes> -| "<!--<noframes>" -| <body> -| "-->" - -#data -<!doctype html><noframes><body><script><!--...</script></body></noframes></html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noframes> -| "<body><script><!--...</script></body>" -| <body> - -#data -<!doctype html><textarea><!--<textarea></textarea>--></textarea> -#errors -(1,64): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "<!--<textarea>" -| "-->" - -#data -<!doctype html><textarea></textarea></textarea> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "</textarea>" - -#data -<!doctype html><textarea><</textarea> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "<" - -#data -<!doctype html><textarea>a<b</textarea> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> -| "a<b" - -#data -<!doctype html><iframe><!--<iframe></iframe>--></iframe> -#errors -(1,56): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <iframe> -| "<!--<iframe>" -| "-->" - -#data -<!doctype html><iframe>...<!--X->...<!--/X->...</iframe> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <iframe> -| "...<!--X->...<!--/X->..." - -#data -<!doctype html><xmp><!--<xmp></xmp>--></xmp> -#errors -(1,44): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <xmp> -| "<!--<xmp>" -| "-->" - -#data -<!doctype html><noembed><!--<noembed></noembed>--></noembed> -#errors -(1,60): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <noembed> -| "<!--<noembed>" -| "-->" - -#data -<script> -#errors -(1,8): expected-doctype-but-got-start-tag -(1,8): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| <body> - -#data -<script>a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,9): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "a" -| <body> - -#data -<script>< -#errors -(1,8): expected-doctype-but-got-start-tag -(1,9): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<" -| <body> - -#data -<script></ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,10): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</" -| <body> - -#data -<script></S -#errors -(1,8): expected-doctype-but-got-start-tag -(1,11): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</S" -| <body> - -#data -<script></SC -#errors -(1,8): expected-doctype-but-got-start-tag -(1,12): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</SC" -| <body> - -#data -<script></SCR -#errors -(1,8): expected-doctype-but-got-start-tag -(1,13): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</SCR" -| <body> - -#data -<script></SCRI -#errors -(1,8): expected-doctype-but-got-start-tag -(1,14): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</SCRI" -| <body> - -#data -<script></SCRIP -#errors -(1,8): expected-doctype-but-got-start-tag -(1,15): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</SCRIP" -| <body> - -#data -<script></SCRIPT -#errors -(1,8): expected-doctype-but-got-start-tag -(1,16): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</SCRIPT" -| <body> - -#data -<script></SCRIPT -#errors -(1,8): expected-doctype-but-got-start-tag -(1,17): expected-attribute-name-but-got-eof -(1,17): expected-named-closing-tag-but-got-eof -#new-errors -(1:18) eof-in-tag -#document -| <html> -| <head> -| <script> -| <body> - -#data -<script></s -#errors -(1,8): expected-doctype-but-got-start-tag -(1,11): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</s" -| <body> - -#data -<script></sc -#errors -(1,8): expected-doctype-but-got-start-tag -(1,12): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</sc" -| <body> - -#data -<script></scr -#errors -(1,8): expected-doctype-but-got-start-tag -(1,13): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</scr" -| <body> - -#data -<script></scri -#errors -(1,8): expected-doctype-but-got-start-tag -(1,14): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</scri" -| <body> - -#data -<script></scrip -#errors -(1,8): expected-doctype-but-got-start-tag -(1,15): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</scrip" -| <body> - -#data -<script></script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,16): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</script" -| <body> - -#data -<script></script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,17): expected-attribute-name-but-got-eof -(1,17): expected-named-closing-tag-but-got-eof -#new-errors -(1:18) eof-in-tag -#document -| <html> -| <head> -| <script> -| <body> - -#data -<script><! -#errors -(1,8): expected-doctype-but-got-start-tag -(1,10): expected-script-data-but-got-eof -(1,10): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!" -| <body> - -#data -<script><!a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,11): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!a" -| <body> - -#data -<script><!- -#errors -(1,8): expected-doctype-but-got-start-tag -(1,11): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!-" -| <body> - -#data -<script><!-a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,12): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!-a" -| <body> - -#data -<script><!-- -#errors -(1,8): expected-doctype-but-got-start-tag -(1,12): expected-named-closing-tag-but-got-eof -(1,12): unexpected-eof-in-text-mode -#new-errors -(1:13) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<script><!--a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,13): expected-named-closing-tag-but-got-eof -(1,13): unexpected-eof-in-text-mode -#new-errors -(1:14) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--a" -| <body> - -#data -<script><!--< -#errors -(1,8): expected-doctype-but-got-start-tag -(1,13): expected-named-closing-tag-but-got-eof -(1,13): unexpected-eof-in-text-mode -#new-errors -(1:14) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<" -| <body> - -#data -<script><!--<a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,14): expected-named-closing-tag-but-got-eof -(1,14): unexpected-eof-in-text-mode -#new-errors -(1:15) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<a" -| <body> - -#data -<script><!--</ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,14): expected-named-closing-tag-but-got-eof -(1,14): unexpected-eof-in-text-mode -#new-errors -(1:15) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--</" -| <body> - -#data -<script><!--</script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,20): expected-named-closing-tag-but-got-eof -(1,20): unexpected-eof-in-text-mode -#new-errors -(1:21) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--</script" -| <body> - -#data -<script><!--</script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,21): expected-attribute-name-but-got-eof -(1,21): expected-named-closing-tag-but-got-eof -#new-errors -(1:22) eof-in-tag -#document -| <html> -| <head> -| <script> -| "<!--" -| <body> - -#data -<script><!--<s -#errors -(1,8): expected-doctype-but-got-start-tag -(1,14): expected-named-closing-tag-but-got-eof -(1,14): unexpected-eof-in-text-mode -#new-errors -(1:15) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<s" -| <body> - -#data -<script><!--<script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,19): expected-named-closing-tag-but-got-eof -(1,19): unexpected-eof-in-text-mode -#new-errors -(1:20) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script" -| <body> - -#data -<script><!--<script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,20): eof-in-script-in-script -(1,20): expected-named-closing-tag-but-got-eof -#new-errors -(1:21) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script " -| <body> - -#data -<script><!--<script < -#errors -(1,8): expected-doctype-but-got-start-tag -(1,21): eof-in-script-in-script -(1,21): expected-named-closing-tag-but-got-eof -#new-errors -(1:22) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script <" -| <body> - -#data -<script><!--<script <a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,22): eof-in-script-in-script -(1,22): expected-named-closing-tag-but-got-eof -#new-errors -(1:23) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script <a" -| <body> - -#data -<script><!--<script </ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,22): eof-in-script-in-script -(1,22): expected-named-closing-tag-but-got-eof -#new-errors -(1:23) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </" -| <body> - -#data -<script><!--<script </s -#errors -(1,8): expected-doctype-but-got-start-tag -(1,23): eof-in-script-in-script -(1,23): expected-named-closing-tag-but-got-eof -#new-errors -(1:24) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </s" -| <body> - -#data -<script><!--<script </script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,28): eof-in-script-in-script -(1,28): expected-named-closing-tag-but-got-eof -#new-errors -(1:29) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script" -| <body> - -#data -<script><!--<script </scripta -#errors -(1,8): expected-doctype-but-got-start-tag -(1,29): eof-in-script-in-script -(1,29): expected-named-closing-tag-but-got-eof -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </scripta" -| <body> - -#data -<script><!--<script </script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,29): expected-named-closing-tag-but-got-eof -(1,29): unexpected-eof-in-text-mode -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script </script> -#errors -(1,8): expected-doctype-but-got-start-tag -(1,29): expected-named-closing-tag-but-got-eof -(1,29): unexpected-eof-in-text-mode -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script>" -| <body> - -#data -<script><!--<script </script/ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,29): expected-named-closing-tag-but-got-eof -(1,29): unexpected-eof-in-text-mode -#new-errors -(1:30) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script/" -| <body> - -#data -<script><!--<script </script < -#errors -(1,8): expected-doctype-but-got-start-tag -(1,30): expected-named-closing-tag-but-got-eof -(1,30): unexpected-eof-in-text-mode -#new-errors -(1:31) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script <" -| <body> - -#data -<script><!--<script </script <a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,31): expected-named-closing-tag-but-got-eof -(1,31): unexpected-eof-in-text-mode -#new-errors -(1:32) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script <a" -| <body> - -#data -<script><!--<script </script </ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,31): expected-named-closing-tag-but-got-eof -(1,31): unexpected-eof-in-text-mode -#new-errors -(1:32) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script </" -| <body> - -#data -<script><!--<script </script </script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,37): expected-named-closing-tag-but-got-eof -(1,37): unexpected-eof-in-text-mode -#new-errors -(1:38) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script </script </script" -| <body> - -#data -<script><!--<script </script </script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,38): expected-attribute-name-but-got-eof -(1,38): expected-named-closing-tag-but-got-eof -#new-errors -(1:39) eof-in-tag -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script </script </script/ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,38): unexpected-EOF-after-solidus-in-tag -(1,38): expected-named-closing-tag-but-got-eof -#new-errors -(1:39) eof-in-tag -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script </script </script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script </script " -| <body> - -#data -<script><!--<script - -#errors -(1,8): expected-doctype-but-got-start-tag -(1,21): eof-in-script-in-script -(1,21): expected-named-closing-tag-but-got-eof -#new-errors -(1:22) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script -" -| <body> - -#data -<script><!--<script -a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,22): eof-in-script-in-script -(1,22): expected-named-closing-tag-but-got-eof -#new-errors -(1:23) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script -a" -| <body> - -#data -<script><!--<script -- -#errors -(1,8): expected-doctype-but-got-start-tag -(1,22): eof-in-script-in-script -(1,22): expected-named-closing-tag-but-got-eof -#new-errors -(1:23) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script --" -| <body> - -#data -<script><!--<script --a -#errors -(1,8): expected-doctype-but-got-start-tag -(1,23): eof-in-script-in-script -(1,23): expected-named-closing-tag-but-got-eof -#new-errors -(1:24) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script --a" -| <body> - -#data -<script><!--<script --> -#errors -(1,8): expected-doctype-but-got-start-tag -(1,23): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script -->< -#errors -(1,8): expected-doctype-but-got-start-tag -(1,24): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!--<script --><" -| <body> - -#data -<script><!--<script --></ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,25): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!--<script --></" -| <body> - -#data -<script><!--<script --></script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,31): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "<!--<script --></script" -| <body> - -#data -<script><!--<script --></script -#errors -(1,8): expected-doctype-but-got-start-tag -(1,32): expected-attribute-name-but-got-eof -(1,32): expected-named-closing-tag-but-got-eof -#new-errors -(1:33) eof-in-tag -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script --></script/ -#errors -(1,8): expected-doctype-but-got-start-tag -(1,32): unexpected-EOF-after-solidus-in-tag -(1,32): expected-named-closing-tag-but-got-eof -#new-errors -(1:33) eof-in-tag -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script --></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script -->" -| <body> - -#data -<script><!--<script><\/script>--></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script><\/script>-->" -| <body> - -#data -<script><!--<script></scr'+'ipt>--></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt>-->" -| <body> - -#data -<script><!--<script></script><script></script></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>" -| <body> - -#data -<script><!--<script></script><script></script>--><!--</script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>--><!--" -| <body> - -#data -<script><!--<script></script><script></script>-- ></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>-- >" -| <body> - -#data -<script><!--<script></script><script></script>- -></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- ->" -| <body> - -#data -<script><!--<script></script><script></script>- - ></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>- - >" -| <body> - -#data -<script><!--<script></script><script></script>-></script> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <script> -| "<!--<script></script><script></script>->" -| <body> - -#data -<script><!--<script>--!></script>X -#errors -(1,8): expected-doctype-but-got-start-tag -(1,34): expected-named-closing-tag-but-got-eof -(1,34): unexpected-eof-in-text-mode -#new-errors -(1:35) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script>--!></script>X" -| <body> - -#data -<script><!--<scr'+'ipt></script>--></script> -#errors -(1,8): expected-doctype-but-got-start-tag -(1,44): unexpected-end-tag -#document -| <html> -| <head> -| <script> -| "<!--<scr'+'ipt>" -| <body> -| "-->" - -#data -<script><!--<script></scr'+'ipt></script>X -#errors -(1,8): expected-doctype-but-got-start-tag -(1,42): expected-named-closing-tag-but-got-eof -(1,42): unexpected-eof-in-text-mode -#new-errors -(1:43) eof-in-script-html-comment-like-text -#document -| <html> -| <head> -| <script> -| "<!--<script></scr'+'ipt></script>X" -| <body> - -#data -<style><!--<style></style>--></style> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,37): unexpected-end-tag -#document -| <html> -| <head> -| <style> -| "<!--<style>" -| <body> -| "-->" - -#data -<style><!--</style>X -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <style> -| "<!--" -| <body> -| "X" - -#data -<style><!--...</style>...--></style> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,36): unexpected-end-tag -#document -| <html> -| <head> -| <style> -| "<!--..." -| <body> -| "...-->" - -#data -<style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <style> -| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" -| <body> -| "X" - -#data -<style><!--...<style><!--...--!></style>--></style> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,51): unexpected-end-tag -#document -| <html> -| <head> -| <style> -| "<!--...<style><!--...--!>" -| <body> -| "-->" - -#data -<style><!--...</style><!-- --><style>@import ...</style> -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <style> -| "<!--..." -| <!-- --> -| <style> -| "@import ..." -| <body> - -#data -<style>...<style><!--...</style><!-- --></style> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,48): unexpected-end-tag -#document -| <html> -| <head> -| <style> -| "...<style><!--..." -| <!-- --> -| <body> - -#data -<style>...<!--[if IE]><style>...</style>X -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <style> -| "...<!--[if IE]><style>..." -| <body> -| "X" - -#data -<title><!--<title>--> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,37): unexpected-end-tag -#document -| -| -| -| "<!--<title>" -| <body> -| "-->" - -#data -<title></title> -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| -| -| -| "" -| - -#data -foo/title><link></head><body>X -#errors -(1,7): expected-doctype-but-got-start-tag -(1,37): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <title> -| "foo/title><link></head><body>X" -| <body> - -#data -<noscript><!--<noscript></noscript>--></noscript> -#errors -(1,10): expected-doctype-but-got-start-tag -(1,49): unexpected-end-tag -#script-on -#document -| <html> -| <head> -| <noscript> -| "<!--<noscript>" -| <body> -| "-->" - -#data -<noscript><!--<noscript></noscript>--></noscript> -#errors - * (1,11) missing DOCTYPE -#script-off -#document -| <html> -| <head> -| <noscript> -| <!-- <noscript></noscript> --> -| <body> - -#data -<noscript><!--</noscript>X<noscript>--></noscript> -#errors -(1,10): expected-doctype-but-got-start-tag -#script-on -#document -| <html> -| <head> -| <noscript> -| "<!--" -| <body> -| "X" -| <noscript> -| "-->" - -#data -<noscript><!--</noscript>X<noscript>--></noscript> -#errors -(1,10): expected-doctype-but-got-start-tag -#script-off -#document -| <html> -| <head> -| <noscript> -| <!-- </noscript>X<noscript> --> -| <body> - -#data -<noscript><iframe></noscript>X -#errors -(1,10): expected-doctype-but-got-start-tag -#script-on -#document -| <html> -| <head> -| <noscript> -| "<iframe>" -| <body> -| "X" - -#data -<noscript><iframe></noscript>X -#errors - * (1,11) missing DOCTYPE - * (1,19) unexpected token in head noscript - * (1,31) unexpected EOF -#script-off -#document -| <html> -| <head> -| <noscript> -| <body> -| <iframe> -| "</noscript>X" - -#data -<noframes><!--<noframes></noframes>--></noframes> -#errors -(1,10): expected-doctype-but-got-start-tag -(1,49): unexpected-end-tag -#document -| <html> -| <head> -| <noframes> -| "<!--<noframes>" -| <body> -| "-->" - -#data -<noframes><body><script><!--...</script></body></noframes></html> -#errors -(1,10): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <noframes> -| "<body><script><!--...</script></body>" -| <body> - -#data -<textarea><!--<textarea></textarea>--></textarea> -#errors -(1,10): expected-doctype-but-got-start-tag -(1,49): unexpected-end-tag -#document -| <html> -| <head> -| <body> -| <textarea> -| "<!--<textarea>" -| "-->" - -#data -<textarea></textarea></textarea> -#errors -(1,10): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <body> -| <textarea> -| "</textarea>" - -#data -<iframe><!--<iframe></iframe>--></iframe> -#errors -(1,8): expected-doctype-but-got-start-tag -(1,41): unexpected-end-tag -#document -| <html> -| <head> -| <body> -| <iframe> -| "<!--<iframe>" -| "-->" - -#data -<iframe>...<!--X->...<!--/X->...</iframe> -#errors -(1,8): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <body> -| <iframe> -| "...<!--X->...<!--/X->..." - -#data -<xmp><!--<xmp></xmp>--></xmp> -#errors -(1,5): expected-doctype-but-got-start-tag -(1,29): unexpected-end-tag -#document -| <html> -| <head> -| <body> -| <xmp> -| "<!--<xmp>" -| "-->" - -#data -<noembed><!--<noembed></noembed>--></noembed> -#errors -(1,9): expected-doctype-but-got-start-tag -(1,45): unexpected-end-tag -#document -| <html> -| <head> -| <body> -| <noembed> -| "<!--<noembed>" -| "-->" - -#data -<!doctype html><table> - -#errors -(2,0): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| " -" - -#data -<!doctype html><table><td><span><font></span><span> -#errors -(1,26): unexpected-cell-in-table-body -(1,45): unexpected-end-tag -(1,51): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <span> -| <font> -| <font> -| <span> - -#data -<!doctype html><form><table></form><form></table></form> -#errors -(1,35): unexpected-end-tag-implies-table-voodoo -(1,35): unexpected-end-tag -(1,41): unexpected-form-in-table -(1,56): unexpected-end-tag -(1,56): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <form> -| <table> -| <form> diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests17.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests17.dat deleted file mode 100644 index e49bcf031..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests17.dat +++ /dev/null @@ -1,179 +0,0 @@ -#data -<!doctype html><table><tbody><select><tr> -#errors -(1,37): unexpected-start-tag-implies-table-voodoo -(1,41): unexpected-table-element-start-tag-in-select-in-table -(1,41): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><tr><select><td> -#errors -(1,34): unexpected-start-tag-implies-table-voodoo -(1,38): unexpected-table-element-start-tag-in-select-in-table -(1,38): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <table> -| <tbody> -| <tr> -| <td> - -#data -<!doctype html><table><tr><td><select><td> -#errors -(1,42): unexpected-table-element-start-tag-in-select-in-table -(1,42): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <select> -| <td> - -#data -<!doctype html><table><tr><th><select><td> -#errors -(1,42): unexpected-table-element-start-tag-in-select-in-table -(1,42): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <th> -| <select> -| <td> - -#data -<!doctype html><table><caption><select><tr> -#errors -(1,43): unexpected-table-element-start-tag-in-select-in-table -(1,43): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| <select> -| <tbody> -| <tr> - -#data -<!doctype html><select><tr> -#errors -(1,27): unexpected-start-tag-in-select -(1,27): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><td> -#errors -(1,27): unexpected-start-tag-in-select -(1,27): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><th> -#errors -(1,27): unexpected-start-tag-in-select -(1,27): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><tbody> -#errors -(1,30): unexpected-start-tag-in-select -(1,30): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><thead> -#errors -(1,30): unexpected-start-tag-in-select -(1,30): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><tfoot> -#errors -(1,30): unexpected-start-tag-in-select -(1,30): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><select><caption> -#errors -(1,32): unexpected-start-tag-in-select -(1,32): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><table><tr></table>a -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| "a" diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests18.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests18.dat deleted file mode 100644 index 05363b392..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests18.dat +++ /dev/null @@ -1,534 +0,0 @@ -#data -<plaintext></plaintext> -#errors -11: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”. -23: End of file seen and there were open elements. -11: Unclosed element “plaintext”. -#document -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><plaintext></plaintext> -#errors -(1,38): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><html><plaintext></plaintext> -#errors -44: End of file seen and there were open elements. -32: Unclosed element “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><head><plaintext></plaintext> -#errors -44: End of file seen and there were open elements. -32: Unclosed element “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><html><noscript><plaintext></plaintext> -#errors -42: Bad start tag in “plaintext” in “head”. -54: End of file seen and there were open elements. -42: Unclosed element “plaintext”. -#script-off -#document -| <!DOCTYPE html> -| <html> -| <head> -| <noscript> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html></head><plaintext></plaintext> -#errors -45: End of file seen and there were open elements. -33: Unclosed element “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><body><plaintext></plaintext> -#errors -44: End of file seen and there were open elements. -32: Unclosed element “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><table><plaintext></plaintext> -#errors -(1,33): foster-parenting-start-tag -(1,45): foster-parenting-character -(1,45): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> - -#data -<!doctype html><table><tbody><plaintext></plaintext> -#errors -(1,40): foster-parenting-start-tag -(1,41): foster-parenting-character -(1,52): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> -| <tbody> - -#data -<!doctype html><table><tbody><tr><plaintext></plaintext> -#errors -(1,44): foster-parenting-start-tag -(1,56): foster-parenting-character -(1,56): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><td><plaintext></plaintext> -#errors -(1,26): unexpected-cell-in-table-body -(1,49): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><table><caption><plaintext></plaintext> -#errors -(1,54): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><table><colgroup><plaintext></plaintext> -#errors -43: Start tag “plaintext” seen in “table”. -55: Misplaced non-space characters inside a table. -55: End of file seen and there were open elements. -43: Unclosed element “plaintext”. -22: Unclosed element “table”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" -| <table> -| <colgroup> - -#data -<!doctype html><select><plaintext></plaintext>X -#errors -34: Stray start tag “plaintext”. -46: Stray end tag “plaintext”. -47: End of file seen and there were open elements. -23: Unclosed element “select”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| "X" - -#data -<!doctype html><table><select><plaintext>a<caption>b -#errors -30: Start tag “select” seen in “table”. -41: Stray start tag “plaintext”. -51: “caption” start tag with “select” open. -52: End of file seen and there were open elements. -51: Unclosed element “caption”. -22: Unclosed element “table”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| "a" -| <table> -| <caption> -| "b" - -#data -<!doctype html><template><plaintext>a</template>b -#errors -49: End of file seen and there were open elements. -36: Unclosed element “plaintext”. -25: Unclosed element “template”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <template> -| content -| <plaintext> -| "a</template>b" -| <body> - -#data -<!doctype html><body></body><plaintext></plaintext> -#errors -39: Stray start tag “plaintext”. -51: End of file seen and there were open elements. -39: Unclosed element “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><frameset><plaintext></plaintext> -#errors -36: Stray start tag “plaintext”. -48: Stray end tag “plaintext”. -48: End of file seen and there were open elements. -25: Unclosed element “frameset”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><frameset></frameset><plaintext></plaintext> -#errors -47: Stray start tag “plaintext”. -59: Stray end tag “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><body></body></html><plaintext></plaintext> -#errors -46: Stray start tag “plaintext”. -58: End of file seen and there were open elements. -46: Unclosed element “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!doctype html><frameset></frameset></html><plaintext></plaintext> -#errors -54: Stray start tag “plaintext”. -66: Stray end tag “plaintext”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><svg><plaintext>a</plaintext>b -#errors -45: End of file seen and there were open elements. -20: Unclosed element “svg”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <svg svg> -| <svg plaintext> -| "a" -| "b" - -#data -<!doctype html><svg><title><plaintext>a</plaintext>b -#errors -52: End of file seen and there were open elements. -38: Unclosed element “plaintext”. -27: Unclosed element “title”. -20: Unclosed element “svg”. -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <svg svg> -| <svg title> -| <plaintext> -| "a</plaintext>b" - -#data -<!doctype html><table><tr><style></script></style>abc -#errors -(1,51): foster-parenting-character -(1,52): foster-parenting-character -(1,53): foster-parenting-character -(1,53): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "abc" -| <table> -| <tbody> -| <tr> -| <style> -| "</script>" - -#data -<!doctype html><table><tr><script></style></script>abc -#errors -(1,52): foster-parenting-character -(1,53): foster-parenting-character -(1,54): foster-parenting-character -(1,54): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "abc" -| <table> -| <tbody> -| <tr> -| <script> -| "</style>" - -#data -<!doctype html><table><caption><style></script></style>abc -#errors -(1,58): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| <style> -| "</script>" -| "abc" - -#data -<!doctype html><table><td><style></script></style>abc -#errors -(1,26): unexpected-cell-in-table-body -(1,53): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <style> -| "</script>" -| "abc" - -#data -<!doctype html><select><script></style></script>abc -#errors -(1,51): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <script> -| "</style>" -| "abc" - -#data -<!doctype html><table><select><script></style></script>abc -#errors -(1,30): unexpected-start-tag-implies-table-voodoo -(1,58): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <script> -| "</style>" -| "abc" -| <table> - -#data -<!doctype html><table><tr><select><script></style></script>abc -#errors -(1,34): unexpected-start-tag-implies-table-voodoo -(1,62): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <script> -| "</style>" -| "abc" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><frameset></frameset><noframes>abc -#errors -(1,49): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" - -#data -<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" -| <!-- abc --> - -#data -<!doctype html><frameset></frameset></html><noframes>abc -#errors -(1,56): expected-named-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" - -#data -<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <noframes> -| "abc" -| <!-- abc --> - -#data -<!doctype html><table><tr></tbody><tfoot> -#errors -(1,41): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <tfoot> - -#data -<!doctype html><table><td><svg></svg>abc<td> -#errors -(1,26): unexpected-cell-in-table-body -(1,44): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <svg svg> -| "abc" -| <td> diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests19.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests19.dat deleted file mode 100644 index a1897774d..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests19.dat +++ /dev/null @@ -1,1454 +0,0 @@ -#data -<!doctype html><math><mn DefinitionUrl="foo"> -#errors -(1,45): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <math math> -| <math mn> -| definitionURL="foo" - -#data -<!doctype html><html></p><!--foo--> -#errors -(1,25): end-tag-after-implied-root -#document -| <!DOCTYPE html> -| <html> -| <!-- foo --> -| <head> -| <body> - -#data -<!doctype html><head></head></p><!--foo--> -#errors -(1,32): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <!-- foo --> -| <body> - -#data -<!doctype html><body><p><pre> -#errors -(1,29): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <pre> - -#data -<!doctype html><body><p><listing> -#errors -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <listing> - -#data -<!doctype html><p><plaintext> -#errors -(1,29): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <plaintext> - -#data -<!doctype html><p><h1> -#errors -(1,22): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <h1> - -#data -<!doctype html><isindex type="hidden"> -#errors -(1,38): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <isindex> -| type="hidden" - -#data -<!doctype html><ruby><p><rp> -#errors -(1,28): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <p> -| <rp> - -#data -<!doctype html><ruby><div><span><rp> -#errors -(1,36): XXX-undefined-error -(1,36): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <span> -| <rp> - -#data -<!doctype html><ruby><div><p><rp> -#errors -(1,33): XXX-undefined-error -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <p> -| <rp> - -#data -<!doctype html><ruby><p><rt> -#errors -(1,28): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <p> -| <rt> - -#data -<!doctype html><ruby><div><span><rt> -#errors -(1,36): XXX-undefined-error -(1,36): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <span> -| <rt> - -#data -<!doctype html><ruby><div><p><rt> -#errors -(1,33): XXX-undefined-error -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <ruby> -| <div> -| <p> -| <rt> - -#data -<html><ruby>a<rb>b<rt></ruby></html> -#errors -(1,6): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <body> -| <ruby> -| "a" -| <rb> -| "b" -| <rt> - -#data -<html><ruby>a<rp>b<rt></ruby></html> -#errors -(1,6): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <body> -| <ruby> -| "a" -| <rp> -| "b" -| <rt> - -#data -<html><ruby>a<rt>b<rt></ruby></html> -#errors -(1,6): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <body> -| <ruby> -| "a" -| <rt> -| "b" -| <rt> - -#data -<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html> -#errors -(1,6): expected-doctype-but-got-start-tag -#document -| <html> -| <head> -| <body> -| <ruby> -| "a" -| <rtc> -| "b" -| <rt> -| "c" -| <rb> -| "d" - -#data -<!doctype html><math/><foo> -#errors -(1,27): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <math math> -| <foo> - -#data -<!doctype html><svg/><foo> -#errors -(1,26): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <svg svg> -| <foo> - -#data -<!doctype html><div></body><!--foo--> -#errors -(1,27): expected-one-end-tag-but-got-another -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> -| <!-- foo --> - -#data -<!doctype html><h1><div><h3><span></h1>foo -#errors -(1,39): end-tag-too-early -(1,42): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <h1> -| <div> -| <h3> -| <span> -| "foo" - -#data -<!doctype html><p></h3>foo -#errors -(1,23): end-tag-too-early -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| "foo" - -#data -<!doctype html><h3><li>abc</h2>foo -#errors -(1,31): end-tag-too-early -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <h3> -| <li> -| "abc" -| "foo" - -#data -<!doctype html><table>abc<!--foo--> -#errors -(1,23): foster-parenting-character -(1,24): foster-parenting-character -(1,25): foster-parenting-character -(1,35): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "abc" -| <table> -| <!-- foo --> - -#data -<!doctype html><table> <!--foo--> -#errors -(1,34): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| " " -| <!-- foo --> - -#data -<!doctype html><table> b <!--foo--> -#errors -(1,23): foster-parenting-character -(1,24): foster-parenting-character -(1,25): foster-parenting-character -(1,35): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| " b " -| <table> -| <!-- foo --> - -#data -<!doctype html><select><option><option> -#errors -(1,39): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> -| <option> - -#data -<!doctype html><select><option></optgroup> -#errors -(1,42): unexpected-end-tag-in-select -(1,42): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> - -#data -<!doctype html><select><option></optgroup> -#errors -(1,42): unexpected-end-tag-in-select -(1,42): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> - -#data -<!doctype html><dd><optgroup><dd> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dd> -| <optgroup> -| <dd> - -#data -<!doctype html><p><math><mi><p><h1> -#errors -(1,35): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mi> -| <p> -| <h1> - -#data -<!doctype html><p><math><mo><p><h1> -#errors -(1,35): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mo> -| <p> -| <h1> - -#data -<!doctype html><p><math><mn><p><h1> -#errors -(1,35): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mn> -| <p> -| <h1> - -#data -<!doctype html><p><math><ms><p><h1> -#errors -(1,35): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math ms> -| <p> -| <h1> - -#data -<!doctype html><p><math><mtext><p><h1> -#errors -(1,38): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mtext> -| <p> -| <h1> - -#data -<!doctype html><frameset></noframes> -#errors -(1,36): unexpected-end-tag-in-frameset -(1,36): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><html c=d><body></html><html a=b> -#errors -(1,48): non-html-root -#document -| <!DOCTYPE html> -| <html> -| a="b" -| c="d" -| <head> -| <body> - -#data -<!doctype html><html c=d><frameset></frameset></html><html a=b> -#errors -(1,63): non-html-root -#document -| <!DOCTYPE html> -| <html> -| a="b" -| c="d" -| <head> -| <frameset> - -#data -<!doctype html><html><frameset></frameset></html><!--foo--> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <!-- foo --> - -#data -<!doctype html><html><frameset></frameset></html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| " " - -#data -<!doctype html><html><frameset></frameset></html>abc -#errors -(1,50): expected-eof-but-got-char -(1,51): expected-eof-but-got-char -(1,52): expected-eof-but-got-char -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><html><frameset></frameset></html><p> -#errors -(1,52): expected-eof-but-got-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><html><frameset></frameset></html></p> -#errors -(1,53): expected-eof-but-got-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<html><frameset></frameset></html><!doctype html> -#errors -(1,6): expected-doctype-but-got-start-tag -(1,49): unexpected-doctype -#document -| <html> -| <head> -| <frameset> - -#data -<!doctype html><body><frameset> -#errors -(1,31): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> - -#data -<!doctype html><p><frameset><frame> -#errors -(1,28): unexpected-start-tag -(1,35): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><p>a<frameset> -#errors -(1,29): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| "a" - -#data -<!doctype html><p> <frameset><frame> -#errors -(1,29): unexpected-start-tag -(1,36): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><pre><frameset> -#errors -(1,30): unexpected-start-tag -(1,30): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <pre> - -#data -<!doctype html><listing><frameset> -#errors -(1,34): unexpected-start-tag -(1,34): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <listing> - -#data -<!doctype html><li><frameset> -#errors -(1,29): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <li> - -#data -<!doctype html><dd><frameset> -#errors -(1,29): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dd> - -#data -<!doctype html><dt><frameset> -#errors -(1,29): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dt> - -#data -<!doctype html><button><frameset> -#errors -(1,33): unexpected-start-tag -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <button> - -#data -<!doctype html><applet><frameset> -#errors -(1,33): unexpected-start-tag -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <applet> - -#data -<!doctype html><marquee><frameset> -#errors -(1,34): unexpected-start-tag -(1,34): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <marquee> - -#data -<!doctype html><object><frameset> -#errors -(1,33): unexpected-start-tag -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <object> - -#data -<!doctype html><table><frameset> -#errors -(1,32): unexpected-start-tag-implies-table-voodoo -(1,32): unexpected-start-tag -(1,32): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> - -#data -<!doctype html><area><frameset> -#errors -(1,31): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <area> - -#data -<!doctype html><basefont><frameset> -#errors -(1,35): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <basefont> -| <frameset> - -#data -<!doctype html><bgsound><frameset> -#errors -(1,34): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <bgsound> -| <frameset> - -#data -<!doctype html><br><frameset> -#errors -(1,29): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <br> - -#data -<!doctype html><embed><frameset> -#errors -(1,32): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <embed> - -#data -<!doctype html><img><frameset> -#errors -(1,30): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <img> - -#data -<!doctype html><input><frameset> -#errors -(1,32): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <input> - -#data -<!doctype html><keygen><frameset> -#errors -(1,33): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <keygen> - -#data -<!doctype html><wbr><frameset> -#errors -(1,30): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <wbr> - -#data -<!doctype html><hr><frameset> -#errors -(1,29): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <hr> - -#data -<!doctype html><textarea></textarea><frameset> -#errors -(1,46): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <textarea> - -#data -<!doctype html><xmp></xmp><frameset> -#errors -(1,36): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <xmp> - -#data -<!doctype html><iframe></iframe><frameset> -#errors -(1,42): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <iframe> - -#data -<!doctype html><select></select><frameset> -#errors -(1,42): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> - -#data -<!doctype html><svg></svg><frameset><frame> -#errors -(1,36): unexpected-start-tag -(1,43): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><math></math><frameset><frame> -#errors -(1,38): unexpected-start-tag -(1,45): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><svg><foreignObject><div> <frameset><frame> -#errors -(1,51): unexpected-start-tag -(1,58): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<!doctype html><svg>a</svg><frameset><frame> -#errors -(1,37): unexpected-start-tag -(1,44): unexpected-start-tag-ignored -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <svg svg> -| "a" - -#data -<!doctype html><svg> </svg><frameset><frame> -#errors -(1,37): unexpected-start-tag -(1,44): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| <frame> - -#data -<html>aaa<frameset></frameset> -#errors -(1,6): expected-doctype-but-got-start-tag -(1,19): unexpected-start-tag -(1,30): unexpected-end-tag -#document -| <html> -| <head> -| <body> -| "aaa" - -#data -<html> a <frameset></frameset> -#errors -(1,6): expected-doctype-but-got-start-tag -(1,19): unexpected-start-tag -(1,30): unexpected-end-tag -#document -| <html> -| <head> -| <body> -| "a " - -#data -<!doctype html><div><frameset> -#errors -(1,30): unexpected-start-tag -(1,30): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!doctype html><div><body><frameset> -#errors -(1,26): unexpected-start-tag -(1,36): unexpected-start-tag -(1,36): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> - -#data -<!doctype html><p><math></p>a -#errors -(1,28): unexpected-end-tag -(1,28): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| "a" - -#data -<!doctype html><p><math><mn><span></p>a -#errors -(1,38): unexpected-end-tag -(1,39): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <math math> -| <math mn> -| <span> -| <p> -| "a" - -#data -<!doctype html><math></html> -#errors -(1,28): unexpected-end-tag -(1,28): expected-one-end-tag-but-got-another -(1,28): unexpected-end-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <math math> - -#data -<!doctype html><meta charset="ascii"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <meta> -| charset="ascii" -| <body> - -#data -<!doctype html><meta http-equiv="content-type" content="text/html;charset=ascii"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <meta> -| content="text/html;charset=ascii" -| http-equiv="content-type" -| <body> - -#data -<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset="utf8"> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --> -| <meta> -| charset="utf8" -| <body> - -#data -<!doctype html><html a=b><head></head><html c=d> -#errors -(1,48): non-html-root -#document -| <!DOCTYPE html> -| <html> -| a="b" -| c="d" -| <head> -| <body> - -#data -<!doctype html><image/> -#errors -(1,23): image-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <img> - -#data -<!doctype html>a<i>b<table>c<b>d</i>e</b>f -#errors -(1,28): foster-parenting-character -(1,31): foster-parenting-start-tag -(1,32): foster-parenting-character -(1,36): foster-parenting-end-tag -(1,36): adoption-agency-1.3 -(1,37): foster-parenting-character -(1,41): foster-parenting-end-tag -(1,42): foster-parenting-character -(1,42): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "a" -| <i> -| "bc" -| <b> -| "de" -| "f" -| <table> - -#data -<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f -#errors -(1,25): foster-parenting-start-tag -(1,26): foster-parenting-character -(1,29): foster-parenting-start-tag -(1,30): foster-parenting-character -(1,35): foster-parenting-start-tag -(1,36): foster-parenting-character -(1,39): foster-parenting-start-tag -(1,40): foster-parenting-character -(1,44): foster-parenting-end-tag -(1,44): adoption-agency-1.3 -(1,44): adoption-agency-1.3 -(1,45): foster-parenting-character -(1,49): foster-parenting-end-tag -(1,49): adoption-agency-1.3 -(1,49): adoption-agency-1.3 -(1,50): foster-parenting-character -(1,50): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <b> -| <i> -| "c" -| <a> -| "d" -| <a> -| "e" -| <a> -| "f" -| <table> - -#data -<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f -#errors -(1,37): adoption-agency-1.3 -(1,37): adoption-agency-1.3 -(1,42): adoption-agency-1.3 -(1,42): adoption-agency-1.3 -(1,43): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <b> -| <i> -| "c" -| <a> -| "d" -| <a> -| "e" -| <a> -| "f" - -#data -<!doctype html><table><i>a<b>b<div>c</i> -#errors -(1,25): foster-parenting-start-tag -(1,26): foster-parenting-character -(1,29): foster-parenting-start-tag -(1,30): foster-parenting-character -(1,35): foster-parenting-start-tag -(1,36): foster-parenting-character -(1,40): foster-parenting-end-tag -(1,40): adoption-agency-1.3 -(1,40): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <i> -| "c" -| <table> - -#data -<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f -#errors -(1,25): foster-parenting-start-tag -(1,26): foster-parenting-character -(1,29): foster-parenting-start-tag -(1,30): foster-parenting-character -(1,35): foster-parenting-start-tag -(1,36): foster-parenting-character -(1,39): foster-parenting-start-tag -(1,40): foster-parenting-character -(1,44): foster-parenting-end-tag -(1,44): adoption-agency-1.3 -(1,44): adoption-agency-1.3 -(1,45): foster-parenting-character -(1,49): foster-parenting-end-tag -(1,44): adoption-agency-1.3 -(1,44): adoption-agency-1.3 -(1,50): foster-parenting-character -(1,50): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <b> -| "b" -| <b> -| <div> -| <b> -| <i> -| "c" -| <a> -| "d" -| <a> -| "e" -| <a> -| "f" -| <table> - -#data -<!doctype html><table><i>a<div>b<tr>c<b>d</i>e -#errors -(1,25): foster-parenting-start-tag -(1,26): foster-parenting-character -(1,31): foster-parenting-start-tag -(1,32): foster-parenting-character -(1,37): foster-parenting-character -(1,40): foster-parenting-start-tag -(1,41): foster-parenting-character -(1,45): foster-parenting-end-tag -(1,45): adoption-agency-1.3 -(1,46): foster-parenting-character -(1,46): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <i> -| "a" -| <div> -| "b" -| <i> -| "c" -| <b> -| "d" -| <b> -| "e" -| <table> -| <tbody> -| <tr> - -#data -<!doctype html><table><td><table><i>a<div>b<b>c</i>d -#errors -(1,26): unexpected-cell-in-table-body -(1,36): foster-parenting-start-tag -(1,37): foster-parenting-character -(1,42): foster-parenting-start-tag -(1,43): foster-parenting-character -(1,46): foster-parenting-start-tag -(1,47): foster-parenting-character -(1,51): foster-parenting-end-tag -(1,51): adoption-agency-1.3 -(1,51): adoption-agency-1.3 -(1,52): foster-parenting-character -(1,52): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| <i> -| "a" -| <div> -| <i> -| "b" -| <b> -| "c" -| <b> -| "d" -| <table> - -#data -<!doctype html><body><bgsound> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <bgsound> - -#data -<!doctype html><body><basefont> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <basefont> - -#data -<!doctype html><a><b></a><basefont> -#errors -(1,25): adoption-agency-1.3 -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <a> -| <b> -| <basefont> - -#data -<!doctype html><a><b></a><bgsound> -#errors -(1,25): adoption-agency-1.3 -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <a> -| <b> -| <bgsound> - -#data -<!doctype html><figcaption><article></figcaption>a -#errors -(1,49): end-tag-too-early -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <figcaption> -| <article> -| "a" - -#data -<!doctype html><summary><article></summary>a -#errors -(1,43): end-tag-too-early -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <summary> -| <article> -| "a" - -#data -<!doctype html><p><a><plaintext>b -#errors -(1,32): unexpected-end-tag -(1,33): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <a> -| <plaintext> -| <a> -| "b" - -#data -<!DOCTYPE html><div>a<a></div>b<p>c</p>d -#errors -(1,30): end-tag-too-early -(1,40): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <div> -| "a" -| <a> -| <a> -| "b" -| <p> -| "c" -| "d" diff --git a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests2.dat b/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests2.dat deleted file mode 100644 index b44fec4d7..000000000 --- a/pkg/mod/golang.org/x/net@v0.0.0-20210916014120-12bc252f5db8/html/testdata/webkit/tests2.dat +++ /dev/null @@ -1,821 +0,0 @@ -#data -<!DOCTYPE html>Test -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "Test" - -#data -<textarea>test</div>test -#errors -(1,10): expected-doctype-but-got-start-tag -(1,24): expected-closing-tag-but-got-eof -#document -| <html> -| <head> -| <body> -| <textarea> -| "test</div>test" - -#data -<table><td> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,11): unexpected-cell-in-table-body -(1,11): expected-closing-tag-but-got-eof -#document -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> - -#data -<table><td>test</tbody></table> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,11): unexpected-cell-in-table-body -#document -| <html> -| <head> -| <body> -| <table> -| <tbody> -| <tr> -| <td> -| "test" - -#data -<frame>test -#errors -(1,7): expected-doctype-but-got-start-tag -(1,7): unexpected-start-tag-ignored -#document -| <html> -| <head> -| <body> -| "test" - -#data -<!DOCTYPE html><frameset>test -#errors -(1,29): unexpected-char-in-frameset -(1,29): unexpected-char-in-frameset -(1,29): unexpected-char-in-frameset -(1,29): unexpected-char-in-frameset -(1,29): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!DOCTYPE html><frameset> te st -#errors -(1,29): unexpected-char-in-frameset -(1,29): unexpected-char-in-frameset -(1,29): unexpected-char-in-frameset -(1,29): unexpected-char-in-frameset -(1,29): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| " " - -#data -<!DOCTYPE html><frameset></frameset> te st -#errors -(1,29): unexpected-char-after-frameset -(1,29): unexpected-char-after-frameset -(1,29): unexpected-char-after-frameset -(1,29): unexpected-char-after-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> -| " " - -#data -<!DOCTYPE html><frameset><!DOCTYPE html> -#errors -(1,40): unexpected-doctype -(1,40): eof-in-frameset -#document -| <!DOCTYPE html> -| <html> -| <head> -| <frameset> - -#data -<!DOCTYPE html><font><p><b>test</font> -#errors -(1,38): adoption-agency-1.3 -(1,38): adoption-agency-1.3 -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <font> -| <p> -| <font> -| <b> -| "test" - -#data -<!DOCTYPE html><dt><div><dd> -#errors -(1,28): end-tag-too-early -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <dt> -| <div> -| <dd> - -#data -<script></x -#errors -(1,8): expected-doctype-but-got-start-tag -(1,11): expected-named-closing-tag-but-got-eof -#document -| <html> -| <head> -| <script> -| "</x" -| <body> - -#data -<table><plaintext><td> -#errors -(1,7): expected-doctype-but-got-start-tag -(1,18): unexpected-start-tag-implies-table-voodoo -(1,22): foster-parenting-character-in-table -(1,22): foster-parenting-character-in-table -(1,22): foster-parenting-character-in-table -(1,22): foster-parenting-character-in-table -(1,22): eof-in-table -#document -| <html> -| <head> -| <body> -| <plaintext> -| "<td>" -| <table> - -#data -<plaintext></plaintext> -#errors -(1,11): expected-doctype-but-got-start-tag -(1,23): expected-closing-tag-but-got-eof -#document -| <html> -| <head> -| <body> -| <plaintext> -| "</plaintext>" - -#data -<!DOCTYPE html><table><tr>TEST -#errors -(1,30): foster-parenting-character-in-table -(1,30): foster-parenting-character-in-table -(1,30): foster-parenting-character-in-table -(1,30): foster-parenting-character-in-table -(1,30): eof-in-table -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "TEST" -| <table> -| <tbody> -| <tr> - -#data -<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4> -#errors -(1,37): unexpected-start-tag -(1,53): unexpected-start-tag -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| t1="1" -| t2="2" -| t3="3" -| t4="4" - -#data -</b test -#errors -(1,8): eof-in-attribute-name -(1,8): expected-doctype-but-got-eof -#new-errors -(1:9) eof-in-tag -#document -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html></b test<b &=&>X -#errors -(1,24): invalid-character-in-attribute-name -(1,32): named-entity-without-semicolon -(1,33): attributes-in-end-tag -(1,33): unexpected-end-tag-before-html -#new-errors -(1:24) unexpected-character-in-attribute-name -(1:33) missing-semicolon-after-character-reference -(1:33) end-tag-with-attributes -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "X" - -#data -<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt -#errors -(1,9): need-space-after-doctype -(1,54): expected-named-closing-tag-but-got-eof -#new-errors -(1:10) missing-whitespace-before-doctype-name -#document -| <!DOCTYPE html> -| <html> -| <head> -| <script> -| type="text/x-foobar;baz" -| "X</SCRipt" -| <body> - -#data -& -#errors -(1,1): expected-doctype-but-got-chars -#document -| <html> -| <head> -| <body> -| "&" - -#data -&# -#errors -(1,2): expected-numeric-entity -(1,2): expected-doctype-but-got-chars -#new-errors -(1:3) absence-of-digits-in-numeric-character-reference -#document -| <html> -| <head> -| <body> -| "&#" - -#data -&#X -#errors -(1,3): expected-numeric-entity -(1,3): expected-doctype-but-got-chars -#new-errors -(1:4) absence-of-digits-in-numeric-character-reference -#document -| <html> -| <head> -| <body> -| "&#X" - -#data -&#x -#errors -(1,3): expected-numeric-entity -(1,3): expected-doctype-but-got-chars -#new-errors -(1:4) absence-of-digits-in-numeric-character-reference -#document -| <html> -| <head> -| <body> -| "&#x" - -#data -- -#errors -(1,4): numeric-entity-without-semicolon -(1,4): expected-doctype-but-got-chars -#new-errors -(1:5) missing-semicolon-after-character-reference -#document -| <html> -| <head> -| <body> -| "-" - -#data -&x-test -#errors -(1,2): expected-doctype-but-got-chars -#document -| <html> -| <head> -| <body> -| "&x-test" - -#data -<!doctypehtml><p><li> -#errors -(1,9): need-space-after-doctype -#new-errors -(1:10) missing-whitespace-before-doctype-name -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <li> - -#data -<!doctypehtml><p><dt> -#errors -(1,9): need-space-after-doctype -#new-errors -(1:10) missing-whitespace-before-doctype-name -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <dt> - -#data -<!doctypehtml><p><dd> -#errors -(1,9): need-space-after-doctype -#new-errors -(1:10) missing-whitespace-before-doctype-name -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <dd> - -#data -<!doctypehtml><p><form> -#errors -(1,9): need-space-after-doctype -(1,23): expected-closing-tag-but-got-eof -#new-errors -(1:10) missing-whitespace-before-doctype-name -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| <form> - -#data -<!DOCTYPE html><p></P>X -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <p> -| "X" - -#data -& -#errors -(1,4): named-entity-without-semicolon -(1,4): expected-doctype-but-got-chars -#new-errors -(1:5) missing-semicolon-after-character-reference -#document -| <html> -| <head> -| <body> -| "&" - -#data -&AMp; -#errors -(1,3): expected-named-entity -(1,3): expected-doctype-but-got-chars -#new-errors -(1:5) unknown-named-character-reference -#document -| <html> -| <head> -| <body> -| "&AMp;" - -#data -<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY> -#errors -(1,110): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly> - -#data -<!DOCTYPE html>X</body>X -#errors -(1,24): unexpected-char-after-body -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| "XX" - -#data -<!DOCTYPE html><!-- X -#errors -(1,21): eof-in-comment -#new-errors -(1:22) eof-in-comment -#document -| <!DOCTYPE html> -| <!-- X --> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><table><caption>test TEST</caption><td>test -#errors -(1,54): unexpected-cell-in-table-body -(1,58): expected-closing-tag-but-got-eof -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <table> -| <caption> -| "test TEST" -| <tbody> -| <tr> -| <td> -| "test" - -#data -<!DOCTYPE html><select><option><optgroup> -#errors -(1,41): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <option> -| <optgroup> - -#data -<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option> -#errors -(1,68): unexpected-select-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <optgroup> -| <option> -| <option> -| <option> - -#data -<!DOCTYPE html><select><optgroup><option><optgroup> -#errors -(1,51): eof-in-select -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <optgroup> -| <option> -| <optgroup> - -#data -<!DOCTYPE html><datalist><option>foo</datalist>bar -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <datalist> -| <option> -| "foo" -| "bar" - -#data -<!DOCTYPE html><font><input><input></font> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <font> -| <input> -| <input> - -#data -<!DOCTYPE html><!-- XXX - XXX --> -#errors -#document -| <!DOCTYPE html> -| <!-- XXX - XXX --> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><!-- XXX - XXX -#errors -(1,29): eof-in-comment -#new-errors -(1:30) eof-in-comment -#document -| <!DOCTYPE html> -| <!-- XXX - XXX --> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><!-- XXX - XXX - XXX --> -#errors -#document -| <!DOCTYPE html> -| <!-- XXX - XXX - XXX --> -| <html> -| <head> -| <body> - -#data -test -test -#errors -(2,4): expected-doctype-but-got-chars -#document -| <html> -| <head> -| <body> -| "test -test" - -#data -<!DOCTYPE html><body><title>test</body> -#errors -#document -| -| -| -| -| -| "test</body>" - -#data -<!DOCTYPE html><body><title>X -#errors -#document -| -| -| -| -| -| "X" -| <meta> -| name="z" -| <link> -| rel="foo" -| <style> -| " -x { content:"</style" } " - -#data -<!DOCTYPE html><select><optgroup></optgroup></select> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> -| <select> -| <optgroup> - -#data - - -#errors -(2,1): expected-doctype-but-got-eof -#document -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html> <html> -#errors -#document -| <!DOCTYPE html> -| <html> -| <head> -| <body> - -#data -<!DOCTYPE html><script> -</script> <title>x -#errors -#document -| -| -| -| -#errors -(1,6): expected-doctype-but-got-start-tag -(1,21): unexpected-start-tag-out-of-my-head -#document -| -| -| -#errors -(1,6): expected-doctype-but-got-start-tag -(1,28): unexpected-start-tag-out-of-my-head -(1,52): unexpected-start-tag-out-of-my-head -#document -| -| -| -#errors -(1,6): expected-doctype-but-got-start-tag -#document -| -| -| -| -| "x" -| x -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| -| -| --> x -#errors -(1,7): expected-doctype-but-got-start-tag -(1,34): unexpected-end-tag -#document -| -| -| x -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| -| -| x -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| -| -| x -#errors -(1,7): expected-doctype-but-got-start-tag -#document -| -| -|

        -#errors -#document -| -| -| -| -| -| ddd -#errors -(1,6): expected-doctype-but-got-start-tag -(1,21): unexpected-start-tag-out-of-my-head -#document -| -| -| -#errors -(1,3): expected-doctype-but-got-start-tag -(1,41): adoption-agency-1.3 -#document -| -| -| -| -|
      • -| -| ", - "