update deps
This commit is contained in:
34
vendor/github.com/yuin/goldmark/extension/cjk.go
generated
vendored
34
vendor/github.com/yuin/goldmark/extension/cjk.go
generated
vendored
@@ -9,11 +9,30 @@ import (
|
||||
// A CJKOption sets options for CJK support mostly for HTML based renderers.
|
||||
type CJKOption func(*cjk)
|
||||
|
||||
// A EastAsianLineBreaks is a style of east asian line breaks.
|
||||
type EastAsianLineBreaks int
|
||||
|
||||
const (
|
||||
//EastAsianLineBreaksNone renders line breaks as it is.
|
||||
EastAsianLineBreaksNone EastAsianLineBreaks = iota
|
||||
// EastAsianLineBreaksSimple is a style where soft line breaks are ignored
|
||||
// if both sides of the break are east asian wide characters.
|
||||
EastAsianLineBreaksSimple
|
||||
// EastAsianLineBreaksCSS3Draft is a style where soft line breaks are ignored
|
||||
// even if only one side of the break is an east asian wide character.
|
||||
EastAsianLineBreaksCSS3Draft
|
||||
)
|
||||
|
||||
// WithEastAsianLineBreaks is a functional option that indicates whether softline breaks
|
||||
// between east asian wide characters should be ignored.
|
||||
func WithEastAsianLineBreaks() CJKOption {
|
||||
// style defauts to [EastAsianLineBreaksSimple] .
|
||||
func WithEastAsianLineBreaks(style ...EastAsianLineBreaks) CJKOption {
|
||||
return func(c *cjk) {
|
||||
c.EastAsianLineBreaks = true
|
||||
if len(style) == 0 {
|
||||
c.EastAsianLineBreaks = EastAsianLineBreaksSimple
|
||||
return
|
||||
}
|
||||
c.EastAsianLineBreaks = style[0]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +44,7 @@ func WithEscapedSpace() CJKOption {
|
||||
}
|
||||
|
||||
type cjk struct {
|
||||
EastAsianLineBreaks bool
|
||||
EastAsianLineBreaks EastAsianLineBreaks
|
||||
EscapedSpace bool
|
||||
}
|
||||
|
||||
@@ -34,7 +53,9 @@ var CJK = NewCJK(WithEastAsianLineBreaks(), WithEscapedSpace())
|
||||
|
||||
// NewCJK returns a new extension with given options.
|
||||
func NewCJK(opts ...CJKOption) goldmark.Extender {
|
||||
e := &cjk{}
|
||||
e := &cjk{
|
||||
EastAsianLineBreaks: EastAsianLineBreaksNone,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(e)
|
||||
}
|
||||
@@ -42,9 +63,8 @@ func NewCJK(opts ...CJKOption) goldmark.Extender {
|
||||
}
|
||||
|
||||
func (e *cjk) Extend(m goldmark.Markdown) {
|
||||
if e.EastAsianLineBreaks {
|
||||
m.Renderer().AddOptions(html.WithEastAsianLineBreaks())
|
||||
}
|
||||
m.Renderer().AddOptions(html.WithEastAsianLineBreaks(
|
||||
html.EastAsianLineBreaks(e.EastAsianLineBreaks)))
|
||||
if e.EscapedSpace {
|
||||
m.Renderer().AddOptions(html.WithWriter(html.NewWriter(html.WithEscapedSpace())))
|
||||
m.Parser().AddOptions(parser.WithEscapedSpace())
|
||||
|
||||
3
vendor/github.com/yuin/goldmark/extension/tasklist.go
generated
vendored
3
vendor/github.com/yuin/goldmark/extension/tasklist.go
generated
vendored
@@ -41,6 +41,9 @@ func (s *taskCheckBoxParser) Parse(parent gast.Node, block text.Reader, pc parse
|
||||
return nil
|
||||
}
|
||||
|
||||
if parent.HasChildren() {
|
||||
return nil
|
||||
}
|
||||
if _, ok := parent.Parent().(*gast.ListItem); !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user