summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown')
-rw-r--r--vendor/github.com/gomarkdown/markdown/.travis.yml17
-rw-r--r--vendor/github.com/gomarkdown/markdown/README.md15
-rw-r--r--vendor/github.com/gomarkdown/markdown/ast/print.go7
-rw-r--r--vendor/github.com/gomarkdown/markdown/doc.go2
-rw-r--r--vendor/github.com/gomarkdown/markdown/html/renderer.go2
-rw-r--r--vendor/github.com/gomarkdown/markdown/parser/block.go76
-rw-r--r--vendor/github.com/gomarkdown/markdown/parser/inline.go5
7 files changed, 62 insertions, 62 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/.travis.yml b/vendor/github.com/gomarkdown/markdown/.travis.yml
deleted file mode 100644
index 4ec5d7b0..00000000
--- a/vendor/github.com/gomarkdown/markdown/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-dist: bionic
-language: go
-
-go:
- - "1.12.x"
-
-install:
- - go build -v ./...
-
-script:
- - go test -v ./...
- - go test -run=^$ -bench=BenchmarkReference -benchmem
- - ./s/test_with_codecoverage.sh
- - ./s/ci_fuzzit.sh
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/gomarkdown/markdown/README.md b/vendor/github.com/gomarkdown/markdown/README.md
index 3bca71db..31ebb600 100644
--- a/vendor/github.com/gomarkdown/markdown/README.md
+++ b/vendor/github.com/gomarkdown/markdown/README.md
@@ -17,6 +17,19 @@ API Docs:
- https://godoc.org/github.com/gomarkdown/markdown/parser : parser
- https://godoc.org/github.com/gomarkdown/markdown/html : html renderer
+## Users
+
+Some tools using this package:
+
+- https://github.com/MichaelMure/go-term-markdown : markdown renderer for the terminal
+- https://github.com/artyom/mdserver : web server that serves markdown files
+- https://github.com/rsdoiel/mkpage : content management system generating static websites
+- https://github.com/cugu/dashboard : creates a badge dashboard from a yaml file
+- https://github.com/ieyasu/go-bwiki : simple wiki
+- https://github.com/romanyx/mdopen : view markdown files in the default browser
+- https://github.com/ystyle/sqlmanager : a library for manager sql with markdown like beetsql
+- https://gitlab.com/kendellfab/fazer : library for making templates
+
## Usage
To convert markdown text to HTML using reasonable defaults:
@@ -295,7 +308,7 @@ implements the following extensions:
Will convert into `<h1 id="id3" class="myclass" fontsize="tiny">Header 1</h1>`.
-- **Mmark support**, see <https://mmark.nl/syntax> for all new syntax elements this adds.
+- **Mmark support**, see <https://mmark.miek.nl/post/syntax/> for all new syntax elements this adds.
## Todo
diff --git a/vendor/github.com/gomarkdown/markdown/ast/print.go b/vendor/github.com/gomarkdown/markdown/ast/print.go
index 75daf911..b186ec07 100644
--- a/vendor/github.com/gomarkdown/markdown/ast/print.go
+++ b/vendor/github.com/gomarkdown/markdown/ast/print.go
@@ -5,6 +5,7 @@ import (
"fmt"
"io"
"strings"
+ "unicode/utf8"
)
// Print is for debugging. It prints a string representation of parsed
@@ -63,11 +64,11 @@ func shortenString(s string, maxLen int) string {
if maxLen < 0 {
return s
}
- if len(s) < maxLen {
+ if utf8.RuneCountInString(s) < maxLen {
return s
}
- // add "..." to indicate truncation
- return s[:maxLen-3] + "..."
+ // add "…" to indicate truncation
+ return string(append([]rune(s)[:maxLen-3], '…'))
}
// get a short name of the type of v which excludes package name
diff --git a/vendor/github.com/gomarkdown/markdown/doc.go b/vendor/github.com/gomarkdown/markdown/doc.go
index 9fb77e02..b623024d 100644
--- a/vendor/github.com/gomarkdown/markdown/doc.go
+++ b/vendor/github.com/gomarkdown/markdown/doc.go
@@ -21,7 +21,7 @@ You can customize parser and HTML renderer:
"github.com/gomarkdown/markdown"
)
extensions := parser.CommonExtensions | parser.AutoHeadingIDs
- p := parser.NewWithExensions(extensions)
+ p := parser.NewWithExtensions(extensions)
htmlFlags := html.CommonFlags | html.HrefTargetBlank
opts := html.RendererOptions{Flags: htmlFlags}
diff --git a/vendor/github.com/gomarkdown/markdown/html/renderer.go b/vendor/github.com/gomarkdown/markdown/html/renderer.go
index 367f7dfa..f0e10a7f 100644
--- a/vendor/github.com/gomarkdown/markdown/html/renderer.go
+++ b/vendor/github.com/gomarkdown/markdown/html/renderer.go
@@ -1298,7 +1298,7 @@ func BlockAttrs(node ast.Node) []string {
// sort the attributes so it remain stable between runs
var keys = []string{}
- for k, _ := range attr.Attrs {
+ for k := range attr.Attrs {
keys = append(keys, k)
}
sort.Strings(keys)
diff --git a/vendor/github.com/gomarkdown/markdown/parser/block.go b/vendor/github.com/gomarkdown/markdown/parser/block.go
index 18a2dd89..3b0c391a 100644
--- a/vendor/github.com/gomarkdown/markdown/parser/block.go
+++ b/vendor/github.com/gomarkdown/markdown/parser/block.go
@@ -24,46 +24,46 @@ var (
// blockTags is a set of tags that are recognized as HTML block tags.
// Any of these can be included in markdown text without special escaping.
blockTags = map[string]struct{}{
- "blockquote": struct{}{},
- "del": struct{}{},
- "div": struct{}{},
- "dl": struct{}{},
- "fieldset": struct{}{},
- "form": struct{}{},
- "h1": struct{}{},
- "h2": struct{}{},
- "h3": struct{}{},
- "h4": struct{}{},
- "h5": struct{}{},
- "h6": struct{}{},
- "iframe": struct{}{},
- "ins": struct{}{},
- "math": struct{}{},
- "noscript": struct{}{},
- "ol": struct{}{},
- "pre": struct{}{},
- "p": struct{}{},
- "script": struct{}{},
- "style": struct{}{},
- "table": struct{}{},
- "ul": struct{}{},
+ "blockquote": {},
+ "del": {},
+ "div": {},
+ "dl": {},
+ "fieldset": {},
+ "form": {},
+ "h1": {},
+ "h2": {},
+ "h3": {},
+ "h4": {},
+ "h5": {},
+ "h6": {},
+ "iframe": {},
+ "ins": {},
+ "math": {},
+ "noscript": {},
+ "ol": {},
+ "pre": {},
+ "p": {},
+ "script": {},
+ "style": {},
+ "table": {},
+ "ul": {},
// HTML5
- "address": struct{}{},
- "article": struct{}{},
- "aside": struct{}{},
- "canvas": struct{}{},
- "figcaption": struct{}{},
- "figure": struct{}{},
- "footer": struct{}{},
- "header": struct{}{},
- "hgroup": struct{}{},
- "main": struct{}{},
- "nav": struct{}{},
- "output": struct{}{},
- "progress": struct{}{},
- "section": struct{}{},
- "video": struct{}{},
+ "address": {},
+ "article": {},
+ "aside": {},
+ "canvas": {},
+ "figcaption": {},
+ "figure": {},
+ "footer": {},
+ "header": {},
+ "hgroup": {},
+ "main": {},
+ "nav": {},
+ "output": {},
+ "progress": {},
+ "section": {},
+ "video": {},
}
)
diff --git a/vendor/github.com/gomarkdown/markdown/parser/inline.go b/vendor/github.com/gomarkdown/markdown/parser/inline.go
index 81766b85..23849f3a 100644
--- a/vendor/github.com/gomarkdown/markdown/parser/inline.go
+++ b/vendor/github.com/gomarkdown/markdown/parser/inline.go
@@ -228,7 +228,7 @@ func maybeInlineFootnoteOrSuper(p *Parser, data []byte, offset int) (int, ast.No
}
sup := &ast.Superscript{}
sup.Literal = data[offset+1 : offset+ret]
- return offset + ret, sup
+ return ret + 1, sup
}
return 0, nil
@@ -536,6 +536,9 @@ func link(p *Parser, data []byte, offset int) (int, ast.Node) {
// if inline footnote, title == footnote contents
title = lr.title
noteID = lr.noteID
+ if len(lr.text) > 0 {
+ altContent = lr.text
+ }
}
// rewind the whitespace