diff options
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown')
-rw-r--r-- | vendor/github.com/gomarkdown/markdown/README.md | 2 | ||||
-rw-r--r-- | vendor/github.com/gomarkdown/markdown/go.sum | 1 | ||||
-rw-r--r-- | vendor/github.com/gomarkdown/markdown/parser/block.go | 33 |
3 files changed, 23 insertions, 13 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/README.md b/vendor/github.com/gomarkdown/markdown/README.md index 31ebb600..5488280c 100644 --- a/vendor/github.com/gomarkdown/markdown/README.md +++ b/vendor/github.com/gomarkdown/markdown/README.md @@ -113,7 +113,7 @@ opts := html.RendererOptions{ } renderer := html.NewRenderer(opts) md := "test\n```\nthis code block will be dropped from output\n```\ntext" -html := markdown.ToHTML([]byte(s), nil, renderer) +html := markdown.ToHTML([]byte(md), nil, renderer) ```` ## Sanitize untrusted content diff --git a/vendor/github.com/gomarkdown/markdown/go.sum b/vendor/github.com/gomarkdown/markdown/go.sum new file mode 100644 index 00000000..1406b01f --- /dev/null +++ b/vendor/github.com/gomarkdown/markdown/go.sum @@ -0,0 +1 @@ +golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= diff --git a/vendor/github.com/gomarkdown/markdown/parser/block.go b/vendor/github.com/gomarkdown/markdown/parser/block.go index 3b0c391a..a0b80991 100644 --- a/vendor/github.com/gomarkdown/markdown/parser/block.go +++ b/vendor/github.com/gomarkdown/markdown/parser/block.go @@ -26,8 +26,10 @@ var ( blockTags = map[string]struct{}{ "blockquote": {}, "del": {}, + "dd": {}, "div": {}, "dl": {}, + "dt": {}, "fieldset": {}, "form": {}, "h1": {}, @@ -36,23 +38,28 @@ var ( "h4": {}, "h5": {}, "h6": {}, - "iframe": {}, - "ins": {}, - "math": {}, - "noscript": {}, - "ol": {}, - "pre": {}, - "p": {}, - "script": {}, - "style": {}, - "table": {}, - "ul": {}, + // TODO: technically block but breaks Inline HTML (Simple).text + //"hr": {}, + "iframe": {}, + "ins": {}, + "li": {}, + "math": {}, + "noscript": {}, + "ol": {}, + "pre": {}, + "p": {}, + "script": {}, + "style": {}, + "table": {}, + "ul": {}, // HTML5 "address": {}, "article": {}, "aside": {}, "canvas": {}, + "details": {}, + "dialog": {}, "figcaption": {}, "figure": {}, "footer": {}, @@ -230,8 +237,10 @@ func (p *Parser) block(data []byte) { // or // ______ if p.isHRule(data) { - p.addBlock(&ast.HorizontalRule{}) i := skipUntilChar(data, 0, '\n') + hr := ast.HorizontalRule{} + hr.Literal = bytes.Trim(data[:i], " \n") + p.addBlock(&hr) data = data[i:] continue } |