4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-04 19:27:45 +00:00

Update dependencies (#975)

This commit is contained in:
Wim
2020-01-09 21:02:56 +01:00
committed by GitHub
parent b9354de8fd
commit 0f708daf2d
360 changed files with 72921 additions and 42691 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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)

View File

@ -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": {},
}
)

View File

@ -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