+# 2: b
+# adl
+# 0: dl
+# bcl
+# 0: l
+
+/\sabc/
+ \x0babc
+ 0: \x0babc
+
+#/[\Qa]\E]+/
+# aa]]
+# 0: aa]]
+
+#/[\Q]a\E]+/
+# aa]]
+# 0: aa]]
+
+/A((((((((a))))))))\8B/
+ AaaB
+ 0: AaaB
+ 1: a
+ 2: a
+ 3: a
+ 4: a
+ 5: a
+ 6: a
+ 7: a
+ 8: a
+
+/A(((((((((a)))))))))\9B/
+ AaaB
+ 0: AaaB
+ 1: a
+ 2: a
+ 3: a
+ 4: a
+ 5: a
+ 6: a
+ 7: a
+ 8: a
+ 9: a
+
+/(|ab)*?d/
+ abd
+ 0: abd
+ 1: ab
+ xyd
+ 0: d
+
+/(\2|a)(\1)/
+ aaa
+ 0: aa
+ 1: a
+ 2: a
+
+/(\2)(\1)/
+
+"Z*(|d*){216}"
+
+/((((((((((((x))))))))))))\12/
+ xx
+ 0: xx
+ 1: x
+ 2: x
+ 3: x
+ 4: x
+ 5: x
+ 6: x
+ 7: x
+ 8: x
+ 9: x
+10: x
+11: x
+12: x
+
+#"(?|(\k'Pm')|(?'Pm'))"
+# abcd
+# 0:
+# 1:
+
+#/(?|(aaa)|(b))\g{1}/
+# aaaaaa
+# 0: aaaaaa
+# 1: aaa
+# bb
+# 0: bb
+# 1: b
+
+#/(?|(aaa)|(b))(?1)/
+# aaaaaa
+# 0: aaaaaa
+# 1: aaa
+# baaa
+# 0: baaa
+# 1: b
+#\= Expect no match
+# bb
+#No match
+
+#/(?|(aaa)|(b))/
+# xaaa
+# 0: aaa
+# 1: aaa
+# xbc
+# 0: b
+# 1: b
+
+#/(?|(?'a'aaa)|(?'a'b))\k'a'/
+# aaaaaa
+# 0: aaaaaa
+# 1: aaa
+# bb
+# 0: bb
+# 1: b
+
+#/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/dupnames
+# aaaccccaaa
+# 0: aaaccccaaa
+# 1: aaa
+# 2: cccc
+# bccccb
+# 0: bccccb
+# 1: b
+# 2: cccc
+
+# End of testinput1
diff --git a/vendor/github.com/google/goterm/AUTHORS b/vendor/github.com/google/goterm/AUTHORS
new file mode 100644
index 000000000..15167cd74
--- /dev/null
+++ b/vendor/github.com/google/goterm/AUTHORS
@@ -0,0 +1,3 @@
+# 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/vendor/github.com/google/goterm/LICENSE b/vendor/github.com/google/goterm/LICENSE
new file mode 100644
index 000000000..931520b99
--- /dev/null
+++ b/vendor/github.com/google/goterm/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2015 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/vendor/github.com/google/goterm/term/color.go b/vendor/github.com/google/goterm/term/color.go
new file mode 100644
index 000000000..4bba71607
--- /dev/null
+++ b/vendor/github.com/google/goterm/term/color.go
@@ -0,0 +1,677 @@
+// 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.
+
+package term
+
+/*
+Some simple functions to add colors and attributes to terminals.
+
+The base colors are types implementing the Stringer interface, this makes
+it very simple to give a color to arbitrary strings. Also handy to have the raw string still
+available for comparisons and such.
+
+ g := Green("Green world")
+ fmt.Println("Hello",g)
+ fmt.Println(Red("Warning!"))
+
+ var col fmt.Stringer
+ switch {
+ case atk == 0:
+ col = Blue("5 FADE OUT")
+ case atk < 4:
+ col = Green("4 DOUBLE TAKE")
+ case atk <10:
+ col = Yellow("3 ROUND HOUSE")
+ case atk <50:
+ col = Red("2 FAST PACE")
+ case atk >= 50:
+ col = Blinking("1 COCKED PISTOL")
+ }
+ fmt.Println("Defcon: ",col)
+*/
+
+import (
+ "errors"
+ "fmt"
+ "math/rand"
+ "strconv"
+)
+
+type stringer interface {
+ String() string
+}
+
+// colorEnable toggles colors on/off.
+var colorEnable = true
+
+// ColorEnable activates the terminal colors , this is the default.
+func ColorEnable() {
+ colorEnable = true
+}
+
+// ColorDisable disables the terminal colors.
+func ColorDisable() {
+ colorEnable = false
+}
+
+// Terminal Color and modifier codes
+const (
+ CSI = "\033["
+ FgBlack = "30"
+ FgRed = "31"
+ FgGreen = "32"
+ FgYellow = "33"
+ FgBlue = "34"
+ FgMagenta = "35"
+ FgCyan = "36"
+ FgWhite = "37"
+ FgDefault = "39"
+ F256 = "38"
+ BgBlack = "40"
+ BgRed = "41"
+ BgGreen = "42"
+ BgYellow = "43"
+ BgBlue = "44"
+ BgMagenta = "45"
+ BgCyan = "46"
+ BgWhite = "47"
+ BgDefault = "49"
+ Bg256 = "48"
+ Blink = "5"
+ Ital = "3"
+ Underln = "4"
+ Faint = "2"
+ Bld = "1"
+ NoMode = "0"
+)
+
+// Standard colors
+// Foreground
+
+// Green implements the Stringer interface to print string foreground in Green color.
+type Green string
+
+// Blue implements the Stringer interface to print string foreground in Blue color.
+type Blue string
+
+// Red implements the Stringer interface to print string foreground in Red color.
+type Red string
+
+// Yellow implements the Stringer interface to print string foreground in Yellow color.
+type Yellow string
+
+// Magenta implements the Stringer interface to print string foreground in Magenta color.
+type Magenta string
+
+// Cyan implements the Stringer interface to print string foreground in Cyan color.
+type Cyan string
+
+// White implements the Stringer interface to print string foreground in White color.
+type White string
+
+// Black implements the Stringer interface to print string foreground in Black color.
+type Black string
+
+// Random implements the Stringer interface to print string foreground in Random color.
+type Random string
+
+// Background
+
+// BGreen implements the Stringer interface to print string background in Green color.
+type BGreen string
+
+// BBlue implements the Stringer interface to print string background in Blue color.
+type BBlue string
+
+// BRed implements the Stringer interface to print string background in Red color.
+type BRed string
+
+// BYellow implements the Stringer interface to print string background in Yellow color.
+type BYellow string
+
+// BRandom implements the Stringer interface to print string background in Random color.
+type BRandom string
+
+// BMagenta implements the Stringer interface to print string background in Magenta color.
+type BMagenta string
+
+// BCyan implements the Stringer interface to print string background in Cyan color.
+type BCyan string
+
+// BWhite implements the Stringer interface to print string background in White color.
+type BWhite string
+
+// BBlack implements the Stringer interface to print string background in Black color.
+type BBlack string
+
+// Set color
+
+// Color is the type returned by the colour setters to print any terminal colour.
+type Color string
+
+// ColorRandom implements the Stringer interface to print string Random color.
+type ColorRandom string
+
+// Color256Random implements the Stringer interface to print string random 256 color Term style.
+type Color256Random string
+
+// Some modifiers
+
+// Blinking implements the Stringer interface to print string in Blinking mode.
+type Blinking string
+
+// Underline implements the Stringer interface to print string in Underline mode.
+type Underline string
+
+// Bold implements the Stringer interface to print string in Bold mode.
+type Bold string
+
+//type Bright string -- Doesn't seem to work well
+
+// Italic implements the Stringer interface to print string foreground in Italic color.
+type Italic string
+
+// colType takes all the base color types and generates proper modifiers.
+func colType(col stringer) string {
+ nMode := FgDefault
+ var mode, res string
+ switch c := col.(type) {
+ case Black:
+ mode = FgBlack
+ res = string(c)
+ case Red:
+ mode = FgRed
+ res = string(c)
+ case Green:
+ mode = FgGreen
+ res = string(c)
+ case Yellow:
+ mode = FgYellow
+ res = string(c)
+ case Blue:
+ mode = FgBlue
+ res = string(c)
+ case Magenta:
+ mode = FgMagenta
+ res = string(c)
+ case Cyan:
+ mode = FgCyan
+ res = string(c)
+ case White:
+ mode = FgWhite
+ res = string(c)
+ case BBlack:
+ mode = BgBlack
+ res = string(c)
+ case BRed:
+ mode = BgRed
+ nMode = BgDefault
+ res = string(c)
+ case BGreen:
+ mode = BgGreen
+ nMode = BgDefault
+ res = string(c)
+ case BYellow:
+ mode = BgYellow
+ nMode = BgDefault
+ res = string(c)
+ case BBlue:
+ mode = BgBlue
+ nMode = BgDefault
+ res = string(c)
+ case BMagenta:
+ mode = BgMagenta
+ nMode = BgDefault
+ res = string(c)
+ case BCyan:
+ mode = BgCyan
+ nMode = BgDefault
+ res = string(c)
+ case BWhite:
+ mode = BgWhite
+ nMode = BgDefault
+ res = string(c)
+ case Blinking:
+ mode = Blink
+ nMode = NoMode
+ res = string(c)
+ case Italic:
+ mode = Ital
+ nMode = NoMode
+ res = string(c)
+ case Underline:
+ mode = Underln
+ nMode = NoMode
+ res = string(c)
+ case Bold:
+ nMode = NoMode
+ mode = Bld
+ res = string(c)
+ default:
+ return "unsupported type"
+ }
+ if !colorEnable {
+ return res
+ }
+ return CSI + mode + "m" + res + CSI + nMode + "m"
+}
+
+// Stringers for all the base colors , just fill it in with something and print it
+// Foreground
+
+// String implements the Stringer interface for type Green.
+func (c Green) String() string {
+ return colType(c)
+}
+
+// Greenf returns a Green formatted string.
+func Greenf(format string, a ...interface{}) string {
+ return colType(Green(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type Blue.
+func (c Blue) String() string {
+ return colType(c)
+}
+
+// Bluef returns a Blue formatted string.
+func Bluef(format string, a ...interface{}) string {
+ return colType(Blue(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type Red.
+func (c Red) String() string {
+ return colType(c)
+}
+
+// Redf returns a Red formatted string.
+func Redf(format string, a ...interface{}) string {
+ return colType(Red(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type Yellow.
+func (c Yellow) String() string {
+ return colType(c)
+}
+
+// Yellowf returns a Yellow formatted string.
+func Yellowf(format string, a ...interface{}) string {
+ return colType(Yellow(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type Magenta.
+func (c Magenta) String() string {
+ return colType(c)
+}
+
+// Magentaf returns a Magenta formatted string.
+func Magentaf(format string, a ...interface{}) string {
+ return colType(Magenta(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type White.
+func (c White) String() string {
+ return colType(c)
+}
+
+// Whitef returns a White formatted string.
+func Whitef(format string, a ...interface{}) string {
+ return colType(White(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type Black.
+func (c Black) String() string {
+ return colType(c)
+}
+
+// Blackf returns a Black formatted string.
+func Blackf(format string, a ...interface{}) string {
+ return colType(Black(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type Cyan.
+func (c Cyan) String() string {
+ return colType(c)
+}
+
+// Cyanf returns a Cyan formatted string.
+func Cyanf(format string, a ...interface{}) string {
+ return colType(Cyan(fmt.Sprintf(format, a...)))
+}
+
+// Background
+
+// String implements the Stringer interface for type BGreen.
+func (c BGreen) String() string {
+ return colType(c)
+}
+
+// BGreenf returns a BGreen formatted string.
+func BGreenf(format string, a ...interface{}) string {
+ return colType(BGreen(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BBlue.
+func (c BBlue) String() string {
+ return colType(c)
+}
+
+// BBluef returns a BBlue formatted string.
+func BBluef(format string, a ...interface{}) string {
+ return colType(BBlue(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BRed.
+func (c BRed) String() string {
+ return colType(c)
+}
+
+// BRedf returns a BRed formatted string.
+func BRedf(format string, a ...interface{}) string {
+ return colType(BRed(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BYellow.
+func (c BYellow) String() string {
+ return colType(c)
+}
+
+// BYellowf returns a BYellow formatted string.
+func BYellowf(format string, a ...interface{}) string {
+ return colType(BYellow(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BMagenta.
+func (c BMagenta) String() string {
+ return colType(c)
+}
+
+// BMagentaf returns a BMagenta formatted string.
+func BMagentaf(format string, a ...interface{}) string {
+ return colType(BMagenta(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BWhite.
+func (c BWhite) String() string {
+ return colType(c)
+}
+
+// BWhitef returns a BWhite formatted string.
+func BWhitef(format string, a ...interface{}) string {
+ return colType(BWhite(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BBlack.
+func (c BBlack) String() string {
+ return colType(c)
+}
+
+// BBlackf returns a BBlack formatted string.
+func BBlackf(format string, a ...interface{}) string {
+ return colType(BBlack(fmt.Sprintf(format, a...)))
+}
+
+// String implements the Stringer interface for type BCyan.
+func (c BCyan) String() string {
+ return colType(c)
+}
+
+// BCyanf returns a BCyan formatted string.
+func BCyanf(format string, a ...interface{}) string {
+ return colType(BCyan(fmt.Sprintf(format, a...)))
+}
+
+// Modifier codes
+
+// String implements the Stringer interface for type Blinking.
+func (c Blinking) String() string {
+ return colType(c)
+}
+
+// String implements the Stringer interface for type Underline.
+func (c Underline) String() string {
+ return colType(c)
+}
+
+// String implements the Stringer interface for type Bold.
+func (c Bold) String() string {
+ return colType(c)
+}
+
+// String implements the Stringer interface for type Italic.
+func (c Italic) String() string {
+ return colType(c)
+}
+
+// NewColor gives a type Color back with specified fg/bg colors set that can
+// be printed with anything using the Stringer iface.
+func NewColor(str string, fg string, bg string) (Color, error) {
+ if fg != "" {
+ ifg, err := strconv.Atoi(fg)
+ if err != nil {
+ return Color(""), err
+ }
+ if ifg < 30 && ifg > 37 {
+ return Color(""), errors.New("fg: " + fg + "not a valid color 30-37")
+ }
+ } else {
+ fg = FgDefault
+ }
+ if bg != "" {
+ ibg, err := strconv.Atoi(bg)
+ if err != nil {
+ return Color(""), err
+ }
+ if ibg < 40 && ibg > 47 {
+ return Color(""), errors.New("fg: " + fg + "not a valid color 40-47")
+ }
+ } else {
+ bg = BgDefault
+ }
+ return Color(CSI + fg + ";" + bg + "m" + str + CSI + FgDefault + ";" + BgDefault + "m"), nil
+}
+
+// String the stringer interface for all base color types.
+func (c Color) String() string {
+ if !colorEnable {
+ clean := make([]byte, 0, len(c))
+ src := []byte(c)
+ L1:
+ for i := 0; i < len(src); i++ {
+ // Shortest possible mod.
+ if len(src) < i+4 {
+ clean = append(clean, src[i:]...)
+ return string(clean)
+ }
+ if string(src[i:i+2]) == CSI {
+ // Save current index incase this is not a term mod code.
+ s := i
+ // skip forward to end of mod
+ for i += 2; i < len(src); i++ {
+ switch src[i] {
+ case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ';':
+ // Legal characters in a term mod code.
+ continue
+ case 'm':
+ // End of the term mod code.
+ continue L1
+ default:
+ // Not a term mod code.
+ i = s
+ break
+ }
+ }
+ }
+ clean = append(clean, src[i])
+ }
+ return string(clean)
+ }
+ return string(c)
+}
+
+// NewColor256 gives a type Color back using Term 256 color that can be printed with anything using the Stringer iface.
+func NewColor256(str string, fg string, bg string) (Color, error) {
+ if fg != "" {
+ ifg, err := strconv.Atoi(fg)
+ if err != nil {
+ return Color(""), err
+ }
+ if ifg < 0 && ifg > 256 {
+ return Color(""), errors.New("fg: " + fg + " not a valid color 0-256")
+ }
+ }
+ if bg != "" {
+ ibg, err := strconv.Atoi(bg)
+ if err != nil {
+ return Color(""), err
+ }
+ if ibg < 0 && ibg > 256 {
+ return Color(""), errors.New("bg: " + bg + " not a valid color 0-256")
+ }
+ }
+ tstr := CSI + F256 + ";5;" + fg + ";" + Bg256 + ";5;" + bg + "m"
+ tstr += str
+ return Color(tstr + CSI + FgDefault + ";5;" + BgDefault + ";5;" + "m"), nil
+}
+
+// NewColorRGB takes R G B and returns a ColorRGB type that can be printed by anything using the Stringer iface.
+// Only Konsole to my knowledge that supports 24bit color
+func NewColorRGB(str string, red uint8, green uint8, blue uint8) Color {
+ ired := strconv.Itoa(int(red))
+ igreen := strconv.Itoa(int(green))
+ iblue := strconv.Itoa(int(blue))
+ tstr := CSI + F256 + ";2;" + ired + ";" + igreen + ";" + iblue + "m"
+ tstr += str
+ return Color(tstr + CSI + FgDefault + ";5;" + BgDefault + ";5;" + "m")
+}
+
+// String is a random color stringer.
+func (c ColorRandom) String() string {
+ if !colorEnable {
+ return string(c)
+ }
+ ifg := rand.Int()%8 + 30
+ ibg := rand.Int()%8 + 40
+ res := CSI + strconv.Itoa(ifg) + ";" + strconv.Itoa(ibg) + "m"
+ res += string(c)
+ res += CSI + strconv.Itoa(ifg) + ";" + strconv.Itoa(ibg) + "m"
+ return res
+}
+
+// String gives a random fg color everytime it's printed.
+func (c Random) String() string {
+ if !colorEnable {
+ return string(c)
+ }
+ ifg := int(rand.Int()%8 + 30)
+ res := CSI + strconv.Itoa(ifg) + "m"
+ res += string(c) + strconv.Itoa(int(ifg))
+ res += CSI + FgDefault + "m"
+ return res
+}
+
+// String gives a random bg color everytime it's printed.
+func (c BRandom) String() string {
+ if !colorEnable {
+ return string(c)
+ }
+ ibg := rand.Int()%8 + 40
+ res := CSI + strconv.Itoa(ibg) + "m"
+ res += string(c) + strconv.Itoa(ibg)
+ res += CSI + BgDefault + "m"
+ return res
+}
+
+// NewCombo Takes a combination of modes and return a string with them all combined.
+func NewCombo(s string, mods ...string) Color {
+ var col, bcol, mod bool
+ modstr := CSI
+ tracking := make(map[string]bool)
+ for _, m := range mods {
+ switch m {
+ case FgBlack, FgRed, FgGreen, FgYellow, FgBlue, FgMagenta, FgCyan, FgWhite:
+ if col {
+ continue
+ }
+ col = true
+ case BgBlack, BgRed, BgGreen, BgYellow, BgBlue, BgMagenta, BgCyan, BgWhite:
+ if bcol {
+ continue
+ }
+ bcol = true
+ case Bld, Faint, Ital, Underln, Blink:
+ if tracking[m] {
+ continue
+ }
+ tracking[m] = true
+ mod = true
+ default:
+ continue
+ }
+ modstr += m + ";"
+ }
+ end := CSI
+ if col {
+ end += FgDefault
+ }
+ if bcol {
+ if col {
+ end += ";"
+ }
+ end += BgDefault
+ }
+ if mod {
+ if col || bcol {
+ end += ";"
+ }
+ end += NoMode
+ }
+ end += "m"
+ modstr = modstr[:len(modstr)-1] + "m"
+ modstr += s
+ modstr += end
+ return Color(modstr)
+}
+
+// TestTerm tries out most of the functions in this package and return
+// a colourful string. Could be used to check what your terminal supports.
+func TestTerm() string {
+ res := "Standard 8:\n"
+ res += "Fg:\t"
+ for c := 30; c < 38; c++ {
+ tres, _ := NewColor("#", strconv.Itoa(c), "")
+ res += tres.String()
+ }
+ res += "\nBg:\t"
+ for c := 40; c < 48; c++ {
+ tres, _ := NewColor(" ", "", strconv.Itoa(c))
+ res += tres.String()
+ }
+ res += "\nStandard 16:\t"
+ for c := 0; c < 16; c++ {
+ tcol, _ := NewColor256(" ", "", strconv.Itoa(c))
+ res += tcol.String()
+ }
+ res += "\n"
+ res += "256 Col:\n"
+ // 6x6x6 cubes are trendy
+ for row, base := 1, 0; row <= 6; row++ {
+ base = (row * 6) + 9 // Step over the first 16 base colors
+ for cubes := 1; cubes <= 6; cubes++ {
+ for column := 1; column <= 6; column++ {
+ tcol, _ := NewColor256(" ", "", strconv.Itoa(base+column))
+ res += tcol.String()
+ }
+ base += 36 // 6 * 6
+ }
+ res += "\n"
+ }
+ // Grayscale left.
+ res += "Grayscales:\n"
+ for c := 232; c <= 255; c++ {
+ tcol, _ := NewColor256(" ", "", strconv.Itoa(c))
+ res += tcol.String()
+ }
+ return res
+}
diff --git a/vendor/github.com/google/goterm/term/ssh.go b/vendor/github.com/google/goterm/term/ssh.go
new file mode 100644
index 000000000..2e7619cec
--- /dev/null
+++ b/vendor/github.com/google/goterm/term/ssh.go
@@ -0,0 +1,203 @@
+// 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.
+
+
+package term
+
+const (
+ // Terminal attribute types.
+ sshIflag = iota
+ sshOflag
+ sshCflag
+ sshLflag
+ sshCchar
+ sshTspeed
+ sshNOP
+
+ // SSH terminal attributes.
+ sshTTYOPEND = 0
+ sshVINTR = 1
+ sshVQUIT = 2
+ sshVERASE = 3
+ sshVKILL = 4
+ sshVEOF = 5
+ sshVEOL = 6
+ sshVEOL2 = 7
+ sshVSTART = 8
+ sshVSTOP = 9
+ sshVSUSP = 10
+ sshVDSUSP = 11
+ sshVREPRINT = 12
+ sshVWERASE = 13
+ sshVLNEXT = 14
+ sshVFLUSH = 15
+ sshVSWTCH = 16
+ sshVSTATUS = 17
+ sshVDISCARD = 18
+ sshIGNPAR = 30
+ sshPARMRK = 31
+ sshINPCK = 32
+ sshISTRIP = 33
+ sshINLCR = 34
+ sshIGNCR = 35
+ sshICRNL = 36
+ sshIUCLC = 37
+ sshIXON = 38
+ sshIXANY = 39
+ sshIXOFF = 40
+ sshIMAXBEL = 41
+ sshISIG = 50
+ sshICANON = 51
+ sshXCASE = 52
+ sshECHO = 53
+ sshECHOE = 54
+ sshECHOK = 55
+ sshECHONL = 56
+ sshNOFLSH = 57
+ sshTOSTOP = 58
+ sshIEXTEN = 59
+ sshECHOCTL = 60
+ sshECHOKE = 61
+ sshPENDIN = 62
+ sshOPOST = 70
+ sshOLCUC = 71
+ sshONLCR = 72
+ sshOCRNL = 73
+ sshONOCR = 74
+ sshONLRET = 75
+ sshCS7 = 90
+ sshCS8 = 91
+ sshPARENB = 92
+ sshPARODD = 93
+ sshTTYOPISPEED = 128
+ sshTTYOPOSPEED = 129
+)
+
+var convertSSH = map[uint8]struct {
+ tType uint
+ native uint32
+}{
+ sshTTYOPEND: {tType: sshNOP},
+ sshVINTR: {tType: sshCchar, native: VINTR},
+ sshVQUIT: {tType: sshCchar, native: VQUIT},
+ sshVERASE: {tType: sshCchar, native: VERASE},
+ sshVKILL: {tType: sshCchar, native: VKILL},
+ sshVEOF: {tType: sshCchar, native: VEOF},
+ sshVEOL: {tType: sshCchar, native: VEOL},
+ sshVEOL2: {tType: sshCchar, native: VEOL2},
+ sshVSTART: {tType: sshCchar, native: VSTART},
+ sshVSTOP: {tType: sshCchar, native: VSTOP},
+ sshVSUSP: {tType: sshCchar, native: VSUSP},
+ sshVDSUSP: {tType: sshCchar, native: sshNOP},
+ sshVREPRINT: {tType: sshCchar, native: VREPRINT},
+ sshVWERASE: {tType: sshCchar, native: VWERASE},
+ sshVLNEXT: {tType: sshCchar, native: VLNEXT},
+ sshVFLUSH: {tType: sshNOP},
+ sshVSWTCH: {tType: sshCchar, native: VSWTC},
+ sshVSTATUS: {tType: sshNOP},
+ sshVDISCARD: {tType: sshCchar, native: VDISCARD},
+ sshIGNPAR: {tType: sshIflag, native: IGNPAR},
+ sshPARMRK: {tType: sshIflag, native: PARMRK},
+ sshINPCK: {tType: sshIflag, native: INPCK},
+ sshISTRIP: {tType: sshIflag, native: ISTRIP},
+ sshINLCR: {tType: sshIflag, native: INLCR},
+ sshIGNCR: {tType: sshIflag, native: IGNCR},
+ sshICRNL: {tType: sshIflag, native: ICRNL},
+ sshIUCLC: {tType: sshIflag, native: IUCLC},
+ sshIXON: {tType: sshIflag, native: IXON},
+ sshIXANY: {tType: sshIflag, native: IXANY},
+ sshIXOFF: {tType: sshIflag, native: IXOFF},
+ sshIMAXBEL: {tType: sshIflag, native: IMAXBEL},
+ sshISIG: {tType: sshLflag, native: ISIG},
+ sshICANON: {tType: sshLflag, native: ICANON},
+ sshXCASE: {tType: sshLflag, native: XCASE},
+ sshECHO: {tType: sshLflag, native: ECHO},
+ sshECHOE: {tType: sshLflag, native: ECHOE},
+ sshECHOK: {tType: sshLflag, native: ECHOK},
+ sshECHONL: {tType: sshLflag, native: ECHONL},
+ sshNOFLSH: {tType: sshLflag, native: NOFLSH},
+ sshTOSTOP: {tType: sshLflag, native: TOSTOP},
+ sshIEXTEN: {tType: sshLflag, native: IEXTEN},
+ sshECHOCTL: {tType: sshLflag, native: ECHOCTL},
+ sshECHOKE: {tType: sshLflag, native: ECHOKE},
+ sshPENDIN: {tType: sshNOP},
+ sshOPOST: {tType: sshOflag, native: OPOST},
+ sshOLCUC: {tType: sshOflag, native: OLCUC},
+ sshONLCR: {tType: sshOflag, native: ONLCR},
+ sshOCRNL: {tType: sshOflag, native: OCRNL},
+ sshONOCR: {tType: sshOflag, native: ONOCR},
+ sshONLRET: {tType: sshOflag, native: ONLRET},
+ sshCS7: {tType: sshCflag, native: CS7},
+ sshCS8: {tType: sshCflag, native: CS8},
+ sshPARENB: {tType: sshCflag, native: PARENB},
+ sshPARODD: {tType: sshCflag, native: PARODD},
+ sshTTYOPISPEED: {tType: sshTspeed},
+ sshTTYOPOSPEED: {tType: sshTspeed},
+}
+
+// ToSSH converts the Termios attributes to SSH attributes usable as ssh.TerminalModes.
+func (t *Termios) ToSSH() map[uint8]uint32 {
+ sshModes := make(map[uint8]uint32, len(convertSSH))
+ var flags uint32
+ for sshID, tios := range convertSSH {
+ switch tios.tType {
+ case sshIflag:
+ flags = t.Iflag
+ case sshOflag:
+ flags = t.Oflag
+ case sshLflag:
+ flags = t.Lflag
+ case sshCflag:
+ flags = t.Cflag
+ case sshCchar:
+ sshModes[sshID] = uint32(t.Cc[tios.native])
+ continue
+ case sshTspeed:
+ sshModes[sshTTYOPISPEED], sshModes[sshTTYOPOSPEED] = t.Ispeed, t.Ospeed
+ continue
+ default:
+ continue
+ }
+ var onOff uint32
+ if tios.native&flags > 0 {
+ onOff = 1
+ }
+ sshModes[sshID] = onOff
+ }
+ return sshModes
+}
+
+// FromSSH converts SSH attributes to Termios attributes.
+func (t *Termios) FromSSH(termModes map[uint8]uint32) {
+ var flags *uint32
+ for sshID, val := range termModes {
+ switch convertSSH[sshID].tType {
+ case sshIflag:
+ flags = &t.Iflag
+ case sshOflag:
+ flags = &t.Oflag
+ case sshLflag:
+ flags = &t.Lflag
+ case sshCflag:
+ flags = &t.Cflag
+ case sshCchar:
+ t.Cc[convertSSH[sshID].native] = byte(val)
+ continue
+ case sshTspeed:
+ if sshID == sshTTYOPISPEED {
+ t.Ispeed = val
+ } else {
+ t.Ospeed = val
+ }
+ continue
+ default:
+ continue
+ }
+ if val > 0 {
+ *flags |= convertSSH[sshID].native
+ } else {
+ *flags &^= convertSSH[sshID].native
+ }
+ }
+}
diff --git a/vendor/github.com/google/goterm/term/termios.go b/vendor/github.com/google/goterm/term/termios.go
new file mode 100644
index 000000000..e1aee994f
--- /dev/null
+++ b/vendor/github.com/google/goterm/term/termios.go
@@ -0,0 +1,392 @@
+// 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.
+
+
+/*
+Package term implements a subset of the C termios library to interface with Terminals.
+
+This package allows the caller to get and set most Terminal capabilites
+and sizes as well as create PTYs to enable writing things like script,
+screen, tmux, and expect.
+
+The Termios type is used for setting/getting Terminal capabilities while
+the PTY type is used for handling virtual terminals.
+
+Currently this part of this lib is Linux specific.
+
+Also implements a simple version of readline in pure Go and some Stringers
+for terminal colors and attributes.
+*/
+package term
+
+import (
+ "errors"
+ "os"
+ "strconv"
+ "strings"
+ "syscall"
+ "unsafe"
+)
+
+// IOCTL terminal stuff.
+const (
+ TCGETS = 0x5401 // TCGETS get terminal attributes
+ TCSETS = 0x5402 // TCSETS set terminal attributes
+ TIOCGWINSZ = 0x5413 // TIOCGWINSZ used to get the terminal window size
+ TIOCSWINSZ = 0x5414 // TIOCSWINSZ used to set the terminal window size
+ TIOCGPTN = 0x80045430 // TIOCGPTN IOCTL used to get the PTY number
+ TIOCSPTLCK = 0x40045431 // TIOCSPTLCK IOCT used to lock/unlock PTY
+ CBAUD = 0010017 // CBAUD Serial speed settings
+ CBAUDEX = 0010000 // CBAUDX Serial speed settings
+)
+
+// INPUT handling terminal flags
+// see 'man stty' for further info about most of the constants
+const (
+ IGNBRK = 0000001 // IGNBRK ignore break characters
+ BRKINT = 0000002 // BRKINT Break genereates an interrupt signal
+ IGNPAR = 0000004 // IGNPAR Ignore characters with parity errors
+ PARMRK = 0000010 // PARMRK Mark parity errors byte{ff,0}
+ INPCK = 0000020 // INPCK enable parity checking
+ ISTRIP = 0000040 // ISTRIP Clear 8th bit of input characters
+ INLCR = 0000100 // INLCR Translate LF => CR
+ IGNCR = 0000200 // IGNCR Ignore Carriage Return
+ ICRNL = 0000400 // ICRNL Translate CR => NL
+ IUCLC = 0001000 // IUCLC Translate uppercase to lowercase
+ IXON = 0002000 // IXON Enable flow control
+ IXANY = 0004000 // IXANY let any char restart input
+ IXOFF = 0010000 // IXOFF start sending start/stop chars
+ IMAXBEL = 0020000 // IMAXBEL Sound the bell and skip flushing input buffer
+ IUTF8 = 0040000 // IUTF8 assume input being utf-8
+)
+
+// OUTPUT treatment terminal flags
+const (
+ OPOST = 0000001 // OPOST post process output
+ OLCUC = 0000002 // OLCUC translate lower case to upper case
+ ONLCR = 0000004 // ONLCR Map NL -> CR-NL
+ OCRNL = 0000010 // OCRNL Map CR -> NL
+ ONOCR = 0000020 // ONOCR No CR at col 0
+ ONLRET = 0000040 // ONLRET NL also do CR
+ OFILL = 0000100 // OFILL Fillchar for delay
+ OFDEL = 0000200 // OFDEL use delete instead of null
+)
+
+// TERM control modes.
+const (
+ CSIZE = 0000060 // CSIZE used as mask when setting character size
+ CS5 = 0000000 // CS5 char size 5bits
+ CS6 = 0000020 // CS6 char size 6bits
+ CS7 = 0000040 // CS7 char size 7bits
+ CS8 = 0000060 // CS8 char size 8bits
+ CSTOPB = 0000100 // CSTOPB two stop bits
+ CREAD = 0000200 // CREAD enable input
+ PARENB = 0000400 // PARENB generate and expect parity bit
+ PARODD = 0001000 // PARODD set odd parity
+ HUPCL = 0002000 // HUPCL send HUP when last process closes term
+ CLOCAL = 0004000 // CLOCAL no modem control signals
+)
+
+// TERM modes
+const (
+ ISIG = 0000001 // ISIG enable Interrupt,quit and suspend chars
+ ICANON = 0000002 // ICANON enable erase,kill ,werase and rprnt chars
+ XCASE = 0000004 // XCASE preceedes all uppercase chars with '\'
+ ECHO = 0000010 // ECHO echo input characters
+ ECHOE = 0000020 // ECHOE erase => BS - SPACE - BS
+ ECHOK = 0000040 // ECHOK add newline after kill char
+ ECHONL = 0000100 // ECHONL echo NL even without other characters
+ NOFLSH = 0000200 // NOFLSH no flush after interrupt and kill characters
+ TOSTOP = 0000400 // TOSTOP stop BG jobs trying to write to term
+ ECHOCTL = 0001000 // ECHOCTL will echo control characters as ^c
+ ECHOPRT = 0002000 // ECHOPRT will print erased characters between \ /
+ ECHOKE = 0004000 // ECHOKE kill all line considering ECHOPRT and ECHOE flags
+ IEXTEN = 0100000 // IEXTEN enable non POSIX special characters
+)
+
+// Control characters
+const (
+ VINTR = 0 // VINTR char will send an interrupt signal
+ VQUIT = 1 // VQUIT char will send a quit signal
+ VERASE = 2 // VEREASE char will erase last typed char
+ VKILL = 3 // VKILL char will erase current line
+ VEOF = 4 // VEOF char will send EOF
+ VTIME = 5 // VTIME set read timeout in tenths of seconds
+ VMIN = 6 // VMIN set min characters for a complete read
+ VSWTC = 7 // VSWTC char will switch to a different shell layer
+ VSTART = 8 // VSTART char will restart output after stopping it
+ VSTOP = 9 // VSTOP char will stop output
+ VSUSP = 10 // VSUSP char will send a stop signal
+ VEOL = 11 // VEOL char will end the line
+ VREPRINT = 12 // VREPRINT will redraw the current line
+ VDISCARD = 13 // VDISCARD
+ VWERASE = 14 // VWERASE char will erase last word typed
+ VLNEXT = 15 // VLNEXT char will enter the next char quoted
+ VEOL2 = 16 // VEOL2 char alternate to end line
+ tNCCS = 32 // tNCCS Termios CC size
+)
+
+// Termios merge of the C Terminal and Kernel termios structs.
+type Termios struct {
+ Iflag uint32 // Iflag Handles the different Input modes
+ Oflag uint32 // Oflag For the different Output modes
+ Cflag uint32 // Cflag Control modes
+ Lflag uint32 // Lflag Local modes
+ Line byte // Line
+ Cc [tNCCS]byte // Cc Control characters. How to handle special Characters eg. Backspace being ^H or ^? and so on
+ Ispeed uint32 // Ispeed Hardly ever used speed of terminal
+ Ospeed uint32 // Ospeed "
+ Wz Winsize // Wz Terminal size information.
+}
+
+// Winsize handle the terminal window size.
+type Winsize struct {
+ WsRow uint16 // WsRow Terminal number of rows
+ WsCol uint16 // WsCol Terminal number of columns
+ WsXpixel uint16 // WsXpixel Terminal width in pixels
+ WsYpixel uint16 // WsYpixel Terminal height in pixels
+}
+
+// PTY the PTY Master/Slave are always bundled together so makes sense to bundle here too.
+//
+// Slave - implements the virtual terminal functionality and the place you connect client applications
+// Master - Things written to the Master are forwarded to the Slave terminal and the other way around.
+// This gives reading from Master would give you nice line-by-line with no strange characters in
+// Cooked() Mode and every char in Raw() mode.
+//
+// Since Slave is a virtual terminal it depends on the terminal settings ( in this lib the Termios ) what
+// and when data is forwarded through the terminal.
+//
+// See 'man pty' for further info
+type PTY struct {
+ Master *os.File // Master The Master part of the PTY
+ Slave *os.File // Slave The Slave part of the PTY
+}
+
+// Raw Sets terminal t to raw mode.
+// This gives that the terminal will do the absolut minimal of processing, pretty much send everything through.
+// This is normally what Shells and such want since they have their own readline and movement code.
+func (t *Termios) Raw() {
+ t.Iflag &^= IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON
+ // t.Iflag &^= BRKINT | ISTRIP | ICRNL | IXON // Stevens RAW
+ t.Oflag &^= OPOST
+ t.Lflag &^= ECHO | ECHONL | ICANON | ISIG | IEXTEN
+ t.Cflag &^= CSIZE | PARENB
+ t.Cflag |= CS8
+ t.Cc[VMIN] = 1
+ t.Cc[VTIME] = 0
+}
+
+// Cook Set the Terminal to Cooked mode.
+// In this mode the Terminal process the information before sending it on to the application.
+func (t *Termios) Cook() {
+ t.Iflag |= BRKINT | IGNPAR | ISTRIP | ICRNL | IXON
+ t.Oflag |= OPOST
+ t.Lflag |= ISIG | ICANON
+}
+
+// Sane reset Term to sane values.
+// Should be pretty much what the shell command "reset" does to the terminal.
+func (t *Termios) Sane() {
+ t.Iflag &^= IGNBRK | INLCR | IGNCR | IUTF8 | IXOFF | IUCLC | IXANY
+ t.Iflag |= BRKINT | ICRNL | IMAXBEL
+ t.Oflag |= OPOST | ONLCR
+ t.Oflag &^= OLCUC | OCRNL | ONOCR | ONLRET
+ t.Cflag |= CREAD
+}
+
+// Set Sets terminal t attributes on file.
+func (t *Termios) Set(file *os.File) error {
+ fd := file.Fd()
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(TCSETS), uintptr(unsafe.Pointer(t)))
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
+
+// Attr Gets (terminal related) attributes from file.
+func Attr(file *os.File) (Termios, error) {
+ var t Termios
+ fd := file.Fd()
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(TCGETS), uintptr(unsafe.Pointer(&t)))
+ if errno != 0 {
+ return t, errno
+ }
+ t.Ispeed &= CBAUD | CBAUDEX
+ t.Ospeed &= CBAUD | CBAUDEX
+ return t, nil
+}
+
+// Isatty returns true if file is a tty.
+func Isatty(file *os.File) bool {
+ _, err := Attr(file)
+ return err == nil
+}
+
+// GetPass reads password from a TTY with no echo.
+func GetPass(prompt string, f *os.File, pbuf []byte) ([]byte, error) {
+ t, err := Attr(f)
+ if err != nil {
+ return nil, err
+ }
+ defer t.Set(f)
+ noecho := t
+ noecho.Lflag = noecho.Lflag &^ ECHO
+ if err := noecho.Set(f); err != nil {
+ return nil, err
+ }
+ b := make([]byte, 1, 1)
+ i := 0
+ if _, err := f.Write([]byte(prompt)); err != nil {
+ return nil, err
+ }
+ for ; i < len(pbuf); i++ {
+ if _, err := f.Read(b); err != nil {
+ b[0] = 0
+ clearbuf(pbuf[:i+1])
+ }
+ if b[0] == '\n' || b[0] == '\r' {
+ return pbuf[:i], nil
+ }
+ pbuf[i] = b[0]
+ b[0] = 0
+ }
+ clearbuf(pbuf[:i+1])
+ return nil, errors.New("ran out of bufferspace")
+}
+
+// clearbuf clears out the buffer incase we couldn't read the full password.
+func clearbuf(b []byte) {
+ for i := range b {
+ b[i] = 0
+ }
+}
+
+// GetChar reads a single byte.
+func GetChar(f *os.File) (b byte, err error) {
+ bs := make([]byte, 1, 1)
+ if _, err = f.Read(bs); err != nil {
+ return 0, err
+ }
+ return bs[0], err
+}
+
+// PTSName return the name of the pty.
+func (p *PTY) PTSName() (string, error) {
+ n, err := p.PTSNumber()
+ if err != nil {
+ return "", err
+ }
+ return "/dev/pts/" + strconv.Itoa(int(n)), nil
+}
+
+// PTSNumber return the pty number.
+func (p *PTY) PTSNumber() (uint, error) {
+ var ptyno uint
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(p.Master.Fd()), uintptr(TIOCGPTN), uintptr(unsafe.Pointer(&ptyno)))
+ if errno != 0 {
+ return 0, errno
+ }
+ return ptyno, nil
+}
+
+// Winsz Fetches the current terminal windowsize.
+// example handling changing window sizes with PTYs:
+//
+// import "os"
+// import "os/signal"
+//
+// var sig = make(chan os.Signal,2) // Channel to listen for UNIX SIGNALS on
+// signal.Notify(sig, syscall.SIGWINCH) // That'd be the window changing
+//
+// for {
+// <-sig
+// term.Winsz(os.Stdin) // We got signaled our terminal changed size so we read in the new value
+// term.Setwinsz(pty.Slave) // Copy it to our virtual Terminal
+// }
+func (t *Termios) Winsz(file *os.File) error {
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(file.Fd()), uintptr(TIOCGWINSZ), uintptr(unsafe.Pointer(&t.Wz)))
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
+
+// Setwinsz Sets the terminal window size.
+func (t *Termios) Setwinsz(file *os.File) error {
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(file.Fd()), uintptr(TIOCSWINSZ), uintptr(unsafe.Pointer(&t.Wz)))
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
+
+// OpenPTY Creates a new Master/Slave PTY pair.
+func OpenPTY() (*PTY, error) {
+ // Opening ptmx gives you the FD of a brand new PTY
+ master, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0)
+ if err != nil {
+ return nil, err
+ }
+
+ // unlock pty slave
+ var unlock int // 0 => Unlock
+ if _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(master.Fd()), uintptr(TIOCSPTLCK), uintptr(unsafe.Pointer(&unlock))); errno != 0 {
+ master.Close()
+ return nil, errno
+ }
+
+ // get path of pts slave
+ pty := &PTY{Master: master}
+ slaveStr, err := pty.PTSName()
+ if err != nil {
+ master.Close()
+ return nil, err
+ }
+
+ // open pty slave
+ pty.Slave, err = os.OpenFile(slaveStr, os.O_RDWR|syscall.O_NOCTTY, 0)
+ if err != nil {
+ master.Close()
+ return nil, err
+ }
+
+ return pty, nil
+}
+
+// Close closes the PTYs that OpenPTY created.
+func (p *PTY) Close() error {
+ slaveErr := errors.New("Slave FD nil")
+ if p.Slave != nil {
+ slaveErr = p.Slave.Close()
+ }
+ masterErr := errors.New("Master FD nil")
+ if p.Master != nil {
+ masterErr = p.Master.Close()
+ }
+ if slaveErr != nil || masterErr != nil {
+ var errs []string
+ if slaveErr != nil {
+ errs = append(errs, "Slave: "+slaveErr.Error())
+ }
+ if masterErr != nil {
+ errs = append(errs, "Master: "+masterErr.Error())
+ }
+ return errors.New(strings.Join(errs, " "))
+ }
+ return nil
+}
+
+// ReadByte implements the io.ByteReader interface to read single char from the PTY.
+func (p *PTY) ReadByte() (byte, error) {
+ bs := make([]byte, 1, 1)
+ _, err := p.Master.Read(bs)
+ return bs[0], err
+}
+
+// GetChar fine old getchar() for a PTY.
+func (p *PTY) GetChar() (byte, error) {
+ return p.ReadByte()
+}
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/.gitignore b/vendor/github.com/lucasb-eyer/go-colorful/.gitignore
new file mode 100644
index 000000000..47fda8eeb
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/.gitignore
@@ -0,0 +1,28 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Vim swap files
+.*.sw?
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+
+# Code coverage stuff
+coverage.out
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/.travis.yml b/vendor/github.com/lucasb-eyer/go-colorful/.travis.yml
new file mode 100644
index 000000000..5bb2a827b
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/.travis.yml
@@ -0,0 +1,7 @@
+language: go
+install:
+ - go get golang.org/x/tools/cmd/cover
+ - go get github.com/mattn/goveralls
+script:
+ - go test -v -covermode=count -coverprofile=coverage.out
+ - if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/LICENSE b/vendor/github.com/lucasb-eyer/go-colorful/LICENSE
new file mode 100644
index 000000000..4e402a00e
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2013 Lucas Beyer
+
+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/vendor/github.com/lucasb-eyer/go-colorful/README.md b/vendor/github.com/lucasb-eyer/go-colorful/README.md
new file mode 100644
index 000000000..2cb0c4243
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/README.md
@@ -0,0 +1,492 @@
+go-colorful
+===========
+A library for playing with colors in go (golang).
+
+[![Build Status](https://travis-ci.org/lucasb-eyer/go-colorful.svg?branch=master)](https://travis-ci.org/lucasb-eyer/go-colorful)
+[![Coverage Status](https://coveralls.io/repos/github/lucasb-eyer/go-colorful/badge.svg?branch=master)](https://coveralls.io/github/lucasb-eyer/go-colorful?branch=master)
+
+Why?
+====
+I love games. I make games. I love detail and I get lost in detail.
+One such detail popped up during the development of [Memory Which Does Not Suck](https://github.com/lucasb-eyer/mwdns/),
+when we wanted the server to assign the players random colors. Sometimes
+two players got very similar colors, which bugged me. The very same evening,
+[I want hue](http://tools.medialab.sciences-po.fr/iwanthue/) was the top post
+on HackerNews' frontpage and showed me how to Do It Right™. Last but not
+least, there was no library for handling color spaces available in go. Colorful
+does just that and implements Go's `color.Color` interface.
+
+What?
+=====
+Go-Colorful stores colors in RGB and provides methods from converting these to various color-spaces. Currently supported colorspaces are:
+
+- **RGB:** All three of Red, Green and Blue in [0..1].
+- **HSL:** Hue in [0..360], Saturation and Luminance in [0..1]. For legacy reasons; please forget that it exists.
+- **HSV:** Hue in [0..360], Saturation and Value in [0..1]. You're better off using HCL, see below.
+- **Hex RGB:** The "internet" color format, as in #FF00FF.
+- **Linear RGB:** See [gamma correct rendering](http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/).
+- **CIE-XYZ:** CIE's standard color space, almost in [0..1].
+- **CIE-xyY:** encodes chromacity in x and y and luminance in Y, all in [0..1]
+- **CIE-L\*a\*b\*:** A *perceptually uniform* color space, i.e. distances are meaningful. L\* in [0..1] and a\*, b\* almost in [-1..1].
+- **CIE-L\*u\*v\*:** Very similar to CIE-L\*a\*b\*, there is [no consensus](http://en.wikipedia.org/wiki/CIELUV#Historical_background) on which one is "better".
+- **CIE-L\*C\*h° (HCL):** This is generally the [most useful](http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/) one; CIE-L\*a\*b\* space in polar coordinates, i.e. a *better* HSV. H° is in [0..360], C\* almost in [-1..1] and L\* as in CIE-L\*a\*b\*.
+
+For the colorspaces where it makes sense (XYZ, Lab, Luv, HCl), the
+[D65](http://en.wikipedia.org/wiki/Illuminant_D65) is used as reference white
+by default but methods for using your own reference white are provided.
+
+A coordinate being *almost in* a range means that generally it is, but for very
+bright colors and depending on the reference white, it might overflow this
+range slightly. For example, C\* of #0000ff is 1.338.
+
+Unit-tests are provided.
+
+Nice, but what's it useful for?
+-------------------------------
+
+- Converting color spaces. Some people like to do that.
+- Blending (interpolating) between colors in a "natural" look by using the right colorspace.
+- Generating random colors under some constraints (e.g. colors of the same shade, or shades of one color.)
+- Generating gorgeous random palettes with distinct colors of a same temperature.
+
+What not (yet)?
+===============
+There are a few features which are currently missing and might be useful.
+I just haven't implemented them yet because I didn't have the need for it.
+Pull requests welcome.
+
+- Sorting colors (potentially using above mentioned distances)
+
+So which colorspace should I use?
+=================================
+It depends on what you want to do. I think the folks from *I want hue* are
+on-spot when they say that RGB fits to how *screens produce* color, CIE L\*a\*b\*
+fits how *humans perceive* color and HCL fits how *humans think* colors.
+
+Whenever you'd use HSV, rather go for CIE-L\*C\*h°. for fixed lightness L\* and
+chroma C\* values, the hue angle h° rotates through colors of the same
+perceived brightness and intensity.
+
+How?
+====
+
+### Installing
+Installing the library is as easy as
+
+```bash
+$ go get github.com/lucasb-eyer/go-colorful
+```
+
+The package can then be used through an
+
+```go
+import "github.com/lucasb-eyer/go-colorful"
+```
+
+### Basic usage
+
+Create a beautiful blue color using different source space:
+
+```go
+// Any of the following should be the same
+c := colorful.Color{0.313725, 0.478431, 0.721569}
+c, err := colorful.Hex("#517AB8")
+if err != nil {
+ log.Fatal(err)
+}
+c = colorful.Hsv(216.0, 0.56, 0.722)
+c = colorful.Xyz(0.189165, 0.190837, 0.480248)
+c = colorful.Xyy(0.219895, 0.221839, 0.190837)
+c = colorful.Lab(0.507850, 0.040585,-0.370945)
+c = colorful.Luv(0.507849,-0.194172,-0.567924)
+c = colorful.Hcl(276.2440, 0.373160, 0.507849)
+fmt.Printf("RGB values: %v, %v, %v", c.R, c.G, c.B)
+```
+
+And then converting this color back into various color spaces:
+
+```go
+hex := c.Hex()
+h, s, v := c.Hsv()
+x, y, z := c.Xyz()
+x, y, Y := c.Xyy()
+l, a, b := c.Lab()
+l, u, v := c.Luv()
+h, c, l := c.Hcl()
+```
+
+Note that, because of Go's unfortunate choice of requiring an initial uppercase,
+the name of the functions relating to the xyY space are just off. If you have
+any good suggestion, please open an issue. (I don't consider XyY good.)
+
+### The `color.Color` interface
+Because a `colorful.Color` implements Go's `color.Color` interface (found in the
+`image/color` package), it can be used anywhere that expects a `color.Color`.
+
+Furthermore, you can convert anything that implements the `color.Color` interface
+into a `colorful.Color` using the `MakeColor` function:
+
+```go
+c, ok := colorful.MakeColor(color.Gray16{12345})
+```
+
+**Caveat:** Be aware that this latter conversion (using `MakeColor`) hits a
+corner-case when alpha is exactly zero. Because `color.Color` uses pre-multiplied
+alpha colors, this means the RGB values are lost (set to 0) and it's impossible
+to recover them. In such a case `MakeColor` will return `false` as its second value.
+
+### Comparing colors
+In the RGB color space, the Euclidian distance between colors *doesn't* correspond
+to visual/perceptual distance. This means that two pairs of colors which have the
+same distance in RGB space can look much further apart. This is fixed by the
+CIE-L\*a\*b\*, CIE-L\*u\*v\* and CIE-L\*C\*h° color spaces.
+Thus you should only compare colors in any of these space.
+(Note that the distance in CIE-L\*a\*b\* and CIE-L\*C\*h° are the same, since it's the same space but in cylindrical coordinates)
+
+![Color distance comparison](doc/colordist/colordist.png)
+
+The two colors shown on the top look much more different than the two shown on
+the bottom. Still, in RGB space, their distance is the same.
+Here is a little example program which shows the distances between the top two
+and bottom two colors in RGB, CIE-L\*a\*b\* and CIE-L\*u\*v\* space. You can find it in `doc/colordist/colordist.go`.
+
+```go
+package main
+
+import "fmt"
+import "github.com/lucasb-eyer/go-colorful"
+
+func main() {
+ c1a := colorful.Color{150.0 / 255.0, 10.0 / 255.0, 150.0 / 255.0}
+ c1b := colorful.Color{53.0 / 255.0, 10.0 / 255.0, 150.0 / 255.0}
+ c2a := colorful.Color{10.0 / 255.0, 150.0 / 255.0, 50.0 / 255.0}
+ c2b := colorful.Color{99.9 / 255.0, 150.0 / 255.0, 10.0 / 255.0}
+
+ fmt.Printf("DistanceRgb: c1: %v\tand c2: %v\n", c1a.DistanceRgb(c1b), c2a.DistanceRgb(c2b))
+ fmt.Printf("DistanceLab: c1: %v\tand c2: %v\n", c1a.DistanceLab(c1b), c2a.DistanceLab(c2b))
+ fmt.Printf("DistanceLuv: c1: %v\tand c2: %v\n", c1a.DistanceLuv(c1b), c2a.DistanceLuv(c2b))
+ fmt.Printf("DistanceCIE76: c1: %v\tand c2: %v\n", c1a.DistanceCIE76(c1b), c2a.DistanceCIE76(c2b))
+ fmt.Printf("DistanceCIE94: c1: %v\tand c2: %v\n", c1a.DistanceCIE94(c1b), c2a.DistanceCIE94(c2b))
+ fmt.Printf("DistanceCIEDE2000: c1: %v\tand c2: %v\n", c1a.DistanceCIEDE2000(c1b), c2a.DistanceCIEDE2000(c2b))
+}
+```
+
+Running the above program shows that you should always prefer any of the CIE distances:
+
+```bash
+$ go run colordist.go
+DistanceRgb: c1: 0.3803921568627451 and c2: 0.3858713931171159
+DistanceLab: c1: 0.32048458312798056 and c2: 0.24397151758565272
+DistanceLuv: c1: 0.5134369614199698 and c2: 0.2568692839860636
+DistanceCIE76: c1: 0.32048458312798056 and c2: 0.24397151758565272
+DistanceCIE94: c1: 0.19799168128511324 and c2: 0.12207136371167401
+DistanceCIEDE2000: c1: 0.17274551120971166 and c2: 0.10665210031428465
+```
+
+It also shows that `DistanceLab` is more formally known as `DistanceCIE76` and
+has been superseded by the slightly more accurate, but much more expensive
+`DistanceCIE94` and `DistanceCIEDE2000`.
+
+Note that `AlmostEqualRgb` is provided mainly for (unit-)testing purposes. Use
+it only if you really know what you're doing. It will eat your cat.
+
+### Blending colors
+Blending is highly connected to distance, since it basically "walks through" the
+colorspace thus, if the colorspace maps distances well, the walk is "smooth".
+
+Colorful comes with blending functions in RGB, HSV and any of the LAB spaces.
+Of course, you'd rather want to use the blending functions of the LAB spaces since
+these spaces map distances well but, just in case, here is an example showing
+you how the blendings (`#fdffcc` to `#242a42`) are done in the various spaces:
+
+![Blending colors in different spaces.](doc/colorblend/colorblend.png)
+
+What you see is that HSV is really bad: it adds some green, which is not present
+in the original colors at all! RGB is much better, but it stays light a little
+too long. LUV and LAB both hit the right lightness but LAB has a little more
+color. HCL works in the same vein as HSV (both cylindrical interpolations) but
+it does it right in that there is no green appearing and the lighthness changes
+in a linear manner.
+
+While this seems all good, you need to know one thing: When interpolating in any
+of the CIE color spaces, you might get invalid RGB colors! This is important if
+the starting and ending colors are user-input or random. An example of where this
+happens is when blending between `#eeef61` and `#1e3140`:
+
+![Invalid RGB colors may crop up when blending in CIE spaces.](doc/colorblend/invalid.png)
+
+You can test whether a color is a valid RGB color by calling the `IsValid` method
+and indeed, calling IsValid will return false for the redish colors on the bottom.
+One way to "fix" this is to get a valid color close to the invalid one by calling
+`Clamped`, which always returns a nearby valid color. Doing this, we get the
+following result, which is satisfactory:
+
+![Fixing invalid RGB colors by clamping them to the valid range.](doc/colorblend/clamped.png)
+
+The following is the code creating the above three images; it can be found in `doc/colorblend/colorblend.go`
+
+```go
+package main
+
+import "fmt"
+import "github.com/lucasb-eyer/go-colorful"
+import "image"
+import "image/draw"
+import "image/png"
+import "os"
+
+func main() {
+ blocks := 10
+ blockw := 40
+ img := image.NewRGBA(image.Rect(0,0,blocks*blockw,200))
+
+ c1, _ := colorful.Hex("#fdffcc")
+ c2, _ := colorful.Hex("#242a42")
+
+ // Use these colors to get invalid RGB in the gradient.
+ //c1, _ := colorful.Hex("#EEEF61")
+ //c2, _ := colorful.Hex("#1E3140")
+
+ for i := 0 ; i < blocks ; i++ {
+ draw.Draw(img, image.Rect(i*blockw, 0,(i+1)*blockw, 40), &image.Uniform{c1.BlendHsv(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src)
+ draw.Draw(img, image.Rect(i*blockw, 40,(i+1)*blockw, 80), &image.Uniform{c1.BlendLuv(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src)
+ draw.Draw(img, image.Rect(i*blockw, 80,(i+1)*blockw,120), &image.Uniform{c1.BlendRgb(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src)
+ draw.Draw(img, image.Rect(i*blockw,120,(i+1)*blockw,160), &image.Uniform{c1.BlendLab(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src)
+ draw.Draw(img, image.Rect(i*blockw,160,(i+1)*blockw,200), &image.Uniform{c1.BlendHcl(c2, float64(i)/float64(blocks-1))}, image.ZP, draw.Src)
+
+ // This can be used to "fix" invalid colors in the gradient.
+ //draw.Draw(img, image.Rect(i*blockw,160,(i+1)*blockw,200), &image.Uniform{c1.BlendHcl(c2, float64(i)/float64(blocks-1)).Clamped()}, image.ZP, draw.Src)
+ }
+
+ toimg, err := os.Create("colorblend.png")
+ if err != nil {
+ fmt.Printf("Error: %v", err)
+ return
+ }
+ defer toimg.Close()
+
+ png.Encode(toimg, img)
+}
+```
+
+#### Generating color gradients
+A very common reason to blend colors is creating gradients. There is an example
+program in [doc/gradientgen.go](doc/gradientgen/gradientgen.go); it doesn't use any API
+which hasn't been used in the previous example code, so I won't bother pasting
+the code in here. Just look at that gorgeous gradient it generated in HCL space:
+
+!["Spectral" colorbrewer gradient in HCL space.](doc/gradientgen/gradientgen.png)
+
+### Getting random colors
+It is sometimes necessary to generate random colors. You could simply do this
+on your own by generating colors with random values. By restricting the random
+values to a range smaller than [0..1] and using a space such as CIE-H\*C\*l° or
+HSV, you can generate both random shades of a color or random colors of a
+lightness:
+
+```go
+random_blue := colorful.Hcl(180.0+rand.Float64()*50.0, 0.2+rand.Float64()*0.8, 0.3+rand.Float64()*0.7)
+random_dark := colorful.Hcl(rand.Float64()*360.0, rand.Float64(), rand.Float64()*0.4)
+random_light := colorful.Hcl(rand.Float64()*360.0, rand.Float64(), 0.6+rand.Float64()*0.4)
+```
+
+Since getting random "warm" and "happy" colors is quite a common task, there
+are some helper functions:
+
+```go
+colorful.WarmColor()
+colorful.HappyColor()
+colorful.FastWarmColor()
+colorful.FastHappyColor()
+```
+
+The ones prefixed by `Fast` are faster but less coherent since they use the HSV
+space as opposed to the regular ones which use CIE-L\*C\*h° space. The
+following picture shows the warm colors in the top two rows and happy colors
+in the bottom two rows. Within these, the first is the regular one and the
+second is the fast one.
+
+![Warm, fast warm, happy and fast happy random colors, respectively.](doc/colorgens/colorgens.png)
+
+Don't forget to initialize the random seed! You can see the code used for
+generating this picture in `doc/colorgens/colorgens.go`.
+
+### Getting random palettes
+As soon as you need to generate more than one random color, you probably want
+them to be distinguishible. Playing against an opponent which has almost the
+same blue as I do is not fun. This is where random palettes can help.
+
+These palettes are generated using an algorithm which ensures that all colors
+on the palette are as distinguishible as possible. Again, there is a `Fast`
+method which works in HSV and is less perceptually uniform and a non-`Fast`
+method which works in CIE spaces. For more theory on `SoftPalette`, check out
+[I want hue](http://tools.medialab.sciences-po.fr/iwanthue/theory.php). Yet
+again, there is a `Happy` and a `Warm` version, which do what you expect, but
+now there is an additional `Soft` version, which is more configurable: you can
+give a constraint on the color space in order to get colors within a certain *feel*.
+
+Let's start with the simple methods first, all they take is the amount of
+colors to generate, which could, for example, be the player count. They return
+an array of `colorful.Color` objects:
+
+```go
+pal1, err1 := colorful.WarmPalette(10)
+pal2 := colorful.FastWarmPalette(10)
+pal3, err3 := colorful.HappyPalette(10)
+pal4 := colorful.FastHappyPalette(10)
+pal5, err5 := colorful.SoftPalette(10)
+```
+
+Note that the non-fast methods *may* fail if you ask for way too many colors.
+Let's move on to the advanced one, namely `SoftPaletteEx`. Besides the color
+count, this function takes a `SoftPaletteSettings` object as argument. The
+interesting part here is its `CheckColor` member, which is a boolean function
+taking three floating points as arguments: `l`, `a` and `b`. This function
+should return `true` for colors which lie within the region you want and `false`
+otherwise. The other members are `Iteration`, which should be within [5..100]
+where higher means slower but more exact palette, and `ManySamples` which you
+should set to `true` in case your `CheckColor` constraint rejects a large part
+of the color space.
+
+For example, to create a palette of 10 brownish colors, you'd call it like this:
+
+```go
+func isbrowny(l, a, b float64) bool {
+ h, c, L := colorful.LabToHcl(l, a, b)
+ return 10.0 < h && h < 50.0 && 0.1 < c && c < 0.5 && L < 0.5
+}
+// Since the above function is pretty restrictive, we set ManySamples to true.
+brownies := colorful.SoftPaletteEx(10, colorful.SoftPaletteSettings{isbrowny, 50, true})
+```
+
+The following picture shows the palettes generated by all of these methods
+(sourcecode in `doc/palettegens/palettegens.go`), in the order they were presented, i.e.
+from top to bottom: `Warm`, `FastWarm`, `Happy`, `FastHappy`, `Soft`,
+`SoftEx(isbrowny)`. All of them contain some randomness, so YMMV.
+
+![All example palettes](doc/palettegens/palettegens.png)
+
+Again, the code used for generating the above image is available as [doc/palettegens/palettegens.go](https://github.com/lucasb-eyer/go-colorful/blob/master/doc/palettegens/palettegens.go).
+
+### Sorting colors
+TODO: Sort using dist fn.
+
+### Using linear RGB for computations
+There are two methods for transforming RGB<->Linear RGB: a fast and almost precise one,
+and a slow and precise one.
+
+```go
+r, g, b := colorful.Hex("#FF0000").FastLinearRgb()
+```
+
+TODO: describe some more.
+
+### Want to use some other reference point?
+
+```go
+c := colorful.LabWhiteRef(0.507850, 0.040585,-0.370945, colorful.D50)
+l, a, b := c.LabWhiteRef(colorful.D50)
+```
+
+### Reading and writing colors from databases
+
+The type `HexColor` makes it easy to store colors as strings in a database. It
+implements the [https://godoc.org/database/sql#Scanner](database/sql.Scanner)
+and [database/sql/driver.Value](https://godoc.org/database/sql/driver.Value)
+interfaces which provide automatic type conversion.
+
+Example:
+
+```go
+var hc HexColor
+_, err := db.QueryRow("SELECT '#ff0000';").Scan(&hc)
+// hc == HexColor{R: 1, G: 0, B: 0}; err == nil
+```
+
+FAQ
+===
+
+### Q: I get all f!@#ed up values! Your library sucks!
+A: You probably provided values in the wrong range. For example, RGB values are
+expected to reside between 0 and 1, *not* between 0 and 255. Normalize your colors.
+
+### Q: Lab/Luv/HCl seem broken! Your library sucks!
+They look like this:
+
+
+
+A: You're likely trying to generate and display colors that can't be represented by RGB,
+and thus monitors. When you're trying to convert, say, `HCL(190.0, 1.0, 1.0).RGB255()`,
+you're asking for RGB values of `(-2105.254 300.680 286.185)`, which clearly don't exist,
+and the `RGB255` function just casts these numbers to `uint8`, creating wrap-around and
+what looks like a completely broken gradient. What you want to do, is either use more
+reasonable values of colors which actually exist in RGB, or just `Clamp()` the resulting
+color to its nearest existing one, living with the consequences:
+`HCL(190.0, 1.0, 1.0).Clamp().RGB255()`. It will look something like this:
+
+
+
+[Here's an issue going in-depth about this](https://github.com/lucasb-eyer/go-colorful/issues/14),
+as well as [my answer](https://github.com/lucasb-eyer/go-colorful/issues/14#issuecomment-324205385),
+both with code and pretty pictures. Also note that this was somewhat covered above in the
+["Blending colors" section](https://github.com/lucasb-eyer/go-colorful#blending-colors).
+
+### Q: In a tight loop, conversion to Lab/Luv/HCl/... are slooooow!
+A: Yes, they are.
+This library aims for correctness, readability, and modularity; it wasn't written with speed in mind.
+A large part of the slowness comes from these conversions going through `LinearRgb` which uses powers.
+I implemented a fast approximation to `LinearRgb` called `FastLinearRgb` by using Taylor approximations.
+The approximation is roughly 5x faster and precise up to roughly 0.5%,
+the major caveat being that if the input values are outside the range 0-1, accuracy drops dramatically.
+You can use these in your conversions as follows:
+
+```go
+col := // Get your color somehow
+l, a, b := XyzToLab(LinearRgbToXyz(col.LinearRgb()))
+```
+
+If you need faster versions of `Distance*` and `Blend*` that make use of this fast approximation,
+feel free to implement them and open a pull-request, I'll happily accept.
+
+The derivation of these functions can be followed in [this Jupyter notebook](doc/LinearRGB Approximations.ipynb).
+Here's the main figure showing the approximation quality:
+
+![approximation quality](doc/approx-quality.png)
+
+More speed could be gained by using SIMD instructions in many places.
+You can also get more speed for specific conversions by approximating the full conversion function,
+but that is outside the scope of this library.
+Thanks to [@ZirconiumX](https://github.com/ZirconiumX) for starting this investigation,
+see [issue #18](https://github.com/lucasb-eyer/go-colorful/issues/18) for details.
+
+### Q: Why would `MakeColor` ever fail!?
+A: `MakeColor` fails when the alpha channel is zero. In that case, the
+conversion is undefined. See [issue 21](https://github.com/lucasb-eyer/go-colorful/issues/21)
+as well as the short caveat note in the ["The `color.Color` interface"](README.md#the-colorcolor-interface)
+section above.
+
+Who?
+====
+
+This library has been developed by Lucas Beyer with contributions from
+Bastien Dejean (@baskerville), Phil Kulak (@pkulak) and Christian Muehlhaeuser (@muesli).
+
+Release Notes
+=============
+
+### Version 1.0
+- API Breaking change in `MakeColor`: instead of `panic`ing when alpha is zero, it now returns a secondary, boolean return value indicating success. See [the color.Color interface](https://github.com/lucasb-eyer/go-colorful#the-colorcolor-interface) section and [this FAQ entry](https://github.com/lucasb-eyer/go-colorful#q-why-would-makecolor-ever-fail) for details.
+
+### Version 0.9
+- Initial version number after having ignored versioning for a long time :)
+
+License: MIT
+============
+Copyright (c) 2013 Lucas Beyer
+
+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/vendor/github.com/lucasb-eyer/go-colorful/colorgens.go b/vendor/github.com/lucasb-eyer/go-colorful/colorgens.go
new file mode 100644
index 000000000..2e2e49e19
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/colorgens.go
@@ -0,0 +1,55 @@
+// Various ways to generate single random colors
+
+package colorful
+
+import (
+ "math/rand"
+)
+
+// Creates a random dark, "warm" color through a restricted HSV space.
+func FastWarmColor() Color {
+ return Hsv(
+ rand.Float64()*360.0,
+ 0.5+rand.Float64()*0.3,
+ 0.3+rand.Float64()*0.3)
+}
+
+// Creates a random dark, "warm" color through restricted HCL space.
+// This is slower than FastWarmColor but will likely give you colors which have
+// the same "warmness" if you run it many times.
+func WarmColor() (c Color) {
+ for c = randomWarm(); !c.IsValid(); c = randomWarm() {
+ }
+ return
+}
+
+func randomWarm() Color {
+ return Hcl(
+ rand.Float64()*360.0,
+ 0.1+rand.Float64()*0.3,
+ 0.2+rand.Float64()*0.3)
+}
+
+// Creates a random bright, "pimpy" color through a restricted HSV space.
+func FastHappyColor() Color {
+ return Hsv(
+ rand.Float64()*360.0,
+ 0.7+rand.Float64()*0.3,
+ 0.6+rand.Float64()*0.3)
+}
+
+// Creates a random bright, "pimpy" color through restricted HCL space.
+// This is slower than FastHappyColor but will likely give you colors which
+// have the same "brightness" if you run it many times.
+func HappyColor() (c Color) {
+ for c = randomPimp(); !c.IsValid(); c = randomPimp() {
+ }
+ return
+}
+
+func randomPimp() Color {
+ return Hcl(
+ rand.Float64()*360.0,
+ 0.5+rand.Float64()*0.3,
+ 0.5+rand.Float64()*0.3)
+}
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/colors.go b/vendor/github.com/lucasb-eyer/go-colorful/colors.go
new file mode 100644
index 000000000..29870df04
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/colors.go
@@ -0,0 +1,903 @@
+// The colorful package provides all kinds of functions for working with colors.
+package colorful
+
+import (
+ "fmt"
+ "image/color"
+ "math"
+)
+
+// A color is stored internally using sRGB (standard RGB) values in the range 0-1
+type Color struct {
+ R, G, B float64
+}
+
+// Implement the Go color.Color interface.
+func (col Color) RGBA() (r, g, b, a uint32) {
+ r = uint32(col.R*65535.0 + 0.5)
+ g = uint32(col.G*65535.0 + 0.5)
+ b = uint32(col.B*65535.0 + 0.5)
+ a = 0xFFFF
+ return
+}
+
+// Constructs a colorful.Color from something implementing color.Color
+func MakeColor(col color.Color) (Color, bool) {
+ r, g, b, a := col.RGBA()
+ if a == 0 {
+ return Color{0, 0, 0}, false
+ }
+
+ // Since color.Color is alpha pre-multiplied, we need to divide the
+ // RGB values by alpha again in order to get back the original RGB.
+ r *= 0xffff
+ r /= a
+ g *= 0xffff
+ g /= a
+ b *= 0xffff
+ b /= a
+
+ return Color{float64(r) / 65535.0, float64(g) / 65535.0, float64(b) / 65535.0}, true
+}
+
+// Might come in handy sometimes to reduce boilerplate code.
+func (col Color) RGB255() (r, g, b uint8) {
+ r = uint8(col.R*255.0 + 0.5)
+ g = uint8(col.G*255.0 + 0.5)
+ b = uint8(col.B*255.0 + 0.5)
+ return
+}
+
+// This is the tolerance used when comparing colors using AlmostEqualRgb.
+const Delta = 1.0 / 255.0
+
+// This is the default reference white point.
+var D65 = [3]float64{0.95047, 1.00000, 1.08883}
+
+// And another one.
+var D50 = [3]float64{0.96422, 1.00000, 0.82521}
+
+// Checks whether the color exists in RGB space, i.e. all values are in [0..1]
+func (c Color) IsValid() bool {
+ return 0.0 <= c.R && c.R <= 1.0 &&
+ 0.0 <= c.G && c.G <= 1.0 &&
+ 0.0 <= c.B && c.B <= 1.0
+}
+
+func clamp01(v float64) float64 {
+ return math.Max(0.0, math.Min(v, 1.0))
+}
+
+// Returns Clamps the color into valid range, clamping each value to [0..1]
+// If the color is valid already, this is a no-op.
+func (c Color) Clamped() Color {
+ return Color{clamp01(c.R), clamp01(c.G), clamp01(c.B)}
+}
+
+func sq(v float64) float64 {
+ return v * v
+}
+
+func cub(v float64) float64 {
+ return v * v * v
+}
+
+// DistanceRgb computes the distance between two colors in RGB space.
+// This is not a good measure! Rather do it in Lab space.
+func (c1 Color) DistanceRgb(c2 Color) float64 {
+ return math.Sqrt(sq(c1.R-c2.R) + sq(c1.G-c2.G) + sq(c1.B-c2.B))
+}
+
+// Check for equality between colors within the tolerance Delta (1/255).
+func (c1 Color) AlmostEqualRgb(c2 Color) bool {
+ return math.Abs(c1.R-c2.R)+
+ math.Abs(c1.G-c2.G)+
+ math.Abs(c1.B-c2.B) < 3.0*Delta
+}
+
+// You don't really want to use this, do you? Go for BlendLab, BlendLuv or BlendHcl.
+func (c1 Color) BlendRgb(c2 Color, t float64) Color {
+ return Color{c1.R + t*(c2.R-c1.R),
+ c1.G + t*(c2.G-c1.G),
+ c1.B + t*(c2.B-c1.B)}
+}
+
+// Utility used by Hxx color-spaces for interpolating between two angles in [0,360].
+func interp_angle(a0, a1, t float64) float64 {
+ // Based on the answer here: http://stackoverflow.com/a/14498790/2366315
+ // With potential proof that it works here: http://math.stackexchange.com/a/2144499
+ delta := math.Mod(math.Mod(a1-a0, 360.0)+540, 360.0) - 180.0
+ return math.Mod(a0+t*delta+360.0, 360.0)
+}
+
+/// HSV ///
+///////////
+// From http://en.wikipedia.org/wiki/HSL_and_HSV
+// Note that h is in [0..360] and s,v in [0..1]
+
+// Hsv returns the Hue [0..360], Saturation and Value [0..1] of the color.
+func (col Color) Hsv() (h, s, v float64) {
+ min := math.Min(math.Min(col.R, col.G), col.B)
+ v = math.Max(math.Max(col.R, col.G), col.B)
+ C := v - min
+
+ s = 0.0
+ if v != 0.0 {
+ s = C / v
+ }
+
+ h = 0.0 // We use 0 instead of undefined as in wp.
+ if min != v {
+ if v == col.R {
+ h = math.Mod((col.G-col.B)/C, 6.0)
+ }
+ if v == col.G {
+ h = (col.B-col.R)/C + 2.0
+ }
+ if v == col.B {
+ h = (col.R-col.G)/C + 4.0
+ }
+ h *= 60.0
+ if h < 0.0 {
+ h += 360.0
+ }
+ }
+ return
+}
+
+// Hsv creates a new Color given a Hue in [0..360], a Saturation and a Value in [0..1]
+func Hsv(H, S, V float64) Color {
+ Hp := H / 60.0
+ C := V * S
+ X := C * (1.0 - math.Abs(math.Mod(Hp, 2.0)-1.0))
+
+ m := V - C
+ r, g, b := 0.0, 0.0, 0.0
+
+ switch {
+ case 0.0 <= Hp && Hp < 1.0:
+ r = C
+ g = X
+ case 1.0 <= Hp && Hp < 2.0:
+ r = X
+ g = C
+ case 2.0 <= Hp && Hp < 3.0:
+ g = C
+ b = X
+ case 3.0 <= Hp && Hp < 4.0:
+ g = X
+ b = C
+ case 4.0 <= Hp && Hp < 5.0:
+ r = X
+ b = C
+ case 5.0 <= Hp && Hp < 6.0:
+ r = C
+ b = X
+ }
+
+ return Color{m + r, m + g, m + b}
+}
+
+// You don't really want to use this, do you? Go for BlendLab, BlendLuv or BlendHcl.
+func (c1 Color) BlendHsv(c2 Color, t float64) Color {
+ h1, s1, v1 := c1.Hsv()
+ h2, s2, v2 := c2.Hsv()
+
+ // We know that h are both in [0..360]
+ return Hsv(interp_angle(h1, h2, t), s1+t*(s2-s1), v1+t*(v2-v1))
+}
+
+/// HSL ///
+///////////
+
+// Hsl returns the Hue [0..360], Saturation [0..1], and Luminance (lightness) [0..1] of the color.
+func (col Color) Hsl() (h, s, l float64) {
+ min := math.Min(math.Min(col.R, col.G), col.B)
+ max := math.Max(math.Max(col.R, col.G), col.B)
+
+ l = (max + min) / 2
+
+ if min == max {
+ s = 0
+ h = 0
+ } else {
+ if l < 0.5 {
+ s = (max - min) / (max + min)
+ } else {
+ s = (max - min) / (2.0 - max - min)
+ }
+
+ if max == col.R {
+ h = (col.G - col.B) / (max - min)
+ } else if max == col.G {
+ h = 2.0 + (col.B-col.R)/(max-min)
+ } else {
+ h = 4.0 + (col.R-col.G)/(max-min)
+ }
+
+ h *= 60
+
+ if h < 0 {
+ h += 360
+ }
+ }
+
+ return
+}
+
+// Hsl creates a new Color given a Hue in [0..360], a Saturation [0..1], and a Luminance (lightness) in [0..1]
+func Hsl(h, s, l float64) Color {
+ if s == 0 {
+ return Color{l, l, l}
+ }
+
+ var r, g, b float64
+ var t1 float64
+ var t2 float64
+ var tr float64
+ var tg float64
+ var tb float64
+
+ if l < 0.5 {
+ t1 = l * (1.0 + s)
+ } else {
+ t1 = l + s - l*s
+ }
+
+ t2 = 2*l - t1
+ h /= 360
+ tr = h + 1.0/3.0
+ tg = h
+ tb = h - 1.0/3.0
+
+ if tr < 0 {
+ tr++
+ }
+ if tr > 1 {
+ tr--
+ }
+ if tg < 0 {
+ tg++
+ }
+ if tg > 1 {
+ tg--
+ }
+ if tb < 0 {
+ tb++
+ }
+ if tb > 1 {
+ tb--
+ }
+
+ // Red
+ if 6*tr < 1 {
+ r = t2 + (t1-t2)*6*tr
+ } else if 2*tr < 1 {
+ r = t1
+ } else if 3*tr < 2 {
+ r = t2 + (t1-t2)*(2.0/3.0-tr)*6
+ } else {
+ r = t2
+ }
+
+ // Green
+ if 6*tg < 1 {
+ g = t2 + (t1-t2)*6*tg
+ } else if 2*tg < 1 {
+ g = t1
+ } else if 3*tg < 2 {
+ g = t2 + (t1-t2)*(2.0/3.0-tg)*6
+ } else {
+ g = t2
+ }
+
+ // Blue
+ if 6*tb < 1 {
+ b = t2 + (t1-t2)*6*tb
+ } else if 2*tb < 1 {
+ b = t1
+ } else if 3*tb < 2 {
+ b = t2 + (t1-t2)*(2.0/3.0-tb)*6
+ } else {
+ b = t2
+ }
+
+ return Color{r, g, b}
+}
+
+/// Hex ///
+///////////
+
+// Hex returns the hex "html" representation of the color, as in #ff0080.
+func (col Color) Hex() string {
+ // Add 0.5 for rounding
+ return fmt.Sprintf("#%02x%02x%02x", uint8(col.R*255.0+0.5), uint8(col.G*255.0+0.5), uint8(col.B*255.0+0.5))
+}
+
+// Hex parses a "html" hex color-string, either in the 3 "#f0c" or 6 "#ff1034" digits form.
+func Hex(scol string) (Color, error) {
+ format := "#%02x%02x%02x"
+ factor := 1.0 / 255.0
+ if len(scol) == 4 {
+ format = "#%1x%1x%1x"
+ factor = 1.0 / 15.0
+ }
+
+ var r, g, b uint8
+ n, err := fmt.Sscanf(scol, format, &r, &g, &b)
+ if err != nil {
+ return Color{}, err
+ }
+ if n != 3 {
+ return Color{}, fmt.Errorf("color: %v is not a hex-color", scol)
+ }
+
+ return Color{float64(r) * factor, float64(g) * factor, float64(b) * factor}, nil
+}
+
+/// Linear ///
+//////////////
+// http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/
+// http://www.brucelindbloom.com/Eqn_RGB_to_XYZ.html
+
+func linearize(v float64) float64 {
+ if v <= 0.04045 {
+ return v / 12.92
+ }
+ return math.Pow((v+0.055)/1.055, 2.4)
+}
+
+// LinearRgb converts the color into the linear RGB space (see http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/).
+func (col Color) LinearRgb() (r, g, b float64) {
+ r = linearize(col.R)
+ g = linearize(col.G)
+ b = linearize(col.B)
+ return
+}
+
+// A much faster and still quite precise linearization using a 6th-order Taylor approximation.
+// See the accompanying Jupyter notebook for derivation of the constants.
+func linearize_fast(v float64) float64 {
+ v1 := v - 0.5
+ v2 := v1 * v1
+ v3 := v2 * v1
+ v4 := v2 * v2
+ //v5 := v3*v2
+ return -0.248750514614486 + 0.925583310193438*v + 1.16740237321695*v2 + 0.280457026598666*v3 - 0.0757991963780179*v4 //+ 0.0437040411548932*v5
+}
+
+// FastLinearRgb is much faster than and almost as accurate as LinearRgb.
+// BUT it is important to NOTE that they only produce good results for valid colors r,g,b in [0,1].
+func (col Color) FastLinearRgb() (r, g, b float64) {
+ r = linearize_fast(col.R)
+ g = linearize_fast(col.G)
+ b = linearize_fast(col.B)
+ return
+}
+
+func delinearize(v float64) float64 {
+ if v <= 0.0031308 {
+ return 12.92 * v
+ }
+ return 1.055*math.Pow(v, 1.0/2.4) - 0.055
+}
+
+// LinearRgb creates an sRGB color out of the given linear RGB color (see http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/).
+func LinearRgb(r, g, b float64) Color {
+ return Color{delinearize(r), delinearize(g), delinearize(b)}
+}
+
+func delinearize_fast(v float64) float64 {
+ // This function (fractional root) is much harder to linearize, so we need to split.
+ if v > 0.2 {
+ v1 := v - 0.6
+ v2 := v1 * v1
+ v3 := v2 * v1
+ v4 := v2 * v2
+ v5 := v3 * v2
+ return 0.442430344268235 + 0.592178981271708*v - 0.287864782562636*v2 + 0.253214392068985*v3 - 0.272557158129811*v4 + 0.325554383321718*v5
+ } else if v > 0.03 {
+ v1 := v - 0.115
+ v2 := v1 * v1
+ v3 := v2 * v1
+ v4 := v2 * v2
+ v5 := v3 * v2
+ return 0.194915592891669 + 1.55227076330229*v - 3.93691860257828*v2 + 18.0679839248761*v3 - 101.468750302746*v4 + 632.341487393927*v5
+ } else {
+ v1 := v - 0.015
+ v2 := v1 * v1
+ v3 := v2 * v1
+ v4 := v2 * v2
+ v5 := v3 * v2
+ // You can clearly see from the involved constants that the low-end is highly nonlinear.
+ return 0.0519565234928877 + 5.09316778537561*v - 99.0338180489702*v2 + 3484.52322764895*v3 - 150028.083412663*v4 + 7168008.42971613*v5
+ }
+}
+
+// FastLinearRgb is much faster than and almost as accurate as LinearRgb.
+// BUT it is important to NOTE that they only produce good results for valid inputs r,g,b in [0,1].
+func FastLinearRgb(r, g, b float64) Color {
+ return Color{delinearize_fast(r), delinearize_fast(g), delinearize_fast(b)}
+}
+
+// XyzToLinearRgb converts from CIE XYZ-space to Linear RGB space.
+func XyzToLinearRgb(x, y, z float64) (r, g, b float64) {
+ r = 3.2404542*x - 1.5371385*y - 0.4985314*z
+ g = -0.9692660*x + 1.8760108*y + 0.0415560*z
+ b = 0.0556434*x - 0.2040259*y + 1.0572252*z
+ return
+}
+
+func LinearRgbToXyz(r, g, b float64) (x, y, z float64) {
+ x = 0.4124564*r + 0.3575761*g + 0.1804375*b
+ y = 0.2126729*r + 0.7151522*g + 0.0721750*b
+ z = 0.0193339*r + 0.1191920*g + 0.9503041*b
+ return
+}
+
+/// XYZ ///
+///////////
+// http://www.sjbrown.co.uk/2004/05/14/gamma-correct-rendering/
+
+func (col Color) Xyz() (x, y, z float64) {
+ return LinearRgbToXyz(col.LinearRgb())
+}
+
+func Xyz(x, y, z float64) Color {
+ return LinearRgb(XyzToLinearRgb(x, y, z))
+}
+
+/// xyY ///
+///////////
+// http://www.brucelindbloom.com/Eqn_XYZ_to_xyY.html
+
+// Well, the name is bad, since it's xyY but Golang needs me to start with a
+// capital letter to make the method public.
+func XyzToXyy(X, Y, Z float64) (x, y, Yout float64) {
+ return XyzToXyyWhiteRef(X, Y, Z, D65)
+}
+
+func XyzToXyyWhiteRef(X, Y, Z float64, wref [3]float64) (x, y, Yout float64) {
+ Yout = Y
+ N := X + Y + Z
+ if math.Abs(N) < 1e-14 {
+ // When we have black, Bruce Lindbloom recommends to use
+ // the reference white's chromacity for x and y.
+ x = wref[0] / (wref[0] + wref[1] + wref[2])
+ y = wref[1] / (wref[0] + wref[1] + wref[2])
+ } else {
+ x = X / N
+ y = Y / N
+ }
+ return
+}
+
+func XyyToXyz(x, y, Y float64) (X, Yout, Z float64) {
+ Yout = Y
+
+ if -1e-14 < y && y < 1e-14 {
+ X = 0.0
+ Z = 0.0
+ } else {
+ X = Y / y * x
+ Z = Y / y * (1.0 - x - y)
+ }
+
+ return
+}
+
+// Converts the given color to CIE xyY space using D65 as reference white.
+// (Note that the reference white is only used for black input.)
+// x, y and Y are in [0..1]
+func (col Color) Xyy() (x, y, Y float64) {
+ return XyzToXyy(col.Xyz())
+}
+
+// Converts the given color to CIE xyY space, taking into account
+// a given reference white. (i.e. the monitor's white)
+// (Note that the reference white is only used for black input.)
+// x, y and Y are in [0..1]
+func (col Color) XyyWhiteRef(wref [3]float64) (x, y, Y float64) {
+ X, Y2, Z := col.Xyz()
+ return XyzToXyyWhiteRef(X, Y2, Z, wref)
+}
+
+// Generates a color by using data given in CIE xyY space.
+// x, y and Y are in [0..1]
+func Xyy(x, y, Y float64) Color {
+ return Xyz(XyyToXyz(x, y, Y))
+}
+
+/// L*a*b* ///
+//////////////
+// http://en.wikipedia.org/wiki/Lab_color_space#CIELAB-CIEXYZ_conversions
+// For L*a*b*, we need to L*a*b*<->XYZ->RGB and the first one is device dependent.
+
+func lab_f(t float64) float64 {
+ if t > 6.0/29.0*6.0/29.0*6.0/29.0 {
+ return math.Cbrt(t)
+ }
+ return t/3.0*29.0/6.0*29.0/6.0 + 4.0/29.0
+}
+
+func XyzToLab(x, y, z float64) (l, a, b float64) {
+ // Use D65 white as reference point by default.
+ // http://www.fredmiranda.com/forum/topic/1035332
+ // http://en.wikipedia.org/wiki/Standard_illuminant
+ return XyzToLabWhiteRef(x, y, z, D65)
+}
+
+func XyzToLabWhiteRef(x, y, z float64, wref [3]float64) (l, a, b float64) {
+ fy := lab_f(y / wref[1])
+ l = 1.16*fy - 0.16
+ a = 5.0 * (lab_f(x/wref[0]) - fy)
+ b = 2.0 * (fy - lab_f(z/wref[2]))
+ return
+}
+
+func lab_finv(t float64) float64 {
+ if t > 6.0/29.0 {
+ return t * t * t
+ }
+ return 3.0 * 6.0 / 29.0 * 6.0 / 29.0 * (t - 4.0/29.0)
+}
+
+func LabToXyz(l, a, b float64) (x, y, z float64) {
+ // D65 white (see above).
+ return LabToXyzWhiteRef(l, a, b, D65)
+}
+
+func LabToXyzWhiteRef(l, a, b float64, wref [3]float64) (x, y, z float64) {
+ l2 := (l + 0.16) / 1.16
+ x = wref[0] * lab_finv(l2+a/5.0)
+ y = wref[1] * lab_finv(l2)
+ z = wref[2] * lab_finv(l2-b/2.0)
+ return
+}
+
+// Converts the given color to CIE L*a*b* space using D65 as reference white.
+func (col Color) Lab() (l, a, b float64) {
+ return XyzToLab(col.Xyz())
+}
+
+// Converts the given color to CIE L*a*b* space, taking into account
+// a given reference white. (i.e. the monitor's white)
+func (col Color) LabWhiteRef(wref [3]float64) (l, a, b float64) {
+ x, y, z := col.Xyz()
+ return XyzToLabWhiteRef(x, y, z, wref)
+}
+
+// Generates a color by using data given in CIE L*a*b* space using D65 as reference white.
+// WARNING: many combinations of `l`, `a`, and `b` values do not have corresponding
+// valid RGB values, check the FAQ in the README if you're unsure.
+func Lab(l, a, b float64) Color {
+ return Xyz(LabToXyz(l, a, b))
+}
+
+// Generates a color by using data given in CIE L*a*b* space, taking
+// into account a given reference white. (i.e. the monitor's white)
+func LabWhiteRef(l, a, b float64, wref [3]float64) Color {
+ return Xyz(LabToXyzWhiteRef(l, a, b, wref))
+}
+
+// DistanceLab is a good measure of visual similarity between two colors!
+// A result of 0 would mean identical colors, while a result of 1 or higher
+// means the colors differ a lot.
+func (c1 Color) DistanceLab(c2 Color) float64 {
+ l1, a1, b1 := c1.Lab()
+ l2, a2, b2 := c2.Lab()
+ return math.Sqrt(sq(l1-l2) + sq(a1-a2) + sq(b1-b2))
+}
+
+// That's actually the same, but I don't want to break code.
+func (c1 Color) DistanceCIE76(c2 Color) float64 {
+ return c1.DistanceLab(c2)
+}
+
+// Uses the CIE94 formula to calculate color distance. More accurate than
+// DistanceLab, but also more work.
+func (cl Color) DistanceCIE94(cr Color) float64 {
+ l1, a1, b1 := cl.Lab()
+ l2, a2, b2 := cr.Lab()
+
+ // NOTE: Since all those formulas expect L,a,b values 100x larger than we
+ // have them in this library, we either need to adjust all constants
+ // in the formula, or convert the ranges of L,a,b before, and then
+ // scale the distances down again. The latter is less error-prone.
+ l1, a1, b1 = l1*100.0, a1*100.0, b1*100.0
+ l2, a2, b2 = l2*100.0, a2*100.0, b2*100.0
+
+ kl := 1.0 // 2.0 for textiles
+ kc := 1.0
+ kh := 1.0
+ k1 := 0.045 // 0.048 for textiles
+ k2 := 0.015 // 0.014 for textiles.
+
+ deltaL := l1 - l2
+ c1 := math.Sqrt(sq(a1) + sq(b1))
+ c2 := math.Sqrt(sq(a2) + sq(b2))
+ deltaCab := c1 - c2
+
+ // Not taking Sqrt here for stability, and it's unnecessary.
+ deltaHab2 := sq(a1-a2) + sq(b1-b2) - sq(deltaCab)
+ sl := 1.0
+ sc := 1.0 + k1*c1
+ sh := 1.0 + k2*c1
+
+ vL2 := sq(deltaL / (kl * sl))
+ vC2 := sq(deltaCab / (kc * sc))
+ vH2 := deltaHab2 / sq(kh*sh)
+
+ return math.Sqrt(vL2+vC2+vH2) * 0.01 // See above.
+}
+
+// DistanceCIEDE2000 uses the Delta E 2000 formula to calculate color
+// distance. It is more expensive but more accurate than both DistanceLab
+// and DistanceCIE94.
+func (cl Color) DistanceCIEDE2000(cr Color) float64 {
+ return cl.DistanceCIEDE2000klch(cr, 1.0, 1.0, 1.0)
+}
+
+// DistanceCIEDE2000klch uses the Delta E 2000 formula with custom values
+// for the weighting factors kL, kC, and kH.
+func (cl Color) DistanceCIEDE2000klch(cr Color, kl, kc, kh float64) float64 {
+ l1, a1, b1 := cl.Lab()
+ l2, a2, b2 := cr.Lab()
+
+ // As with CIE94, we scale up the ranges of L,a,b beforehand and scale
+ // them down again afterwards.
+ l1, a1, b1 = l1*100.0, a1*100.0, b1*100.0
+ l2, a2, b2 = l2*100.0, a2*100.0, b2*100.0
+
+ cab1 := math.Sqrt(sq(a1) + sq(b1))
+ cab2 := math.Sqrt(sq(a2) + sq(b2))
+ cabmean := (cab1 + cab2) / 2
+
+ g := 0.5 * (1 - math.Sqrt(math.Pow(cabmean, 7)/(math.Pow(cabmean, 7)+math.Pow(25, 7))))
+ ap1 := (1 + g) * a1
+ ap2 := (1 + g) * a2
+ cp1 := math.Sqrt(sq(ap1) + sq(b1))
+ cp2 := math.Sqrt(sq(ap2) + sq(b2))
+
+ hp1 := 0.0
+ if b1 != ap1 || ap1 != 0 {
+ hp1 = math.Atan2(b1, ap1)
+ if hp1 < 0 {
+ hp1 += math.Pi * 2
+ }
+ hp1 *= 180 / math.Pi
+ }
+ hp2 := 0.0
+ if b2 != ap2 || ap2 != 0 {
+ hp2 = math.Atan2(b2, ap2)
+ if hp2 < 0 {
+ hp2 += math.Pi * 2
+ }
+ hp2 *= 180 / math.Pi
+ }
+
+ deltaLp := l2 - l1
+ deltaCp := cp2 - cp1
+ dhp := 0.0
+ cpProduct := cp1 * cp2
+ if cpProduct != 0 {
+ dhp = hp2 - hp1
+ if dhp > 180 {
+ dhp -= 360
+ } else if dhp < -180 {
+ dhp += 360
+ }
+ }
+ deltaHp := 2 * math.Sqrt(cpProduct) * math.Sin(dhp/2*math.Pi/180)
+
+ lpmean := (l1 + l2) / 2
+ cpmean := (cp1 + cp2) / 2
+ hpmean := hp1 + hp2
+ if cpProduct != 0 {
+ hpmean /= 2
+ if math.Abs(hp1-hp2) > 180 {
+ if hp1+hp2 < 360 {
+ hpmean += 180
+ } else {
+ hpmean -= 180
+ }
+ }
+ }
+
+ t := 1 - 0.17*math.Cos((hpmean-30)*math.Pi/180) + 0.24*math.Cos(2*hpmean*math.Pi/180) + 0.32*math.Cos((3*hpmean+6)*math.Pi/180) - 0.2*math.Cos((4*hpmean-63)*math.Pi/180)
+ deltaTheta := 30 * math.Exp(-sq((hpmean-275)/25))
+ rc := 2 * math.Sqrt(math.Pow(cpmean, 7)/(math.Pow(cpmean, 7)+math.Pow(25, 7)))
+ sl := 1 + (0.015*sq(lpmean-50))/math.Sqrt(20+sq(lpmean-50))
+ sc := 1 + 0.045*cpmean
+ sh := 1 + 0.015*cpmean*t
+ rt := -math.Sin(2*deltaTheta*math.Pi/180) * rc
+
+ return math.Sqrt(sq(deltaLp/(kl*sl))+sq(deltaCp/(kc*sc))+sq(deltaHp/(kh*sh))+rt*(deltaCp/(kc*sc))*(deltaHp/(kh*sh))) * 0.01
+}
+
+// BlendLab blends two colors in the L*a*b* color-space, which should result in a smoother blend.
+// t == 0 results in c1, t == 1 results in c2
+func (c1 Color) BlendLab(c2 Color, t float64) Color {
+ l1, a1, b1 := c1.Lab()
+ l2, a2, b2 := c2.Lab()
+ return Lab(l1+t*(l2-l1),
+ a1+t*(a2-a1),
+ b1+t*(b2-b1))
+}
+
+/// L*u*v* ///
+//////////////
+// http://en.wikipedia.org/wiki/CIELUV#XYZ_.E2.86.92_CIELUV_and_CIELUV_.E2.86.92_XYZ_conversions
+// For L*u*v*, we need to L*u*v*<->XYZ<->RGB and the first one is device dependent.
+
+func XyzToLuv(x, y, z float64) (l, a, b float64) {
+ // Use D65 white as reference point by default.
+ // http://www.fredmiranda.com/forum/topic/1035332
+ // http://en.wikipedia.org/wiki/Standard_illuminant
+ return XyzToLuvWhiteRef(x, y, z, D65)
+}
+
+func XyzToLuvWhiteRef(x, y, z float64, wref [3]float64) (l, u, v float64) {
+ if y/wref[1] <= 6.0/29.0*6.0/29.0*6.0/29.0 {
+ l = y / wref[1] * 29.0 / 3.0 * 29.0 / 3.0 * 29.0 / 3.0
+ } else {
+ l = 1.16*math.Cbrt(y/wref[1]) - 0.16
+ }
+ ubis, vbis := xyz_to_uv(x, y, z)
+ un, vn := xyz_to_uv(wref[0], wref[1], wref[2])
+ u = 13.0 * l * (ubis - un)
+ v = 13.0 * l * (vbis - vn)
+ return
+}
+
+// For this part, we do as R's graphics.hcl does, not as wikipedia does.
+// Or is it the same?
+func xyz_to_uv(x, y, z float64) (u, v float64) {
+ denom := x + 15.0*y + 3.0*z
+ if denom == 0.0 {
+ u, v = 0.0, 0.0
+ } else {
+ u = 4.0 * x / denom
+ v = 9.0 * y / denom
+ }
+ return
+}
+
+func LuvToXyz(l, u, v float64) (x, y, z float64) {
+ // D65 white (see above).
+ return LuvToXyzWhiteRef(l, u, v, D65)
+}
+
+func LuvToXyzWhiteRef(l, u, v float64, wref [3]float64) (x, y, z float64) {
+ //y = wref[1] * lab_finv((l + 0.16) / 1.16)
+ if l <= 0.08 {
+ y = wref[1] * l * 100.0 * 3.0 / 29.0 * 3.0 / 29.0 * 3.0 / 29.0
+ } else {
+ y = wref[1] * cub((l+0.16)/1.16)
+ }
+ un, vn := xyz_to_uv(wref[0], wref[1], wref[2])
+ if l != 0.0 {
+ ubis := u/(13.0*l) + un
+ vbis := v/(13.0*l) + vn
+ x = y * 9.0 * ubis / (4.0 * vbis)
+ z = y * (12.0 - 3.0*ubis - 20.0*vbis) / (4.0 * vbis)
+ } else {
+ x, y = 0.0, 0.0
+ }
+ return
+}
+
+// Converts the given color to CIE L*u*v* space using D65 as reference white.
+// L* is in [0..1] and both u* and v* are in about [-1..1]
+func (col Color) Luv() (l, u, v float64) {
+ return XyzToLuv(col.Xyz())
+}
+
+// Converts the given color to CIE L*u*v* space, taking into account
+// a given reference white. (i.e. the monitor's white)
+// L* is in [0..1] and both u* and v* are in about [-1..1]
+func (col Color) LuvWhiteRef(wref [3]float64) (l, u, v float64) {
+ x, y, z := col.Xyz()
+ return XyzToLuvWhiteRef(x, y, z, wref)
+}
+
+// Generates a color by using data given in CIE L*u*v* space using D65 as reference white.
+// L* is in [0..1] and both u* and v* are in about [-1..1]
+// WARNING: many combinations of `l`, `a`, and `b` values do not have corresponding
+// valid RGB values, check the FAQ in the README if you're unsure.
+func Luv(l, u, v float64) Color {
+ return Xyz(LuvToXyz(l, u, v))
+}
+
+// Generates a color by using data given in CIE L*u*v* space, taking
+// into account a given reference white. (i.e. the monitor's white)
+// L* is in [0..1] and both u* and v* are in about [-1..1]
+func LuvWhiteRef(l, u, v float64, wref [3]float64) Color {
+ return Xyz(LuvToXyzWhiteRef(l, u, v, wref))
+}
+
+// DistanceLuv is a good measure of visual similarity between two colors!
+// A result of 0 would mean identical colors, while a result of 1 or higher
+// means the colors differ a lot.
+func (c1 Color) DistanceLuv(c2 Color) float64 {
+ l1, u1, v1 := c1.Luv()
+ l2, u2, v2 := c2.Luv()
+ return math.Sqrt(sq(l1-l2) + sq(u1-u2) + sq(v1-v2))
+}
+
+// BlendLuv blends two colors in the CIE-L*u*v* color-space, which should result in a smoother blend.
+// t == 0 results in c1, t == 1 results in c2
+func (c1 Color) BlendLuv(c2 Color, t float64) Color {
+ l1, u1, v1 := c1.Luv()
+ l2, u2, v2 := c2.Luv()
+ return Luv(l1+t*(l2-l1),
+ u1+t*(u2-u1),
+ v1+t*(v2-v1))
+}
+
+/// HCL ///
+///////////
+// HCL is nothing else than L*a*b* in cylindrical coordinates!
+// (this was wrong on English wikipedia, I fixed it, let's hope the fix stays.)
+// But it is widely popular since it is a "correct HSV"
+// http://www.hunterlab.com/appnotes/an09_96a.pdf
+
+// Converts the given color to HCL space using D65 as reference white.
+// H values are in [0..360], C and L values are in [0..1] although C can overshoot 1.0
+func (col Color) Hcl() (h, c, l float64) {
+ return col.HclWhiteRef(D65)
+}
+
+func LabToHcl(L, a, b float64) (h, c, l float64) {
+ // Oops, floating point workaround necessary if a ~= b and both are very small (i.e. almost zero).
+ if math.Abs(b-a) > 1e-4 && math.Abs(a) > 1e-4 {
+ h = math.Mod(57.29577951308232087721*math.Atan2(b, a)+360.0, 360.0) // Rad2Deg
+ } else {
+ h = 0.0
+ }
+ c = math.Sqrt(sq(a) + sq(b))
+ l = L
+ return
+}
+
+// Converts the given color to HCL space, taking into account
+// a given reference white. (i.e. the monitor's white)
+// H values are in [0..360], C and L values are in [0..1]
+func (col Color) HclWhiteRef(wref [3]float64) (h, c, l float64) {
+ L, a, b := col.LabWhiteRef(wref)
+ return LabToHcl(L, a, b)
+}
+
+// Generates a color by using data given in HCL space using D65 as reference white.
+// H values are in [0..360], C and L values are in [0..1]
+// WARNING: many combinations of `l`, `a`, and `b` values do not have corresponding
+// valid RGB values, check the FAQ in the README if you're unsure.
+func Hcl(h, c, l float64) Color {
+ return HclWhiteRef(h, c, l, D65)
+}
+
+func HclToLab(h, c, l float64) (L, a, b float64) {
+ H := 0.01745329251994329576 * h // Deg2Rad
+ a = c * math.Cos(H)
+ b = c * math.Sin(H)
+ L = l
+ return
+}
+
+// Generates a color by using data given in HCL space, taking
+// into account a given reference white. (i.e. the monitor's white)
+// H values are in [0..360], C and L values are in [0..1]
+func HclWhiteRef(h, c, l float64, wref [3]float64) Color {
+ L, a, b := HclToLab(h, c, l)
+ return LabWhiteRef(L, a, b, wref)
+}
+
+// BlendHcl blends two colors in the CIE-L*C*h° color-space, which should result in a smoother blend.
+// t == 0 results in c1, t == 1 results in c2
+func (col1 Color) BlendHcl(col2 Color, t float64) Color {
+ h1, c1, l1 := col1.Hcl()
+ h2, c2, l2 := col2.Hcl()
+
+ // We know that h are both in [0..360]
+ return Hcl(interp_angle(h1, h2, t), c1+t*(c2-c1), l1+t*(l2-l1))
+}
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/go.mod b/vendor/github.com/lucasb-eyer/go-colorful/go.mod
new file mode 100644
index 000000000..35925f3d7
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/go.mod
@@ -0,0 +1,3 @@
+module github.com/lucasb-eyer/go-colorful
+
+go 1.12
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/go.sum b/vendor/github.com/lucasb-eyer/go-colorful/go.sum
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go
new file mode 100644
index 000000000..bb66dfa4f
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go
@@ -0,0 +1,25 @@
+package colorful
+
+import (
+ "math/rand"
+)
+
+// Uses the HSV color space to generate colors with similar S,V but distributed
+// evenly along their Hue. This is fast but not always pretty.
+// If you've got time to spare, use Lab (the non-fast below).
+func FastHappyPalette(colorsCount int) (colors []Color) {
+ colors = make([]Color, colorsCount)
+
+ for i := 0; i < colorsCount; i++ {
+ colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.8+rand.Float64()*0.2, 0.65+rand.Float64()*0.2)
+ }
+ return
+}
+
+func HappyPalette(colorsCount int) ([]Color, error) {
+ pimpy := func(l, a, b float64) bool {
+ _, c, _ := LabToHcl(l, a, b)
+ return 0.3 <= c && 0.4 <= l && l <= 0.8
+ }
+ return SoftPaletteEx(colorsCount, SoftPaletteSettings{pimpy, 50, true})
+}
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go b/vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go
new file mode 100644
index 000000000..86a5ed987
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go
@@ -0,0 +1,37 @@
+package colorful
+
+import (
+ "database/sql/driver"
+ "fmt"
+ "reflect"
+)
+
+// A HexColor is a Color stored as a hex string "#rrggbb". It implements the
+// database/sql.Scanner and database/sql/driver.Value interfaces.
+type HexColor Color
+
+type errUnsupportedType struct {
+ got interface{}
+ want reflect.Type
+}
+
+func (hc *HexColor) Scan(value interface{}) error {
+ s, ok := value.(string)
+ if !ok {
+ return errUnsupportedType{got: reflect.TypeOf(value), want: reflect.TypeOf("")}
+ }
+ c, err := Hex(s)
+ if err != nil {
+ return err
+ }
+ *hc = HexColor(c)
+ return nil
+}
+
+func (hc *HexColor) Value() (driver.Value, error) {
+ return Color(*hc).Hex(), nil
+}
+
+func (e errUnsupportedType) Error() string {
+ return fmt.Sprintf("unsupported type: got %v, want a %s", e.got, e.want)
+}
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go
new file mode 100644
index 000000000..0154ac9ba
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go
@@ -0,0 +1,185 @@
+// Largely inspired by the descriptions in http://lab.medialab.sciences-po.fr/iwanthue/
+// but written from scratch.
+
+package colorful
+
+import (
+ "fmt"
+ "math"
+ "math/rand"
+)
+
+// The algorithm works in L*a*b* color space and converts to RGB in the end.
+// L* in [0..1], a* and b* in [-1..1]
+type lab_t struct {
+ L, A, B float64
+}
+
+type SoftPaletteSettings struct {
+ // A function which can be used to restrict the allowed color-space.
+ CheckColor func(l, a, b float64) bool
+
+ // The higher, the better quality but the slower. Usually two figures.
+ Iterations int
+
+ // Use up to 160000 or 8000 samples of the L*a*b* space (and thus calls to CheckColor).
+ // Set this to true only if your CheckColor shapes the Lab space weirdly.
+ ManySamples bool
+}
+
+// Yeah, windows-stype Foo, FooEx, screw you golang...
+// Uses K-means to cluster the color-space and return the means of the clusters
+// as a new palette of distinctive colors. Falls back to K-medoid if the mean
+// happens to fall outside of the color-space, which can only happen if you
+// specify a CheckColor function.
+func SoftPaletteEx(colorsCount int, settings SoftPaletteSettings) ([]Color, error) {
+
+ // Checks whether it's a valid RGB and also fulfills the potentially provided constraint.
+ check := func(col lab_t) bool {
+ c := Lab(col.L, col.A, col.B)
+ return c.IsValid() && (settings.CheckColor == nil || settings.CheckColor(col.L, col.A, col.B))
+ }
+
+ // Sample the color space. These will be the points k-means is run on.
+ dl := 0.05
+ dab := 0.1
+ if settings.ManySamples {
+ dl = 0.01
+ dab = 0.05
+ }
+
+ samples := make([]lab_t, 0, int(1.0/dl*2.0/dab*2.0/dab))
+ for l := 0.0; l <= 1.0; l += dl {
+ for a := -1.0; a <= 1.0; a += dab {
+ for b := -1.0; b <= 1.0; b += dab {
+ if check(lab_t{l, a, b}) {
+ samples = append(samples, lab_t{l, a, b})
+ }
+ }
+ }
+ }
+
+ // That would cause some infinite loops down there...
+ if len(samples) < colorsCount {
+ return nil, fmt.Errorf("palettegen: more colors requested (%v) than samples available (%v). Your requested color count may be wrong, you might want to use many samples or your constraint function makes the valid color space too small.", colorsCount, len(samples))
+ } else if len(samples) == colorsCount {
+ return labs2cols(samples), nil // Oops?
+ }
+
+ // We take the initial means out of the samples, so they are in fact medoids.
+ // This helps us avoid infinite loops or arbitrary cutoffs with too restrictive constraints.
+ means := make([]lab_t, colorsCount)
+ for i := 0; i < colorsCount; i++ {
+ for means[i] = samples[rand.Intn(len(samples))]; in(means, i, means[i]); means[i] = samples[rand.Intn(len(samples))] {
+ }
+ }
+
+ clusters := make([]int, len(samples))
+ samples_used := make([]bool, len(samples))
+
+ // The actual k-means/medoid iterations
+ for i := 0; i < settings.Iterations; i++ {
+ // Reassing the samples to clusters, i.e. to their closest mean.
+ // By the way, also check if any sample is used as a medoid and if so, mark that.
+ for isample, sample := range samples {
+ samples_used[isample] = false
+ mindist := math.Inf(+1)
+ for imean, mean := range means {
+ dist := lab_dist(sample, mean)
+ if dist < mindist {
+ mindist = dist
+ clusters[isample] = imean
+ }
+
+ // Mark samples which are used as a medoid.
+ if lab_eq(sample, mean) {
+ samples_used[isample] = true
+ }
+ }
+ }
+
+ // Compute new means according to the samples.
+ for imean := range means {
+ // The new mean is the average of all samples belonging to it..
+ nsamples := 0
+ newmean := lab_t{0.0, 0.0, 0.0}
+ for isample, sample := range samples {
+ if clusters[isample] == imean {
+ nsamples++
+ newmean.L += sample.L
+ newmean.A += sample.A
+ newmean.B += sample.B
+ }
+ }
+ if nsamples > 0 {
+ newmean.L /= float64(nsamples)
+ newmean.A /= float64(nsamples)
+ newmean.B /= float64(nsamples)
+ } else {
+ // That mean doesn't have any samples? Get a new mean from the sample list!
+ var inewmean int
+ for inewmean = rand.Intn(len(samples_used)); samples_used[inewmean]; inewmean = rand.Intn(len(samples_used)) {
+ }
+ newmean = samples[inewmean]
+ samples_used[inewmean] = true
+ }
+
+ // But now we still need to check whether the new mean is an allowed color.
+ if nsamples > 0 && check(newmean) {
+ // It does, life's good (TM)
+ means[imean] = newmean
+ } else {
+ // New mean isn't an allowed color or doesn't have any samples!
+ // Switch to medoid mode and pick the closest (unused) sample.
+ // This should always find something thanks to len(samples) >= colorsCount
+ mindist := math.Inf(+1)
+ for isample, sample := range samples {
+ if !samples_used[isample] {
+ dist := lab_dist(sample, newmean)
+ if dist < mindist {
+ mindist = dist
+ newmean = sample
+ }
+ }
+ }
+ }
+ }
+ }
+ return labs2cols(means), nil
+}
+
+// A wrapper which uses common parameters.
+func SoftPalette(colorsCount int) ([]Color, error) {
+ return SoftPaletteEx(colorsCount, SoftPaletteSettings{nil, 50, false})
+}
+
+func in(haystack []lab_t, upto int, needle lab_t) bool {
+ for i := 0; i < upto && i < len(haystack); i++ {
+ if haystack[i] == needle {
+ return true
+ }
+ }
+ return false
+}
+
+const LAB_DELTA = 1e-6
+
+func lab_eq(lab1, lab2 lab_t) bool {
+ return math.Abs(lab1.L-lab2.L) < LAB_DELTA &&
+ math.Abs(lab1.A-lab2.A) < LAB_DELTA &&
+ math.Abs(lab1.B-lab2.B) < LAB_DELTA
+}
+
+// That's faster than using colorful's DistanceLab since we would have to
+// convert back and forth for that. Here is no conversion.
+func lab_dist(lab1, lab2 lab_t) float64 {
+ return math.Sqrt(sq(lab1.L-lab2.L) + sq(lab1.A-lab2.A) + sq(lab1.B-lab2.B))
+}
+
+func labs2cols(labs []lab_t) (cols []Color) {
+ cols = make([]Color, len(labs))
+ for k, v := range labs {
+ cols[k] = Lab(v.L, v.A, v.B)
+ }
+ return cols
+}
diff --git a/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go b/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
new file mode 100644
index 000000000..00f42a5cc
--- /dev/null
+++ b/vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go
@@ -0,0 +1,25 @@
+package colorful
+
+import (
+ "math/rand"
+)
+
+// Uses the HSV color space to generate colors with similar S,V but distributed
+// evenly along their Hue. This is fast but not always pretty.
+// If you've got time to spare, use Lab (the non-fast below).
+func FastWarmPalette(colorsCount int) (colors []Color) {
+ colors = make([]Color, colorsCount)
+
+ for i := 0; i < colorsCount; i++ {
+ colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.55+rand.Float64()*0.2, 0.35+rand.Float64()*0.2)
+ }
+ return
+}
+
+func WarmPalette(colorsCount int) ([]Color, error) {
+ warmy := func(l, a, b float64) bool {
+ _, c, _ := LabToHcl(l, a, b)
+ return 0.1 <= c && c <= 0.4 && 0.2 <= l && l <= 0.5
+ }
+ return SoftPaletteEx(colorsCount, SoftPaletteSettings{warmy, 50, true})
+}
diff --git a/vendor/github.com/microcosm-cc/bluemonday/.coveralls.yml b/vendor/github.com/microcosm-cc/bluemonday/.coveralls.yml
new file mode 100644
index 000000000..e0c87602f
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/.coveralls.yml
@@ -0,0 +1 @@
+repo_token: x2wlA1x0X8CK45ybWpZRCVRB4g7vtkhaw
diff --git a/vendor/github.com/microcosm-cc/bluemonday/.travis.yml b/vendor/github.com/microcosm-cc/bluemonday/.travis.yml
new file mode 100644
index 000000000..4f6664619
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/.travis.yml
@@ -0,0 +1,22 @@
+language: go
+go:
+ - 1.1.x
+ - 1.2.x
+ - 1.3.x
+ - 1.4.x
+ - 1.5.x
+ - 1.6.x
+ - 1.7.x
+ - 1.8.x
+ - 1.9.x
+ - 1.10.x
+ - 1.11.x
+ - tip
+matrix:
+ allow_failures:
+ - go: tip
+ fast_finish: true
+install:
+ - go get .
+script:
+ - go test -v ./...
diff --git a/vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md b/vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md
new file mode 100644
index 000000000..d2b12302f
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md
@@ -0,0 +1,51 @@
+# Contributing to bluemonday
+
+Third-party patches are essential for keeping bluemonday secure and offering the features developers want. However there are a few guidelines that we need contributors to follow so that we can maintain the quality of work that developers who use bluemonday expect.
+
+## Getting Started
+
+* Make sure you have a [Github account](https://github.com/signup/free)
+
+## Guidelines
+
+1. Do not vendor dependencies. As a security package, were we to vendor dependencies the projects that then vendor bluemonday may not receive the latest security updates to the dependencies. By not vendoring dependencies the project that implements bluemonday will vendor the latest version of any dependent packages. Vendoring is a project problem, not a package problem. bluemonday will be tested against the latest version of dependencies periodically and during any PR/merge.
+
+## Submitting an Issue
+
+* Submit a ticket for your issue, assuming one does not already exist
+* Clearly describe the issue including the steps to reproduce (with sample input and output) if it is a bug
+
+If you are reporting a security flaw, you may expect that we will provide the code to fix it for you. Otherwise you may want to submit a pull request to ensure the resolution is applied sooner rather than later:
+
+* Fork the repository on Github
+* Issue a pull request containing code to resolve the issue
+
+## Submitting a Pull Request
+
+* Submit a ticket for your issue, assuming one does not already exist
+* Describe the reason for the pull request and if applicable show some example inputs and outputs to demonstrate what the patch does
+* Fork the repository on Github
+* Before submitting the pull request you should
+ 1. Include tests for your patch, 1 test should encapsulate the entire patch and should refer to the Github issue
+ 1. If you have added new exposed/public functionality, you should ensure it is documented appropriately
+ 1. If you have added new exposed/public functionality, you should consider demonstrating how to use it within one of the helpers or shipped policies if appropriate or within a test if modifying a helper or policy is not appropriate
+ 1. Run all of the tests `go test -v ./...` or `make test` and ensure all tests pass
+ 1. Run gofmt `gofmt -w ./$*` or `make fmt`
+ 1. Run vet `go tool vet *.go` or `make vet` and resolve any issues
+ 1. Install golint using `go get -u github.com/golang/lint/golint` and run vet `golint *.go` or `make lint` and resolve every warning
+* When submitting the pull request you should
+ 1. Note the issue(s) it resolves, i.e. `Closes #6` in the pull request comment to close issue #6 when the pull request is accepted
+
+Once you have submitted a pull request, we *may* merge it without changes. If we have any comments or feedback, or need you to make changes to your pull request we will update the Github pull request or the associated issue. We expect responses from you within two weeks, and we may close the pull request is there is no activity.
+
+### Contributor Licence Agreement
+
+We haven't gone for the formal "Sign a Contributor Licence Agreement" thing that projects like [puppet](https://cla.puppetlabs.com/), [Mojito](https://developer.yahoo.com/cocktails/mojito/cla/) and companies like [Google](http://code.google.com/legal/individual-cla-v1.0.html) are using.
+
+But we do need to know that we can accept and merge your contributions, so for now the act of contributing a pull request should be considered equivalent to agreeing to a contributor licence agreement, specifically:
+
+You accept that the act of submitting code to the bluemonday project is to grant a copyright licence to the project that is perpetual, worldwide, non-exclusive, no-charge, royalty free and irrevocable.
+
+You accept that all who comply with the licence of the project (BSD 3-clause) are permitted to use your contributions to the project.
+
+You accept, and by submitting code do declare, that you have the legal right to grant such a licence to the project and that each of the contributions is your own original creation.
diff --git a/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md b/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md
new file mode 100644
index 000000000..b98873f3c
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/CREDITS.md
@@ -0,0 +1,6 @@
+1. Andrew Krasichkov @buglloc https://github.com/buglloc
+1. John Graham-Cumming http://jgc.org/
+1. Mike Samuel mikesamuel@gmail.com
+1. Dmitri Shuralyov shurcooL@gmail.com
+1. https://github.com/opennota
+1. https://github.com/Gufran
\ No newline at end of file
diff --git a/vendor/github.com/microcosm-cc/bluemonday/LICENSE.md b/vendor/github.com/microcosm-cc/bluemonday/LICENSE.md
new file mode 100644
index 000000000..f822458ed
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/LICENSE.md
@@ -0,0 +1,28 @@
+Copyright (c) 2014, David Kitchen
+
+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 organisation (Microcosm) 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/vendor/github.com/microcosm-cc/bluemonday/Makefile b/vendor/github.com/microcosm-cc/bluemonday/Makefile
new file mode 100644
index 000000000..b15dc74f3
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/Makefile
@@ -0,0 +1,42 @@
+# Targets:
+#
+# all: Builds the code locally after testing
+#
+# fmt: Formats the source files
+# build: Builds the code locally
+# vet: Vets the code
+# lint: Runs lint over the code (you do not need to fix everything)
+# test: Runs the tests
+# cover: Gives you the URL to a nice test coverage report
+#
+# install: Builds, tests and installs the code locally
+
+.PHONY: all fmt build vet lint test cover install
+
+# The first target is always the default action if `make` is called without
+# args we build and install into $GOPATH so that it can just be run
+
+all: fmt vet test install
+
+fmt:
+ @gofmt -s -w ./$*
+
+build:
+ @go build
+
+vet:
+ @go vet *.go
+
+lint:
+ @golint *.go
+
+test:
+ @go test -v ./...
+
+cover: COVERAGE_FILE := coverage.out
+cover:
+ @go test -coverprofile=$(COVERAGE_FILE) && \
+ cover -html=$(COVERAGE_FILE) && rm $(COVERAGE_FILE)
+
+install:
+ @go install ./...
diff --git a/vendor/github.com/microcosm-cc/bluemonday/README.md b/vendor/github.com/microcosm-cc/bluemonday/README.md
new file mode 100644
index 000000000..ce679c10b
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/README.md
@@ -0,0 +1,350 @@
+# bluemonday [![Build Status](https://travis-ci.org/microcosm-cc/bluemonday.svg?branch=master)](https://travis-ci.org/microcosm-cc/bluemonday) [![GoDoc](https://godoc.org/github.com/microcosm-cc/bluemonday?status.png)](https://godoc.org/github.com/microcosm-cc/bluemonday) [![Sourcegraph](https://sourcegraph.com/github.com/microcosm-cc/bluemonday/-/badge.svg)](https://sourcegraph.com/github.com/microcosm-cc/bluemonday?badge)
+
+bluemonday is a HTML sanitizer implemented in Go. It is fast and highly configurable.
+
+bluemonday takes untrusted user generated content as an input, and will return HTML that has been sanitised against a whitelist of approved HTML elements and attributes so that you can safely include the content in your web page.
+
+If you accept user generated content, and your server uses Go, you **need** bluemonday.
+
+The default policy for user generated content (`bluemonday.UGCPolicy().Sanitize()`) turns this:
+```html
+Hello World
+```
+
+Into a harmless:
+```html
+Hello World
+```
+
+And it turns this:
+```html
+XSS
+```
+
+Into this:
+```html
+XSS
+```
+
+Whilst still allowing this:
+```html
+
+
+
+```
+
+To pass through mostly unaltered (it gained a rel="nofollow" which is a good thing for user generated content):
+```html
+
+
+
+```
+
+It protects sites from [XSS](http://en.wikipedia.org/wiki/Cross-site_scripting) attacks. There are many [vectors for an XSS attack](https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet) and the best way to mitigate the risk is to sanitize user input against a known safe list of HTML elements and attributes.
+
+You should **always** run bluemonday **after** any other processing.
+
+If you use [blackfriday](https://github.com/russross/blackfriday) or [Pandoc](http://johnmacfarlane.net/pandoc/) then bluemonday should be run after these steps. This ensures that no insecure HTML is introduced later in your process.
+
+bluemonday is heavily inspired by both the [OWASP Java HTML Sanitizer](https://code.google.com/p/owasp-java-html-sanitizer/) and the [HTML Purifier](http://htmlpurifier.org/).
+
+## Technical Summary
+
+Whitelist based, you need to either build a policy describing the HTML elements and attributes to permit (and the `regexp` patterns of attributes), or use one of the supplied policies representing good defaults.
+
+The policy containing the whitelist is applied using a fast non-validating, forward only, token-based parser implemented in the [Go net/html library](https://godoc.org/golang.org/x/net/html) by the core Go team.
+
+We expect to be supplied with well-formatted HTML (closing elements for every applicable open element, nested correctly) and so we do not focus on repairing badly nested or incomplete HTML. We focus on simply ensuring that whatever elements do exist are described in the policy whitelist and that attributes and links are safe for use on your web page. [GIGO](http://en.wikipedia.org/wiki/Garbage_in,_garbage_out) does apply and if you feed it bad HTML bluemonday is not tasked with figuring out how to make it good again.
+
+### Supported Go Versions
+
+bluemonday is tested against Go 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, and tip.
+
+We do not support Go 1.0 as we depend on `golang.org/x/net/html` which includes a reference to `io.ErrNoProgress` which did not exist in Go 1.0.
+
+## Is it production ready?
+
+*Yes*
+
+We are using bluemonday in production having migrated from the widely used and heavily field tested OWASP Java HTML Sanitizer.
+
+We are passing our extensive test suite (including AntiSamy tests as well as tests for any issues raised). Check for any [unresolved issues](https://github.com/microcosm-cc/bluemonday/issues?page=1&state=open) to see whether anything may be a blocker for you.
+
+We invite pull requests and issues to help us ensure we are offering comprehensive protection against various attacks via user generated content.
+
+## Usage
+
+Install in your `${GOPATH}` using `go get -u github.com/microcosm-cc/bluemonday`
+
+Then call it:
+```go
+package main
+
+import (
+ "fmt"
+
+ "github.com/microcosm-cc/bluemonday"
+)
+
+func main() {
+ // Do this once for each unique policy, and use the policy for the life of the program
+ // Policy creation/editing is not safe to use in multiple goroutines
+ p := bluemonday.UGCPolicy()
+
+ // The policy can then be used to sanitize lots of input and it is safe to use the policy in multiple goroutines
+ html := p.Sanitize(
+ `Google `,
+ )
+
+ // Output:
+ // Google
+ fmt.Println(html)
+}
+```
+
+We offer three ways to call Sanitize:
+```go
+p.Sanitize(string) string
+p.SanitizeBytes([]byte) []byte
+p.SanitizeReader(io.Reader) bytes.Buffer
+```
+
+If you are obsessed about performance, `p.SanitizeReader(r).Bytes()` will return a `[]byte` without performing any unnecessary casting of the inputs or outputs. Though the difference is so negligible you should never need to care.
+
+You can build your own policies:
+```go
+package main
+
+import (
+ "fmt"
+
+ "github.com/microcosm-cc/bluemonday"
+)
+
+func main() {
+ p := bluemonday.NewPolicy()
+
+ // Require URLs to be parseable by net/url.Parse and either:
+ // mailto: http:// or https://
+ p.AllowStandardURLs()
+
+ // We only allow and
+ p.AllowAttrs("href").OnElements("a")
+ p.AllowElements("p")
+
+ html := p.Sanitize(
+ ` Google `,
+ )
+
+ // Output:
+ // Google
+ fmt.Println(html)
+}
+```
+
+We ship two default policies:
+
+1. `bluemonday.StrictPolicy()` which can be thought of as equivalent to stripping all HTML elements and their attributes as it has nothing on its whitelist. An example usage scenario would be blog post titles where HTML tags are not expected at all and if they are then the elements *and* the content of the elements should be stripped. This is a *very* strict policy.
+2. `bluemonday.UGCPolicy()` which allows a broad selection of HTML elements and attributes that are safe for user generated content. Note that this policy does *not* whitelist iframes, object, embed, styles, script, etc. An example usage scenario would be blog post bodies where a variety of formatting is expected along with the potential for TABLEs and IMGs.
+
+## Policy Building
+
+The essence of building a policy is to determine which HTML elements and attributes are considered safe for your scenario. OWASP provide an [XSS prevention cheat sheet](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet) to help explain the risks, but essentially:
+
+1. Avoid anything other than the standard HTML elements
+1. Avoid `script`, `style`, `iframe`, `object`, `embed`, `base` elements that allow code to be executed by the client or third party content to be included that can execute code
+1. Avoid anything other than plain HTML attributes with values matched to a regexp
+
+Basically, you should be able to describe what HTML is fine for your scenario. If you do not have confidence that you can describe your policy please consider using one of the shipped policies such as `bluemonday.UGCPolicy()`.
+
+To create a new policy:
+```go
+p := bluemonday.NewPolicy()
+```
+
+To add elements to a policy either add just the elements:
+```go
+p.AllowElements("b", "strong")
+```
+
+Or add elements as a virtue of adding an attribute:
+```go
+// Not the recommended pattern, see the recommendation on using .Matching() below
+p.AllowAttrs("nowrap").OnElements("td", "th")
+```
+
+Attributes can either be added to all elements:
+```go
+p.AllowAttrs("dir").Matching(regexp.MustCompile("(?i)rtl|ltr")).Globally()
+```
+
+Or attributes can be added to specific elements:
+```go
+// Not the recommended pattern, see the recommendation on using .Matching() below
+p.AllowAttrs("value").OnElements("li")
+```
+
+It is **always** recommended that an attribute be made to match a pattern. XSS in HTML attributes is very easy otherwise:
+```go
+// \p{L} matches unicode letters, \p{N} matches unicode numbers
+p.AllowAttrs("title").Matching(regexp.MustCompile(`[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&]*`)).Globally()
+```
+
+You can stop at any time and call .Sanitize():
+```go
+// string htmlIn passed in from a HTTP POST
+htmlOut := p.Sanitize(htmlIn)
+```
+
+And you can take any existing policy and extend it:
+```go
+p := bluemonday.UGCPolicy()
+p.AllowElements("fieldset", "select", "option")
+```
+
+### Links
+
+Links are difficult beasts to sanitise safely and also one of the biggest attack vectors for malicious content.
+
+It is possible to do this:
+```go
+p.AllowAttrs("href").Matching(regexp.MustCompile(`(?i)mailto|https?`)).OnElements("a")
+```
+
+But that will not protect you as the regular expression is insufficient in this case to have prevented a malformed value doing something unexpected.
+
+We provide some additional global options for safely working with links.
+
+`RequireParseableURLs` will ensure that URLs are parseable by Go's `net/url` package:
+```go
+p.RequireParseableURLs(true)
+```
+
+If you have enabled parseable URLs then the following option will `AllowRelativeURLs`. By default this is disabled (bluemonday is a whitelist tool... you need to explicitly tell us to permit things) and when disabled it will prevent all local and scheme relative URLs (i.e. `href="localpage.html"`, `href="../home.html"` and even `href="//www.google.com"` are relative):
+```go
+p.AllowRelativeURLs(true)
+```
+
+If you have enabled parseable URLs then you can whitelist the schemes (commonly called protocol when thinking of `http` and `https`) that are permitted. Bear in mind that allowing relative URLs in the above option will allow for a blank scheme:
+```go
+p.AllowURLSchemes("mailto", "http", "https")
+```
+
+Regardless of whether you have enabled parseable URLs, you can force all URLs to have a rel="nofollow" attribute. This will be added if it does not exist, but only when the `href` is valid:
+```go
+// This applies to "a" "area" "link" elements that have a "href" attribute
+p.RequireNoFollowOnLinks(true)
+```
+
+We provide a convenience method that applies all of the above, but you will still need to whitelist the linkable elements for the URL rules to be applied to:
+```go
+p.AllowStandardURLs()
+p.AllowAttrs("cite").OnElements("blockquote", "q")
+p.AllowAttrs("href").OnElements("a", "area")
+p.AllowAttrs("src").OnElements("img")
+```
+
+An additional complexity regarding links is the data URI as defined in [RFC2397](http://tools.ietf.org/html/rfc2397). The data URI allows for images to be served inline using this format:
+
+```html
+
+```
+
+We have provided a helper to verify the mimetype followed by base64 content of data URIs links:
+
+```go
+p.AllowDataURIImages()
+```
+
+That helper will enable GIF, JPEG, PNG and WEBP images.
+
+It should be noted that there is a potential [security](http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/) [risk](https://capec.mitre.org/data/definitions/244.html) with the use of data URI links. You should only enable data URI links if you already trust the content.
+
+We also have some features to help deal with user generated content:
+```go
+p.AddTargetBlankToFullyQualifiedLinks(true)
+```
+
+This will ensure that anchor ` ` links that are fully qualified (the href destination includes a host name) will get `target="_blank"` added to them.
+
+Additionally any link that has `target="_blank"` after the policy has been applied will also have the `rel` attribute adjusted to add `noopener`. This means a link may start like ` ` and will end up as ``. It is important to note that the addition of `noopener` is a security feature and not an issue. There is an unfortunate feature to browsers that a browser window opened as a result of `target="_blank"` can still control the opener (your web page) and this protects against that. The background to this can be found here: [https://dev.to/ben/the-targetblank-vulnerability-by-example](https://dev.to/ben/the-targetblank-vulnerability-by-example)
+
+### Policy Building Helpers
+
+We also bundle some helpers to simplify policy building:
+```go
+
+// Permits the "dir", "id", "lang", "title" attributes globally
+p.AllowStandardAttributes()
+
+// Permits the "img" element and its standard attributes
+p.AllowImages()
+
+// Permits ordered and unordered lists, and also definition lists
+p.AllowLists()
+
+// Permits HTML tables and all applicable elements and non-styling attributes
+p.AllowTables()
+```
+
+### Invalid Instructions
+
+The following are invalid:
+```go
+// This does not say where the attributes are allowed, you need to add
+// .Globally() or .OnElements(...)
+// This will be ignored without error.
+p.AllowAttrs("value")
+
+// This does not say where the attributes are allowed, you need to add
+// .Globally() or .OnElements(...)
+// This will be ignored without error.
+p.AllowAttrs(
+ "type",
+).Matching(
+ regexp.MustCompile("(?i)^(circle|disc|square|a|A|i|I|1)$"),
+)
+```
+
+Both examples exhibit the same issue, they declare attributes but do not then specify whether they are whitelisted globally or only on specific elements (and which elements). Attributes belong to one or more elements, and the policy needs to declare this.
+
+## Limitations
+
+We are not yet including any tools to help whitelist and sanitize CSS. Which means that unless you wish to do the heavy lifting in a single regular expression (inadvisable), **you should not allow the "style" attribute anywhere**.
+
+It is not the job of bluemonday to fix your bad HTML, it is merely the job of bluemonday to prevent malicious HTML getting through. If you have mismatched HTML elements, or non-conforming nesting of elements, those will remain. But if you have well-structured HTML bluemonday will not break it.
+
+## TODO
+
+* Add support for CSS sanitisation to allow some CSS properties based on a whitelist, possibly using the [Gorilla CSS3 scanner](http://www.gorillatoolkit.org/pkg/css/scanner) - PRs welcome so long as testing covers XSS and demonstrates safety first
+* Investigate whether devs want to blacklist elements and attributes. This would allow devs to take an existing policy (such as the `bluemonday.UGCPolicy()` ) that encapsulates 90% of what they're looking for but does more than they need, and to remove the extra things they do not want to make it 100% what they want
+* Investigate whether devs want a validating HTML mode, in which the HTML elements are not just transformed into a balanced tree (every start tag has a closing tag at the correct depth) but also that elements and character data appear only in their allowed context (i.e. that a `table` element isn't a descendent of a `caption`, that `colgroup`, `thead`, `tbody`, `tfoot` and `tr` are permitted, and that character data is not permitted)
+
+## Development
+
+If you have cloned this repo you will probably need the dependency:
+
+`go get golang.org/x/net/html`
+
+Gophers can use their familiar tools:
+
+`go build`
+
+`go test`
+
+I personally use a Makefile as it spares typing the same args over and over whilst providing consistency for those of us who jump from language to language and enjoy just typing `make` in a project directory and watch magic happen.
+
+`make` will build, vet, test and install the library.
+
+`make clean` will remove the library from a *single* `${GOPATH}/pkg` directory tree
+
+`make test` will run the tests
+
+`make cover` will run the tests and *open a browser window* with the coverage report
+
+`make lint` will run golint (install via `go get github.com/golang/lint/golint`)
+
+## Long term goals
+
+1. Open the code to adversarial peer review similar to the [Attack Review Ground Rules](https://code.google.com/p/owasp-java-html-sanitizer/wiki/AttackReviewGroundRules)
+1. Raise funds and pay for an external security review
diff --git a/vendor/github.com/microcosm-cc/bluemonday/doc.go b/vendor/github.com/microcosm-cc/bluemonday/doc.go
new file mode 100644
index 000000000..71dab6089
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/doc.go
@@ -0,0 +1,104 @@
+// Copyright (c) 2014, David Kitchen
+//
+// 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 organisation (Microcosm) 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 bluemonday provides a way of describing a whitelist of HTML elements
+and attributes as a policy, and for that policy to be applied to untrusted
+strings from users that may contain markup. All elements and attributes not on
+the whitelist will be stripped.
+
+The default bluemonday.UGCPolicy().Sanitize() turns this:
+
+ Hello World
+
+Into the more harmless:
+
+ Hello World
+
+And it turns this:
+
+ XSS
+
+Into this:
+
+ XSS
+
+Whilst still allowing this:
+
+
+
+
+
+To pass through mostly unaltered (it gained a rel="nofollow"):
+
+
+
+
+
+The primary purpose of bluemonday is to take potentially unsafe user generated
+content (from things like Markdown, HTML WYSIWYG tools, etc) and make it safe
+for you to put on your website.
+
+It protects sites against XSS (http://en.wikipedia.org/wiki/Cross-site_scripting)
+and other malicious content that a user interface may deliver. There are many
+vectors for an XSS attack (https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet)
+and the safest thing to do is to sanitize user input against a known safe list
+of HTML elements and attributes.
+
+Note: You should always run bluemonday after any other processing.
+
+If you use blackfriday (https://github.com/russross/blackfriday) or
+Pandoc (http://johnmacfarlane.net/pandoc/) then bluemonday should be run after
+these steps. This ensures that no insecure HTML is introduced later in your
+process.
+
+bluemonday is heavily inspired by both the OWASP Java HTML Sanitizer
+(https://code.google.com/p/owasp-java-html-sanitizer/) and the HTML Purifier
+(http://htmlpurifier.org/).
+
+We ship two default policies, one is bluemonday.StrictPolicy() and can be
+thought of as equivalent to stripping all HTML elements and their attributes as
+it has nothing on its whitelist.
+
+The other is bluemonday.UGCPolicy() and allows a broad selection of HTML
+elements and attributes that are safe for user generated content. Note that
+this policy does not whitelist iframes, object, embed, styles, script, etc.
+
+The essence of building a policy is to determine which HTML elements and
+attributes are considered safe for your scenario. OWASP provide an XSS
+prevention cheat sheet ( https://www.google.com/search?q=xss+prevention+cheat+sheet )
+to help explain the risks, but essentially:
+
+ 1. Avoid whitelisting anything other than plain HTML elements
+ 2. Avoid whitelisting `script`, `style`, `iframe`, `object`, `embed`, `base`
+ elements
+ 3. Avoid whitelisting anything other than plain HTML elements with simple
+ values that you can match to a regexp
+*/
+package bluemonday
diff --git a/vendor/github.com/microcosm-cc/bluemonday/go.mod b/vendor/github.com/microcosm-cc/bluemonday/go.mod
new file mode 100644
index 000000000..fa8453c5f
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/go.mod
@@ -0,0 +1,5 @@
+module github.com/microcosm-cc/bluemonday
+
+go 1.9
+
+require golang.org/x/net v0.0.0-20181220203305-927f97764cc3
diff --git a/vendor/github.com/microcosm-cc/bluemonday/go.sum b/vendor/github.com/microcosm-cc/bluemonday/go.sum
new file mode 100644
index 000000000..bee241d1c
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/go.sum
@@ -0,0 +1,2 @@
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
diff --git a/vendor/github.com/microcosm-cc/bluemonday/helpers.go b/vendor/github.com/microcosm-cc/bluemonday/helpers.go
new file mode 100644
index 000000000..dfa5868da
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/helpers.go
@@ -0,0 +1,297 @@
+// Copyright (c) 2014, David Kitchen
+//
+// 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 organisation (Microcosm) 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 bluemonday
+
+import (
+ "encoding/base64"
+ "net/url"
+ "regexp"
+)
+
+// A selection of regular expressions that can be used as .Matching() rules on
+// HTML attributes.
+var (
+ // CellAlign handles the `align` attribute
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-align
+ CellAlign = regexp.MustCompile(`(?i)^(center|justify|left|right|char)$`)
+
+ // CellVerticalAlign handles the `valign` attribute
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-valign
+ CellVerticalAlign = regexp.MustCompile(`(?i)^(baseline|bottom|middle|top)$`)
+
+ // Direction handles the `dir` attribute
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo#attr-dir
+ Direction = regexp.MustCompile(`(?i)^(rtl|ltr)$`)
+
+ // ImageAlign handles the `align` attribute on the `image` tag
+ // http://www.w3.org/MarkUp/Test/Img/imgtest.html
+ ImageAlign = regexp.MustCompile(
+ `(?i)^(left|right|top|texttop|middle|absmiddle|baseline|bottom|absbottom)$`,
+ )
+
+ // Integer describes whole positive integers (including 0) used in places
+ // like td.colspan
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-colspan
+ Integer = regexp.MustCompile(`^[0-9]+$`)
+
+ // ISO8601 according to the W3 group is only a subset of the ISO8601
+ // standard: http://www.w3.org/TR/NOTE-datetime
+ //
+ // Used in places like time.datetime
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time#attr-datetime
+ //
+ // Matches patterns:
+ // Year:
+ // YYYY (eg 1997)
+ // Year and month:
+ // YYYY-MM (eg 1997-07)
+ // Complete date:
+ // YYYY-MM-DD (eg 1997-07-16)
+ // Complete date plus hours and minutes:
+ // YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
+ // Complete date plus hours, minutes and seconds:
+ // YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
+ // Complete date plus hours, minutes, seconds and a decimal fraction of a
+ // second
+ // YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
+ ISO8601 = regexp.MustCompile(
+ `^[0-9]{4}(-[0-9]{2}(-[0-9]{2}([ T][0-9]{2}(:[0-9]{2}){1,2}(.[0-9]{1,6})` +
+ `?Z?([\+-][0-9]{2}:[0-9]{2})?)?)?)?$`,
+ )
+
+ // ListType encapsulates the common value as well as the latest spec
+ // values for lists
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol#attr-type
+ ListType = regexp.MustCompile(`(?i)^(circle|disc|square|a|A|i|I|1)$`)
+
+ // SpaceSeparatedTokens is used in places like `a.rel` and the common attribute
+ // `class` which both contain space delimited lists of data tokens
+ // http://www.w3.org/TR/html-markup/datatypes.html#common.data.tokens-def
+ // Regexp: \p{L} matches unicode letters, \p{N} matches unicode numbers
+ SpaceSeparatedTokens = regexp.MustCompile(`^([\s\p{L}\p{N}_-]+)$`)
+
+ // Number is a double value used on HTML5 meter and progress elements
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-meter-element
+ Number = regexp.MustCompile(`^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$`)
+
+ // NumberOrPercent is used predominantly as units of measurement in width
+ // and height attributes
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-height
+ NumberOrPercent = regexp.MustCompile(`^[0-9]+[%]?$`)
+
+ // Paragraph of text in an attribute such as *.'title', img.alt, etc
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-title
+ // Note that we are not allowing chars that could close tags like '>'
+ Paragraph = regexp.MustCompile(`^[\p{L}\p{N}\s\-_',\[\]!\./\\\(\)]*$`)
+
+ // dataURIImagePrefix is used by AllowDataURIImages to define the acceptable
+ // prefix of data URIs that contain common web image formats.
+ //
+ // This is not exported as it's not useful by itself, and only has value
+ // within the AllowDataURIImages func
+ dataURIImagePrefix = regexp.MustCompile(
+ `^image/(gif|jpeg|png|webp);base64,`,
+ )
+)
+
+// AllowStandardURLs is a convenience function that will enable rel="nofollow"
+// on "a", "area" and "link" (if you have allowed those elements) and will
+// ensure that the URL values are parseable and either relative or belong to the
+// "mailto", "http", or "https" schemes
+func (p *Policy) AllowStandardURLs() {
+ // URLs must be parseable by net/url.Parse()
+ p.RequireParseableURLs(true)
+
+ // !url.IsAbs() is permitted
+ p.AllowRelativeURLs(true)
+
+ // Most common URL schemes only
+ p.AllowURLSchemes("mailto", "http", "https")
+
+ // For all anchors we will add rel="nofollow" if it does not already exist
+ // This applies to "a" "area" "link"
+ p.RequireNoFollowOnLinks(true)
+}
+
+// AllowStandardAttributes will enable "id", "title" and the language specific
+// attributes "dir" and "lang" on all elements that are whitelisted
+func (p *Policy) AllowStandardAttributes() {
+ // "dir" "lang" are permitted as both language attributes affect charsets
+ // and direction of text.
+ p.AllowAttrs("dir").Matching(Direction).Globally()
+ p.AllowAttrs(
+ "lang",
+ ).Matching(regexp.MustCompile(`[a-zA-Z]{2,20}`)).Globally()
+
+ // "id" is permitted. This is pretty much as some HTML elements require this
+ // to work well ("dfn" is an example of a "id" being value)
+ // This does create a risk that JavaScript and CSS within your web page
+ // might identify the wrong elements. Ensure that you select things
+ // accurately
+ p.AllowAttrs("id").Matching(
+ regexp.MustCompile(`[a-zA-Z0-9\:\-_\.]+`),
+ ).Globally()
+
+ // "title" is permitted as it improves accessibility.
+ p.AllowAttrs("title").Matching(Paragraph).Globally()
+}
+
+// AllowStyling presently enables the class attribute globally.
+//
+// Note: When bluemonday ships a CSS parser and we can safely sanitise that,
+// this will also allow sanitized styling of elements via the style attribute.
+func (p *Policy) AllowStyling() {
+
+ // "class" is permitted globally
+ p.AllowAttrs("class").Matching(SpaceSeparatedTokens).Globally()
+}
+
+// AllowImages enables the img element and some popular attributes. It will also
+// ensure that URL values are parseable. This helper does not enable data URI
+// images, for that you should also use the AllowDataURIImages() helper.
+func (p *Policy) AllowImages() {
+
+ // "img" is permitted
+ p.AllowAttrs("align").Matching(ImageAlign).OnElements("img")
+ p.AllowAttrs("alt").Matching(Paragraph).OnElements("img")
+ p.AllowAttrs("height", "width").Matching(NumberOrPercent).OnElements("img")
+
+ // Standard URLs enabled
+ p.AllowStandardURLs()
+ p.AllowAttrs("src").OnElements("img")
+}
+
+// AllowDataURIImages permits the use of inline images defined in RFC2397
+// http://tools.ietf.org/html/rfc2397
+// http://en.wikipedia.org/wiki/Data_URI_scheme
+//
+// Images must have a mimetype matching:
+// image/gif
+// image/jpeg
+// image/png
+// image/webp
+//
+// NOTE: There is a potential security risk to allowing data URIs and you should
+// only permit them on content you already trust.
+// http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/
+// https://capec.mitre.org/data/definitions/244.html
+func (p *Policy) AllowDataURIImages() {
+
+ // URLs must be parseable by net/url.Parse()
+ p.RequireParseableURLs(true)
+
+ // Supply a function to validate images contained within data URI
+ p.AllowURLSchemeWithCustomPolicy(
+ "data",
+ func(url *url.URL) (allowUrl bool) {
+ if url.RawQuery != "" || url.Fragment != "" {
+ return false
+ }
+
+ matched := dataURIImagePrefix.FindString(url.Opaque)
+ if matched == "" {
+ return false
+ }
+
+ _, err := base64.StdEncoding.DecodeString(url.Opaque[len(matched):])
+ if err != nil {
+ return false
+ }
+
+ return true
+ },
+ )
+}
+
+// AllowLists will enabled ordered and unordered lists, as well as definition
+// lists
+func (p *Policy) AllowLists() {
+ // "ol" "ul" are permitted
+ p.AllowAttrs("type").Matching(ListType).OnElements("ol", "ul")
+
+ // "li" is permitted
+ p.AllowAttrs("type").Matching(ListType).OnElements("li")
+ p.AllowAttrs("value").Matching(Integer).OnElements("li")
+
+ // "dl" "dt" "dd" are permitted
+ p.AllowElements("dl", "dt", "dd")
+}
+
+// AllowTables will enable a rich set of elements and attributes to describe
+// HTML tables
+func (p *Policy) AllowTables() {
+
+ // "table" is permitted
+ p.AllowAttrs("height", "width").Matching(NumberOrPercent).OnElements("table")
+ p.AllowAttrs("summary").Matching(Paragraph).OnElements("table")
+
+ // "caption" is permitted
+ p.AllowElements("caption")
+
+ // "col" "colgroup" are permitted
+ p.AllowAttrs("align").Matching(CellAlign).OnElements("col", "colgroup")
+ p.AllowAttrs("height", "width").Matching(
+ NumberOrPercent,
+ ).OnElements("col", "colgroup")
+ p.AllowAttrs("span").Matching(Integer).OnElements("colgroup", "col")
+ p.AllowAttrs("valign").Matching(
+ CellVerticalAlign,
+ ).OnElements("col", "colgroup")
+
+ // "thead" "tr" are permitted
+ p.AllowAttrs("align").Matching(CellAlign).OnElements("thead", "tr")
+ p.AllowAttrs("valign").Matching(CellVerticalAlign).OnElements("thead", "tr")
+
+ // "td" "th" are permitted
+ p.AllowAttrs("abbr").Matching(Paragraph).OnElements("td", "th")
+ p.AllowAttrs("align").Matching(CellAlign).OnElements("td", "th")
+ p.AllowAttrs("colspan", "rowspan").Matching(Integer).OnElements("td", "th")
+ p.AllowAttrs("headers").Matching(
+ SpaceSeparatedTokens,
+ ).OnElements("td", "th")
+ p.AllowAttrs("height", "width").Matching(
+ NumberOrPercent,
+ ).OnElements("td", "th")
+ p.AllowAttrs(
+ "scope",
+ ).Matching(
+ regexp.MustCompile(`(?i)(?:row|col)(?:group)?`),
+ ).OnElements("td", "th")
+ p.AllowAttrs("valign").Matching(CellVerticalAlign).OnElements("td", "th")
+ p.AllowAttrs("nowrap").Matching(
+ regexp.MustCompile(`(?i)|nowrap`),
+ ).OnElements("td", "th")
+
+ // "tbody" "tfoot"
+ p.AllowAttrs("align").Matching(CellAlign).OnElements("tbody", "tfoot")
+ p.AllowAttrs("valign").Matching(
+ CellVerticalAlign,
+ ).OnElements("tbody", "tfoot")
+}
diff --git a/vendor/github.com/microcosm-cc/bluemonday/policies.go b/vendor/github.com/microcosm-cc/bluemonday/policies.go
new file mode 100644
index 000000000..570bba886
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/policies.go
@@ -0,0 +1,253 @@
+// Copyright (c) 2014, David Kitchen
+//
+// 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 organisation (Microcosm) 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 bluemonday
+
+import (
+ "regexp"
+)
+
+// StrictPolicy returns an empty policy, which will effectively strip all HTML
+// elements and their attributes from a document.
+func StrictPolicy() *Policy {
+ return NewPolicy()
+}
+
+// StripTagsPolicy is DEPRECATED. Use StrictPolicy instead.
+func StripTagsPolicy() *Policy {
+ return StrictPolicy()
+}
+
+// UGCPolicy returns a policy aimed at user generated content that is a result
+// of HTML WYSIWYG tools and Markdown conversions.
+//
+// This is expected to be a fairly rich document where as much markup as
+// possible should be retained. Markdown permits raw HTML so we are basically
+// providing a policy to sanitise HTML5 documents safely but with the
+// least intrusion on the formatting expectations of the user.
+func UGCPolicy() *Policy {
+
+ p := NewPolicy()
+
+ ///////////////////////
+ // Global attributes //
+ ///////////////////////
+
+ // "class" is not permitted as we are not allowing users to style their own
+ // content
+
+ p.AllowStandardAttributes()
+
+ //////////////////////////////
+ // Global URL format policy //
+ //////////////////////////////
+
+ p.AllowStandardURLs()
+
+ ////////////////////////////////
+ // Declarations and structure //
+ ////////////////////////////////
+
+ // "xml" "xslt" "DOCTYPE" "html" "head" are not permitted as we are
+ // expecting user generated content to be a fragment of HTML and not a full
+ // document.
+
+ //////////////////////////
+ // Sectioning root tags //
+ //////////////////////////
+
+ // "article" and "aside" are permitted and takes no attributes
+ p.AllowElements("article", "aside")
+
+ // "body" is not permitted as we are expecting user generated content to be a fragment
+ // of HTML and not a full document.
+
+ // "details" is permitted, including the "open" attribute which can either
+ // be blank or the value "open".
+ p.AllowAttrs(
+ "open",
+ ).Matching(regexp.MustCompile(`(?i)^(|open)$`)).OnElements("details")
+
+ // "fieldset" is not permitted as we are not allowing forms to be created.
+
+ // "figure" is permitted and takes no attributes
+ p.AllowElements("figure")
+
+ // "nav" is not permitted as it is assumed that the site (and not the user)
+ // has defined navigation elements
+
+ // "section" is permitted and takes no attributes
+ p.AllowElements("section")
+
+ // "summary" is permitted and takes no attributes
+ p.AllowElements("summary")
+
+ //////////////////////////
+ // Headings and footers //
+ //////////////////////////
+
+ // "footer" is not permitted as we expect user content to be a fragment and
+ // not structural to this extent
+
+ // "h1" through "h6" are permitted and take no attributes
+ p.AllowElements("h1", "h2", "h3", "h4", "h5", "h6")
+
+ // "header" is not permitted as we expect user content to be a fragment and
+ // not structural to this extent
+
+ // "hgroup" is permitted and takes no attributes
+ p.AllowElements("hgroup")
+
+ /////////////////////////////////////
+ // Content grouping and separating //
+ /////////////////////////////////////
+
+ // "blockquote" is permitted, including the "cite" attribute which must be
+ // a standard URL.
+ p.AllowAttrs("cite").OnElements("blockquote")
+
+ // "br" "div" "hr" "p" "span" "wbr" are permitted and take no attributes
+ p.AllowElements("br", "div", "hr", "p", "span", "wbr")
+
+ ///////////
+ // Links //
+ ///////////
+
+ // "a" is permitted
+ p.AllowAttrs("href").OnElements("a")
+
+ // "area" is permitted along with the attributes that map image maps work
+ p.AllowAttrs("name").Matching(
+ regexp.MustCompile(`^([\p{L}\p{N}_-]+)$`),
+ ).OnElements("map")
+ p.AllowAttrs("alt").Matching(Paragraph).OnElements("area")
+ p.AllowAttrs("coords").Matching(
+ regexp.MustCompile(`^([0-9]+,)+[0-9]+$`),
+ ).OnElements("area")
+ p.AllowAttrs("href").OnElements("area")
+ p.AllowAttrs("rel").Matching(SpaceSeparatedTokens).OnElements("area")
+ p.AllowAttrs("shape").Matching(
+ regexp.MustCompile(`(?i)^(default|circle|rect|poly)$`),
+ ).OnElements("area")
+ p.AllowAttrs("usemap").Matching(
+ regexp.MustCompile(`(?i)^#[\p{L}\p{N}_-]+$`),
+ ).OnElements("img")
+
+ // "link" is not permitted
+
+ /////////////////////
+ // Phrase elements //
+ /////////////////////
+
+ // The following are all inline phrasing elements
+ p.AllowElements("abbr", "acronym", "cite", "code", "dfn", "em",
+ "figcaption", "mark", "s", "samp", "strong", "sub", "sup", "var")
+
+ // "q" is permitted and "cite" is a URL and handled by URL policies
+ p.AllowAttrs("cite").OnElements("q")
+
+ // "time" is permitted
+ p.AllowAttrs("datetime").Matching(ISO8601).OnElements("time")
+
+ ////////////////////
+ // Style elements //
+ ////////////////////
+
+ // block and inline elements that impart no semantic meaning but style the
+ // document
+ p.AllowElements("b", "i", "pre", "small", "strike", "tt", "u")
+
+ // "style" is not permitted as we are not yet sanitising CSS and it is an
+ // XSS attack vector
+
+ //////////////////////
+ // HTML5 Formatting //
+ //////////////////////
+
+ // "bdi" "bdo" are permitted
+ p.AllowAttrs("dir").Matching(Direction).OnElements("bdi", "bdo")
+
+ // "rp" "rt" "ruby" are permitted
+ p.AllowElements("rp", "rt", "ruby")
+
+ ///////////////////////////
+ // HTML5 Change tracking //
+ ///////////////////////////
+
+ // "del" "ins" are permitted
+ p.AllowAttrs("cite").Matching(Paragraph).OnElements("del", "ins")
+ p.AllowAttrs("datetime").Matching(ISO8601).OnElements("del", "ins")
+
+ ///////////
+ // Lists //
+ ///////////
+
+ p.AllowLists()
+
+ ////////////
+ // Tables //
+ ////////////
+
+ p.AllowTables()
+
+ ///////////
+ // Forms //
+ ///////////
+
+ // By and large, forms are not permitted. However there are some form
+ // elements that can be used to present data, and we do permit those
+ //
+ // "button" "fieldset" "input" "keygen" "label" "output" "select" "datalist"
+ // "textarea" "optgroup" "option" are all not permitted
+
+ // "meter" is permitted
+ p.AllowAttrs(
+ "value",
+ "min",
+ "max",
+ "low",
+ "high",
+ "optimum",
+ ).Matching(Number).OnElements("meter")
+
+ // "progress" is permitted
+ p.AllowAttrs("value", "max").Matching(Number).OnElements("progress")
+
+ //////////////////////
+ // Embedded content //
+ //////////////////////
+
+ // Vast majority not permitted
+ // "audio" "canvas" "embed" "iframe" "object" "param" "source" "svg" "track"
+ // "video" are all not permitted
+
+ p.AllowImages()
+
+ return p
+}
diff --git a/vendor/github.com/microcosm-cc/bluemonday/policy.go b/vendor/github.com/microcosm-cc/bluemonday/policy.go
new file mode 100644
index 000000000..f61d98f59
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/policy.go
@@ -0,0 +1,552 @@
+// Copyright (c) 2014, David Kitchen
+//
+// 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 organisation (Microcosm) 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 bluemonday
+
+import (
+ "net/url"
+ "regexp"
+ "strings"
+)
+
+// Policy encapsulates the whitelist of HTML elements and attributes that will
+// be applied to the sanitised HTML.
+//
+// You should use bluemonday.NewPolicy() to create a blank policy as the
+// unexported fields contain maps that need to be initialized.
+type Policy struct {
+
+ // Declares whether the maps have been initialized, used as a cheap check to
+ // ensure that those using Policy{} directly won't cause nil pointer
+ // exceptions
+ initialized bool
+
+ // If true then we add spaces when stripping tags, specifically the closing
+ // tag is replaced by a space character.
+ addSpaces bool
+
+ // When true, add rel="nofollow" to HTML anchors
+ requireNoFollow bool
+
+ // When true, add rel="nofollow" to HTML anchors
+ // Will add for href="http://foo"
+ // Will skip for href="/foo" or href="foo"
+ requireNoFollowFullyQualifiedLinks bool
+
+ // When true add target="_blank" to fully qualified links
+ // Will add for href="http://foo"
+ // Will skip for href="/foo" or href="foo"
+ addTargetBlankToFullyQualifiedLinks bool
+
+ // When true, URLs must be parseable by "net/url" url.Parse()
+ requireParseableURLs bool
+
+ // When true, u, _ := url.Parse("url"); !u.IsAbs() is permitted
+ allowRelativeURLs bool
+
+ // When true, allow data attributes.
+ allowDataAttributes bool
+
+ // map[htmlElementName]map[htmlAttributeName]attrPolicy
+ elsAndAttrs map[string]map[string]attrPolicy
+
+ // map[htmlAttributeName]attrPolicy
+ globalAttrs map[string]attrPolicy
+
+ // If urlPolicy is nil, all URLs with matching schema are allowed.
+ // Otherwise, only the URLs with matching schema and urlPolicy(url)
+ // returning true are allowed.
+ allowURLSchemes map[string]urlPolicy
+
+ // If an element has had all attributes removed as a result of a policy
+ // being applied, then the element would be removed from the output.
+ //
+ // However some elements are valid and have strong layout meaning without
+ // any attributes, i.e. . To prevent those being removed we maintain
+ // a list of elements that are allowed to have no attributes and that will
+ // be maintained in the output HTML.
+ setOfElementsAllowedWithoutAttrs map[string]struct{}
+
+ setOfElementsToSkipContent map[string]struct{}
+}
+
+type attrPolicy struct {
+
+ // optional pattern to match, when not nil the regexp needs to match
+ // otherwise the attribute is removed
+ regexp *regexp.Regexp
+}
+
+type attrPolicyBuilder struct {
+ p *Policy
+
+ attrNames []string
+ regexp *regexp.Regexp
+ allowEmpty bool
+}
+
+type urlPolicy func(url *url.URL) (allowUrl bool)
+
+// init initializes the maps if this has not been done already
+func (p *Policy) init() {
+ if !p.initialized {
+ p.elsAndAttrs = make(map[string]map[string]attrPolicy)
+ p.globalAttrs = make(map[string]attrPolicy)
+ p.allowURLSchemes = make(map[string]urlPolicy)
+ p.setOfElementsAllowedWithoutAttrs = make(map[string]struct{})
+ p.setOfElementsToSkipContent = make(map[string]struct{})
+ p.initialized = true
+ }
+}
+
+// NewPolicy returns a blank policy with nothing whitelisted or permitted. This
+// is the recommended way to start building a policy and you should now use
+// AllowAttrs() and/or AllowElements() to construct the whitelist of HTML
+// elements and attributes.
+func NewPolicy() *Policy {
+
+ p := Policy{}
+
+ p.addDefaultElementsWithoutAttrs()
+ p.addDefaultSkipElementContent()
+
+ return &p
+}
+
+// AllowAttrs takes a range of HTML attribute names and returns an
+// attribute policy builder that allows you to specify the pattern and scope of
+// the whitelisted attribute.
+//
+// The attribute policy is only added to the core policy when either Globally()
+// or OnElements(...) are called.
+func (p *Policy) AllowAttrs(attrNames ...string) *attrPolicyBuilder {
+
+ p.init()
+
+ abp := attrPolicyBuilder{
+ p: p,
+ allowEmpty: false,
+ }
+
+ for _, attrName := range attrNames {
+ abp.attrNames = append(abp.attrNames, strings.ToLower(attrName))
+ }
+
+ return &abp
+}
+
+// AllowDataAttributes whitelists all data attributes. We can't specify the name
+// of each attribute exactly as they are customized.
+//
+// NOTE: These values are not sanitized and applications that evaluate or process
+// them without checking and verification of the input may be at risk if this option
+// is enabled. This is a 'caveat emptor' option and the person enabling this option
+// needs to fully understand the potential impact with regards to whatever application
+// will be consuming the sanitized HTML afterwards, i.e. if you know you put a link in a
+// data attribute and use that to automatically load some new window then you're giving
+// the author of a HTML fragment the means to open a malicious destination automatically.
+// Use with care!
+func (p *Policy) AllowDataAttributes() {
+ p.allowDataAttributes = true
+}
+
+// AllowNoAttrs says that attributes on element are optional.
+//
+// The attribute policy is only added to the core policy when OnElements(...)
+// are called.
+func (p *Policy) AllowNoAttrs() *attrPolicyBuilder {
+
+ p.init()
+
+ abp := attrPolicyBuilder{
+ p: p,
+ allowEmpty: true,
+ }
+ return &abp
+}
+
+// AllowNoAttrs says that attributes on element are optional.
+//
+// The attribute policy is only added to the core policy when OnElements(...)
+// are called.
+func (abp *attrPolicyBuilder) AllowNoAttrs() *attrPolicyBuilder {
+
+ abp.allowEmpty = true
+
+ return abp
+}
+
+// Matching allows a regular expression to be applied to a nascent attribute
+// policy, and returns the attribute policy. Calling this more than once will
+// replace the existing regexp.
+func (abp *attrPolicyBuilder) Matching(regex *regexp.Regexp) *attrPolicyBuilder {
+
+ abp.regexp = regex
+
+ return abp
+}
+
+// OnElements will bind an attribute policy to a given range of HTML elements
+// and return the updated policy
+func (abp *attrPolicyBuilder) OnElements(elements ...string) *Policy {
+
+ for _, element := range elements {
+ element = strings.ToLower(element)
+
+ for _, attr := range abp.attrNames {
+
+ if _, ok := abp.p.elsAndAttrs[element]; !ok {
+ abp.p.elsAndAttrs[element] = make(map[string]attrPolicy)
+ }
+
+ ap := attrPolicy{}
+ if abp.regexp != nil {
+ ap.regexp = abp.regexp
+ }
+
+ abp.p.elsAndAttrs[element][attr] = ap
+ }
+
+ if abp.allowEmpty {
+ abp.p.setOfElementsAllowedWithoutAttrs[element] = struct{}{}
+
+ if _, ok := abp.p.elsAndAttrs[element]; !ok {
+ abp.p.elsAndAttrs[element] = make(map[string]attrPolicy)
+ }
+ }
+ }
+
+ return abp.p
+}
+
+// Globally will bind an attribute policy to all HTML elements and return the
+// updated policy
+func (abp *attrPolicyBuilder) Globally() *Policy {
+
+ for _, attr := range abp.attrNames {
+ if _, ok := abp.p.globalAttrs[attr]; !ok {
+ abp.p.globalAttrs[attr] = attrPolicy{}
+ }
+
+ ap := attrPolicy{}
+ if abp.regexp != nil {
+ ap.regexp = abp.regexp
+ }
+
+ abp.p.globalAttrs[attr] = ap
+ }
+
+ return abp.p
+}
+
+// AllowElements will append HTML elements to the whitelist without applying an
+// attribute policy to those elements (the elements are permitted
+// sans-attributes)
+func (p *Policy) AllowElements(names ...string) *Policy {
+ p.init()
+
+ for _, element := range names {
+ element = strings.ToLower(element)
+
+ if _, ok := p.elsAndAttrs[element]; !ok {
+ p.elsAndAttrs[element] = make(map[string]attrPolicy)
+ }
+ }
+
+ return p
+}
+
+// RequireNoFollowOnLinks will result in all tags having a rel="nofollow"
+// added to them if one does not already exist
+//
+// Note: This requires p.RequireParseableURLs(true) and will enable it.
+func (p *Policy) RequireNoFollowOnLinks(require bool) *Policy {
+
+ p.requireNoFollow = require
+ p.requireParseableURLs = true
+
+ return p
+}
+
+// RequireNoFollowOnFullyQualifiedLinks will result in all tags that point
+// to a non-local destination (i.e. starts with a protocol and has a host)
+// having a rel="nofollow" added to them if one does not already exist
+//
+// Note: This requires p.RequireParseableURLs(true) and will enable it.
+func (p *Policy) RequireNoFollowOnFullyQualifiedLinks(require bool) *Policy {
+
+ p.requireNoFollowFullyQualifiedLinks = require
+ p.requireParseableURLs = true
+
+ return p
+}
+
+// AddTargetBlankToFullyQualifiedLinks will result in all tags that point
+// to a non-local destination (i.e. starts with a protocol and has a host)
+// having a target="_blank" added to them if one does not already exist
+//
+// Note: This requires p.RequireParseableURLs(true) and will enable it.
+func (p *Policy) AddTargetBlankToFullyQualifiedLinks(require bool) *Policy {
+
+ p.addTargetBlankToFullyQualifiedLinks = require
+ p.requireParseableURLs = true
+
+ return p
+}
+
+// RequireParseableURLs will result in all URLs requiring that they be parseable
+// by "net/url" url.Parse()
+// This applies to:
+// - a.href
+// - area.href
+// - blockquote.cite
+// - img.src
+// - link.href
+// - script.src
+func (p *Policy) RequireParseableURLs(require bool) *Policy {
+
+ p.requireParseableURLs = require
+
+ return p
+}
+
+// AllowRelativeURLs enables RequireParseableURLs and then permits URLs that
+// are parseable, have no schema information and url.IsAbs() returns false
+// This permits local URLs
+func (p *Policy) AllowRelativeURLs(require bool) *Policy {
+
+ p.RequireParseableURLs(true)
+ p.allowRelativeURLs = require
+
+ return p
+}
+
+// AllowURLSchemes will append URL schemes to the whitelist
+// Example: p.AllowURLSchemes("mailto", "http", "https")
+func (p *Policy) AllowURLSchemes(schemes ...string) *Policy {
+ p.init()
+
+ p.RequireParseableURLs(true)
+
+ for _, scheme := range schemes {
+ scheme = strings.ToLower(scheme)
+
+ // Allow all URLs with matching scheme.
+ p.allowURLSchemes[scheme] = nil
+ }
+
+ return p
+}
+
+// AllowURLSchemeWithCustomPolicy will append URL schemes with
+// a custom URL policy to the whitelist.
+// Only the URLs with matching schema and urlPolicy(url)
+// returning true will be allowed.
+func (p *Policy) AllowURLSchemeWithCustomPolicy(
+ scheme string,
+ urlPolicy func(url *url.URL) (allowUrl bool),
+) *Policy {
+
+ p.init()
+
+ p.RequireParseableURLs(true)
+
+ scheme = strings.ToLower(scheme)
+
+ p.allowURLSchemes[scheme] = urlPolicy
+
+ return p
+}
+
+// AddSpaceWhenStrippingTag states whether to add a single space " " when
+// removing tags that are not whitelisted by the policy.
+//
+// This is useful if you expect to strip tags in dense markup and may lose the
+// value of whitespace.
+//
+// For example: "Hello
World
"" would be sanitized to "HelloWorld"
+// with the default value of false, but you may wish to sanitize this to
+// " Hello World " by setting AddSpaceWhenStrippingTag to true as this would
+// retain the intent of the text.
+func (p *Policy) AddSpaceWhenStrippingTag(allow bool) *Policy {
+
+ p.addSpaces = allow
+
+ return p
+}
+
+// SkipElementsContent adds the HTML elements whose tags is needed to be removed
+// with its content.
+func (p *Policy) SkipElementsContent(names ...string) *Policy {
+
+ p.init()
+
+ for _, element := range names {
+ element = strings.ToLower(element)
+
+ if _, ok := p.setOfElementsToSkipContent[element]; !ok {
+ p.setOfElementsToSkipContent[element] = struct{}{}
+ }
+ }
+
+ return p
+}
+
+// AllowElementsContent marks the HTML elements whose content should be
+// retained after removing the tag.
+func (p *Policy) AllowElementsContent(names ...string) *Policy {
+
+ p.init()
+
+ for _, element := range names {
+ delete(p.setOfElementsToSkipContent, strings.ToLower(element))
+ }
+
+ return p
+}
+
+// addDefaultElementsWithoutAttrs adds the HTML elements that we know are valid
+// without any attributes to an internal map.
+// i.e. we know that is valid, but isn't valid as the "dir" attr
+// is mandatory
+func (p *Policy) addDefaultElementsWithoutAttrs() {
+ p.init()
+
+ p.setOfElementsAllowedWithoutAttrs["abbr"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["acronym"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["address"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["article"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["aside"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["audio"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["b"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["bdi"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["blockquote"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["body"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["br"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["button"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["canvas"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["caption"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["center"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["cite"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["code"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["col"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["colgroup"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["datalist"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["dd"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["del"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["details"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["dfn"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["div"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["dl"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["dt"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["em"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["fieldset"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["figcaption"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["figure"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["footer"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["h1"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["h2"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["h3"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["h4"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["h5"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["h6"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["head"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["header"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["hgroup"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["hr"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["html"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["i"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["ins"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["kbd"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["li"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["mark"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["marquee"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["nav"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["ol"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["optgroup"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["option"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["p"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["pre"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["q"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["rp"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["rt"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["ruby"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["s"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["samp"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["script"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["section"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["select"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["small"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["span"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["strike"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["strong"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["style"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["sub"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["summary"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["sup"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["svg"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["table"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["tbody"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["td"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["textarea"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["tfoot"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["th"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["thead"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["title"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["time"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["tr"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["tt"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["u"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["ul"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["var"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["video"] = struct{}{}
+ p.setOfElementsAllowedWithoutAttrs["wbr"] = struct{}{}
+
+}
+
+// addDefaultSkipElementContent adds the HTML elements that we should skip
+// rendering the character content of, if the element itself is not allowed.
+// This is all character data that the end user would not normally see.
+// i.e. if we exclude a tag.
+func (p *Policy) addDefaultSkipElementContent() {
+ p.init()
+
+ p.setOfElementsToSkipContent["frame"] = struct{}{}
+ p.setOfElementsToSkipContent["frameset"] = struct{}{}
+ p.setOfElementsToSkipContent["iframe"] = struct{}{}
+ p.setOfElementsToSkipContent["noembed"] = struct{}{}
+ p.setOfElementsToSkipContent["noframes"] = struct{}{}
+ p.setOfElementsToSkipContent["noscript"] = struct{}{}
+ p.setOfElementsToSkipContent["nostyle"] = struct{}{}
+ p.setOfElementsToSkipContent["object"] = struct{}{}
+ p.setOfElementsToSkipContent["script"] = struct{}{}
+ p.setOfElementsToSkipContent["style"] = struct{}{}
+ p.setOfElementsToSkipContent["title"] = struct{}{}
+}
diff --git a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go
new file mode 100644
index 000000000..65ed89b79
--- /dev/null
+++ b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go
@@ -0,0 +1,581 @@
+// Copyright (c) 2014, David Kitchen
+//
+// 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 organisation (Microcosm) 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 bluemonday
+
+import (
+ "bytes"
+ "io"
+ "net/url"
+ "regexp"
+ "strings"
+
+ "golang.org/x/net/html"
+)
+
+var (
+ dataAttribute = regexp.MustCompile("^data-.+")
+ dataAttributeXMLPrefix = regexp.MustCompile("^xml.+")
+ dataAttributeInvalidChars = regexp.MustCompile("[A-Z;]+")
+)
+
+// Sanitize takes a string that contains a HTML fragment or document and applies
+// the given policy whitelist.
+//
+// It returns a HTML string that has been sanitized by the policy or an empty
+// string if an error has occurred (most likely as a consequence of extremely
+// malformed input)
+func (p *Policy) Sanitize(s string) string {
+ if strings.TrimSpace(s) == "" {
+ return s
+ }
+
+ return p.sanitize(strings.NewReader(s)).String()
+}
+
+// SanitizeBytes takes a []byte that contains a HTML fragment or document and applies
+// the given policy whitelist.
+//
+// It returns a []byte containing the HTML that has been sanitized by the policy
+// or an empty []byte if an error has occurred (most likely as a consequence of
+// extremely malformed input)
+func (p *Policy) SanitizeBytes(b []byte) []byte {
+ if len(bytes.TrimSpace(b)) == 0 {
+ return b
+ }
+
+ return p.sanitize(bytes.NewReader(b)).Bytes()
+}
+
+// SanitizeReader takes an io.Reader that contains a HTML fragment or document
+// and applies the given policy whitelist.
+//
+// It returns a bytes.Buffer containing the HTML that has been sanitized by the
+// policy. Errors during sanitization will merely return an empty result.
+func (p *Policy) SanitizeReader(r io.Reader) *bytes.Buffer {
+ return p.sanitize(r)
+}
+
+// Performs the actual sanitization process.
+func (p *Policy) sanitize(r io.Reader) *bytes.Buffer {
+
+ // It is possible that the developer has created the policy via:
+ // p := bluemonday.Policy{}
+ // rather than:
+ // p := bluemonday.NewPolicy()
+ // If this is the case, and if they haven't yet triggered an action that
+ // would initiliaze the maps, then we need to do that.
+ p.init()
+
+ var (
+ buff bytes.Buffer
+ skipElementContent bool
+ skippingElementsCount int64
+ skipClosingTag bool
+ closingTagToSkipStack []string
+ mostRecentlyStartedToken string
+ )
+
+ tokenizer := html.NewTokenizer(r)
+ for {
+ if tokenizer.Next() == html.ErrorToken {
+ err := tokenizer.Err()
+ if err == io.EOF {
+ // End of input means end of processing
+ return &buff
+ }
+
+ // Raw tokenizer error
+ return &bytes.Buffer{}
+ }
+
+ token := tokenizer.Token()
+ switch token.Type {
+ case html.DoctypeToken:
+
+ // DocType is not handled as there is no safe parsing mechanism
+ // provided by golang.org/x/net/html for the content, and this can
+ // be misused to insert HTML tags that are not then sanitized
+ //
+ // One might wish to recursively sanitize here using the same policy
+ // but I will need to do some further testing before considering
+ // this.
+
+ case html.CommentToken:
+
+ // Comments are ignored by default
+
+ case html.StartTagToken:
+
+ mostRecentlyStartedToken = token.Data
+
+ aps, ok := p.elsAndAttrs[token.Data]
+ if !ok {
+ if _, ok := p.setOfElementsToSkipContent[token.Data]; ok {
+ skipElementContent = true
+ skippingElementsCount++
+ }
+ if p.addSpaces {
+ buff.WriteString(" ")
+ }
+ break
+ }
+
+ if len(token.Attr) != 0 {
+ token.Attr = p.sanitizeAttrs(token.Data, token.Attr, aps)
+ }
+
+ if len(token.Attr) == 0 {
+ if !p.allowNoAttrs(token.Data) {
+ skipClosingTag = true
+ closingTagToSkipStack = append(closingTagToSkipStack, token.Data)
+ if p.addSpaces {
+ buff.WriteString(" ")
+ }
+ break
+ }
+ }
+
+ if !skipElementContent {
+ buff.WriteString(token.String())
+ }
+
+ case html.EndTagToken:
+
+ if mostRecentlyStartedToken == token.Data {
+ mostRecentlyStartedToken = ""
+ }
+
+ if skipClosingTag && closingTagToSkipStack[len(closingTagToSkipStack)-1] == token.Data {
+ closingTagToSkipStack = closingTagToSkipStack[:len(closingTagToSkipStack)-1]
+ if len(closingTagToSkipStack) == 0 {
+ skipClosingTag = false
+ }
+ if p.addSpaces {
+ buff.WriteString(" ")
+ }
+ break
+ }
+
+ if _, ok := p.elsAndAttrs[token.Data]; !ok {
+ if _, ok := p.setOfElementsToSkipContent[token.Data]; ok {
+ skippingElementsCount--
+ if skippingElementsCount == 0 {
+ skipElementContent = false
+ }
+ }
+ if p.addSpaces {
+ buff.WriteString(" ")
+ }
+ break
+ }
+
+ if !skipElementContent {
+ buff.WriteString(token.String())
+ }
+
+ case html.SelfClosingTagToken:
+
+ aps, ok := p.elsAndAttrs[token.Data]
+ if !ok {
+ if p.addSpaces {
+ buff.WriteString(" ")
+ }
+ break
+ }
+
+ if len(token.Attr) != 0 {
+ token.Attr = p.sanitizeAttrs(token.Data, token.Attr, aps)
+ }
+
+ if len(token.Attr) == 0 && !p.allowNoAttrs(token.Data) {
+ if p.addSpaces {
+ buff.WriteString(" ")
+ }
+ break
+ }
+
+ if !skipElementContent {
+ buff.WriteString(token.String())
+ }
+
+ case html.TextToken:
+
+ if !skipElementContent {
+ switch mostRecentlyStartedToken {
+ case "script":
+ // not encouraged, but if a policy allows JavaScript we
+ // should not HTML escape it as that would break the output
+ buff.WriteString(token.Data)
+ case "style":
+ // not encouraged, but if a policy allows CSS styles we
+ // should not HTML escape it as that would break the output
+ buff.WriteString(token.Data)
+ default:
+ // HTML escape the text
+ buff.WriteString(token.String())
+ }
+ }
+ default:
+ // A token that didn't exist in the html package when we wrote this
+ return &bytes.Buffer{}
+ }
+ }
+}
+
+// sanitizeAttrs takes a set of element attribute policies and the global
+// attribute policies and applies them to the []html.Attribute returning a set
+// of html.Attributes that match the policies
+func (p *Policy) sanitizeAttrs(
+ elementName string,
+ attrs []html.Attribute,
+ aps map[string]attrPolicy,
+) []html.Attribute {
+
+ if len(attrs) == 0 {
+ return attrs
+ }
+
+ // Builds a new attribute slice based on the whether the attribute has been
+ // whitelisted explicitly or globally.
+ cleanAttrs := []html.Attribute{}
+ for _, htmlAttr := range attrs {
+ if p.allowDataAttributes {
+ // If we see a data attribute, let it through.
+ if isDataAttribute(htmlAttr.Key) {
+ cleanAttrs = append(cleanAttrs, htmlAttr)
+ continue
+ }
+ }
+ // Is there an element specific attribute policy that applies?
+ if ap, ok := aps[htmlAttr.Key]; ok {
+ if ap.regexp != nil {
+ if ap.regexp.MatchString(htmlAttr.Val) {
+ cleanAttrs = append(cleanAttrs, htmlAttr)
+ continue
+ }
+ } else {
+ cleanAttrs = append(cleanAttrs, htmlAttr)
+ continue
+ }
+ }
+
+ // Is there a global attribute policy that applies?
+ if ap, ok := p.globalAttrs[htmlAttr.Key]; ok {
+
+ if ap.regexp != nil {
+ if ap.regexp.MatchString(htmlAttr.Val) {
+ cleanAttrs = append(cleanAttrs, htmlAttr)
+ }
+ } else {
+ cleanAttrs = append(cleanAttrs, htmlAttr)
+ }
+ }
+ }
+
+ if len(cleanAttrs) == 0 {
+ // If nothing was allowed, let's get out of here
+ return cleanAttrs
+ }
+ // cleanAttrs now contains the attributes that are permitted
+
+ if linkable(elementName) {
+ if p.requireParseableURLs {
+ // Ensure URLs are parseable:
+ // - a.href
+ // - area.href
+ // - link.href
+ // - blockquote.cite
+ // - q.cite
+ // - img.src
+ // - script.src
+ tmpAttrs := []html.Attribute{}
+ for _, htmlAttr := range cleanAttrs {
+ switch elementName {
+ case "a", "area", "link":
+ if htmlAttr.Key == "href" {
+ if u, ok := p.validURL(htmlAttr.Val); ok {
+ htmlAttr.Val = u
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+ break
+ }
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ case "blockquote", "q":
+ if htmlAttr.Key == "cite" {
+ if u, ok := p.validURL(htmlAttr.Val); ok {
+ htmlAttr.Val = u
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+ break
+ }
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ case "img", "script":
+ if htmlAttr.Key == "src" {
+ if u, ok := p.validURL(htmlAttr.Val); ok {
+ htmlAttr.Val = u
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+ break
+ }
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ default:
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+ }
+ cleanAttrs = tmpAttrs
+ }
+
+ if (p.requireNoFollow ||
+ p.requireNoFollowFullyQualifiedLinks ||
+ p.addTargetBlankToFullyQualifiedLinks) &&
+ len(cleanAttrs) > 0 {
+
+ // Add rel="nofollow" if a "href" exists
+ switch elementName {
+ case "a", "area", "link":
+ var hrefFound bool
+ var externalLink bool
+ for _, htmlAttr := range cleanAttrs {
+ if htmlAttr.Key == "href" {
+ hrefFound = true
+
+ u, err := url.Parse(htmlAttr.Val)
+ if err != nil {
+ continue
+ }
+ if u.Host != "" {
+ externalLink = true
+ }
+
+ continue
+ }
+ }
+
+ if hrefFound {
+ var (
+ noFollowFound bool
+ targetBlankFound bool
+ )
+
+ addNoFollow := (p.requireNoFollow ||
+ externalLink && p.requireNoFollowFullyQualifiedLinks)
+
+ addTargetBlank := (externalLink &&
+ p.addTargetBlankToFullyQualifiedLinks)
+
+ tmpAttrs := []html.Attribute{}
+ for _, htmlAttr := range cleanAttrs {
+
+ var appended bool
+ if htmlAttr.Key == "rel" && addNoFollow {
+
+ if strings.Contains(htmlAttr.Val, "nofollow") {
+ noFollowFound = true
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ appended = true
+ } else {
+ htmlAttr.Val += " nofollow"
+ noFollowFound = true
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ appended = true
+ }
+ }
+
+ if elementName == "a" && htmlAttr.Key == "target" {
+ if htmlAttr.Val == "_blank" {
+ targetBlankFound = true
+ }
+ if addTargetBlank && !targetBlankFound {
+ htmlAttr.Val = "_blank"
+ targetBlankFound = true
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ appended = true
+ }
+ }
+
+ if !appended {
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+ }
+ if noFollowFound || targetBlankFound {
+ cleanAttrs = tmpAttrs
+ }
+
+ if addNoFollow && !noFollowFound {
+ rel := html.Attribute{}
+ rel.Key = "rel"
+ rel.Val = "nofollow"
+ cleanAttrs = append(cleanAttrs, rel)
+ }
+
+ if elementName == "a" && addTargetBlank && !targetBlankFound {
+ rel := html.Attribute{}
+ rel.Key = "target"
+ rel.Val = "_blank"
+ targetBlankFound = true
+ cleanAttrs = append(cleanAttrs, rel)
+ }
+
+ if targetBlankFound {
+ // target="_blank" has a security risk that allows the
+ // opened window/tab to issue JavaScript calls against
+ // window.opener, which in effect allow the destination
+ // of the link to control the source:
+ // https://dev.to/ben/the-targetblank-vulnerability-by-example
+ //
+ // To mitigate this risk, we need to add a specific rel
+ // attribute if it is not already present.
+ // rel="noopener"
+ //
+ // Unfortunately this is processing the rel twice (we
+ // already looked at it earlier ^^) as we cannot be sure
+ // of the ordering of the href and rel, and whether we
+ // have fully satisfied that we need to do this. This
+ // double processing only happens *if* target="_blank"
+ // is true.
+ var noOpenerAdded bool
+ tmpAttrs := []html.Attribute{}
+ for _, htmlAttr := range cleanAttrs {
+ var appended bool
+ if htmlAttr.Key == "rel" {
+ if strings.Contains(htmlAttr.Val, "noopener") {
+ noOpenerAdded = true
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ } else {
+ htmlAttr.Val += " noopener"
+ noOpenerAdded = true
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+
+ appended = true
+ }
+ if !appended {
+ tmpAttrs = append(tmpAttrs, htmlAttr)
+ }
+ }
+ if noOpenerAdded {
+ cleanAttrs = tmpAttrs
+ } else {
+ // rel attr was not found, or else noopener would
+ // have been added already
+ rel := html.Attribute{}
+ rel.Key = "rel"
+ rel.Val = "noopener"
+ cleanAttrs = append(cleanAttrs, rel)
+ }
+
+ }
+ }
+ default:
+ }
+ }
+ }
+
+ return cleanAttrs
+}
+
+func (p *Policy) allowNoAttrs(elementName string) bool {
+ _, ok := p.setOfElementsAllowedWithoutAttrs[elementName]
+ return ok
+}
+
+func (p *Policy) validURL(rawurl string) (string, bool) {
+ if p.requireParseableURLs {
+ // URLs are valid if when space is trimmed the URL is valid
+ rawurl = strings.TrimSpace(rawurl)
+
+ // URLs cannot contain whitespace, unless it is a data-uri
+ if (strings.Contains(rawurl, " ") ||
+ strings.Contains(rawurl, "\t") ||
+ strings.Contains(rawurl, "\n")) &&
+ !strings.HasPrefix(rawurl, `data:`) {
+ return "", false
+ }
+
+ // URLs are valid if they parse
+ u, err := url.Parse(rawurl)
+ if err != nil {
+ return "", false
+ }
+
+ if u.Scheme != "" {
+
+ urlPolicy, ok := p.allowURLSchemes[u.Scheme]
+ if !ok {
+ return "", false
+
+ }
+
+ if urlPolicy == nil || urlPolicy(u) == true {
+ return u.String(), true
+ }
+
+ return "", false
+ }
+
+ if p.allowRelativeURLs {
+ if u.String() != "" {
+ return u.String(), true
+ }
+ }
+
+ return "", false
+ }
+
+ return rawurl, true
+}
+
+func linkable(elementName string) bool {
+ switch elementName {
+ case "a", "area", "blockquote", "img", "link", "script":
+ return true
+ default:
+ return false
+ }
+}
+
+func isDataAttribute(val string) bool {
+ if !dataAttribute.MatchString(val) {
+ return false
+ }
+ rest := strings.Split(val, "data-")
+ if len(rest) == 1 {
+ return false
+ }
+ // data-xml* is invalid.
+ if dataAttributeXMLPrefix.MatchString(rest[1]) {
+ return false
+ }
+ // no uppercase or semi-colons allowed.
+ if dataAttributeInvalidChars.MatchString(rest[1]) {
+ return false
+ }
+ return true
+}
diff --git a/vendor/github.com/muesli/reflow/LICENSE b/vendor/github.com/muesli/reflow/LICENSE
new file mode 100644
index 000000000..8532c45c9
--- /dev/null
+++ b/vendor/github.com/muesli/reflow/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Christian Muehlhaeuser
+
+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/vendor/github.com/muesli/reflow/ansi/buffer.go b/vendor/github.com/muesli/reflow/ansi/buffer.go
new file mode 100644
index 000000000..4b7db2583
--- /dev/null
+++ b/vendor/github.com/muesli/reflow/ansi/buffer.go
@@ -0,0 +1,33 @@
+package ansi
+
+import (
+ "bytes"
+
+ "github.com/mattn/go-runewidth"
+)
+
+// Buffer is a buffer aware of ANSI escape sequences.
+type Buffer struct {
+ bytes.Buffer
+}
+
+// PrintableRuneCount returns the amount of printable runes in the buffer.
+func (w Buffer) PrintableRuneCount() int {
+ var n int
+ var ansi bool
+ for _, c := range w.String() {
+ if c == '\x1B' {
+ // ANSI escape sequence
+ ansi = true
+ } else if ansi {
+ if (c >= 0x40 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) {
+ // ANSI sequence terminated
+ ansi = false
+ }
+ } else {
+ n += runewidth.StringWidth(string(c))
+ }
+ }
+
+ return n
+}
diff --git a/vendor/github.com/muesli/reflow/ansi/writer.go b/vendor/github.com/muesli/reflow/ansi/writer.go
new file mode 100644
index 000000000..9fc53be36
--- /dev/null
+++ b/vendor/github.com/muesli/reflow/ansi/writer.go
@@ -0,0 +1,65 @@
+package ansi
+
+import (
+ "io"
+ "strings"
+)
+
+type Writer struct {
+ Forward io.Writer
+
+ ansi bool
+ ansiseq string
+ lastseq string
+ seqchanged bool
+}
+
+// Write is used to write content to the ANSI buffer.
+func (w *Writer) Write(b []byte) (int, error) {
+ for _, c := range string(b) {
+ if c == '\x1B' {
+ // ANSI escape sequence
+ w.ansi = true
+ w.seqchanged = true
+ w.ansiseq += string(c)
+ } else if w.ansi {
+ w.ansiseq += string(c)
+ if (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) {
+ // ANSI sequence terminated
+ w.ansi = false
+
+ _, _ = w.Forward.Write([]byte(w.ansiseq))
+ if strings.HasSuffix(w.ansiseq, "[0m") {
+ // reset sequence
+ w.lastseq = ""
+ } else if strings.HasSuffix(w.ansiseq, "m") {
+ // color code
+ w.lastseq = w.ansiseq
+ }
+ w.ansiseq = ""
+ }
+ } else {
+ _, err := w.Forward.Write([]byte(string(c)))
+ if err != nil {
+ return 0, err
+ }
+ }
+ }
+
+ return len(b), nil
+}
+
+func (w *Writer) LastSequence() string {
+ return w.lastseq
+}
+
+func (w *Writer) ResetAnsi() {
+ if !w.seqchanged {
+ return
+ }
+ _, _ = w.Forward.Write([]byte("\x1b[0m"))
+}
+
+func (w *Writer) RestoreAnsi() {
+ _, _ = w.Forward.Write([]byte(w.lastseq))
+}
diff --git a/vendor/github.com/muesli/reflow/indent/indent.go b/vendor/github.com/muesli/reflow/indent/indent.go
new file mode 100644
index 000000000..3536a483a
--- /dev/null
+++ b/vendor/github.com/muesli/reflow/indent/indent.go
@@ -0,0 +1,111 @@
+package indent
+
+import (
+ "bytes"
+ "io"
+ "strings"
+
+ "github.com/muesli/reflow/ansi"
+)
+
+type IndentFunc func(w io.Writer)
+
+type Writer struct {
+ Indent uint
+ IndentFunc IndentFunc
+
+ ansiWriter *ansi.Writer
+ buf bytes.Buffer
+ skipIndent bool
+ ansi bool
+}
+
+func NewWriter(indent uint, indentFunc IndentFunc) *Writer {
+ w := &Writer{
+ Indent: indent,
+ IndentFunc: indentFunc,
+ }
+ w.ansiWriter = &ansi.Writer{
+ Forward: &w.buf,
+ }
+ return w
+}
+
+func NewWriterPipe(forward io.Writer, indent uint, indentFunc IndentFunc) *Writer {
+ return &Writer{
+ Indent: indent,
+ IndentFunc: indentFunc,
+ ansiWriter: &ansi.Writer{
+ Forward: forward,
+ },
+ }
+}
+
+// Bytes is shorthand for declaring a new default indent-writer instance,
+// used to immediately indent a byte slice.
+func Bytes(b []byte, indent uint) []byte {
+ f := NewWriter(indent, nil)
+ _, _ = f.Write(b)
+
+ return f.Bytes()
+}
+
+// String is shorthand for declaring a new default indent-writer instance,
+// used to immediately indent a string.
+func String(s string, indent uint) string {
+ return string(Bytes([]byte(s), indent))
+}
+
+// Write is used to write content to the indent buffer.
+func (w *Writer) Write(b []byte) (int, error) {
+ for _, c := range string(b) {
+ if c == '\x1B' {
+ // ANSI escape sequence
+ w.ansi = true
+ } else if w.ansi {
+ if (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) {
+ // ANSI sequence terminated
+ w.ansi = false
+ }
+ } else {
+ if !w.skipIndent {
+ w.ansiWriter.ResetAnsi()
+ if w.IndentFunc != nil {
+ for i := 0; i < int(w.Indent); i++ {
+ w.IndentFunc(w.ansiWriter)
+ }
+ } else {
+ _, err := w.ansiWriter.Write([]byte(strings.Repeat(" ", int(w.Indent))))
+ if err != nil {
+ return 0, err
+ }
+ }
+
+ w.skipIndent = true
+ w.ansiWriter.RestoreAnsi()
+ }
+
+ if c == '\n' {
+ // end of current line
+ w.skipIndent = false
+ }
+ }
+
+ _, err := w.ansiWriter.Write([]byte(string(c)))
+ if err != nil {
+ return 0, err
+ }
+ }
+
+ return len(b), nil
+}
+
+// Bytes returns the indented result as a byte slice.
+func (w *Writer) Bytes() []byte {
+ return w.buf.Bytes()
+}
+
+// String returns the indented result as a string.
+func (w *Writer) String() string {
+ return w.buf.String()
+}
diff --git a/vendor/github.com/muesli/reflow/padding/padding.go b/vendor/github.com/muesli/reflow/padding/padding.go
new file mode 100644
index 000000000..b21ba053e
--- /dev/null
+++ b/vendor/github.com/muesli/reflow/padding/padding.go
@@ -0,0 +1,132 @@
+package padding
+
+import (
+ "bytes"
+ "io"
+ "strings"
+
+ "github.com/mattn/go-runewidth"
+
+ "github.com/muesli/reflow/ansi"
+)
+
+type PaddingFunc func(w io.Writer)
+
+type Writer struct {
+ Padding uint
+ PadFunc PaddingFunc
+
+ ansiWriter *ansi.Writer
+ buf bytes.Buffer
+ lineLen int
+ ansi bool
+}
+
+func NewWriter(width uint, paddingFunc PaddingFunc) *Writer {
+ w := &Writer{
+ Padding: width,
+ PadFunc: paddingFunc,
+ }
+ w.ansiWriter = &ansi.Writer{
+ Forward: &w.buf,
+ }
+ return w
+}
+
+func NewWriterPipe(forward io.Writer, width uint, paddingFunc PaddingFunc) *Writer {
+ return &Writer{
+ Padding: width,
+ PadFunc: paddingFunc,
+ ansiWriter: &ansi.Writer{
+ Forward: forward,
+ },
+ }
+}
+
+// Bytes is shorthand for declaring a new default padding-writer instance,
+// used to immediately pad a byte slice.
+func Bytes(b []byte, width uint) []byte {
+ f := NewWriter(width, nil)
+ _, _ = f.Write(b)
+ f.Close()
+
+ return f.Bytes()
+}
+
+// String is shorthand for declaring a new default padding-writer instance,
+// used to immediately pad a string.
+func String(s string, width uint) string {
+ return string(Bytes([]byte(s), width))
+}
+
+// Write is used to write content to the padding buffer.
+func (w *Writer) Write(b []byte) (int, error) {
+ for _, c := range string(b) {
+ if c == '\x1B' {
+ // ANSI escape sequence
+ w.ansi = true
+ } else if w.ansi {
+ if (c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) {
+ // ANSI sequence terminated
+ w.ansi = false
+ }
+ } else {
+ w.lineLen += runewidth.StringWidth(string(c))
+
+ if c == '\n' {
+ // end of current line
+ err := w.pad()
+ if err != nil {
+ return 0, err
+ }
+ w.ansiWriter.ResetAnsi()
+ w.lineLen = 0
+ }
+ }
+
+ _, err := w.ansiWriter.Write([]byte(string(c)))
+ if err != nil {
+ return 0, err
+ }
+ }
+
+ return len(b), nil
+}
+
+func (w *Writer) pad() error {
+ if w.Padding > 0 && uint(w.lineLen) < w.Padding {
+ if w.PadFunc != nil {
+ for i := 0; i < int(w.Padding)-w.lineLen; i++ {
+ w.PadFunc(w.ansiWriter)
+ }
+ } else {
+ _, err := w.ansiWriter.Write([]byte(strings.Repeat(" ", int(w.Padding)-w.lineLen)))
+ if err != nil {
+ return err
+ }
+ }
+ }
+
+ return nil
+}
+
+// Close will finish the padding operation. Always call it before trying to
+// retrieve the final result.
+func (w *Writer) Close() error {
+ // don't pad empty trailing lines
+ if w.lineLen == 0 {
+ return nil
+ }
+
+ return w.pad()
+}
+
+// Bytes returns the padded result as a byte slice.
+func (w *Writer) Bytes() []byte {
+ return w.buf.Bytes()
+}
+
+// String returns the padded result as a string.
+func (w *Writer) String() string {
+ return w.buf.String()
+}
diff --git a/vendor/github.com/muesli/reflow/wordwrap/wordwrap.go b/vendor/github.com/muesli/reflow/wordwrap/wordwrap.go
new file mode 100644
index 000000000..8a46738eb
--- /dev/null
+++ b/vendor/github.com/muesli/reflow/wordwrap/wordwrap.go
@@ -0,0 +1,167 @@
+package wordwrap
+
+import (
+ "bytes"
+ "strings"
+ "unicode"
+
+ "github.com/muesli/reflow/ansi"
+)
+
+var (
+ defaultBreakpoints = []rune{'-'}
+ defaultNewline = []rune{'\n'}
+)
+
+// WordWrap contains settings and state for customisable text reflowing with
+// support for ANSI escape sequences. This means you can style your terminal
+// output without affecting the word wrapping algorithm.
+type WordWrap struct {
+ Limit int
+ Breakpoints []rune
+ Newline []rune
+ KeepNewlines bool
+
+ buf bytes.Buffer
+ space bytes.Buffer
+ word ansi.Buffer
+
+ lineLen int
+ ansi bool
+}
+
+// NewWriter returns a new instance of a word-wrapping writer, initialized with
+// default settings.
+func NewWriter(limit int) *WordWrap {
+ return &WordWrap{
+ Limit: limit,
+ Breakpoints: defaultBreakpoints,
+ Newline: defaultNewline,
+ KeepNewlines: true,
+ }
+}
+
+// Bytes is shorthand for declaring a new default WordWrap instance,
+// used to immediately word-wrap a byte slice.
+func Bytes(b []byte, limit int) []byte {
+ f := NewWriter(limit)
+ _, _ = f.Write(b)
+ f.Close()
+
+ return f.Bytes()
+}
+
+// String is shorthand for declaring a new default WordWrap instance,
+// used to immediately word-wrap a string.
+func String(s string, limit int) string {
+ return string(Bytes([]byte(s), limit))
+}
+
+func (w *WordWrap) addSpace() {
+ w.lineLen += w.space.Len()
+ w.buf.Write(w.space.Bytes())
+ w.space.Reset()
+}
+
+func (w *WordWrap) addWord() {
+ if w.word.Len() > 0 {
+ w.addSpace()
+ w.lineLen += w.word.PrintableRuneCount()
+ w.buf.Write(w.word.Bytes())
+ w.word.Reset()
+ }
+}
+
+func (w *WordWrap) addNewLine() {
+ w.buf.WriteRune('\n')
+ w.lineLen = 0
+ w.space.Reset()
+}
+
+func inGroup(a []rune, c rune) bool {
+ for _, v := range a {
+ if v == c {
+ return true
+ }
+ }
+ return false
+}
+
+// Write is used to write more content to the word-wrap buffer.
+func (w *WordWrap) Write(b []byte) (int, error) {
+ if w.Limit == 0 {
+ return w.buf.Write(b)
+ }
+
+ s := string(b)
+ if !w.KeepNewlines {
+ s = strings.Replace(strings.TrimSpace(s), "\n", " ", -1)
+ }
+
+ for _, c := range s {
+ if c == '\x1B' {
+ // ANSI escape sequence
+ w.word.WriteRune(c)
+ w.ansi = true
+ } else if w.ansi {
+ w.word.WriteRune(c)
+ if (c >= 0x40 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) {
+ // ANSI sequence terminated
+ w.ansi = false
+ }
+ } else if inGroup(w.Newline, c) {
+ // end of current line
+ // see if we can add the content of the space buffer to the current line
+ if w.word.Len() == 0 {
+ if w.lineLen+w.space.Len() > w.Limit {
+ w.lineLen = 0
+ } else {
+ // preserve whitespace
+ w.buf.Write(w.space.Bytes())
+ }
+ w.space.Reset()
+ }
+
+ w.addWord()
+ w.addNewLine()
+ } else if unicode.IsSpace(c) {
+ // end of current word
+ w.addWord()
+ w.space.WriteRune(c)
+ } else if inGroup(w.Breakpoints, c) {
+ // valid breakpoint
+ w.addSpace()
+ w.addWord()
+ w.buf.WriteRune(c)
+ } else {
+ // any other character
+ w.word.WriteRune(c)
+
+ // add a line break if the current word would exceed the line's
+ // character limit
+ if w.lineLen+w.space.Len()+w.word.PrintableRuneCount() > w.Limit &&
+ w.word.PrintableRuneCount() < w.Limit {
+ w.addNewLine()
+ }
+ }
+ }
+
+ return len(b), nil
+}
+
+// Close will finish the word-wrap operation. Always call it before trying to
+// retrieve the final result.
+func (w *WordWrap) Close() error {
+ w.addWord()
+ return nil
+}
+
+// Bytes returns the word-wrapped result as a byte slice.
+func (w *WordWrap) Bytes() []byte {
+ return w.buf.Bytes()
+}
+
+// String returns the word-wrapped result as a string.
+func (w *WordWrap) String() string {
+ return w.buf.String()
+}
diff --git a/vendor/github.com/muesli/termenv/.gitignore b/vendor/github.com/muesli/termenv/.gitignore
new file mode 100644
index 000000000..66fd13c90
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/.gitignore
@@ -0,0 +1,15 @@
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, built with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
+
+# Dependency directories (remove the comment below to include it)
+# vendor/
diff --git a/vendor/github.com/muesli/termenv/LICENSE b/vendor/github.com/muesli/termenv/LICENSE
new file mode 100644
index 000000000..8532c45c9
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Christian Muehlhaeuser
+
+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/vendor/github.com/muesli/termenv/README.md b/vendor/github.com/muesli/termenv/README.md
new file mode 100644
index 000000000..cda01ebc7
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/README.md
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+
+
+
+
+`termenv` lets you safely use advanced styling options on the terminal. It
+gathers information about the terminal environment in terms of its ANSI & color
+support and offers you convenient methods to colorize and style your output,
+without you having to deal with all kinds of weird ANSI escape sequences and
+color conversions.
+
+![Example output](https://github.com/muesli/termenv/raw/master/examples/hello-world/hello-world.png)
+
+## Installation
+
+```bash
+go get github.com/muesli/termenv
+```
+
+## Query Terminal Status
+
+```go
+// returns supported color profile: Ascii, ANSI, ANSI256, or TrueColor
+termenv.ColorProfile()
+
+// returns default foreground color
+termenv.ForegroundColor()
+
+// returns default background color
+termenv.BackgroundColor()
+
+// returns whether terminal uses a dark-ish background
+termenv.HasDarkBackground()
+```
+
+## Colors
+
+`termenv` supports multiple color profiles: ANSI (16 colors), ANSI Extended
+(256 colors), and TrueColor (24-bit RGB). Colors will automatically be degraded
+to the best matching available color in the desired profile:
+
+`TrueColor` => `ANSI 256 Colors` => `ANSI 16 Colors` => `Ascii`
+
+```go
+out := termenv.String("Hello World")
+
+// retrieve color profile supported by terminal
+p := termenv.ColorProfile()
+
+// supports hex values
+// will automatically degrade colors on terminals not supporting RGB
+out = out.Foreground(p.Color("#abcdef"))
+// but also supports ANSI colors (0-255)
+out = out.Background(p.Color("69"))
+
+fmt.Println(out)
+```
+
+## Styles
+
+```go
+out := termenv.String("foobar")
+
+// text styles
+out.Bold()
+out.Faint()
+out.Italic()
+out.CrossOut()
+out.Underline()
+out.Overline()
+
+// reverse swaps current fore- & background colors
+out.Reverse()
+
+// blinking text
+out.Blink()
+
+// combine multiple options
+out.Bold().Underline()
+```
+
+## Template Helpers
+
+```go
+// load template helpers
+f := termenv.TemplateFuncs(termenv.ColorProfile())
+tpl := template.New("tpl").Funcs(f)
+
+// apply bold style in a template
+bold := `{{ Bold "Hello World" }}`
+
+// examples for colorized templates
+col := `{{ Color "#ff0000" "#0000ff" "Red on Blue" }}`
+fg := `{{ Foreground "#ff0000" "Red Foreground" }}`
+bg := `{{ Background "#0000ff" "Blue Background" }}`
+
+// wrap styles
+wrap := `{{ Bold (Underline "Hello World") }}`
+
+// parse and render
+tpl = tpl.Parse(bold)
+
+var buf bytes.Buffer
+tpl.Execute(&buf, nil)
+fmt.Println(buf)
+```
+
+Other available helper functions are: `Faint`, `Italic`, `CrossOut`,
+`Underline`, `Overline`, `Reverse`, and `Blink`.
+
+## Screen
+
+```go
+// Reset the terminal to its default style, removing any active styles
+termenv.Reset()
+
+// Switch to the altscreen. The former view can be restored with ExitAltScreen()
+termenv.AltScreen()
+
+// Exit the altscreen and return to the former terminal view
+termenv.ExitAltScreen()
+
+// Clear the visible portion of the terminal
+termenv.ClearScreen()
+
+// Move the cursor to a given position
+termenv.MoveCursor(row, column)
+
+// Hide the cursor
+termenv.HideCursor()
+
+// Show the cursor
+termenv.ShowCursor()
+
+// Move the cursor up a given number of lines
+termenv.CursorUp(n)
+
+// Move the cursor down a given number of lines
+termenv.CursorDown(n)
+
+// Move the cursor down a given number of lines and place it at the beginning
+// of the line
+termenv.CursorNextLine(n)
+
+// Move the cursor up a given number of lines and place it at the beginning of
+// the line
+termenv.CursorPrevLine(n)
+
+// Clear the current line
+termenv.ClearLine()
+
+// Clear a given number of lines
+termenv.ClearLines(n)
+```
+
+## Color Chart
+
+![ANSI color chart](https://github.com/muesli/termenv/raw/master/examples/color-chart/color-chart.png)
+
+You can find the source code used to create this chart in `termenv`'s examples.
+
+## Related Projects
+
+Check out [Glow](https://github.com/charmbracelet/glow), a markdown renderer for
+the command-line, which uses `termenv`.
+
+## License
+
+[MIT](https://github.com/muesli/termenv/raw/master/LICENSE)
diff --git a/vendor/github.com/muesli/termenv/ansicolors.go b/vendor/github.com/muesli/termenv/ansicolors.go
new file mode 100644
index 000000000..3a00856ee
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/ansicolors.go
@@ -0,0 +1,261 @@
+package termenv
+
+// RGB values of ANSI colors (0-255)
+var ansiHex = []string{
+ "#000000",
+ "#800000",
+ "#008000",
+ "#808000",
+ "#000080",
+ "#800080",
+ "#008080",
+ "#c0c0c0",
+ "#808080",
+ "#ff0000",
+ "#00ff00",
+ "#ffff00",
+ "#0000ff",
+ "#ff00ff",
+ "#00ffff",
+ "#ffffff",
+ "#000000",
+ "#00005f",
+ "#000087",
+ "#0000af",
+ "#0000d7",
+ "#0000ff",
+ "#005f00",
+ "#005f5f",
+ "#005f87",
+ "#005faf",
+ "#005fd7",
+ "#005fff",
+ "#008700",
+ "#00875f",
+ "#008787",
+ "#0087af",
+ "#0087d7",
+ "#0087ff",
+ "#00af00",
+ "#00af5f",
+ "#00af87",
+ "#00afaf",
+ "#00afd7",
+ "#00afff",
+ "#00d700",
+ "#00d75f",
+ "#00d787",
+ "#00d7af",
+ "#00d7d7",
+ "#00d7ff",
+ "#00ff00",
+ "#00ff5f",
+ "#00ff87",
+ "#00ffaf",
+ "#00ffd7",
+ "#00ffff",
+ "#5f0000",
+ "#5f005f",
+ "#5f0087",
+ "#5f00af",
+ "#5f00d7",
+ "#5f00ff",
+ "#5f5f00",
+ "#5f5f5f",
+ "#5f5f87",
+ "#5f5faf",
+ "#5f5fd7",
+ "#5f5fff",
+ "#5f8700",
+ "#5f875f",
+ "#5f8787",
+ "#5f87af",
+ "#5f87d7",
+ "#5f87ff",
+ "#5faf00",
+ "#5faf5f",
+ "#5faf87",
+ "#5fafaf",
+ "#5fafd7",
+ "#5fafff",
+ "#5fd700",
+ "#5fd75f",
+ "#5fd787",
+ "#5fd7af",
+ "#5fd7d7",
+ "#5fd7ff",
+ "#5fff00",
+ "#5fff5f",
+ "#5fff87",
+ "#5fffaf",
+ "#5fffd7",
+ "#5fffff",
+ "#870000",
+ "#87005f",
+ "#870087",
+ "#8700af",
+ "#8700d7",
+ "#8700ff",
+ "#875f00",
+ "#875f5f",
+ "#875f87",
+ "#875faf",
+ "#875fd7",
+ "#875fff",
+ "#878700",
+ "#87875f",
+ "#878787",
+ "#8787af",
+ "#8787d7",
+ "#8787ff",
+ "#87af00",
+ "#87af5f",
+ "#87af87",
+ "#87afaf",
+ "#87afd7",
+ "#87afff",
+ "#87d700",
+ "#87d75f",
+ "#87d787",
+ "#87d7af",
+ "#87d7d7",
+ "#87d7ff",
+ "#87ff00",
+ "#87ff5f",
+ "#87ff87",
+ "#87ffaf",
+ "#87ffd7",
+ "#87ffff",
+ "#af0000",
+ "#af005f",
+ "#af0087",
+ "#af00af",
+ "#af00d7",
+ "#af00ff",
+ "#af5f00",
+ "#af5f5f",
+ "#af5f87",
+ "#af5faf",
+ "#af5fd7",
+ "#af5fff",
+ "#af8700",
+ "#af875f",
+ "#af8787",
+ "#af87af",
+ "#af87d7",
+ "#af87ff",
+ "#afaf00",
+ "#afaf5f",
+ "#afaf87",
+ "#afafaf",
+ "#afafd7",
+ "#afafff",
+ "#afd700",
+ "#afd75f",
+ "#afd787",
+ "#afd7af",
+ "#afd7d7",
+ "#afd7ff",
+ "#afff00",
+ "#afff5f",
+ "#afff87",
+ "#afffaf",
+ "#afffd7",
+ "#afffff",
+ "#d70000",
+ "#d7005f",
+ "#d70087",
+ "#d700af",
+ "#d700d7",
+ "#d700ff",
+ "#d75f00",
+ "#d75f5f",
+ "#d75f87",
+ "#d75faf",
+ "#d75fd7",
+ "#d75fff",
+ "#d78700",
+ "#d7875f",
+ "#d78787",
+ "#d787af",
+ "#d787d7",
+ "#d787ff",
+ "#d7af00",
+ "#d7af5f",
+ "#d7af87",
+ "#d7afaf",
+ "#d7afd7",
+ "#d7afff",
+ "#d7d700",
+ "#d7d75f",
+ "#d7d787",
+ "#d7d7af",
+ "#d7d7d7",
+ "#d7d7ff",
+ "#d7ff00",
+ "#d7ff5f",
+ "#d7ff87",
+ "#d7ffaf",
+ "#d7ffd7",
+ "#d7ffff",
+ "#ff0000",
+ "#ff005f",
+ "#ff0087",
+ "#ff00af",
+ "#ff00d7",
+ "#ff00ff",
+ "#ff5f00",
+ "#ff5f5f",
+ "#ff5f87",
+ "#ff5faf",
+ "#ff5fd7",
+ "#ff5fff",
+ "#ff8700",
+ "#ff875f",
+ "#ff8787",
+ "#ff87af",
+ "#ff87d7",
+ "#ff87ff",
+ "#ffaf00",
+ "#ffaf5f",
+ "#ffaf87",
+ "#ffafaf",
+ "#ffafd7",
+ "#ffafff",
+ "#ffd700",
+ "#ffd75f",
+ "#ffd787",
+ "#ffd7af",
+ "#ffd7d7",
+ "#ffd7ff",
+ "#ffff00",
+ "#ffff5f",
+ "#ffff87",
+ "#ffffaf",
+ "#ffffd7",
+ "#ffffff",
+ "#080808",
+ "#121212",
+ "#1c1c1c",
+ "#262626",
+ "#303030",
+ "#3a3a3a",
+ "#444444",
+ "#4e4e4e",
+ "#585858",
+ "#626262",
+ "#6c6c6c",
+ "#767676",
+ "#808080",
+ "#8a8a8a",
+ "#949494",
+ "#9e9e9e",
+ "#a8a8a8",
+ "#b2b2b2",
+ "#bcbcbc",
+ "#c6c6c6",
+ "#d0d0d0",
+ "#dadada",
+ "#e4e4e4",
+ "#eeeeee",
+}
diff --git a/vendor/github.com/muesli/termenv/color.go b/vendor/github.com/muesli/termenv/color.go
new file mode 100644
index 000000000..ab269590d
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/color.go
@@ -0,0 +1,228 @@
+package termenv
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "strconv"
+ "strings"
+
+ "github.com/lucasb-eyer/go-colorful"
+)
+
+var (
+ ErrInvalidColor = errors.New("invalid color")
+)
+
+const (
+ Foreground = "38"
+ Background = "48"
+)
+
+type Color interface {
+ Sequence(bg bool) string
+}
+
+type NoColor struct{}
+
+// ANSIColor is a color (0-15) as defined by the ANSI Standard
+type ANSIColor int
+
+// ANSI256Color is a color (16-255) as defined by the ANSI Standard
+type ANSI256Color int
+
+// RGBColor is a hex-encoded color, e.g. "#abcdef"
+type RGBColor string
+
+func ConvertToRGB(c Color) colorful.Color {
+ var hex string
+ switch v := c.(type) {
+ case RGBColor:
+ hex = string(v)
+ case ANSIColor:
+ hex = ansiHex[v]
+ case ANSI256Color:
+ hex = ansiHex[v]
+ }
+
+ ch, _ := colorful.Hex(hex)
+ return ch
+}
+
+func (p Profile) Convert(c Color) Color {
+ if p == Ascii {
+ return NoColor{}
+ }
+
+ switch v := c.(type) {
+ case ANSIColor:
+ return v
+
+ case ANSI256Color:
+ if p == ANSI {
+ return ansi256ToANSIColor(v)
+ }
+ return v
+
+ case RGBColor:
+ h, err := colorful.Hex(string(v))
+ if err != nil {
+ return nil
+ }
+ if p < TrueColor {
+ ac := hexToANSI256Color(h)
+ if p == ANSI {
+ return ansi256ToANSIColor(ac)
+ }
+ return ac
+ }
+ return v
+ }
+
+ return c
+}
+
+func (p Profile) Color(s string) Color {
+ if len(s) == 0 {
+ return nil
+ }
+
+ var c Color
+ if strings.HasPrefix(s, "#") {
+ c = RGBColor(s)
+ } else {
+ i, err := strconv.Atoi(s)
+ if err != nil {
+ return nil
+ }
+
+ if i < 16 {
+ c = ANSIColor(i)
+ } else {
+ c = ANSI256Color(i)
+ }
+ }
+
+ return p.Convert(c)
+}
+
+func (c NoColor) Sequence(bg bool) string {
+ return ""
+}
+
+func (c ANSIColor) Sequence(bg bool) string {
+ col := int(c)
+ bgMod := func(c int) int {
+ if bg {
+ return c + 10
+ }
+ return c
+ }
+
+ if col < 8 {
+ return fmt.Sprintf("%d", bgMod(col)+30)
+ }
+ return fmt.Sprintf("%d", bgMod(col-8)+90)
+}
+
+func (c ANSI256Color) Sequence(bg bool) string {
+ prefix := Foreground
+ if bg {
+ prefix = Background
+ }
+ return fmt.Sprintf("%s;5;%d", prefix, c)
+}
+
+func (c RGBColor) Sequence(bg bool) string {
+ f, err := colorful.Hex(string(c))
+ if err != nil {
+ return ""
+ }
+
+ prefix := Foreground
+ if bg {
+ prefix = Background
+ }
+ return fmt.Sprintf("%s;2;%d;%d;%d", prefix, uint8(f.R*255), uint8(f.G*255), uint8(f.B*255))
+}
+
+func xTermColor(s string) (RGBColor, error) {
+ if len(s) != 24 {
+ return RGBColor(""), ErrInvalidColor
+ }
+ s = s[4:]
+
+ prefix := ";rgb:"
+ if !strings.HasPrefix(s, prefix) {
+ return RGBColor(""), ErrInvalidColor
+ }
+ s = strings.TrimPrefix(s, prefix)
+ s = strings.TrimSuffix(s, "\a")
+
+ h := strings.Split(s, "/")
+ hex := fmt.Sprintf("#%s%s%s", h[0][:2], h[1][:2], h[2][:2])
+ return RGBColor(hex), nil
+}
+
+func ansi256ToANSIColor(c ANSI256Color) ANSIColor {
+ var r int
+ md := math.MaxFloat64
+
+ h, _ := colorful.Hex(ansiHex[c])
+ for i := 0; i <= 15; i++ {
+ hb, _ := colorful.Hex(ansiHex[i])
+ d := h.DistanceLab(hb)
+
+ if d < md {
+ md = d
+ r = i
+ }
+ }
+
+ return ANSIColor(r)
+}
+
+func hexToANSI256Color(c colorful.Color) ANSI256Color {
+ v2ci := func(v float64) int {
+ if v < 48 {
+ return 0
+ }
+ if v < 115 {
+ return 1
+ }
+ return int((v - 35) / 40)
+ }
+
+ // Calculate the nearest 0-based color index at 16..231
+ r := v2ci(c.R * 255.0) // 0..5 each
+ g := v2ci(c.G * 255.0)
+ b := v2ci(c.B * 255.0)
+ ci := 36*r + 6*g + b /* 0..215 */
+
+ // Calculate the represented colors back from the index
+ i2cv := [6]int{0, 0x5f, 0x87, 0xaf, 0xd7, 0xff}
+ cr := i2cv[r] // r/g/b, 0..255 each
+ cg := i2cv[g]
+ cb := i2cv[b]
+
+ // Calculate the nearest 0-based gray index at 232..255
+ var grayIdx int
+ average := (r + g + b) / 3
+ if average > 238 {
+ grayIdx = 23
+ } else {
+ grayIdx = (average - 3) / 10 // 0..23
+ }
+ gv := 8 + 10*grayIdx // same value for r/g/b, 0..255
+
+ // Return the one which is nearer to the original input rgb value
+ c2 := colorful.Color{R: float64(cr) / 255.0, G: float64(cg) / 255.0, B: float64(cb) / 255.0}
+ g2 := colorful.Color{R: float64(gv) / 255.0, G: float64(gv) / 255.0, B: float64(gv) / 255.0}
+ colorDist := c.DistanceLab(c2)
+ grayDist := c.DistanceLab(g2)
+
+ if colorDist <= grayDist {
+ return ANSI256Color(16 + ci)
+ }
+ return ANSI256Color(232 + grayIdx)
+}
diff --git a/vendor/github.com/muesli/termenv/go.mod b/vendor/github.com/muesli/termenv/go.mod
new file mode 100644
index 000000000..c3f75ad4f
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/go.mod
@@ -0,0 +1,10 @@
+module github.com/muesli/termenv
+
+go 1.13
+
+require (
+ github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f
+ github.com/lucasb-eyer/go-colorful v1.0.3
+ github.com/mattn/go-isatty v0.0.12
+ github.com/mattn/go-runewidth v0.0.9
+)
diff --git a/vendor/github.com/muesli/termenv/go.sum b/vendor/github.com/muesli/termenv/go.sum
new file mode 100644
index 000000000..669810887
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/go.sum
@@ -0,0 +1,10 @@
+github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f h1:5CjVwnuUcp5adK4gmY6i72gpVFVnZDP2h5TmPScB6u4=
+github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4=
+github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
+github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
+github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
+github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
+github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/vendor/github.com/muesli/termenv/screen.go b/vendor/github.com/muesli/termenv/screen.go
new file mode 100644
index 000000000..37168bcff
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/screen.go
@@ -0,0 +1,200 @@
+package termenv
+
+import (
+ "fmt"
+ "strings"
+)
+
+const (
+ CursorUpSeq = "%dA"
+ CursorDownSeq = "%dB"
+ CursorForwardSeq = "%dC"
+ CursorBackSeq = "%dD"
+ CursorNextLineSeq = "%dE"
+ CursorPreviousLineSeq = "%dF"
+ CursorHorizontalSeq = "%dG"
+ CursorPositionSeq = "%d;%dH"
+ EraseDisplaySeq = "%dJ"
+ EraseLineSeq = "%dK"
+ ScrollUpSeq = "%dS"
+ ScrollDownSeq = "%dT"
+ SaveCursorPositionSeq = "s"
+ RestoreCursorPositionSeq = "u"
+ ChangeScrollingRegionSeq = "%d;%dr"
+ InsertLineSeq = "%dL"
+ DeleteLineSeq = "%dM"
+
+ ShowCursorSeq = "?25h"
+ HideCursorSeq = "?25l"
+ EnableMousePressSeq = "?9h" // press only (X10)
+ DisableMousePressSeq = "?9l"
+ EnableMouseSeq = "?1000h" // press, release, wheel
+ DisableMouseSeq = "?1000l"
+ EnableMouseHiliteSeq = "?1001h" // highlight
+ DisableMouseHiliteSeq = "?1001l"
+ EnableMouseCellMotionSeq = "?1002h" // press, release, move on pressed, wheel
+ DisableMouseCellMotionSeq = "?1002l"
+ EnableMouseAllMotionSeq = "?1003h" // press, release, move, wheel
+ DisableMouseAllMotionSeq = "?1003l"
+ AltScreenSeq = "?1049h"
+ ExitAltScreenSeq = "?1049l"
+)
+
+// Reset the terminal to its default style, removing any active styles.
+func Reset() {
+ fmt.Print(CSI + ResetSeq + "m")
+}
+
+// AltScreen switches to the alternate screen buffer. The former view can be
+// restored with ExitAltScreen().
+func AltScreen() {
+ fmt.Print(CSI + AltScreenSeq)
+}
+
+// ExitAltScreen exits the alternate screen buffer and returns to the former
+// terminal view.
+func ExitAltScreen() {
+ fmt.Print(CSI + ExitAltScreenSeq)
+}
+
+// ClearScreen clears the visible portion of the terminal.
+func ClearScreen() {
+ fmt.Printf(CSI+EraseDisplaySeq, 2)
+ MoveCursor(1, 1)
+}
+
+// MoveCursor moves the cursor to a given position.
+func MoveCursor(row int, column int) {
+ fmt.Printf(CSI+CursorPositionSeq, row, column)
+}
+
+// HideCursor hides the cursor.
+func HideCursor() {
+ fmt.Printf(CSI + HideCursorSeq)
+}
+
+// ShowCursor shows the cursor.
+func ShowCursor() {
+ fmt.Printf(CSI + ShowCursorSeq)
+}
+
+// SaveCursorPosition saves the cursor position.
+func SaveCursorPosition() {
+ fmt.Print(CSI + SaveCursorPositionSeq)
+}
+
+// RestoreCursorPosition restores a saved cursor position.
+func RestoreCursorPosition() {
+ fmt.Print(CSI + RestoreCursorPositionSeq)
+}
+
+// CursorUp moves the cursor up a given number of lines.
+func CursorUp(n int) {
+ fmt.Printf(CSI+CursorUpSeq, n)
+}
+
+// CursorDown moves the cursor down a given number of lines.
+func CursorDown(n int) {
+ fmt.Printf(CSI+CursorDownSeq, n)
+}
+
+// CursorForward moves the cursor up a given number of lines.
+func CursorForward(n int) {
+ fmt.Printf(CSI+CursorForwardSeq, n)
+}
+
+// CursorBack moves the cursor backwards a given number of cells.
+func CursorBack(n int) {
+ fmt.Printf(CSI+CursorBackSeq, n)
+}
+
+// CursorNextLine moves the cursor down a given number of lines and places it at
+// the beginning of the line.
+func CursorNextLine(n int) {
+ fmt.Printf(CSI+CursorNextLineSeq, n)
+}
+
+// CursorPrevLine moves the cursor up a given number of lines and places it at
+// the beginning of the line.
+func CursorPrevLine(n int) {
+ fmt.Printf(CSI+CursorPreviousLineSeq, n)
+}
+
+// ClearLine clears the current line.
+func ClearLine() {
+ fmt.Printf(CSI+EraseLineSeq, 2)
+}
+
+// ClearLines clears a given number of lines.
+func ClearLines(n int) {
+ clearLine := fmt.Sprintf(CSI+EraseLineSeq, 2)
+ cursorUp := fmt.Sprintf(CSI+CursorUpSeq, 1)
+ fmt.Print(clearLine + strings.Repeat(cursorUp+clearLine, n))
+}
+
+// ChangeScrollingRegion sets the scrolling region of the terminal.
+func ChangeScrollingRegion(top, bottom int) {
+ fmt.Printf(CSI+ChangeScrollingRegionSeq, top, bottom)
+}
+
+// InsertLines inserts the given number lines at the top of the scrollable
+// region, pushing lines below down.
+func InsertLines(n int) {
+ fmt.Printf(CSI+InsertLineSeq, n)
+}
+
+// DeleteLines deletes the given number of lines, pulling any lines in
+// the scrollable region below up.
+func DeleteLines(n int) {
+ fmt.Printf(CSI+DeleteLineSeq, n)
+}
+
+// EnableMousePress enables X10 mouse mode. Button press events are sent only.
+func EnableMousePress() {
+ fmt.Print(CSI + EnableMousePressSeq)
+}
+
+// DisableMousePress disables X10 mouse mode.
+func DisableMousePress() {
+ fmt.Print(CSI + EnableMousePressSeq)
+}
+
+// EnableMouse enables Mouse Tracking mode.
+func EnableMouse() {
+ fmt.Print(CSI + EnableMouseSeq)
+}
+
+// DisableMouse disables Mouse Tracking mode.
+func DisableMouse() {
+ fmt.Print(CSI + DisableMouseSeq)
+}
+
+// EnableMouseHilite enables Hilite Mouse Tracking mode.
+func EnableMouseHilite() {
+ fmt.Print(CSI + EnableMouseHiliteSeq)
+}
+
+// DisableMouseHilite disables Hilite Mouse Tracking mode.
+func DisableMouseHilite() {
+ fmt.Print(CSI + DisableMouseHiliteSeq)
+}
+
+// EnableMouseCellMotion enables Cell Motion Mouse Tracking mode.
+func EnableMouseCellMotion() {
+ fmt.Print(CSI + EnableMouseCellMotionSeq)
+}
+
+// DisableMouseCellMotion disables Cell Motion Mouse Tracking mode.
+func DisableMouseCellMotion() {
+ fmt.Print(CSI + DisableMouseCellMotionSeq)
+}
+
+// EnableMouseAllMotion enables All Motion Mouse mode.
+func EnableMouseAllMotion() {
+ fmt.Print(CSI + EnableMouseAllMotionSeq)
+}
+
+// DisableMouseAllMotion disables All Motion Mouse mode.
+func DisableMouseAllMotion() {
+ fmt.Print(CSI + DisableMouseAllMotionSeq)
+}
diff --git a/vendor/github.com/muesli/termenv/style.go b/vendor/github.com/muesli/termenv/style.go
new file mode 100644
index 000000000..390bab8cf
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/style.go
@@ -0,0 +1,120 @@
+package termenv
+
+import (
+ "fmt"
+ "strings"
+
+ "github.com/mattn/go-runewidth"
+)
+
+const (
+ ResetSeq = "0"
+ BoldSeq = "1"
+ FaintSeq = "2"
+ ItalicSeq = "3"
+ UnderlineSeq = "4"
+ BlinkSeq = "5"
+ ReverseSeq = "7"
+ CrossOutSeq = "9"
+ OverlineSeq = "53"
+)
+
+// Style is a string that various rendering styles can be applied to.
+type Style struct {
+ string
+ styles []string
+}
+
+// String returns a new Style
+func String(s ...string) Style {
+ return Style{
+ string: strings.Join(s, " "),
+ }
+}
+
+func (t Style) String() string {
+ return t.Styled(t.string)
+}
+
+// Styled renders s with all applied styles
+func (t Style) Styled(s string) string {
+ if len(t.styles) == 0 {
+ return s
+ }
+
+ seq := strings.Join(t.styles, ";")
+ if seq == "" {
+ return s
+ }
+
+ return fmt.Sprintf("%s%sm%s%sm", CSI, seq, s, CSI+ResetSeq)
+}
+
+// Foreground sets a foreground color
+func (t Style) Foreground(c Color) Style {
+ if c != nil {
+ t.styles = append(t.styles, c.Sequence(false))
+ }
+ return t
+}
+
+// Background sets a background color
+func (t Style) Background(c Color) Style {
+ if c != nil {
+ t.styles = append(t.styles, c.Sequence(true))
+ }
+ return t
+}
+
+// Bold enables bold rendering
+func (t Style) Bold() Style {
+ t.styles = append(t.styles, BoldSeq)
+ return t
+}
+
+// Faint enables faint rendering
+func (t Style) Faint() Style {
+ t.styles = append(t.styles, FaintSeq)
+ return t
+}
+
+// Italic enables italic rendering
+func (t Style) Italic() Style {
+ t.styles = append(t.styles, ItalicSeq)
+ return t
+}
+
+// Underline enables underline rendering
+func (t Style) Underline() Style {
+ t.styles = append(t.styles, UnderlineSeq)
+ return t
+}
+
+// Overline enables overline rendering
+func (t Style) Overline() Style {
+ t.styles = append(t.styles, OverlineSeq)
+ return t
+}
+
+// Blink enables blink mode
+func (t Style) Blink() Style {
+ t.styles = append(t.styles, BlinkSeq)
+ return t
+}
+
+// Reverse enables reverse color mode
+func (t Style) Reverse() Style {
+ t.styles = append(t.styles, ReverseSeq)
+ return t
+}
+
+// CrossOut enables crossed-out rendering
+func (t Style) CrossOut() Style {
+ t.styles = append(t.styles, CrossOutSeq)
+ return t
+}
+
+// Width returns the width required to print all runes in Style.
+func (t Style) Width() int {
+ return runewidth.StringWidth(t.string)
+}
diff --git a/vendor/github.com/muesli/termenv/syscall_linux.go b/vendor/github.com/muesli/termenv/syscall_linux.go
new file mode 100644
index 000000000..a8b0a1089
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/syscall_linux.go
@@ -0,0 +1,12 @@
+// +build linux
+
+package termenv
+
+import (
+ "syscall"
+)
+
+func sysSelect(nfd int, r *syscall.FdSet, timeout *syscall.Timeval) error {
+ _, err := syscall.Select(nfd, r, nil, nil, timeout)
+ return err
+}
diff --git a/vendor/github.com/muesli/termenv/syscall_unix.go b/vendor/github.com/muesli/termenv/syscall_unix.go
new file mode 100644
index 000000000..14509110c
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/syscall_unix.go
@@ -0,0 +1,11 @@
+// +build !linux,!windows,!plan9,!solaris
+
+package termenv
+
+import (
+ "syscall"
+)
+
+func sysSelect(nfd int, r *syscall.FdSet, timeout *syscall.Timeval) error {
+ return syscall.Select(nfd, r, nil, nil, timeout)
+}
diff --git a/vendor/github.com/muesli/termenv/templatehelper.go b/vendor/github.com/muesli/termenv/templatehelper.go
new file mode 100644
index 000000000..2b898700b
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/templatehelper.go
@@ -0,0 +1,55 @@
+package termenv
+
+import (
+ "text/template"
+)
+
+// TemplateFuncs contains a few useful template helpers
+func TemplateFuncs(p Profile) template.FuncMap {
+ return template.FuncMap{
+ "Color": func(values ...interface{}) string {
+ s := String(values[len(values)-1].(string))
+ switch len(values) {
+ case 2:
+ s = s.Foreground(p.Color(values[0].(string)))
+ case 3:
+ s = s.
+ Foreground(p.Color(values[0].(string))).
+ Background(p.Color(values[1].(string)))
+ }
+
+ return s.String()
+ },
+ "Foreground": func(values ...interface{}) string {
+ s := String(values[len(values)-1].(string))
+ if len(values) == 2 {
+ s = s.Foreground(p.Color(values[0].(string)))
+ }
+
+ return s.String()
+ },
+ "Background": func(values ...interface{}) string {
+ s := String(values[len(values)-1].(string))
+ if len(values) == 2 {
+ s = s.Background(p.Color(values[0].(string)))
+ }
+
+ return s.String()
+ },
+ "Bold": styleFunc(Style.Bold),
+ "Faint": styleFunc(Style.Faint),
+ "Italic": styleFunc(Style.Italic),
+ "Underline": styleFunc(Style.Underline),
+ "Overline": styleFunc(Style.Overline),
+ "Blink": styleFunc(Style.Blink),
+ "Reverse": styleFunc(Style.Reverse),
+ "CrossOut": styleFunc(Style.CrossOut),
+ }
+}
+
+func styleFunc(f func(Style) Style) func(...interface{}) string {
+ return func(values ...interface{}) string {
+ s := String(values[0].(string))
+ return f(s).String()
+ }
+}
diff --git a/vendor/github.com/muesli/termenv/termenv.go b/vendor/github.com/muesli/termenv/termenv.go
new file mode 100644
index 000000000..815de67e5
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/termenv.go
@@ -0,0 +1,58 @@
+package termenv
+
+import (
+ "errors"
+ "os"
+
+ "github.com/mattn/go-isatty"
+)
+
+var (
+ ErrStatusReport = errors.New("unable to retrieve status report")
+)
+
+type Profile int
+
+const (
+ CSI = "\x1b["
+
+ Ascii = Profile(iota)
+ ANSI
+ ANSI256
+ TrueColor
+)
+
+// ColorProfile returns the supported color profile:
+// Ascii, ANSI, ANSI256, or TrueColor
+func ColorProfile() Profile {
+ if !isatty.IsTerminal(os.Stdout.Fd()) {
+ return Ascii
+ }
+
+ return colorProfile()
+}
+
+// ForegroundColor returns the terminal's default foreground color
+func ForegroundColor() Color {
+ if !isatty.IsTerminal(os.Stdout.Fd()) {
+ return NoColor{}
+ }
+
+ return foregroundColor()
+}
+
+// BackgroundColor returns the terminal's default background color
+func BackgroundColor() Color {
+ if !isatty.IsTerminal(os.Stdout.Fd()) {
+ return NoColor{}
+ }
+
+ return backgroundColor()
+}
+
+// HasDarkBackground returns whether terminal uses a dark-ish background
+func HasDarkBackground() bool {
+ c := ConvertToRGB(BackgroundColor())
+ _, _, l := c.Hsl()
+ return l < 0.5
+}
diff --git a/vendor/github.com/muesli/termenv/termenv_darwin.go b/vendor/github.com/muesli/termenv/termenv_darwin.go
new file mode 100644
index 000000000..cfc07cb45
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/termenv_darwin.go
@@ -0,0 +1,62 @@
+// +build darwin
+
+package termenv
+
+import (
+ "fmt"
+ "os"
+ "syscall"
+ "unsafe"
+
+ "github.com/google/goterm/term"
+)
+
+type Termios struct {
+ Iflag uintptr
+ Oflag uintptr
+ Cflag uintptr
+ Lflag uintptr
+ Cc [20]byte
+ Ispeed uintptr
+ Ospeed uintptr
+}
+
+func Attr(file *os.File) (Termios, error) {
+ var t Termios
+ fd := file.Fd()
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TIOCGETA), uintptr(unsafe.Pointer(&t)))
+ if errno != 0 {
+ return t, errno
+ }
+ return t, nil
+}
+
+func Set(t Termios, file *os.File) error {
+ fd := file.Fd()
+ _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(syscall.TIOCSETA), uintptr(unsafe.Pointer(&t)))
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
+
+func termStatusReport(sequence int) (string, error) {
+ t, err := Attr(os.Stdout)
+ if err != nil {
+ return "", ErrStatusReport
+ }
+ defer Set(t, os.Stdout)
+
+ noecho := t
+ noecho.Lflag &= term.ECHO &^ term.ICANON
+ if err := Set(noecho, os.Stdout); err != nil {
+ return "", ErrStatusReport
+ }
+ fmt.Printf("\033]%d;?\007", sequence)
+ s, ok := readWithTimeout(os.Stdout)
+ if !ok {
+ return "", ErrStatusReport
+ }
+ // fmt.Println("Rcvd", s[1:])
+ return s, nil
+}
diff --git a/vendor/github.com/muesli/termenv/termenv_linux.go b/vendor/github.com/muesli/termenv/termenv_linux.go
new file mode 100644
index 000000000..a3afd5a01
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/termenv_linux.go
@@ -0,0 +1,33 @@
+// +build dragonfly freebsd linux netbsd openbsd solaris
+
+package termenv
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/google/goterm/term"
+)
+
+func termStatusReport(sequence int) (string, error) {
+ t, err := term.Attr(os.Stdout)
+ if err != nil {
+ return "", ErrStatusReport
+ }
+ defer t.Set(os.Stdout)
+
+ noecho := t
+ noecho.Lflag = noecho.Lflag &^ term.ECHO
+ noecho.Lflag = noecho.Lflag &^ term.ICANON
+ if err := noecho.Set(os.Stdout); err != nil {
+ return "", ErrStatusReport
+ }
+
+ fmt.Printf("\033]%d;?\007", sequence)
+ s, ok := readWithTimeout(os.Stdout)
+ if !ok {
+ return "", ErrStatusReport
+ }
+ // fmt.Println("Rcvd", s[1:])
+ return s, nil
+}
diff --git a/vendor/github.com/muesli/termenv/termenv_unix.go b/vendor/github.com/muesli/termenv/termenv_unix.go
new file mode 100644
index 000000000..ef4c2e6f6
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/termenv_unix.go
@@ -0,0 +1,111 @@
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
+
+package termenv
+
+import (
+ "os"
+ "strconv"
+ "strings"
+ "syscall"
+)
+
+func colorProfile() Profile {
+ colorTerm := os.Getenv("COLORTERM")
+ if colorTerm == "truecolor" {
+ return TrueColor
+ }
+
+ term := os.Getenv("TERM")
+ if strings.Contains(term, "256color") {
+ return ANSI256
+ }
+ if strings.Contains(term, "color") {
+ return ANSI
+ }
+
+ return Ascii
+}
+
+func foregroundColor() Color {
+ s, err := termStatusReport(10)
+ if err == nil {
+ c, err := xTermColor(s)
+ if err == nil {
+ return c
+ }
+ }
+
+ colorFGBG := os.Getenv("COLORFGBG")
+ if strings.Contains(colorFGBG, ";") {
+ c := strings.Split(colorFGBG, ";")
+ i, err := strconv.Atoi(c[0])
+ if err == nil {
+ return ANSIColor(i)
+ }
+ }
+
+ // default gray
+ return ANSIColor(7)
+}
+
+func backgroundColor() Color {
+ s, err := termStatusReport(11)
+ if err == nil {
+ c, err := xTermColor(s)
+ if err == nil {
+ return c
+ }
+ }
+
+ colorFGBG := os.Getenv("COLORFGBG")
+ if strings.Contains(colorFGBG, ";") {
+ c := strings.Split(colorFGBG, ";")
+ i, err := strconv.Atoi(c[1])
+ if err == nil {
+ return ANSIColor(i)
+ }
+ }
+
+ // default black
+ return ANSIColor(0)
+}
+
+func readWithTimeout(f *os.File) (string, bool) {
+ var readfds syscall.FdSet
+ fd := f.Fd()
+ readfds.Bits[fd/64] |= 1 << (fd % 64)
+
+ // Use select to attempt to read from os.Stdout for 100 ms
+ err := sysSelect(int(fd)+1,
+ &readfds,
+ &syscall.Timeval{Usec: 100000})
+
+ if err != nil {
+ // log.Printf("select(read error): %v", err)
+ return "", false
+ }
+ if readfds.Bits[fd/64]&(1<<(fd%64)) == 0 {
+ // log.Print("select(read timeout)")
+ return "", false
+ }
+
+ // n > 0 => is readable
+ var data []byte
+ b := make([]byte, 1)
+ for {
+ _, err := f.Read(b)
+ if err != nil {
+ // log.Printf("read(%d): %v %d", fd, err, n)
+ return "", false
+ }
+ // log.Printf("read %d bytes from stdout: %s %d\n", n, data, data[len(data)-1])
+
+ data = append(data, b[0])
+ if b[0] == '\a' || (b[0] == '\\' && len(data) > 2) {
+ break
+ }
+ }
+
+ // fmt.Printf("read %d bytes from stdout: %s\n", n, data)
+ return string(data), true
+}
diff --git a/vendor/github.com/muesli/termenv/termenv_windows.go b/vendor/github.com/muesli/termenv/termenv_windows.go
new file mode 100644
index 000000000..2fb8ec5f6
--- /dev/null
+++ b/vendor/github.com/muesli/termenv/termenv_windows.go
@@ -0,0 +1,17 @@
+// +build windows
+
+package termenv
+
+func colorProfile() Profile {
+ return TrueColor
+}
+
+func foregroundColor() Color {
+ // default gray
+ return ANSIColor(7)
+}
+
+func backgroundColor() Color {
+ // default black
+ return ANSIColor(0)
+}
diff --git a/vendor/github.com/yuin/goldmark/.gitignore b/vendor/github.com/yuin/goldmark/.gitignore
new file mode 100644
index 000000000..06c135f17
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/.gitignore
@@ -0,0 +1,19 @@
+# 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/vendor/github.com/yuin/goldmark/LICENSE b/vendor/github.com/yuin/goldmark/LICENSE
new file mode 100644
index 000000000..dc5b2a690
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/LICENSE
@@ -0,0 +1,21 @@
+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/vendor/github.com/yuin/goldmark/Makefile b/vendor/github.com/yuin/goldmark/Makefile
new file mode 100644
index 000000000..667a19a47
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/Makefile
@@ -0,0 +1,16 @@
+.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/vendor/github.com/yuin/goldmark/README.md b/vendor/github.com/yuin/goldmark/README.md
new file mode 100644
index 000000000..8cf7c5a0e
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/README.md
@@ -0,0 +1,403 @@
+goldmark
+==========================================
+
+[![http://godoc.org/github.com/yuin/goldmark](https://godoc.org/github.com/yuin/goldmark?status.svg)](http://godoc.org/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.29.
+
+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).
+- `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(),
+ ),
+ ),
+ ),
+)
+```
+
+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-mathjax](https://github.com/litao91/goldmark-mathjax): Mathjax support for the goldmark markdown parser
+
+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/vendor/github.com/yuin/goldmark/ast/ast.go b/vendor/github.com/yuin/goldmark/ast/ast.go
new file mode 100644
index 000000000..66059e94c
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/ast/ast.go
@@ -0,0 +1,492 @@
+// 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{}
+}
+
+var attrNameIDS = []byte("#")
+var attrNameID = []byte("id")
+var attrNameClassS = []byte(".")
+var attrNameClass = []byte("class")
+
+// 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)
+
+ // 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.
+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)
+ }
+}
+
+// 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/vendor/github.com/yuin/goldmark/ast/block.go b/vendor/github.com/yuin/goldmark/ast/block.go
new file mode 100644
index 000000000..f5bca33fe
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/ast/block.go
@@ -0,0 +1,474 @@
+package ast
+
+import (
+ "fmt"
+ "strings"
+
+ textm "github.com/yuin/goldmark/text"
+)
+
+// A BaseBlock struct implements the Node interface.
+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
+}
+
+// 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
+}
+
+// NewDocument returns a new Document node.
+func NewDocument() *Document {
+ return &Document{
+ BaseBlock: BaseBlock{},
+ }
+}
+
+// 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.29/#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.29/#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/vendor/github.com/yuin/goldmark/ast/inline.go b/vendor/github.com/yuin/goldmark/ast/inline.go
new file mode 100644
index 000000000..23dcad4bc
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/ast/inline.go
@@ -0,0 +1,548 @@
+package ast
+
+import (
+ "fmt"
+ "strings"
+
+ textm "github.com/yuin/goldmark/text"
+ "github.com/yuin/goldmark/util"
+)
+
+// A BaseInline struct implements the Node interface.
+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.29/#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/vendor/github.com/yuin/goldmark/extension/ast/definition_list.go b/vendor/github.com/yuin/goldmark/extension/ast/definition_list.go
new file mode 100644
index 000000000..1beffb3aa
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/ast/definition_list.go
@@ -0,0 +1,83 @@
+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/vendor/github.com/yuin/goldmark/extension/ast/footnote.go b/vendor/github.com/yuin/goldmark/extension/ast/footnote.go
new file mode 100644
index 000000000..835f8478b
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/ast/footnote.go
@@ -0,0 +1,125 @@
+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
+}
+
+// Dump implements Node.Dump.
+func (n *FootnoteLink) Dump(source []byte, level int) {
+ m := map[string]string{}
+ m["Index"] = fmt.Sprintf("%v", n.Index)
+ 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,
+ }
+}
+
+// A FootnoteBackLink struct represents a link to a footnote of Markdown
+// (PHP Markdown Extra) text.
+type FootnoteBackLink struct {
+ gast.BaseInline
+ Index int
+}
+
+// Dump implements Node.Dump.
+func (n *FootnoteBackLink) Dump(source []byte, level int) {
+ m := map[string]string{}
+ m["Index"] = fmt.Sprintf("%v", n.Index)
+ 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,
+ }
+}
+
+// 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/vendor/github.com/yuin/goldmark/extension/ast/strikethrough.go b/vendor/github.com/yuin/goldmark/extension/ast/strikethrough.go
new file mode 100644
index 000000000..a9216b72e
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/ast/strikethrough.go
@@ -0,0 +1,29 @@
+// 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/vendor/github.com/yuin/goldmark/extension/ast/table.go b/vendor/github.com/yuin/goldmark/extension/ast/table.go
new file mode 100644
index 000000000..1d8890b5e
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/ast/table.go
@@ -0,0 +1,157 @@
+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/vendor/github.com/yuin/goldmark/extension/ast/tasklist.go b/vendor/github.com/yuin/goldmark/extension/ast/tasklist.go
new file mode 100644
index 000000000..670cc1495
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/ast/tasklist.go
@@ -0,0 +1,35 @@
+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/vendor/github.com/yuin/goldmark/extension/definition_list.go b/vendor/github.com/yuin/goldmark/extension/definition_list.go
new file mode 100644
index 000000000..eb16dd03f
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/definition_list.go
@@ -0,0 +1,270 @@
+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, 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/vendor/github.com/yuin/goldmark/extension/footnote.go b/vendor/github.com/yuin/goldmark/extension/footnote.go
new file mode 100644
index 000000000..ede72db87
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/footnote.go
@@ -0,0 +1,336 @@
+package extension
+
+import (
+ "bytes"
+ "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"
+ "strconv"
+)
+
+var footnoteListKey = 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
+ }
+
+ return ast.NewFootnoteLink(index)
+}
+
+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
+ if tlist := pc.Get(footnoteListKey); tlist != nil {
+ list = tlist.(*ast.FootnoteList)
+ } else {
+ return
+ }
+ pc.Set(footnoteListKey, nil)
+ 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
+ }
+ index := footnote.(*ast.Footnote).Index
+ if index < 0 {
+ list.RemoveChild(list, footnote)
+ } else {
+ container.AppendChild(container, ast.NewFootnoteBackLink(index))
+ }
+ 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)
+}
+
+// FootnoteHTMLRenderer is a renderer.NodeRenderer implementation that
+// renders FootnoteLink nodes.
+type FootnoteHTMLRenderer struct {
+ html.Config
+}
+
+// NewFootnoteHTMLRenderer returns a new FootnoteHTMLRenderer.
+func NewFootnoteHTMLRenderer(opts ...html.Option) renderer.NodeRenderer {
+ r := &FootnoteHTMLRenderer{
+ Config: html.NewConfig(),
+ }
+ for _, opt := range opts {
+ opt.SetHTMLOption(&r.Config)
+ }
+ 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(` `)
+ }
+ 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(` `)
+ }
+ 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("")
+ _, _ = w.WriteString(tag)
+ _, _ = w.WriteString(">\n")
+ }
+ return gast.WalkContinue, nil
+}
+
+type footnote struct {
+}
+
+// Footnote is an extension that allow you to use PHP Markdown Extra Footnotes.
+var Footnote = &footnote{}
+
+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(), 500),
+ ))
+}
diff --git a/vendor/github.com/yuin/goldmark/extension/gfm.go b/vendor/github.com/yuin/goldmark/extension/gfm.go
new file mode 100644
index 000000000..a570fbdb3
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/gfm.go
@@ -0,0 +1,18 @@
+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/vendor/github.com/yuin/goldmark/extension/linkify.go b/vendor/github.com/yuin/goldmark/extension/linkify.go
new file mode 100644
index 000000000..9e68fa534
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/linkify.go
@@ -0,0 +1,303 @@
+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@:%._\+~#=]{2,256}\.[a-z]+(?:(?:/|[#?])[-a-zA-Z0-9@:%_\+.~#!?&//=\(\);,'">\^{}\[\]` + "`" + `]*)?`)
+
+var urlRegexp = regexp.MustCompile(`^(?:http|https|ftp):\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]+(?:(?:/|[#?])[-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"
+const optLinkifyURLRegexp parser.OptionName = "LinkifyURLRegexp"
+const optLinkifyWWWRegexp parser.OptionName = "LinkifyWWWRegexp"
+const 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:")
+var protoHTTPS = []byte("https:")
+var protoFTP = []byte("ftp:")
+var 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)
+ }
+ consumes += m[1]
+ block.Advance(consumes)
+ n := ast.NewTextSegment(text.NewSegment(start, start+m[1]))
+ 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/vendor/github.com/yuin/goldmark/extension/strikethrough.go b/vendor/github.com/yuin/goldmark/extension/strikethrough.go
new file mode 100644
index 000000000..1b629ad8f
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/strikethrough.go
@@ -0,0 +1,116 @@
+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/vendor/github.com/yuin/goldmark/extension/table.go b/vendor/github.com/yuin/goldmark/extension/table.go
new file mode 100644
index 000000000..f0e994e83
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/table.go
@@ -0,0 +1,463 @@
+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"
+)
+
+// 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)
+ 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))
+ }
+ 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) *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]
+ }
+ closure := util.FindClosure(line[pos:], byte(0), '|', true, false)
+ if closure < 0 {
+ closure = len(line[pos:])
+ }
+ node := ast.NewTableCell()
+ seg := text.NewSegment(segment.Start+pos, segment.Start+pos+closure)
+ seg = seg.TrimLeftSpace(source)
+ seg = seg.TrimRightSpace(source)
+ node.Lines().Append(seg)
+ node.Alignment = alignment
+ 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
+}
+
+// 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.Append(util.StringToReadOnlyBytes(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, "%s>\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),
+ ))
+ m.Renderer().AddOptions(renderer.WithNodeRenderers(
+ util.Prioritized(NewTableHTMLRenderer(e.options...), 500),
+ ))
+}
diff --git a/vendor/github.com/yuin/goldmark/extension/tasklist.go b/vendor/github.com/yuin/goldmark/extension/tasklist.go
new file mode 100644
index 000000000..1f3e52c20
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/tasklist.go
@@ -0,0 +1,115 @@
+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/vendor/github.com/yuin/goldmark/extension/typographer.go b/vendor/github.com/yuin/goldmark/extension/typographer.go
new file mode 100644
index 000000000..2c3473094
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/extension/typographer.go
@@ -0,0 +1,323 @@
+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/vendor/github.com/yuin/goldmark/go.mod b/vendor/github.com/yuin/goldmark/go.mod
new file mode 100644
index 000000000..a10efcad5
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/go.mod
@@ -0,0 +1,3 @@
+module github.com/yuin/goldmark
+
+go 1.13
diff --git a/vendor/github.com/yuin/goldmark/go.sum b/vendor/github.com/yuin/goldmark/go.sum
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/yuin/goldmark/markdown.go b/vendor/github.com/yuin/goldmark/markdown.go
new file mode 100644
index 000000000..86d12e225
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/markdown.go
@@ -0,0 +1,140 @@
+// 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/vendor/github.com/yuin/goldmark/parser/attribute.go b/vendor/github.com/yuin/goldmark/parser/attribute.go
new file mode 100644
index 000000000..ea8c0645d
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/attribute.go
@@ -0,0 +1,319 @@
+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
+ for ; i < len(line) && !util.IsSpace(line[i]) && (!util.IsPunct(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
+ }
+ 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/vendor/github.com/yuin/goldmark/parser/atx_heading.go b/vendor/github.com/yuin/goldmark/parser/atx_heading.go
new file mode 100644
index 000000000..252608881
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/atx_heading.go
@@ -0,0 +1,243 @@
+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
+ }
+ 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/vendor/github.com/yuin/goldmark/parser/auto_link.go b/vendor/github.com/yuin/goldmark/parser/auto_link.go
new file mode 100644
index 000000000..726a50571
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/auto_link.go
@@ -0,0 +1,42 @@
+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/vendor/github.com/yuin/goldmark/parser/blockquote.go b/vendor/github.com/yuin/goldmark/parser/blockquote.go
new file mode 100644
index 000000000..e7778dca7
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/blockquote.go
@@ -0,0 +1,69 @@
+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/vendor/github.com/yuin/goldmark/parser/code_block.go b/vendor/github.com/yuin/goldmark/parser/code_block.go
new file mode 100644
index 000000000..d02c21fc7
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/code_block.go
@@ -0,0 +1,79 @@
+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()
+ 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()
+ 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
+}
diff --git a/vendor/github.com/yuin/goldmark/parser/code_span.go b/vendor/github.com/yuin/goldmark/parser/code_span.go
new file mode 100644
index 000000000..13652367f
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/code_span.go
@@ -0,0 +1,83 @@
+package parser
+
+import (
+ "github.com/yuin/goldmark/ast"
+ "github.com/yuin/goldmark/text"
+ "github.com/yuin/goldmark/util"
+)
+
+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
+ }
+ }
+ }
+ if !util.IsBlank(line) {
+ 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() && block.Source()[segment.Start] == ' ') {
+ shouldTrimmed = false
+ }
+ segment = node.LastChild().(*ast.Text).Segment
+ if !(!segment.IsEmpty() && 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
+}
diff --git a/vendor/github.com/yuin/goldmark/parser/delimiter.go b/vendor/github.com/yuin/goldmark/parser/delimiter.go
new file mode 100644
index 000000000..8259f6224
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/delimiter.go
@@ -0,0 +1,241 @@
+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.29/#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.29/#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; {
+ if d, ok := c.(*Delimiter); ok {
+ closer = d
+ }
+ prev := c.PreviousSibling()
+ if prev == bottom {
+ break
+ }
+ c = prev
+ }
+ }
+ } 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 = opener.PreviousDelimiter {
+ if opener.CanOpen && opener.Processor.CanOpenCloser(opener, closer) {
+ maybeOpener = true
+ consume = opener.CalcComsumption(closer)
+ if consume > 0 {
+ found = true
+ break
+ }
+ }
+ }
+ if !found {
+ if !maybeOpener && !closer.CanOpen {
+ pc.RemoveDelimiter(closer)
+ }
+ closer = closer.NextDelimiter
+ 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/vendor/github.com/yuin/goldmark/parser/emphasis.go b/vendor/github.com/yuin/goldmark/parser/emphasis.go
new file mode 100644
index 000000000..488647117
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/emphasis.go
@@ -0,0 +1,50 @@
+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/vendor/github.com/yuin/goldmark/parser/fcode_block.go b/vendor/github.com/yuin/goldmark/parser/fcode_block.go
new file mode 100644
index 000000000..f5b83eef7
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/fcode_block.go
@@ -0,0 +1,110 @@
+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.DedentPositionPadding(line, reader.LineOffset(), segment.Padding, fdata.indent)
+
+ seg := text.NewSegmentPadding(segment.Start+pos, segment.Stop, padding)
+ 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/vendor/github.com/yuin/goldmark/parser/html_block.go b/vendor/github.com/yuin/goldmark/parser/html_block.go
new file mode 100644
index 000000000..845c00f98
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/html_block.go
@@ -0,0 +1,228 @@
+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)(?:\s.*|>.*|/>.*|)\n?$`)
+var htmlBlockType1CloseRegexp = regexp.MustCompile(`(?i)^.*(?:script|pre|style)>.*`)
+
+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-Z0-9]+)(?:\s.*|>.*|/>.*|)\n?$`)
+
+var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/)?([a-zA-Z0-9\-]+)(` + attributePattern + `*)(:?>|/>)\s*\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/vendor/github.com/yuin/goldmark/parser/link.go b/vendor/github.com/yuin/goldmark/parser/link.go
new file mode 100644
index 000000000..e7c6966f3
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/link.go
@@ -0,0 +1,387 @@
+package parser
+
+import (
+ "fmt"
+ "regexp"
+ "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 linkDestinationRegexp = regexp.MustCompile(`\s*([^\s].+)`)
+var linkTitleRegexp = regexp.MustCompile(`\s+(\)|["'\(].+)`)
+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 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(last *linkLabelState) bool {
+ if last.IsImage {
+ return false
+ }
+ var c ast.Node
+ for c = last; c != nil; c = c.NextSibling() {
+ if _, ok := c.(*ast.Link); ok {
+ 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
+ }
+}
+
+func (s *linkParser) parseReferenceLink(parent ast.Node, last *linkLabelState, block text.Reader, pc Context) (*ast.Link, bool) {
+ _, orgpos := block.Position()
+ block.Advance(1) // skip '['
+ line, segment := block.PeekLine()
+ endIndex := util.FindClosure(line, '[', ']', false, true)
+ if endIndex < 0 {
+ return nil, false
+ }
+
+ block.Advance(endIndex + 1)
+ ssegment := segment.WithStop(segment.Start + endIndex)
+ maybeReference := block.Value(ssegment)
+ if util.IsBlank(maybeReference) { // collapsed reference link
+ ssegment = text.NewSegment(last.Segment.Stop, orgpos.Start-1)
+ maybeReference = block.Value(ssegment)
+ }
+
+ 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()
+ buf := []byte{}
+ if block.Peek() == '<' {
+ i := 1
+ for i < len(line) {
+ c := line[i]
+ if c == '\\' && i < len(line)-1 && util.IsPunct(line[i+1]) {
+ buf = append(buf, '\\', line[i+1])
+ i += 2
+ continue
+ } else if c == '>' {
+ block.Advance(i + 1)
+ return line[1:i], true
+ }
+ buf = append(buf, c)
+ 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]) {
+ buf = append(buf, '\\', line[i+1])
+ i += 2
+ continue
+ } else if c == '(' {
+ opened++
+ } else if c == ')' {
+ opened--
+ if opened < 0 {
+ break
+ }
+ } else if util.IsSpace(c) {
+ break
+ }
+ buf = append(buf, c)
+ 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 = ')'
+ }
+ savedLine, savedPosition := block.Position()
+ var title []byte
+ for i := 0; ; i++ {
+ line, _ := block.PeekLine()
+ if line == nil {
+ block.SetPosition(savedLine, savedPosition)
+ return nil, false
+ }
+ offset := 0
+ if i == 0 {
+ offset = 1
+ }
+ pos := util.FindClosure(line[offset:], opener, closer, false, true)
+ if pos < 0 {
+ title = append(title, line[offset:]...)
+ block.AdvanceLine()
+ continue
+ }
+ pos += offset + 1 // 1: closer
+ block.Advance(pos)
+ if i == 0 { // avoid allocating new slice
+ return line[offset : pos-1], true
+ }
+ return append(title, line[offset:pos-1]...), true
+ }
+}
+
+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/vendor/github.com/yuin/goldmark/parser/link_ref.go b/vendor/github.com/yuin/goldmark/parser/link_ref.go
new file mode 100644
index 000000000..3fa1ecf6f
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/link_ref.go
@@ -0,0 +1,163 @@
+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, segment := 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
+ }
+ open := segment.Start + pos + 1
+ closes := -1
+ block.Advance(pos + 1)
+ for {
+ line, segment = block.PeekLine()
+ if line == nil {
+ return -1, -1
+ }
+ closure := util.FindClosure(line, '[', ']', false, false)
+ if closure > -1 {
+ closes = segment.Start + closure
+ next := closure + 1
+ if next >= len(line) || line[next] != ':' {
+ return -1, -1
+ }
+ block.Advance(next + 1)
+ break
+ }
+ block.AdvanceLine()
+ }
+ if closes < 0 {
+ return -1, -1
+ }
+ label := block.Value(text.NewSegment(open, closes))
+ if util.IsBlank(label) {
+ return -1, -1
+ }
+ block.SkipSpaces()
+ destination, ok := parseLinkDestination(block)
+ if !ok {
+ return -1, -1
+ }
+ line, segment = 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)
+ open = -1
+ closes = -1
+ closer := opener
+ if opener == '(' {
+ closer = ')'
+ }
+ for {
+ line, segment = block.PeekLine()
+ if line == nil {
+ return -1, -1
+ }
+ if open < 0 {
+ open = segment.Start
+ }
+ closure := util.FindClosure(line, opener, closer, false, true)
+ if closure > -1 {
+ closes = segment.Start + closure
+ block.Advance(closure + 1)
+ break
+ }
+ block.AdvanceLine()
+ }
+ if closes < 0 {
+ return -1, -1
+ }
+
+ line, segment = block.PeekLine()
+ if line != nil && !util.IsBlank(line) {
+ if !isNewLine {
+ return -1, -1
+ }
+ title := block.Value(text.NewSegment(open, closes))
+ ref := NewReference(label, destination, title)
+ pc.AddReference(ref)
+ return startLine, endLine
+ }
+
+ title := block.Value(text.NewSegment(open, closes))
+
+ endLine, _ = block.Position()
+ ref := NewReference(label, destination, title)
+ pc.AddReference(ref)
+ return startLine, endLine + 1
+}
diff --git a/vendor/github.com/yuin/goldmark/parser/list.go b/vendor/github.com/yuin/goldmark/parser/list.go
new file mode 100644
index 000000000..9183a6da3
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/list.go
@@ -0,0 +1,251 @@
+package parser
+
+import (
+ "github.com/yuin/goldmark/ast"
+ "github.com/yuin/goldmark/text"
+ "github.com/yuin/goldmark/util"
+ "strconv"
+)
+
+type listItemType int
+
+const (
+ notList listItemType = iota
+ bulletList
+ orderedList
+)
+
+// 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(skipListParser) != nil {
+ pc.Set(skipListParser, 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[5]-match[4] == 1 {
+ return nil, NoChildren
+ }
+ }
+
+ marker := line[match[3]-1]
+ node := ast.NewList(marker)
+ if start > -1 {
+ node.Start = start
+ }
+ 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) {
+ // A list item can begin with at most one blank line
+ if node.ChildCount() == 1 && node.LastChild().ChildCount() == 0 {
+ return Close
+ }
+ 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.
+ offset := lastOffset(node)
+ indent, _ := util.IndentWidth(line, reader.LineOffset())
+
+ if indent < offset {
+ 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
+ }
+ }
+ 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; gc = gc.NextSibling() {
+ paragraph, ok := gc.(*ast.Paragraph)
+ 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/vendor/github.com/yuin/goldmark/parser/list_item.go b/vendor/github.com/yuin/goldmark/parser/list_item.go
new file mode 100644
index 000000000..4a698d838
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/list_item.go
@@ -0,0 +1,85 @@
+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
+}
+
+var skipListParser = NewContextKey()
+var skipListParserValue interface{} = true
+
+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
+ }
+ itemOffset := calcListOffset(line, match)
+ node := ast.NewListItem(match[3] + itemOffset)
+ if match[4] < 0 || match[5]-match[4] == 1 {
+ 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) {
+ return Continue | HasChildren
+ }
+
+ indent, _ := util.IndentWidth(line, reader.LineOffset())
+ offset := lastOffset(node.Parent())
+ if indent < offset && indent < 4 {
+ _, typ := matchesListItem(line, true)
+ // new list item found
+ if typ != notList {
+ pc.Set(skipListParser, skipListParserValue)
+ }
+ 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/vendor/github.com/yuin/goldmark/parser/paragraph.go b/vendor/github.com/yuin/goldmark/parser/paragraph.go
new file mode 100644
index 000000000..2dd2b9a97
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/paragraph.go
@@ -0,0 +1,71 @@
+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/vendor/github.com/yuin/goldmark/parser/parser.go b/vendor/github.com/yuin/goldmark/parser/parser.go
new file mode 100644
index 000000000..def13db66
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/parser.go
@@ -0,0 +1,1211 @@
+// 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{}
+
+ // 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) 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)
+}
+
+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)
+ hardlineBreak := false
+ softLinebreak := line[lineLength-1] == '\n'
+ if lineLength >= 2 && line[lineLength-2] == '\\' && softLinebreak { // ends with \\n
+ lineLength -= 2
+ hardlineBreak = true
+
+ } else if lineLength >= 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && softLinebreak { // ends with \\r\n
+ lineLength -= 3
+ hardlineBreak = true
+ } else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && softLinebreak { // ends with [space][space]\n
+ lineLength -= 3
+ hardlineBreak = true
+ } else if lineLength >= 4 && line[lineLength-4] == ' ' && line[lineLength-3] == ' ' && line[lineLength-2] == '\r' && softLinebreak { // ends with [space][space]\r\n
+ lineLength -= 4
+ hardlineBreak = true
+ }
+
+ 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)
+ stop := diff.Stop
+ rest := diff.WithStop(stop)
+ text := ast.NewTextSegment(rest.TrimRightSpace(source))
+ text.SetSoftLineBreak(softLinebreak)
+ text.SetHardLineBreak(hardlineBreak)
+ parent.AppendChild(parent, text)
+ block.AdvanceLine()
+ }
+
+ ProcessDelimiters(nil, pc)
+ for _, ip := range p.closeBlockers {
+ ip.CloseBlock(parent, block, pc)
+ }
+}
diff --git a/vendor/github.com/yuin/goldmark/parser/raw_html.go b/vendor/github.com/yuin/goldmark/parser/raw_html.go
new file mode 100644
index 000000000..d7ba414ff
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/raw_html.go
@@ -0,0 +1,108 @@
+package parser
+
+import (
+ "bytes"
+ "github.com/yuin/goldmark/ast"
+ "github.com/yuin/goldmark/text"
+ "github.com/yuin/goldmark/util"
+ "regexp"
+)
+
+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
+}
+
+var dummyMatch = [][]byte{}
+
+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
+}
+
+func (s *rawHTMLParser) CloseBlock(parent ast.Node, pc Context) {
+ // nothing to do
+}
diff --git a/vendor/github.com/yuin/goldmark/parser/setext_headings.go b/vendor/github.com/yuin/goldmark/parser/setext_headings.go
new file mode 100644
index 000000000..686efe179
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/setext_headings.go
@@ -0,0 +1,126 @@
+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/vendor/github.com/yuin/goldmark/parser/thematic_break.go b/vendor/github.com/yuin/goldmark/parser/thematic_break.go
new file mode 100644
index 000000000..db20a1e7a
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/parser/thematic_break.go
@@ -0,0 +1,75 @@
+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/vendor/github.com/yuin/goldmark/renderer/html/html.go b/vendor/github.com/yuin/goldmark/renderer/html/html.go
new file mode 100644
index 000000000..e545a736b
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/renderer/html/html.go
@@ -0,0 +1,804 @@
+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("')
+ r.writeLines(w, source, n)
+ } else {
+ _, _ = 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)
+ _, _ = w.Write(line.Value(source))
+ }
+ } else {
+ _, _ = w.WriteString("\n")
+ }
+ } else {
+ if n.HasClosure() {
+ if r.Unsafe {
+ closure := n.ClosureLine
+ _, _ = w.Write(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"),
+)
+
+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("")
+ _, _ = w.WriteString(tag)
+ _, _ = 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])
+ if c != n.LastChild() {
+ 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("")
+ _, _ = w.WriteString(tag)
+ _ = w.WriteByte('>')
+ }
+ 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(" ")
+ } 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)
+}
+
+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) 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 == '&' {
+ 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] == ';' {
+ 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]), 0, 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/vendor/github.com/yuin/goldmark/renderer/renderer.go b/vendor/github.com/yuin/goldmark/renderer/renderer.go
new file mode 100644
index 000000000..10f6d4010
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/renderer/renderer.go
@@ -0,0 +1,174 @@
+// 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/vendor/github.com/yuin/goldmark/text/reader.go b/vendor/github.com/yuin/goldmark/text/reader.go
new file mode 100644
index 000000000..df25e5457
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/text/reader.go
@@ -0,0 +1,543 @@
+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
+}
+
+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) 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) 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
+}
diff --git a/vendor/github.com/yuin/goldmark/text/segment.go b/vendor/github.com/yuin/goldmark/text/segment.go
new file mode 100644
index 000000000..badd4bc8e
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/text/segment.go
@@ -0,0 +1,209 @@
+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/vendor/github.com/yuin/goldmark/util/html5entities.go b/vendor/github.com/yuin/goldmark/util/html5entities.go
new file mode 100644
index 000000000..b8e00a91b
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/util/html5entities.go
@@ -0,0 +1,2142 @@
+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/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go b/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go
new file mode 100644
index 000000000..f66ee7c43
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/util/unicode_case_folding.go
@@ -0,0 +1,1491 @@
+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/vendor/github.com/yuin/goldmark/util/util.go b/vendor/github.com/yuin/goldmark/util/util.go
new file mode 100644
index 000000000..fc1438dc1
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/util/util.go
@@ -0,0 +1,980 @@
+// 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...)
+}
+
+// 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...)
+}
+
+// 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)
+ 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) {
+ if width == 0 {
+ return 0, 0
+ }
+ w := 0
+ l := len(bs)
+ i := 0
+ hasTab := false
+ for ; i < l; i++ {
+ if bs[i] == '\t' {
+ w += TabWidth(currentPos + w)
+ hasTab = true
+ } else if bs[i] == ' ' {
+ w++
+ } else {
+ break
+ }
+ }
+ if w >= width {
+ if !hasTab {
+ return width, 0
+ }
+ return i, w - width
+ }
+ return -1, -1
+}
+
+// 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 += TabWidth(currentPos + w)
+ } else if bs[i] == ' ' {
+ w++
+ } else {
+ break
+ }
+ }
+ if w >= width {
+ return i - paddingv, w - width
+ }
+ return -1, -1
+}
+
+// DedentPosition dedents lines by the given width.
+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.
+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.
+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, 1, 1, 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
+}
+
+// IsPunct 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
+}
+
+// IsSpace 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/vendor/github.com/yuin/goldmark/util/util_safe.go b/vendor/github.com/yuin/goldmark/util/util_safe.go
new file mode 100644
index 000000000..507a9d029
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/util/util_safe.go
@@ -0,0 +1,13 @@
+// +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/vendor/github.com/yuin/goldmark/util/util_unsafe.go b/vendor/github.com/yuin/goldmark/util/util_unsafe.go
new file mode 100644
index 000000000..d09881104
--- /dev/null
+++ b/vendor/github.com/yuin/goldmark/util/util_unsafe.go
@@ -0,0 +1,23 @@
+// +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/vendor/golang.org/x/net/html/atom/atom.go b/vendor/golang.org/x/net/html/atom/atom.go
new file mode 100644
index 000000000..cd0a8ac15
--- /dev/null
+++ b/vendor/golang.org/x/net/html/atom/atom.go
@@ -0,0 +1,78 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package atom provides integer codes (also known as atoms) for a fixed set of
+// frequently occurring HTML strings: tag names and attribute keys such as "p"
+// and "id".
+//
+// Sharing an atom's name between all elements with the same tag can result in
+// fewer string allocations when tokenizing and parsing HTML. Integer
+// comparisons are also generally faster than string comparisons.
+//
+// The value of an atom's particular code is not guaranteed to stay the same
+// between versions of this package. Neither is any ordering guaranteed:
+// whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to
+// be dense. The only guarantees are that e.g. looking up "div" will yield
+// atom.Div, calling atom.Div.String will return "div", and atom.Div != 0.
+package atom // import "golang.org/x/net/html/atom"
+
+// Atom is an integer code for a string. The zero value maps to "".
+type Atom uint32
+
+// String returns the atom's name.
+func (a Atom) String() string {
+ start := uint32(a >> 8)
+ n := uint32(a & 0xff)
+ if start+n > uint32(len(atomText)) {
+ return ""
+ }
+ return atomText[start : start+n]
+}
+
+func (a Atom) string() string {
+ return atomText[a>>8 : a>>8+a&0xff]
+}
+
+// fnv computes the FNV hash with an arbitrary starting value h.
+func fnv(h uint32, s []byte) uint32 {
+ for i := range s {
+ h ^= uint32(s[i])
+ h *= 16777619
+ }
+ return h
+}
+
+func match(s string, t []byte) bool {
+ for i, c := range t {
+ if s[i] != c {
+ return false
+ }
+ }
+ return true
+}
+
+// Lookup returns the atom whose name is s. It returns zero if there is no
+// such atom. The lookup is case sensitive.
+func Lookup(s []byte) Atom {
+ if len(s) == 0 || len(s) > maxAtomLen {
+ return 0
+ }
+ h := fnv(hash0, s)
+ if a := table[h&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {
+ return a
+ }
+ if a := table[(h>>16)&uint32(len(table)-1)]; int(a&0xff) == len(s) && match(a.string(), s) {
+ return a
+ }
+ return 0
+}
+
+// String returns a string whose contents are equal to s. In that sense, it is
+// equivalent to string(s) but may be more efficient.
+func String(s []byte) string {
+ if a := Lookup(s); a != 0 {
+ return a.String()
+ }
+ return string(s)
+}
diff --git a/vendor/golang.org/x/net/html/atom/table.go b/vendor/golang.org/x/net/html/atom/table.go
new file mode 100644
index 000000000..2a938864c
--- /dev/null
+++ b/vendor/golang.org/x/net/html/atom/table.go
@@ -0,0 +1,783 @@
+// Code generated by go generate gen.go; DO NOT EDIT.
+
+//go:generate go run gen.go
+
+package atom
+
+const (
+ A Atom = 0x1
+ Abbr Atom = 0x4
+ Accept Atom = 0x1a06
+ AcceptCharset Atom = 0x1a0e
+ Accesskey Atom = 0x2c09
+ Acronym Atom = 0xaa07
+ Action Atom = 0x27206
+ Address Atom = 0x6f307
+ Align Atom = 0xb105
+ Allowfullscreen Atom = 0x2080f
+ Allowpaymentrequest Atom = 0xc113
+ Allowusermedia Atom = 0xdd0e
+ Alt Atom = 0xf303
+ Annotation Atom = 0x1c90a
+ AnnotationXml Atom = 0x1c90e
+ Applet Atom = 0x31906
+ Area Atom = 0x35604
+ Article Atom = 0x3fc07
+ As Atom = 0x3c02
+ Aside Atom = 0x10705
+ Async Atom = 0xff05
+ Audio Atom = 0x11505
+ Autocomplete Atom = 0x2780c
+ Autofocus Atom = 0x12109
+ Autoplay Atom = 0x13c08
+ B Atom = 0x101
+ Base Atom = 0x3b04
+ Basefont Atom = 0x3b08
+ Bdi Atom = 0xba03
+ Bdo Atom = 0x14b03
+ Bgsound Atom = 0x15e07
+ Big Atom = 0x17003
+ Blink Atom = 0x17305
+ Blockquote Atom = 0x1870a
+ Body Atom = 0x2804
+ Br Atom = 0x202
+ Button Atom = 0x19106
+ Canvas Atom = 0x10306
+ Caption Atom = 0x23107
+ Center Atom = 0x22006
+ Challenge Atom = 0x29b09
+ Charset Atom = 0x2107
+ Checked Atom = 0x47907
+ Cite Atom = 0x19c04
+ Class Atom = 0x56405
+ Code Atom = 0x5c504
+ Col Atom = 0x1ab03
+ Colgroup Atom = 0x1ab08
+ Color Atom = 0x1bf05
+ Cols Atom = 0x1c404
+ Colspan Atom = 0x1c407
+ Command Atom = 0x1d707
+ Content Atom = 0x58b07
+ Contenteditable Atom = 0x58b0f
+ Contextmenu Atom = 0x3800b
+ Controls Atom = 0x1de08
+ Coords Atom = 0x1ea06
+ Crossorigin Atom = 0x1fb0b
+ Data Atom = 0x4a504
+ Datalist Atom = 0x4a508
+ Datetime Atom = 0x2b808
+ Dd Atom = 0x2d702
+ Default Atom = 0x10a07
+ Defer Atom = 0x5c705
+ Del Atom = 0x45203
+ Desc Atom = 0x56104
+ Details Atom = 0x7207
+ Dfn Atom = 0x8703
+ Dialog Atom = 0xbb06
+ Dir Atom = 0x9303
+ Dirname Atom = 0x9307
+ Disabled Atom = 0x16408
+ Div Atom = 0x16b03
+ Dl Atom = 0x5e602
+ Download Atom = 0x46308
+ Draggable Atom = 0x17a09
+ Dropzone Atom = 0x40508
+ Dt Atom = 0x64b02
+ Em Atom = 0x6e02
+ Embed Atom = 0x6e05
+ Enctype Atom = 0x28d07
+ Face Atom = 0x21e04
+ Fieldset Atom = 0x22608
+ Figcaption Atom = 0x22e0a
+ Figure Atom = 0x24806
+ Font Atom = 0x3f04
+ Footer Atom = 0xf606
+ For Atom = 0x25403
+ ForeignObject Atom = 0x2540d
+ Foreignobject Atom = 0x2610d
+ Form Atom = 0x26e04
+ Formaction Atom = 0x26e0a
+ Formenctype Atom = 0x2890b
+ Formmethod Atom = 0x2a40a
+ Formnovalidate Atom = 0x2ae0e
+ Formtarget Atom = 0x2c00a
+ Frame Atom = 0x8b05
+ Frameset Atom = 0x8b08
+ H1 Atom = 0x15c02
+ H2 Atom = 0x2de02
+ H3 Atom = 0x30d02
+ H4 Atom = 0x34502
+ H5 Atom = 0x34f02
+ H6 Atom = 0x64d02
+ Head Atom = 0x33104
+ Header Atom = 0x33106
+ Headers Atom = 0x33107
+ Height Atom = 0x5206
+ Hgroup Atom = 0x2ca06
+ Hidden Atom = 0x2d506
+ High Atom = 0x2db04
+ Hr Atom = 0x15702
+ Href Atom = 0x2e004
+ Hreflang Atom = 0x2e008
+ Html Atom = 0x5604
+ HttpEquiv Atom = 0x2e80a
+ I Atom = 0x601
+ Icon Atom = 0x58a04
+ Id Atom = 0x10902
+ Iframe Atom = 0x2fc06
+ Image Atom = 0x30205
+ Img Atom = 0x30703
+ Input Atom = 0x44b05
+ Inputmode Atom = 0x44b09
+ Ins Atom = 0x20403
+ Integrity Atom = 0x23f09
+ Is Atom = 0x16502
+ Isindex Atom = 0x30f07
+ Ismap Atom = 0x31605
+ Itemid Atom = 0x38b06
+ Itemprop Atom = 0x19d08
+ Itemref Atom = 0x3cd07
+ Itemscope Atom = 0x67109
+ Itemtype Atom = 0x31f08
+ Kbd Atom = 0xb903
+ Keygen Atom = 0x3206
+ Keytype Atom = 0xd607
+ Kind Atom = 0x17704
+ Label Atom = 0x5905
+ Lang Atom = 0x2e404
+ Legend Atom = 0x18106
+ Li Atom = 0xb202
+ Link Atom = 0x17404
+ List Atom = 0x4a904
+ Listing Atom = 0x4a907
+ Loop Atom = 0x5d04
+ Low Atom = 0xc303
+ Main Atom = 0x1004
+ Malignmark Atom = 0xb00a
+ Manifest Atom = 0x6d708
+ Map Atom = 0x31803
+ Mark Atom = 0xb604
+ Marquee Atom = 0x32707
+ Math Atom = 0x32e04
+ Max Atom = 0x33d03
+ Maxlength Atom = 0x33d09
+ Media Atom = 0xe605
+ Mediagroup Atom = 0xe60a
+ Menu Atom = 0x38704
+ Menuitem Atom = 0x38708
+ Meta Atom = 0x4b804
+ Meter Atom = 0x9805
+ Method Atom = 0x2a806
+ Mglyph Atom = 0x30806
+ Mi Atom = 0x34702
+ Min Atom = 0x34703
+ Minlength Atom = 0x34709
+ Mn Atom = 0x2b102
+ Mo Atom = 0xa402
+ Ms Atom = 0x67402
+ Mtext Atom = 0x35105
+ Multiple Atom = 0x35f08
+ Muted Atom = 0x36705
+ Name Atom = 0x9604
+ Nav Atom = 0x1303
+ Nobr Atom = 0x3704
+ Noembed Atom = 0x6c07
+ Noframes Atom = 0x8908
+ Nomodule Atom = 0xa208
+ Nonce Atom = 0x1a605
+ Noscript Atom = 0x21608
+ Novalidate Atom = 0x2b20a
+ Object Atom = 0x26806
+ Ol Atom = 0x13702
+ Onabort Atom = 0x19507
+ Onafterprint Atom = 0x2360c
+ Onautocomplete Atom = 0x2760e
+ Onautocompleteerror Atom = 0x27613
+ Onauxclick Atom = 0x61f0a
+ Onbeforeprint Atom = 0x69e0d
+ Onbeforeunload Atom = 0x6e70e
+ Onblur Atom = 0x56d06
+ Oncancel Atom = 0x11908
+ Oncanplay Atom = 0x14d09
+ Oncanplaythrough Atom = 0x14d10
+ Onchange Atom = 0x41b08
+ Onclick Atom = 0x2f507
+ Onclose Atom = 0x36c07
+ Oncontextmenu Atom = 0x37e0d
+ Oncopy Atom = 0x39106
+ Oncuechange Atom = 0x3970b
+ Oncut Atom = 0x3a205
+ Ondblclick Atom = 0x3a70a
+ Ondrag Atom = 0x3b106
+ Ondragend Atom = 0x3b109
+ Ondragenter Atom = 0x3ba0b
+ Ondragexit Atom = 0x3c50a
+ Ondragleave Atom = 0x3df0b
+ Ondragover Atom = 0x3ea0a
+ Ondragstart Atom = 0x3f40b
+ Ondrop Atom = 0x40306
+ Ondurationchange Atom = 0x41310
+ Onemptied Atom = 0x40a09
+ Onended Atom = 0x42307
+ Onerror Atom = 0x42a07
+ Onfocus Atom = 0x43107
+ Onhashchange Atom = 0x43d0c
+ Oninput Atom = 0x44907
+ Oninvalid Atom = 0x45509
+ Onkeydown Atom = 0x45e09
+ Onkeypress Atom = 0x46b0a
+ Onkeyup Atom = 0x48007
+ Onlanguagechange Atom = 0x48d10
+ Onload Atom = 0x49d06
+ Onloadeddata Atom = 0x49d0c
+ Onloadedmetadata Atom = 0x4b010
+ Onloadend Atom = 0x4c609
+ Onloadstart Atom = 0x4cf0b
+ Onmessage Atom = 0x4da09
+ Onmessageerror Atom = 0x4da0e
+ Onmousedown Atom = 0x4e80b
+ Onmouseenter Atom = 0x4f30c
+ Onmouseleave Atom = 0x4ff0c
+ Onmousemove Atom = 0x50b0b
+ Onmouseout Atom = 0x5160a
+ Onmouseover Atom = 0x5230b
+ Onmouseup Atom = 0x52e09
+ Onmousewheel Atom = 0x53c0c
+ Onoffline Atom = 0x54809
+ Ononline Atom = 0x55108
+ Onpagehide Atom = 0x5590a
+ Onpageshow Atom = 0x5730a
+ Onpaste Atom = 0x57f07
+ Onpause Atom = 0x59a07
+ Onplay Atom = 0x5a406
+ Onplaying Atom = 0x5a409
+ Onpopstate Atom = 0x5ad0a
+ Onprogress Atom = 0x5b70a
+ Onratechange Atom = 0x5cc0c
+ Onrejectionhandled Atom = 0x5d812
+ Onreset Atom = 0x5ea07
+ Onresize Atom = 0x5f108
+ Onscroll Atom = 0x60008
+ Onsecuritypolicyviolation Atom = 0x60819
+ Onseeked Atom = 0x62908
+ Onseeking Atom = 0x63109
+ Onselect Atom = 0x63a08
+ Onshow Atom = 0x64406
+ Onsort Atom = 0x64f06
+ Onstalled Atom = 0x65909
+ Onstorage Atom = 0x66209
+ Onsubmit Atom = 0x66b08
+ Onsuspend Atom = 0x67b09
+ Ontimeupdate Atom = 0x400c
+ Ontoggle Atom = 0x68408
+ Onunhandledrejection Atom = 0x68c14
+ Onunload Atom = 0x6ab08
+ Onvolumechange Atom = 0x6b30e
+ Onwaiting Atom = 0x6c109
+ Onwheel Atom = 0x6ca07
+ Open Atom = 0x1a304
+ Optgroup Atom = 0x5f08
+ Optimum Atom = 0x6d107
+ Option Atom = 0x6e306
+ Output Atom = 0x51d06
+ P Atom = 0xc01
+ Param Atom = 0xc05
+ Pattern Atom = 0x6607
+ Picture Atom = 0x7b07
+ Ping Atom = 0xef04
+ Placeholder Atom = 0x1310b
+ Plaintext Atom = 0x1b209
+ Playsinline Atom = 0x1400b
+ Poster Atom = 0x2cf06
+ Pre Atom = 0x47003
+ Preload Atom = 0x48607
+ Progress Atom = 0x5b908
+ Prompt Atom = 0x53606
+ Public Atom = 0x58606
+ Q Atom = 0xcf01
+ Radiogroup Atom = 0x30a
+ Rb Atom = 0x3a02
+ Readonly Atom = 0x35708
+ Referrerpolicy Atom = 0x3d10e
+ Rel Atom = 0x48703
+ Required Atom = 0x24c08
+ Reversed Atom = 0x8008
+ Rows Atom = 0x9c04
+ Rowspan Atom = 0x9c07
+ Rp Atom = 0x23c02
+ Rt Atom = 0x19a02
+ Rtc Atom = 0x19a03
+ Ruby Atom = 0xfb04
+ S Atom = 0x2501
+ Samp Atom = 0x7804
+ Sandbox Atom = 0x12907
+ Scope Atom = 0x67505
+ Scoped Atom = 0x67506
+ Script Atom = 0x21806
+ Seamless Atom = 0x37108
+ Section Atom = 0x56807
+ Select Atom = 0x63c06
+ Selected Atom = 0x63c08
+ Shape Atom = 0x1e505
+ Size Atom = 0x5f504
+ Sizes Atom = 0x5f505
+ Slot Atom = 0x1ef04
+ Small Atom = 0x20605
+ Sortable Atom = 0x65108
+ Sorted Atom = 0x33706
+ Source Atom = 0x37806
+ Spacer Atom = 0x43706
+ Span Atom = 0x9f04
+ Spellcheck Atom = 0x4740a
+ Src Atom = 0x5c003
+ Srcdoc Atom = 0x5c006
+ Srclang Atom = 0x5f907
+ Srcset Atom = 0x6f906
+ Start Atom = 0x3fa05
+ Step Atom = 0x58304
+ Strike Atom = 0xd206
+ Strong Atom = 0x6dd06
+ Style Atom = 0x6ff05
+ Sub Atom = 0x66d03
+ Summary Atom = 0x70407
+ Sup Atom = 0x70b03
+ Svg Atom = 0x70e03
+ System Atom = 0x71106
+ Tabindex Atom = 0x4be08
+ Table Atom = 0x59505
+ Target Atom = 0x2c406
+ Tbody Atom = 0x2705
+ Td Atom = 0x9202
+ Template Atom = 0x71408
+ Textarea Atom = 0x35208
+ Tfoot Atom = 0xf505
+ Th Atom = 0x15602
+ Thead Atom = 0x33005
+ Time Atom = 0x4204
+ Title Atom = 0x11005
+ Tr Atom = 0xcc02
+ Track Atom = 0x1ba05
+ Translate Atom = 0x1f209
+ Tt Atom = 0x6802
+ Type Atom = 0xd904
+ Typemustmatch Atom = 0x2900d
+ U Atom = 0xb01
+ Ul Atom = 0xa702
+ Updateviacache Atom = 0x460e
+ Usemap Atom = 0x59e06
+ Value Atom = 0x1505
+ Var Atom = 0x16d03
+ Video Atom = 0x2f105
+ Wbr Atom = 0x57c03
+ Width Atom = 0x64905
+ Workertype Atom = 0x71c0a
+ Wrap Atom = 0x72604
+ Xmp Atom = 0x12f03
+)
+
+const hash0 = 0x81cdf10e
+
+const maxAtomLen = 25
+
+var table = [1 << 9]Atom{
+ 0x1: 0xe60a, // mediagroup
+ 0x2: 0x2e404, // lang
+ 0x4: 0x2c09, // accesskey
+ 0x5: 0x8b08, // frameset
+ 0x7: 0x63a08, // onselect
+ 0x8: 0x71106, // system
+ 0xa: 0x64905, // width
+ 0xc: 0x2890b, // formenctype
+ 0xd: 0x13702, // ol
+ 0xe: 0x3970b, // oncuechange
+ 0x10: 0x14b03, // bdo
+ 0x11: 0x11505, // audio
+ 0x12: 0x17a09, // draggable
+ 0x14: 0x2f105, // video
+ 0x15: 0x2b102, // mn
+ 0x16: 0x38704, // menu
+ 0x17: 0x2cf06, // poster
+ 0x19: 0xf606, // footer
+ 0x1a: 0x2a806, // method
+ 0x1b: 0x2b808, // datetime
+ 0x1c: 0x19507, // onabort
+ 0x1d: 0x460e, // updateviacache
+ 0x1e: 0xff05, // async
+ 0x1f: 0x49d06, // onload
+ 0x21: 0x11908, // oncancel
+ 0x22: 0x62908, // onseeked
+ 0x23: 0x30205, // image
+ 0x24: 0x5d812, // onrejectionhandled
+ 0x26: 0x17404, // link
+ 0x27: 0x51d06, // output
+ 0x28: 0x33104, // head
+ 0x29: 0x4ff0c, // onmouseleave
+ 0x2a: 0x57f07, // onpaste
+ 0x2b: 0x5a409, // onplaying
+ 0x2c: 0x1c407, // colspan
+ 0x2f: 0x1bf05, // color
+ 0x30: 0x5f504, // size
+ 0x31: 0x2e80a, // http-equiv
+ 0x33: 0x601, // i
+ 0x34: 0x5590a, // onpagehide
+ 0x35: 0x68c14, // onunhandledrejection
+ 0x37: 0x42a07, // onerror
+ 0x3a: 0x3b08, // basefont
+ 0x3f: 0x1303, // nav
+ 0x40: 0x17704, // kind
+ 0x41: 0x35708, // readonly
+ 0x42: 0x30806, // mglyph
+ 0x44: 0xb202, // li
+ 0x46: 0x2d506, // hidden
+ 0x47: 0x70e03, // svg
+ 0x48: 0x58304, // step
+ 0x49: 0x23f09, // integrity
+ 0x4a: 0x58606, // public
+ 0x4c: 0x1ab03, // col
+ 0x4d: 0x1870a, // blockquote
+ 0x4e: 0x34f02, // h5
+ 0x50: 0x5b908, // progress
+ 0x51: 0x5f505, // sizes
+ 0x52: 0x34502, // h4
+ 0x56: 0x33005, // thead
+ 0x57: 0xd607, // keytype
+ 0x58: 0x5b70a, // onprogress
+ 0x59: 0x44b09, // inputmode
+ 0x5a: 0x3b109, // ondragend
+ 0x5d: 0x3a205, // oncut
+ 0x5e: 0x43706, // spacer
+ 0x5f: 0x1ab08, // colgroup
+ 0x62: 0x16502, // is
+ 0x65: 0x3c02, // as
+ 0x66: 0x54809, // onoffline
+ 0x67: 0x33706, // sorted
+ 0x69: 0x48d10, // onlanguagechange
+ 0x6c: 0x43d0c, // onhashchange
+ 0x6d: 0x9604, // name
+ 0x6e: 0xf505, // tfoot
+ 0x6f: 0x56104, // desc
+ 0x70: 0x33d03, // max
+ 0x72: 0x1ea06, // coords
+ 0x73: 0x30d02, // h3
+ 0x74: 0x6e70e, // onbeforeunload
+ 0x75: 0x9c04, // rows
+ 0x76: 0x63c06, // select
+ 0x77: 0x9805, // meter
+ 0x78: 0x38b06, // itemid
+ 0x79: 0x53c0c, // onmousewheel
+ 0x7a: 0x5c006, // srcdoc
+ 0x7d: 0x1ba05, // track
+ 0x7f: 0x31f08, // itemtype
+ 0x82: 0xa402, // mo
+ 0x83: 0x41b08, // onchange
+ 0x84: 0x33107, // headers
+ 0x85: 0x5cc0c, // onratechange
+ 0x86: 0x60819, // onsecuritypolicyviolation
+ 0x88: 0x4a508, // datalist
+ 0x89: 0x4e80b, // onmousedown
+ 0x8a: 0x1ef04, // slot
+ 0x8b: 0x4b010, // onloadedmetadata
+ 0x8c: 0x1a06, // accept
+ 0x8d: 0x26806, // object
+ 0x91: 0x6b30e, // onvolumechange
+ 0x92: 0x2107, // charset
+ 0x93: 0x27613, // onautocompleteerror
+ 0x94: 0xc113, // allowpaymentrequest
+ 0x95: 0x2804, // body
+ 0x96: 0x10a07, // default
+ 0x97: 0x63c08, // selected
+ 0x98: 0x21e04, // face
+ 0x99: 0x1e505, // shape
+ 0x9b: 0x68408, // ontoggle
+ 0x9e: 0x64b02, // dt
+ 0x9f: 0xb604, // mark
+ 0xa1: 0xb01, // u
+ 0xa4: 0x6ab08, // onunload
+ 0xa5: 0x5d04, // loop
+ 0xa6: 0x16408, // disabled
+ 0xaa: 0x42307, // onended
+ 0xab: 0xb00a, // malignmark
+ 0xad: 0x67b09, // onsuspend
+ 0xae: 0x35105, // mtext
+ 0xaf: 0x64f06, // onsort
+ 0xb0: 0x19d08, // itemprop
+ 0xb3: 0x67109, // itemscope
+ 0xb4: 0x17305, // blink
+ 0xb6: 0x3b106, // ondrag
+ 0xb7: 0xa702, // ul
+ 0xb8: 0x26e04, // form
+ 0xb9: 0x12907, // sandbox
+ 0xba: 0x8b05, // frame
+ 0xbb: 0x1505, // value
+ 0xbc: 0x66209, // onstorage
+ 0xbf: 0xaa07, // acronym
+ 0xc0: 0x19a02, // rt
+ 0xc2: 0x202, // br
+ 0xc3: 0x22608, // fieldset
+ 0xc4: 0x2900d, // typemustmatch
+ 0xc5: 0xa208, // nomodule
+ 0xc6: 0x6c07, // noembed
+ 0xc7: 0x69e0d, // onbeforeprint
+ 0xc8: 0x19106, // button
+ 0xc9: 0x2f507, // onclick
+ 0xca: 0x70407, // summary
+ 0xcd: 0xfb04, // ruby
+ 0xce: 0x56405, // class
+ 0xcf: 0x3f40b, // ondragstart
+ 0xd0: 0x23107, // caption
+ 0xd4: 0xdd0e, // allowusermedia
+ 0xd5: 0x4cf0b, // onloadstart
+ 0xd9: 0x16b03, // div
+ 0xda: 0x4a904, // list
+ 0xdb: 0x32e04, // math
+ 0xdc: 0x44b05, // input
+ 0xdf: 0x3ea0a, // ondragover
+ 0xe0: 0x2de02, // h2
+ 0xe2: 0x1b209, // plaintext
+ 0xe4: 0x4f30c, // onmouseenter
+ 0xe7: 0x47907, // checked
+ 0xe8: 0x47003, // pre
+ 0xea: 0x35f08, // multiple
+ 0xeb: 0xba03, // bdi
+ 0xec: 0x33d09, // maxlength
+ 0xed: 0xcf01, // q
+ 0xee: 0x61f0a, // onauxclick
+ 0xf0: 0x57c03, // wbr
+ 0xf2: 0x3b04, // base
+ 0xf3: 0x6e306, // option
+ 0xf5: 0x41310, // ondurationchange
+ 0xf7: 0x8908, // noframes
+ 0xf9: 0x40508, // dropzone
+ 0xfb: 0x67505, // scope
+ 0xfc: 0x8008, // reversed
+ 0xfd: 0x3ba0b, // ondragenter
+ 0xfe: 0x3fa05, // start
+ 0xff: 0x12f03, // xmp
+ 0x100: 0x5f907, // srclang
+ 0x101: 0x30703, // img
+ 0x104: 0x101, // b
+ 0x105: 0x25403, // for
+ 0x106: 0x10705, // aside
+ 0x107: 0x44907, // oninput
+ 0x108: 0x35604, // area
+ 0x109: 0x2a40a, // formmethod
+ 0x10a: 0x72604, // wrap
+ 0x10c: 0x23c02, // rp
+ 0x10d: 0x46b0a, // onkeypress
+ 0x10e: 0x6802, // tt
+ 0x110: 0x34702, // mi
+ 0x111: 0x36705, // muted
+ 0x112: 0xf303, // alt
+ 0x113: 0x5c504, // code
+ 0x114: 0x6e02, // em
+ 0x115: 0x3c50a, // ondragexit
+ 0x117: 0x9f04, // span
+ 0x119: 0x6d708, // manifest
+ 0x11a: 0x38708, // menuitem
+ 0x11b: 0x58b07, // content
+ 0x11d: 0x6c109, // onwaiting
+ 0x11f: 0x4c609, // onloadend
+ 0x121: 0x37e0d, // oncontextmenu
+ 0x123: 0x56d06, // onblur
+ 0x124: 0x3fc07, // article
+ 0x125: 0x9303, // dir
+ 0x126: 0xef04, // ping
+ 0x127: 0x24c08, // required
+ 0x128: 0x45509, // oninvalid
+ 0x129: 0xb105, // align
+ 0x12b: 0x58a04, // icon
+ 0x12c: 0x64d02, // h6
+ 0x12d: 0x1c404, // cols
+ 0x12e: 0x22e0a, // figcaption
+ 0x12f: 0x45e09, // onkeydown
+ 0x130: 0x66b08, // onsubmit
+ 0x131: 0x14d09, // oncanplay
+ 0x132: 0x70b03, // sup
+ 0x133: 0xc01, // p
+ 0x135: 0x40a09, // onemptied
+ 0x136: 0x39106, // oncopy
+ 0x137: 0x19c04, // cite
+ 0x138: 0x3a70a, // ondblclick
+ 0x13a: 0x50b0b, // onmousemove
+ 0x13c: 0x66d03, // sub
+ 0x13d: 0x48703, // rel
+ 0x13e: 0x5f08, // optgroup
+ 0x142: 0x9c07, // rowspan
+ 0x143: 0x37806, // source
+ 0x144: 0x21608, // noscript
+ 0x145: 0x1a304, // open
+ 0x146: 0x20403, // ins
+ 0x147: 0x2540d, // foreignObject
+ 0x148: 0x5ad0a, // onpopstate
+ 0x14a: 0x28d07, // enctype
+ 0x14b: 0x2760e, // onautocomplete
+ 0x14c: 0x35208, // textarea
+ 0x14e: 0x2780c, // autocomplete
+ 0x14f: 0x15702, // hr
+ 0x150: 0x1de08, // controls
+ 0x151: 0x10902, // id
+ 0x153: 0x2360c, // onafterprint
+ 0x155: 0x2610d, // foreignobject
+ 0x156: 0x32707, // marquee
+ 0x157: 0x59a07, // onpause
+ 0x158: 0x5e602, // dl
+ 0x159: 0x5206, // height
+ 0x15a: 0x34703, // min
+ 0x15b: 0x9307, // dirname
+ 0x15c: 0x1f209, // translate
+ 0x15d: 0x5604, // html
+ 0x15e: 0x34709, // minlength
+ 0x15f: 0x48607, // preload
+ 0x160: 0x71408, // template
+ 0x161: 0x3df0b, // ondragleave
+ 0x162: 0x3a02, // rb
+ 0x164: 0x5c003, // src
+ 0x165: 0x6dd06, // strong
+ 0x167: 0x7804, // samp
+ 0x168: 0x6f307, // address
+ 0x169: 0x55108, // ononline
+ 0x16b: 0x1310b, // placeholder
+ 0x16c: 0x2c406, // target
+ 0x16d: 0x20605, // small
+ 0x16e: 0x6ca07, // onwheel
+ 0x16f: 0x1c90a, // annotation
+ 0x170: 0x4740a, // spellcheck
+ 0x171: 0x7207, // details
+ 0x172: 0x10306, // canvas
+ 0x173: 0x12109, // autofocus
+ 0x174: 0xc05, // param
+ 0x176: 0x46308, // download
+ 0x177: 0x45203, // del
+ 0x178: 0x36c07, // onclose
+ 0x179: 0xb903, // kbd
+ 0x17a: 0x31906, // applet
+ 0x17b: 0x2e004, // href
+ 0x17c: 0x5f108, // onresize
+ 0x17e: 0x49d0c, // onloadeddata
+ 0x180: 0xcc02, // tr
+ 0x181: 0x2c00a, // formtarget
+ 0x182: 0x11005, // title
+ 0x183: 0x6ff05, // style
+ 0x184: 0xd206, // strike
+ 0x185: 0x59e06, // usemap
+ 0x186: 0x2fc06, // iframe
+ 0x187: 0x1004, // main
+ 0x189: 0x7b07, // picture
+ 0x18c: 0x31605, // ismap
+ 0x18e: 0x4a504, // data
+ 0x18f: 0x5905, // label
+ 0x191: 0x3d10e, // referrerpolicy
+ 0x192: 0x15602, // th
+ 0x194: 0x53606, // prompt
+ 0x195: 0x56807, // section
+ 0x197: 0x6d107, // optimum
+ 0x198: 0x2db04, // high
+ 0x199: 0x15c02, // h1
+ 0x19a: 0x65909, // onstalled
+ 0x19b: 0x16d03, // var
+ 0x19c: 0x4204, // time
+ 0x19e: 0x67402, // ms
+ 0x19f: 0x33106, // header
+ 0x1a0: 0x4da09, // onmessage
+ 0x1a1: 0x1a605, // nonce
+ 0x1a2: 0x26e0a, // formaction
+ 0x1a3: 0x22006, // center
+ 0x1a4: 0x3704, // nobr
+ 0x1a5: 0x59505, // table
+ 0x1a6: 0x4a907, // listing
+ 0x1a7: 0x18106, // legend
+ 0x1a9: 0x29b09, // challenge
+ 0x1aa: 0x24806, // figure
+ 0x1ab: 0xe605, // media
+ 0x1ae: 0xd904, // type
+ 0x1af: 0x3f04, // font
+ 0x1b0: 0x4da0e, // onmessageerror
+ 0x1b1: 0x37108, // seamless
+ 0x1b2: 0x8703, // dfn
+ 0x1b3: 0x5c705, // defer
+ 0x1b4: 0xc303, // low
+ 0x1b5: 0x19a03, // rtc
+ 0x1b6: 0x5230b, // onmouseover
+ 0x1b7: 0x2b20a, // novalidate
+ 0x1b8: 0x71c0a, // workertype
+ 0x1ba: 0x3cd07, // itemref
+ 0x1bd: 0x1, // a
+ 0x1be: 0x31803, // map
+ 0x1bf: 0x400c, // ontimeupdate
+ 0x1c0: 0x15e07, // bgsound
+ 0x1c1: 0x3206, // keygen
+ 0x1c2: 0x2705, // tbody
+ 0x1c5: 0x64406, // onshow
+ 0x1c7: 0x2501, // s
+ 0x1c8: 0x6607, // pattern
+ 0x1cc: 0x14d10, // oncanplaythrough
+ 0x1ce: 0x2d702, // dd
+ 0x1cf: 0x6f906, // srcset
+ 0x1d0: 0x17003, // big
+ 0x1d2: 0x65108, // sortable
+ 0x1d3: 0x48007, // onkeyup
+ 0x1d5: 0x5a406, // onplay
+ 0x1d7: 0x4b804, // meta
+ 0x1d8: 0x40306, // ondrop
+ 0x1da: 0x60008, // onscroll
+ 0x1db: 0x1fb0b, // crossorigin
+ 0x1dc: 0x5730a, // onpageshow
+ 0x1dd: 0x4, // abbr
+ 0x1de: 0x9202, // td
+ 0x1df: 0x58b0f, // contenteditable
+ 0x1e0: 0x27206, // action
+ 0x1e1: 0x1400b, // playsinline
+ 0x1e2: 0x43107, // onfocus
+ 0x1e3: 0x2e008, // hreflang
+ 0x1e5: 0x5160a, // onmouseout
+ 0x1e6: 0x5ea07, // onreset
+ 0x1e7: 0x13c08, // autoplay
+ 0x1e8: 0x63109, // onseeking
+ 0x1ea: 0x67506, // scoped
+ 0x1ec: 0x30a, // radiogroup
+ 0x1ee: 0x3800b, // contextmenu
+ 0x1ef: 0x52e09, // onmouseup
+ 0x1f1: 0x2ca06, // hgroup
+ 0x1f2: 0x2080f, // allowfullscreen
+ 0x1f3: 0x4be08, // tabindex
+ 0x1f6: 0x30f07, // isindex
+ 0x1f7: 0x1a0e, // accept-charset
+ 0x1f8: 0x2ae0e, // formnovalidate
+ 0x1fb: 0x1c90e, // annotation-xml
+ 0x1fc: 0x6e05, // embed
+ 0x1fd: 0x21806, // script
+ 0x1fe: 0xbb06, // dialog
+ 0x1ff: 0x1d707, // command
+}
+
+const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobrb" +
+ "asefontimeupdateviacacheightmlabelooptgroupatternoembedetail" +
+ "sampictureversedfnoframesetdirnameterowspanomoduleacronymali" +
+ "gnmarkbdialogallowpaymentrequestrikeytypeallowusermediagroup" +
+ "ingaltfooterubyasyncanvasidefaultitleaudioncancelautofocusan" +
+ "dboxmplaceholderautoplaysinlinebdoncanplaythrough1bgsoundisa" +
+ "bledivarbigblinkindraggablegendblockquotebuttonabortcitempro" +
+ "penoncecolgrouplaintextrackcolorcolspannotation-xmlcommandco" +
+ "ntrolshapecoordslotranslatecrossoriginsmallowfullscreenoscri" +
+ "ptfacenterfieldsetfigcaptionafterprintegrityfigurequiredfore" +
+ "ignObjectforeignobjectformactionautocompleteerrorformenctype" +
+ "mustmatchallengeformmethodformnovalidatetimeformtargethgroup" +
+ "osterhiddenhigh2hreflanghttp-equivideonclickiframeimageimgly" +
+ "ph3isindexismappletitemtypemarqueematheadersortedmaxlength4m" +
+ "inlength5mtextareadonlymultiplemutedoncloseamlessourceoncont" +
+ "extmenuitemidoncopyoncuechangeoncutondblclickondragendondrag" +
+ "enterondragexitemreferrerpolicyondragleaveondragoverondragst" +
+ "articleondropzonemptiedondurationchangeonendedonerroronfocus" +
+ "paceronhashchangeoninputmodeloninvalidonkeydownloadonkeypres" +
+ "spellcheckedonkeyupreloadonlanguagechangeonloadeddatalisting" +
+ "onloadedmetadatabindexonloadendonloadstartonmessageerroronmo" +
+ "usedownonmouseenteronmouseleaveonmousemoveonmouseoutputonmou" +
+ "seoveronmouseupromptonmousewheelonofflineononlineonpagehides" +
+ "classectionbluronpageshowbronpastepublicontenteditableonpaus" +
+ "emaponplayingonpopstateonprogressrcdocodeferonratechangeonre" +
+ "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" +
+ "violationauxclickonseekedonseekingonselectedonshowidth6onsor" +
+ "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" +
+ "handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" +
+ "wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" +
+ "arysupsvgsystemplateworkertypewrap"
diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go
new file mode 100644
index 000000000..ff7acf2d5
--- /dev/null
+++ b/vendor/golang.org/x/net/html/const.go
@@ -0,0 +1,111 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package html
+
+// Section 12.2.4.2 of the HTML5 specification says "The following elements
+// have varying levels of special parsing rules".
+// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements
+var isSpecialElementMap = map[string]bool{
+ "address": true,
+ "applet": true,
+ "area": true,
+ "article": true,
+ "aside": true,
+ "base": true,
+ "basefont": true,
+ "bgsound": true,
+ "blockquote": true,
+ "body": true,
+ "br": true,
+ "button": true,
+ "caption": true,
+ "center": true,
+ "col": true,
+ "colgroup": true,
+ "dd": true,
+ "details": true,
+ "dir": true,
+ "div": true,
+ "dl": true,
+ "dt": true,
+ "embed": true,
+ "fieldset": true,
+ "figcaption": true,
+ "figure": true,
+ "footer": true,
+ "form": true,
+ "frame": true,
+ "frameset": true,
+ "h1": true,
+ "h2": true,
+ "h3": true,
+ "h4": true,
+ "h5": true,
+ "h6": true,
+ "head": true,
+ "header": true,
+ "hgroup": true,
+ "hr": true,
+ "html": true,
+ "iframe": true,
+ "img": true,
+ "input": true,
+ "keygen": true, // "keygen" has been removed from the spec, but are kept here for backwards compatibility.
+ "li": true,
+ "link": true,
+ "listing": true,
+ "main": true,
+ "marquee": true,
+ "menu": true,
+ "meta": true,
+ "nav": true,
+ "noembed": true,
+ "noframes": true,
+ "noscript": true,
+ "object": true,
+ "ol": true,
+ "p": true,
+ "param": true,
+ "plaintext": true,
+ "pre": true,
+ "script": true,
+ "section": true,
+ "select": true,
+ "source": true,
+ "style": true,
+ "summary": true,
+ "table": true,
+ "tbody": true,
+ "td": true,
+ "template": true,
+ "textarea": true,
+ "tfoot": true,
+ "th": true,
+ "thead": true,
+ "title": true,
+ "tr": true,
+ "track": true,
+ "ul": true,
+ "wbr": true,
+ "xmp": true,
+}
+
+func isSpecialElement(element *Node) bool {
+ switch element.Namespace {
+ case "", "html":
+ return isSpecialElementMap[element.Data]
+ case "math":
+ switch element.Data {
+ case "mi", "mo", "mn", "ms", "mtext", "annotation-xml":
+ return true
+ }
+ case "svg":
+ switch element.Data {
+ case "foreignObject", "desc", "title":
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/golang.org/x/net/html/doc.go b/vendor/golang.org/x/net/html/doc.go
new file mode 100644
index 000000000..822ed42a0
--- /dev/null
+++ b/vendor/golang.org/x/net/html/doc.go
@@ -0,0 +1,106 @@
+// 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/vendor/golang.org/x/net/html/doctype.go b/vendor/golang.org/x/net/html/doctype.go
new file mode 100644
index 000000000..c484e5a94
--- /dev/null
+++ b/vendor/golang.org/x/net/html/doctype.go
@@ -0,0 +1,156 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package html
+
+import (
+ "strings"
+)
+
+// parseDoctype parses the data from a DoctypeToken into a name,
+// public identifier, and system identifier. It returns a Node whose Type
+// is DoctypeNode, whose Data is the name, and which has attributes
+// named "system" and "public" for the two identifiers if they were present.
+// quirks is whether the document should be parsed in "quirks mode".
+func parseDoctype(s string) (n *Node, quirks bool) {
+ n = &Node{Type: DoctypeNode}
+
+ // Find the name.
+ space := strings.IndexAny(s, whitespace)
+ if space == -1 {
+ space = len(s)
+ }
+ n.Data = s[:space]
+ // The comparison to "html" is case-sensitive.
+ if n.Data != "html" {
+ quirks = true
+ }
+ n.Data = strings.ToLower(n.Data)
+ s = strings.TrimLeft(s[space:], whitespace)
+
+ if len(s) < 6 {
+ // It can't start with "PUBLIC" or "SYSTEM".
+ // Ignore the rest of the string.
+ return n, quirks || s != ""
+ }
+
+ key := strings.ToLower(s[:6])
+ s = s[6:]
+ for key == "public" || key == "system" {
+ s = strings.TrimLeft(s, whitespace)
+ if s == "" {
+ break
+ }
+ quote := s[0]
+ if quote != '"' && quote != '\'' {
+ break
+ }
+ s = s[1:]
+ q := strings.IndexRune(s, rune(quote))
+ var id string
+ if q == -1 {
+ id = s
+ s = ""
+ } else {
+ id = s[:q]
+ s = s[q+1:]
+ }
+ n.Attr = append(n.Attr, Attribute{Key: key, Val: id})
+ if key == "public" {
+ key = "system"
+ } else {
+ key = ""
+ }
+ }
+
+ if key != "" || s != "" {
+ quirks = true
+ } else if len(n.Attr) > 0 {
+ if n.Attr[0].Key == "public" {
+ public := strings.ToLower(n.Attr[0].Val)
+ switch public {
+ case "-//w3o//dtd w3 html strict 3.0//en//", "-/w3d/dtd html 4.0 transitional/en", "html":
+ quirks = true
+ default:
+ for _, q := range quirkyIDs {
+ if strings.HasPrefix(public, q) {
+ quirks = true
+ break
+ }
+ }
+ }
+ // The following two public IDs only cause quirks mode if there is no system ID.
+ if len(n.Attr) == 1 && (strings.HasPrefix(public, "-//w3c//dtd html 4.01 frameset//") ||
+ strings.HasPrefix(public, "-//w3c//dtd html 4.01 transitional//")) {
+ quirks = true
+ }
+ }
+ if lastAttr := n.Attr[len(n.Attr)-1]; lastAttr.Key == "system" &&
+ strings.ToLower(lastAttr.Val) == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" {
+ quirks = true
+ }
+ }
+
+ return n, quirks
+}
+
+// quirkyIDs is a list of public doctype identifiers that cause a document
+// to be interpreted in quirks mode. The identifiers should be in lower case.
+var quirkyIDs = []string{
+ "+//silmaril//dtd html pro v0r11 19970101//",
+ "-//advasoft ltd//dtd html 3.0 aswedit + extensions//",
+ "-//as//dtd html 3.0 aswedit + extensions//",
+ "-//ietf//dtd html 2.0 level 1//",
+ "-//ietf//dtd html 2.0 level 2//",
+ "-//ietf//dtd html 2.0 strict level 1//",
+ "-//ietf//dtd html 2.0 strict level 2//",
+ "-//ietf//dtd html 2.0 strict//",
+ "-//ietf//dtd html 2.0//",
+ "-//ietf//dtd html 2.1e//",
+ "-//ietf//dtd html 3.0//",
+ "-//ietf//dtd html 3.2 final//",
+ "-//ietf//dtd html 3.2//",
+ "-//ietf//dtd html 3//",
+ "-//ietf//dtd html level 0//",
+ "-//ietf//dtd html level 1//",
+ "-//ietf//dtd html level 2//",
+ "-//ietf//dtd html level 3//",
+ "-//ietf//dtd html strict level 0//",
+ "-//ietf//dtd html strict level 1//",
+ "-//ietf//dtd html strict level 2//",
+ "-//ietf//dtd html strict level 3//",
+ "-//ietf//dtd html strict//",
+ "-//ietf//dtd html//",
+ "-//metrius//dtd metrius presentational//",
+ "-//microsoft//dtd internet explorer 2.0 html strict//",
+ "-//microsoft//dtd internet explorer 2.0 html//",
+ "-//microsoft//dtd internet explorer 2.0 tables//",
+ "-//microsoft//dtd internet explorer 3.0 html strict//",
+ "-//microsoft//dtd internet explorer 3.0 html//",
+ "-//microsoft//dtd internet explorer 3.0 tables//",
+ "-//netscape comm. corp.//dtd html//",
+ "-//netscape comm. corp.//dtd strict html//",
+ "-//o'reilly and associates//dtd html 2.0//",
+ "-//o'reilly and associates//dtd html extended 1.0//",
+ "-//o'reilly and associates//dtd html extended relaxed 1.0//",
+ "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//",
+ "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//",
+ "-//spyglass//dtd html 2.0 extended//",
+ "-//sq//dtd html 2.0 hotmetal + extensions//",
+ "-//sun microsystems corp.//dtd hotjava html//",
+ "-//sun microsystems corp.//dtd hotjava strict html//",
+ "-//w3c//dtd html 3 1995-03-24//",
+ "-//w3c//dtd html 3.2 draft//",
+ "-//w3c//dtd html 3.2 final//",
+ "-//w3c//dtd html 3.2//",
+ "-//w3c//dtd html 3.2s draft//",
+ "-//w3c//dtd html 4.0 frameset//",
+ "-//w3c//dtd html 4.0 transitional//",
+ "-//w3c//dtd html experimental 19960712//",
+ "-//w3c//dtd html experimental 970421//",
+ "-//w3c//dtd w3 html//",
+ "-//w3o//dtd w3 html 3.0//",
+ "-//webtechs//dtd mozilla html 2.0//",
+ "-//webtechs//dtd mozilla html//",
+}
diff --git a/vendor/golang.org/x/net/html/entity.go b/vendor/golang.org/x/net/html/entity.go
new file mode 100644
index 000000000..b628880a0
--- /dev/null
+++ b/vendor/golang.org/x/net/html/entity.go
@@ -0,0 +1,2253 @@
+// 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/vendor/golang.org/x/net/html/escape.go b/vendor/golang.org/x/net/html/escape.go
new file mode 100644
index 000000000..d85613962
--- /dev/null
+++ b/vendor/golang.org/x/net/html/escape.go
@@ -0,0 +1,258 @@
+// 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/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go
new file mode 100644
index 000000000..9da9e9dc4
--- /dev/null
+++ b/vendor/golang.org/x/net/html/foreign.go
@@ -0,0 +1,222 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package html
+
+import (
+ "strings"
+)
+
+func adjustAttributeNames(aa []Attribute, nameMap map[string]string) {
+ for i := range aa {
+ if newName, ok := nameMap[aa[i].Key]; ok {
+ aa[i].Key = newName
+ }
+ }
+}
+
+func adjustForeignAttributes(aa []Attribute) {
+ for i, a := range aa {
+ if a.Key == "" || a.Key[0] != 'x' {
+ continue
+ }
+ switch a.Key {
+ case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show",
+ "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink":
+ j := strings.Index(a.Key, ":")
+ aa[i].Namespace = a.Key[:j]
+ aa[i].Key = a.Key[j+1:]
+ }
+ }
+}
+
+func htmlIntegrationPoint(n *Node) bool {
+ if n.Type != ElementNode {
+ return false
+ }
+ switch n.Namespace {
+ case "math":
+ if n.Data == "annotation-xml" {
+ for _, a := range n.Attr {
+ if a.Key == "encoding" {
+ val := strings.ToLower(a.Val)
+ if val == "text/html" || val == "application/xhtml+xml" {
+ return true
+ }
+ }
+ }
+ }
+ case "svg":
+ switch n.Data {
+ case "desc", "foreignObject", "title":
+ return true
+ }
+ }
+ return false
+}
+
+func mathMLTextIntegrationPoint(n *Node) bool {
+ if n.Namespace != "math" {
+ return false
+ }
+ switch n.Data {
+ case "mi", "mo", "mn", "ms", "mtext":
+ return true
+ }
+ return false
+}
+
+// Section 12.2.6.5.
+var breakout = map[string]bool{
+ "b": true,
+ "big": true,
+ "blockquote": true,
+ "body": true,
+ "br": true,
+ "center": true,
+ "code": true,
+ "dd": true,
+ "div": true,
+ "dl": true,
+ "dt": true,
+ "em": true,
+ "embed": true,
+ "h1": true,
+ "h2": true,
+ "h3": true,
+ "h4": true,
+ "h5": true,
+ "h6": true,
+ "head": true,
+ "hr": true,
+ "i": true,
+ "img": true,
+ "li": true,
+ "listing": true,
+ "menu": true,
+ "meta": true,
+ "nobr": true,
+ "ol": true,
+ "p": true,
+ "pre": true,
+ "ruby": true,
+ "s": true,
+ "small": true,
+ "span": true,
+ "strong": true,
+ "strike": true,
+ "sub": true,
+ "sup": true,
+ "table": true,
+ "tt": true,
+ "u": true,
+ "ul": true,
+ "var": true,
+}
+
+// Section 12.2.6.5.
+var svgTagNameAdjustments = map[string]string{
+ "altglyph": "altGlyph",
+ "altglyphdef": "altGlyphDef",
+ "altglyphitem": "altGlyphItem",
+ "animatecolor": "animateColor",
+ "animatemotion": "animateMotion",
+ "animatetransform": "animateTransform",
+ "clippath": "clipPath",
+ "feblend": "feBlend",
+ "fecolormatrix": "feColorMatrix",
+ "fecomponenttransfer": "feComponentTransfer",
+ "fecomposite": "feComposite",
+ "feconvolvematrix": "feConvolveMatrix",
+ "fediffuselighting": "feDiffuseLighting",
+ "fedisplacementmap": "feDisplacementMap",
+ "fedistantlight": "feDistantLight",
+ "feflood": "feFlood",
+ "fefunca": "feFuncA",
+ "fefuncb": "feFuncB",
+ "fefuncg": "feFuncG",
+ "fefuncr": "feFuncR",
+ "fegaussianblur": "feGaussianBlur",
+ "feimage": "feImage",
+ "femerge": "feMerge",
+ "femergenode": "feMergeNode",
+ "femorphology": "feMorphology",
+ "feoffset": "feOffset",
+ "fepointlight": "fePointLight",
+ "fespecularlighting": "feSpecularLighting",
+ "fespotlight": "feSpotLight",
+ "fetile": "feTile",
+ "feturbulence": "feTurbulence",
+ "foreignobject": "foreignObject",
+ "glyphref": "glyphRef",
+ "lineargradient": "linearGradient",
+ "radialgradient": "radialGradient",
+ "textpath": "textPath",
+}
+
+// Section 12.2.6.1
+var mathMLAttributeAdjustments = map[string]string{
+ "definitionurl": "definitionURL",
+}
+
+var svgAttributeAdjustments = map[string]string{
+ "attributename": "attributeName",
+ "attributetype": "attributeType",
+ "basefrequency": "baseFrequency",
+ "baseprofile": "baseProfile",
+ "calcmode": "calcMode",
+ "clippathunits": "clipPathUnits",
+ "diffuseconstant": "diffuseConstant",
+ "edgemode": "edgeMode",
+ "filterunits": "filterUnits",
+ "glyphref": "glyphRef",
+ "gradienttransform": "gradientTransform",
+ "gradientunits": "gradientUnits",
+ "kernelmatrix": "kernelMatrix",
+ "kernelunitlength": "kernelUnitLength",
+ "keypoints": "keyPoints",
+ "keysplines": "keySplines",
+ "keytimes": "keyTimes",
+ "lengthadjust": "lengthAdjust",
+ "limitingconeangle": "limitingConeAngle",
+ "markerheight": "markerHeight",
+ "markerunits": "markerUnits",
+ "markerwidth": "markerWidth",
+ "maskcontentunits": "maskContentUnits",
+ "maskunits": "maskUnits",
+ "numoctaves": "numOctaves",
+ "pathlength": "pathLength",
+ "patterncontentunits": "patternContentUnits",
+ "patterntransform": "patternTransform",
+ "patternunits": "patternUnits",
+ "pointsatx": "pointsAtX",
+ "pointsaty": "pointsAtY",
+ "pointsatz": "pointsAtZ",
+ "preservealpha": "preserveAlpha",
+ "preserveaspectratio": "preserveAspectRatio",
+ "primitiveunits": "primitiveUnits",
+ "refx": "refX",
+ "refy": "refY",
+ "repeatcount": "repeatCount",
+ "repeatdur": "repeatDur",
+ "requiredextensions": "requiredExtensions",
+ "requiredfeatures": "requiredFeatures",
+ "specularconstant": "specularConstant",
+ "specularexponent": "specularExponent",
+ "spreadmethod": "spreadMethod",
+ "startoffset": "startOffset",
+ "stddeviation": "stdDeviation",
+ "stitchtiles": "stitchTiles",
+ "surfacescale": "surfaceScale",
+ "systemlanguage": "systemLanguage",
+ "tablevalues": "tableValues",
+ "targetx": "targetX",
+ "targety": "targetY",
+ "textlength": "textLength",
+ "viewbox": "viewBox",
+ "viewtarget": "viewTarget",
+ "xchannelselector": "xChannelSelector",
+ "ychannelselector": "yChannelSelector",
+ "zoomandpan": "zoomAndPan",
+}
diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go
new file mode 100644
index 000000000..1350eef22
--- /dev/null
+++ b/vendor/golang.org/x/net/html/node.go
@@ -0,0 +1,225 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package html
+
+import (
+ "golang.org/x/net/html/atom"
+)
+
+// A NodeType is the type of a Node.
+type NodeType uint32
+
+const (
+ ErrorNode NodeType = iota
+ TextNode
+ DocumentNode
+ ElementNode
+ CommentNode
+ DoctypeNode
+ // RawNode nodes are not returned by the parser, but can be part of the
+ // Node tree passed to func Render to insert raw HTML (without escaping).
+ // If so, this package makes no guarantee that the rendered HTML is secure
+ // (from e.g. Cross Site Scripting attacks) or well-formed.
+ RawNode
+ scopeMarkerNode
+)
+
+// Section 12.2.4.3 says "The markers are inserted when entering applet,
+// object, marquee, template, td, th, and caption elements, and are used
+// to prevent formatting from "leaking" into applet, object, marquee,
+// template, td, th, and caption elements".
+var scopeMarker = Node{Type: scopeMarkerNode}
+
+// A Node consists of a NodeType and some Data (tag name for element nodes,
+// content for text) and are part of a tree of Nodes. Element nodes may also
+// have a Namespace and contain a slice of Attributes. Data is unescaped, so
+// that it looks like "a 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/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go
new file mode 100644
index 000000000..2cd12fc81
--- /dev/null
+++ b/vendor/golang.org/x/net/html/parse.go
@@ -0,0 +1,2425 @@
+// 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:
+ p.addElement()
+ p.afe = append(p.afe, &scopeMarker)
+ p.framesetOK = false
+ p.im = inTemplateIM
+ p.templateStack = append(p.templateStack, inTemplateIM)
+ return true
+ }
+ case EndTagToken:
+ switch p.tok.DataAtom {
+ case a.Head:
+ p.oe.pop()
+ p.im = afterHeadIM
+ return true
+ case a.Body, a.Html, a.Br:
+ p.parseImpliedToken(EndTagToken, a.Head, a.Head.String())
+ return false
+ case a.Template:
+ if !p.oe.contains(a.Template) {
+ return true
+ }
+ // TODO: remove this divergence from the HTML5 spec.
+ //
+ // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668
+ p.generateImpliedEndTags()
+ for i := len(p.oe) - 1; i >= 0; i-- {
+ if n := p.oe[i]; n.Namespace == "" && n.DataAtom == a.Template {
+ p.oe = p.oe[:i]
+ break
+ }
+ }
+ p.clearActiveFormattingElements()
+ p.templateStack.pop()
+ p.resetInsertionMode()
+ return true
+ 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(EndTagToken, a.Head, a.Head.String())
+ return false
+}
+
+// 12.2.6.4.5.
+func inHeadNoscriptIM(p *parser) bool {
+ switch p.tok.Type {
+ case DoctypeToken:
+ // Ignore the token.
+ return true
+ case StartTagToken:
+ switch p.tok.DataAtom {
+ case a.Html:
+ return inBodyIM(p)
+ case a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Style:
+ return inHeadIM(p)
+ case a.Head, a.Noscript:
+ // Ignore the token.
+ return true
+ }
+ case EndTagToken:
+ switch p.tok.DataAtom {
+ case a.Noscript, a.Br:
+ default:
+ // Ignore the token.
+ return true
+ }
+ case TextToken:
+ s := strings.TrimLeft(p.tok.Data, whitespace)
+ if len(s) == 0 {
+ // It was all whitespace.
+ return inHeadIM(p)
+ }
+ case CommentToken:
+ return inHeadIM(p)
+ }
+ p.oe.pop()
+ if p.top().DataAtom != a.Head {
+ panic("html: the new current node will be a head element.")
+ }
+ p.im = inHeadIM
+ if p.tok.DataAtom == a.Noscript {
+ return true
+ }
+ return false
+}
+
+// Section 12.2.6.4.6.
+func afterHeadIM(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.Body:
+ p.addElement()
+ p.framesetOK = false
+ p.im = inBodyIM
+ return true
+ case a.Frameset:
+ p.addElement()
+ p.im = inFramesetIM
+ return true
+ case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title:
+ p.oe = append(p.oe, p.head)
+ defer p.oe.remove(p.head)
+ return inHeadIM(p)
+ case a.Head:
+ // Ignore the token.
+ return true
+ }
+ case EndTagToken:
+ switch p.tok.DataAtom {
+ case a.Body, a.Html, a.Br:
+ // Drop down to creating an implied 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