diff --git a/.gitignore b/.gitignore index f1c181e..9193b32 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out + +.DS_Store diff --git a/commonmark_test.go b/commonmark_test.go index a666998..a11d805 100644 --- a/commonmark_test.go +++ b/commonmark_test.go @@ -2,8 +2,12 @@ package md_test import ( "bytes" + "fmt" "io/ioutil" + "os" "path" + "path/filepath" + "strings" "testing" md "github.com/JohannesKaufmann/html-to-markdown" @@ -13,13 +17,56 @@ import ( ) type GoldenTest struct { - Name string + Name string + Domain string Options map[string]*md.Options Plugins []md.Plugin } func RunGoldenTest(t *testing.T, tests []GoldenTest) { + // loop through all test cases that were added manually + dirs := make(map[string]struct{}) + for _, test := range tests { + name := test.Name + name = strings.Replace(name, " ", "_", -1) + dirs[name] = struct{}{} + } + + // now add all tests that were found on disk to the tests slice + err := filepath.Walk(path.Join("testdata", t.Name()), + func(p string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() { + return nil + } + + // skip folders that don't contain an input.html file + if _, err := os.Stat(path.Join(p, "input.html")); os.IsNotExist(err) { + return nil + } + + parts := strings.SplitN(p, string(os.PathSeparator), 3) + p = parts[2] // remove "testdata/TestCommonmark/" from "testdata/TestCommonmark/..." + + _, ok := dirs[p] + if ok { + return nil + } + + // add the folder from disk to the tests slice, since its not it there yet + tests = append(tests, GoldenTest{ + Name: p, + }) + return nil + }) + if err != nil { + t.Error(err) + return + } + for _, test := range tests { if len(test.Options) == 0 { test.Options = map[string]*md.Options{ @@ -28,6 +75,11 @@ func RunGoldenTest(t *testing.T, tests []GoldenTest) { } t.Run(test.Name, func(t *testing.T) { + if strings.Contains(t.Name(), "#") { + fmt.Println("the name", test.Name, t.Name(), "seems too be used for multiple tests") + return + } + g := goldie.New(t) for key, options := range test.Options { @@ -38,9 +90,11 @@ func RunGoldenTest(t *testing.T, tests []GoldenTest) { input, err := ioutil.ReadFile(path.Join("testdata", p)) if err != nil { t.Error(err) + return } - conv := md.NewConverter("", true, options) + conv := md.NewConverter(test.Domain, true, options) + conv.Keep("keep-tag").Remove("remove-tag") for _, plugin := range test.Plugins { conv.Use(plugin) } @@ -70,73 +124,88 @@ func RunGoldenTest(t *testing.T, tests []GoldenTest) { func TestCommonmark(t *testing.T) { var tests = []GoldenTest{ { - Name: "h1", + Name: "link", Options: map[string]*md.Options{ - "setext": {HeadingStyle: "setext"}, - "atx": {HeadingStyle: "atx"}, + "inlined": &md.Options{LinkStyle: "inlined"}, + "referenced_full": &md.Options{LinkStyle: "referenced", LinkReferenceStyle: "full"}, + "referenced_collapsed": &md.Options{LinkStyle: "referenced", LinkReferenceStyle: "collapsed"}, + "referenced_shortcut": &md.Options{LinkStyle: "referenced", LinkReferenceStyle: "shortcut"}, }, }, { - Name: "h2", + Name: "heading", Options: map[string]*md.Options{ - "setext": {HeadingStyle: "setext"}, - "atx": {HeadingStyle: "atx"}, + "atx": &md.Options{HeadingStyle: "atx"}, + "setext": &md.Options{HeadingStyle: "setext"}, }, }, { - Name: "h3", + Name: "italic", Options: map[string]*md.Options{ - "setext": {HeadingStyle: "setext"}, - "atx": {HeadingStyle: "atx"}, + "asterisks": &md.Options{EmDelimiter: "*"}, + "underscores": &md.Options{EmDelimiter: "_"}, }, }, { - Name: "p with content", - }, - { - Name: "p inside div", + Name: "bold", + Options: map[string]*md.Options{ + "asterisks": &md.Options{StrongDelimiter: "**"}, + "underscores": &md.Options{StrongDelimiter: "__"}, + }, }, { - Name: "p with span", + Name: "pre_code", + Options: map[string]*md.Options{ + "indented": &md.Options{CodeBlockStyle: "indented"}, + "fenced_backtick": &md.Options{CodeBlockStyle: "fenced", Fence: "```"}, + "fenced_tilde": &md.Options{CodeBlockStyle: "fenced", Fence: "~~~"}, + }, }, { - Name: "p with strong", + Name: "list", Options: map[string]*md.Options{ - "default": {StrongDelimiter: ""}, - "underscore": {StrongDelimiter: "__"}, + "asterisks": &md.Options{BulletListMarker: "*"}, + "dash": &md.Options{BulletListMarker: "-"}, + "plus": &md.Options{BulletListMarker: "+"}, }, }, { - Name: "p with b", + Name: "list_nested", + Options: map[string]*md.Options{ + "asterisks": &md.Options{BulletListMarker: "*"}, + "dash": &md.Options{BulletListMarker: "-"}, + "plus": &md.Options{BulletListMarker: "+"}, + }, }, + // + all the test on disk that are added automatically } RunGoldenTest(t, tests) +} - /* - - TestCommonmark - TestPlugins - TestRules/Keep/Remove - - ---- always start with the main tag - - - p with content - - strong nested - - h3 - - escape - - - ---- files - h1.input - - h1.setext.golden - h1.atx.golden - - - */ +func TestRealWorld(t *testing.T) { + var tests = []GoldenTest{ + { + Name: "blog.golang.org", + Domain: "blog.golang.org", + Options: map[string]*md.Options{ + "inlined": &md.Options{LinkStyle: "inlined"}, + "referenced_full": &md.Options{LinkStyle: "referenced", LinkReferenceStyle: "full"}, + "referenced_collapsed": &md.Options{LinkStyle: "referenced", LinkReferenceStyle: "collapsed"}, + "referenced_shortcut": &md.Options{LinkStyle: "referenced", LinkReferenceStyle: "shortcut"}, + "emphasis_asterisks": &md.Options{EmDelimiter: "*", StrongDelimiter: "**"}, + "emphasis_underscores": &md.Options{EmDelimiter: "_", StrongDelimiter: "__"}, + }, + }, + { + Name: "golang.org", + Domain: "golang.org", + }, + { + Name: "bonnerruderverein.de", + Domain: "bonnerruderverein.de", + }, + // + all the test on disk that are added automatically + } + RunGoldenTest(t, tests) } diff --git a/from.go b/from.go index a9f1faa..31c7a30 100644 --- a/from.go +++ b/from.go @@ -355,7 +355,7 @@ func (c *Converter) ConvertURL(url string) (string, error) { } domain := DomainFromURL(url) if c.domain != domain { - return "", errors.New("expected " + c.domain + " as the domain but got " + domain) + return "", fmt.Errorf("expected '%s' as the domain but got '%s'", c.domain, domain) } return c.Convert(doc.Selection), nil } diff --git a/from_test.go b/from_test.go index 2dab7ac..54d0c57 100644 --- a/from_test.go +++ b/from_test.go @@ -2,856 +2,123 @@ package md import ( "bytes" - "fmt" "io/ioutil" - "net/url" - "path/filepath" + "net/http" + "net/http/httptest" "strings" "sync" "testing" "github.com/PuerkitoBio/goquery" - "github.com/sergi/go-diff/diffmatchpatch" ) -// var update = flag.Bool("update", false, "update .golden files") -var f = false -var update = &f - -func TestFromString(t *testing.T) { - var tests = []struct { - name string - - domain string - html string - options *Options - }{ - { - name: "strong in p tag with whitespace", - html: "

Some Text

", - }, - { - name: "strong in p tag with whitespace inside", - html: "

Some Text.

", - }, - { - name: "strong in p tag whithout whitespace", - html: "

SomeText

", - }, - { - name: "strong in p tag with spans", - html: "

SomeTextContent

", - }, - { - name: "strong in p tag with punctuation", - html: "

SomeText.

", - }, - { - name: "nested strong tags", - html: `

Text

`, - }, - { - name: "i inside an em ", - html: `DoubleItalic`, - }, - { - name: "em in a p", - html: `

首付19,8 月供

`, - }, - { - name: "two em in a h4", - html: `

首付19,8 / - 月供6339元X24

`, - }, - { - name: "em in p tag", - html: "

Some Text

", - }, - { - name: "em in p tag with whitespace", - html: "

Some Text

", - }, - { - name: "h1", - html: "

Header

", - }, - { - name: "h2", - html: "

Header

", - }, - { - name: "h6", - html: "
Header
", - }, - { - name: "escape h1", - html: "

#hashtag

", - }, - { // TODO: also escape short setext - name: "escape h2", - html: ` -not title -- -`, - }, - { - name: "escape h2 with longer dashes", - html: ` -not title ------- -`, - }, - { // TODO: dont escape twice - name: "dont escape twice", - html: ` -not title -\-\-\- -`, - }, - { - name: "heading in link", - html: ` -
- -
-
-

#zuhause_jul20

- - Remote - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - -
-
- Datum
- 31.07. - 02.08.20 -
-
-
-
- - - - -
-
- Uhrzeit
- Fr 15 Uhr - So 19 Uhr -
-
-
-
-
- Details anzeigen → -
-
-
-
- `, - }, - { - name: "setext h1", - html: "

Header

", - options: &Options{ - HeadingStyle: "setext", - }, - }, - { - name: "setext h2", - html: "

Header

", - options: &Options{ - HeadingStyle: "setext", - }, - }, - { - name: "setext h3", - html: "

Header

", - options: &Options{ - HeadingStyle: "setext", - }, - }, - { - name: "ul", - html: ` - - `, - }, - { - name: "ol", - html: ` -
    -
  1. First Thing
  2. -
  3. Second Thing
  4. -
- `, - }, - { - name: "indent content in li", - html: ` - - `, - }, - { - name: "nested list", - html: ` - - `, - }, - { - name: "nested lists without space", - html: `

header1

- - - - `, - }, - { - name: "nested lists with too much space", - html: `

header1

`, - }, - { - name: "nested list real world", - html: ` - - - `, - }, - { - name: "italic with no space after", - html: ` -

Content and no space afterward.

- `, - }, - { - name: "ul in ol", - html: ` -
    -
  1. -

    First Thing

    - -
  2. -
  3. Second Thing
  4. -
- `, - }, - { - name: "empty list item", - html: ` - - `, - }, - { - name: "list items ending with a space", - html: ` - - `, - }, - { - name: "sup element", - html: ` -

One of the most common equations in all of physics is - E=mc2.

- `, - }, - { - name: "sup element in list", - html: ` -

The ordinal number "fifth" can be abbreviated in various languages as follows:

- - `, - }, - { - name: "image", - html: `website favicon`, - }, - { - name: "image with alt tag", - html: `website "favicon"`, - }, - { - name: "image with no src", - html: ``, - }, - { - name: "image with empty src", - html: ``, - }, - { - name: "image with invalid src", - html: "", - }, - { - name: "image with completely invalid src", - html: "", - }, - { - name: "image with data uri", - html: `star`, - }, - { - name: "image inside an empty link", - html: ` - website favicon - `, - }, - { - name: "link", - html: `Link`, - }, - { - name: "links next to each other", - html: `

first second

`, - }, - { - name: "links directly next to content", - html: `

BeforeLinkAfter

`, - }, - { - name: "link with href", - html: `Link`, - }, - { - name: "link with broken href", - html: `Link`, - }, - { - name: "link with title", - html: `Link`, - }, - { - name: "multiline link", - html: ` - -

First Text

- -

Second Text

-
`, - }, - { - name: "multiline link inside a list item", - html: ` - - `, - }, - { - name: "link with svg inlined", - html: ` - - - - `, - options: &Options{ - LinkStyle: "inlined", - }, - }, - { - name: "link with svg reference link full", - html: ` - - - - `, - options: &Options{ - LinkStyle: "referenced", - LinkReferenceStyle: "full", - }, - }, - { - name: "link with svg reference link collapsed", - html: ` - - - - `, - options: &Options{ - LinkStyle: "referenced", - LinkReferenceStyle: "collapsed", - }, - }, - { - name: "link with svg reference link shortcut", - html: ` - - - - `, - options: &Options{ - LinkStyle: "referenced", - LinkReferenceStyle: "shortcut", - }, - }, - { - name: "tweet", - html: ` -
-
Kroger @kroger
-

As a company, it’s our responsibility to better support our Black associates, customers and allies. We know there is more work to do and will keep you updated on our progress, this is only the beginning. Black Lives Matter.

-
- `, - }, - { - name: "reference link full", - html: ` -First Link - -Second Link -`, - options: &Options{ - LinkStyle: "referenced", - LinkReferenceStyle: "full", - }, - }, - { - name: "reference link collapsed", - html: `Link`, - options: &Options{ - LinkStyle: "referenced", - LinkReferenceStyle: "collapsed", - }, - }, - { - name: "reference link shortcut", - html: `Link`, - options: &Options{ - LinkStyle: "referenced", - LinkReferenceStyle: "shortcut", - }, - }, - { - name: "escape strong", - html: `

**Not Strong** - **Still Not - Strong**

`, - }, - { - name: "escape italic", - html: `

_Not Italic_

`, - }, - { - name: "escape ordered list", - html: `

1. Not List 1. Not List - 1. Not List

`, - }, - { - name: "escape unordered list", - html: `

- Not List

`, - }, - { - name: "pre tag", - html: ` -
-

Who ate the most donuts this week?

-
Jeff  15
-Sam   11
-Robin  6
-
- `, - }, - { - name: "code tag inside p", - html: ` -

When x = 3, that means x + 2 = 5

- `, - }, - { - name: "code tag", - html: ` - last_30_days - `, - }, - { - name: "code block with fence characters", - html: "
```
", - }, - { - name: "code block with fence characters tilde", - html: "
~~~
", - options: &Options{ - Fence: "~~~", - }, - }, - { - name: "code block with multiple fence characters tilde", - html: `

-Some ~~~
-totally ~~~~~~ normal
-~ code
-
`, - options: &Options{ - Fence: "~~~", - }, - }, - { - name: "hr", - html: ` -

Some Content

-
-

Other Content

- `, - }, - { - name: "blockquote", - html: ` -
-Some Quote -Next Line -
- `, - }, - { - name: "large blockquote", - html: ` -
-

Allowing an unimportant mistake to pass without comment is a wonderful social grace.

-

Ideological differences are no excuse for rudeness.

-
- `, - }, - { - name: "empty blockquote", - html: ` -
- `, - }, - { - name: "turndown demo", - html: ` -

Turndown Demo

- -

This demonstrates turndown – an HTML to Markdown converter in JavaScript.

- -

Usage

- -
var turndownService = new TurndownService()
-console.log(
-  turndownService.turndown('<h1>Hello world</h1>')
-)
- -
- -

It aims to be CommonMark - compliant, and includes options to style the output. These options include:

- - - `, - }, - { - name: "keep tag", - html: `

Content

`, - }, - { - name: "remove tag", - html: `

Content

`, - }, - { - /* - When a header (eg.

) contains any new lines in its body, it will split the header contents - over multiple lines, breaking the header in Markdown (because in Markdown, a header just - starts with #'s and anything on the next line is not part of the header). Since in HTML - and Markdown all white space is treated the same, I chose to replace line endings with spaces. - -> https://github.com/lunny/html2md/pull/6 - */ - name: "strip newlines from header", - html: ` -

- -Header -Containing - -Newlines - -

- `, - }, - { - name: "text with whitespace", - html: ` -
-

Aktuelles

- - -
25 Mai
- -

9. Bonner Nachtlauf - Einschränkungen am Bootshaus

- - - am Mittwoch, dem 30. Mai 2018 findet am Bonner Rheinufer der 9. ... - More - - - -
- -
- -
-

Aktuelles

-

Title

- - - Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vestibulum id ligula porta felis euismod semper. - More - -
-`, - }, - { - name: "pre tag without code tag", - html: ` -
// Fprint formats using the default formats for its operands and writes to w.
-// Spaces are added between operands when neither is a string.
-// It returns the number of bytes written and any write error encountered.
-func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
-`, - }, - { - name: "escape pipe characters because of the use in tables", - html: `

With | Character

`, - }, - { - name: "br adds new line break", - html: `

1. xxx
2. xxxx
3. xxx


4. golang
a. xx
b. xx

`, - }, - { - name: "br does not add new line inside header", - html: `

Heading

One

`, - }, - { - name: "dont escape too much", - html: `jmap –histo[:live]`, - }, - { - name: "html in noscript", - html: ` - - `, - }, - { - name: "remove iframe", - html: ` `, - }, - /* - { // TODO: not working yet - name: "p tag with lots of whitespace", - html: ` -

- Sometimes a struct field, function, type, or even a whole package becomes - - - redundant or unnecessary, but must be kept for compatibility with existing +func TestConvertReader(t *testing.T) { + input := `Bold` + expected := `**Bold**` + converter := NewConverter("", true, nil) + res, err := converter.ConvertReader(strings.NewReader(input)) + if err != nil { + t.Error(err) + } - programs. + if !bytes.Equal(res.Bytes(), []byte(expected)) { + t.Error("the result is different that expected") + } +} +func TestConvertBytes(t *testing.T) { + input := `Bold` + expected := `**Bold**` - To signal that an identifier should not be used, add a paragraph to its doc + converter := NewConverter("", true, nil) + res, err := converter.ConvertBytes([]byte(input)) + if err != nil { + t.Error(err) + } + if !bytes.Equal(res, []byte(expected)) { + t.Error("the result is different that expected") + } +} - comment that begins with "Deprecated:" followed by some information about the +func TestConvertResponse(t *testing.T) { + input := `Bold` + expected := `**Bold**` + converter := NewConverter("", true, nil) + res, err := converter.ConvertResponse(&http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewBufferString(input)), + Request: &http.Request{}, + }) + if err != nil { + t.Error(err) + } - deprecation. + if res != expected { + t.Error("the result is different that expected") + } +} +func TestConvertString(t *testing.T) { + input := `Bold` + expected := `**Bold**` - There are a few examples in the standard library. -

- `, - }, - */ + converter := NewConverter("", true, nil) + res, err := converter.ConvertString(input) + if err != nil { + t.Error(err) } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - converter := NewConverter(test.domain, true, test.options) - converter.Keep("keep-tag").Remove("remove-tag") - - markdown, err := converter.ConvertString(test.html) - if err != nil { - t.Error(err) - } - data := []byte(markdown) - name := strings.Replace(test.name, " ", "_", -1) - if url.QueryEscape(name) != name { - fmt.Printf("'%s' is not a safe path", name) - } - name = url.QueryEscape(name) // for safety - name = filepath.Join("TestFromString", name) + if res != expected { + t.Error("the result is different that expected") + } +} - gp := filepath.Join("testdata", name+".golden") - if *update { - t.Log("update golden file") - if err := ioutil.WriteFile(gp, data, 0644); err != nil { - t.Fatalf("failed to update golden file: %s", err) - } - } +func TestConvertSelection(t *testing.T) { + input := `Bold` + expected := `**Bold**` - g, err := ioutil.ReadFile(gp) - if err != nil { - t.Logf("Result:\n'%s'\n", markdown) - t.Fatalf("failed reading .golden: %s", err) - } + doc, err := goquery.NewDocumentFromReader(strings.NewReader(input)) + if err != nil { + t.Error(err) + } - if !bytes.Equal([]byte(markdown), g) { - dmp := diffmatchpatch.New() + converter := NewConverter("", true, nil) + res := converter.Convert(doc.Selection) - diffs := dmp.DiffMain(string(g), markdown, false) - diffs = dmp.DiffCleanupSemantic(diffs) + if res != expected { + t.Error("the result is different that expected") + } +} - fmt.Println(dmp.DiffToDelta(diffs)) +func TestConvertURL(t *testing.T) { + input := `Bold` + expected := `**Bold**` + + // Start a local HTTP server + server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + rw.Write([]byte(input)) + })) + // Close the server when test finishes + defer server.Close() + // override the client used in `ConvertURL` + netClient = server.Client() + + converter := NewConverter(server.URL, true, nil) + res, err := converter.ConvertURL(server.URL) + if err != nil { + t.Error(err) + } - t.Errorf("written json does not match .golden file: %+v \n", dmp.DiffPrettyText(diffs)) - } - }) + if res != expected { + t.Error("the result is different that expected") } } +// - - - - - - - - - - - - // + func BenchmarkFromString(b *testing.B) { converter := NewConverter("www.google.com", true, nil) @@ -977,64 +244,3 @@ func TestAddRules_Fallback(t *testing.T) { t.Error("second rule was not called") } } -func TestWholeSite(t *testing.T) { - var tests = []struct { - name string - domain string - - file string - }{ - { - name: "golang.org", - - domain: "golang.org", - }, - { - name: "bonnerruderverein.de", - domain: "bonnerruderverein.de", - }, - { - name: "blog.golang.org", - domain: "blog.golang.org", - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - converter := NewConverter(test.domain, true, nil) - - htmlData, err := ioutil.ReadFile( - filepath.Join("testdata", t.Name()+".html"), - ) - if err != nil { - t.Error(err) - } - - markdownData, err := converter.ConvertBytes(htmlData) - if err != nil { - t.Error(err) - } - - // output := blackfriday.Run(data) - // fmt.Println(string(output)) - - gp := filepath.Join("testdata", t.Name()+".md") - if *update { - t.Log("update golden file") - if err := ioutil.WriteFile(gp, markdownData, 0644); err != nil { - t.Fatalf("failed to update golden file: %s", err) - } - } - - g, err := ioutil.ReadFile(gp) - if err != nil { - t.Logf("Result:\n'%s'\n", string(markdownData)) - t.Fatalf("failed reading .golden: %s", err) - } - - if !bytes.Equal(markdownData, g) { - t.Errorf("written json does not match .golden file \nexpected:\n'%s'\nbut got:\n'%s'", string(g), string(markdownData)) - } - }) - } -} diff --git a/testdata/TestCommonmark/blockquote/goldmark.golden b/testdata/TestCommonmark/blockquote/goldmark.golden new file mode 100644 index 0000000..c630b98 --- /dev/null +++ b/testdata/TestCommonmark/blockquote/goldmark.golden @@ -0,0 +1,8 @@ +
+

Some Quote +Next Line

+
+
+

Allowing an unimportant mistake to pass without comment is a wonderful social grace.

+

Ideological differences are no excuse for rudeness.

+
diff --git a/testdata/TestCommonmark/blockquote/input.html b/testdata/TestCommonmark/blockquote/input.html new file mode 100644 index 0000000..a2d219f --- /dev/null +++ b/testdata/TestCommonmark/blockquote/input.html @@ -0,0 +1,16 @@ + +
+Some Quote +Next Line +
+ + +
+ + + +
+

Allowing an unimportant mistake to pass without comment is a wonderful social grace.

+

Ideological differences are no excuse for rudeness.

+
+ \ No newline at end of file diff --git a/testdata/TestFromString/large_blockquote.golden b/testdata/TestCommonmark/blockquote/output.default.golden similarity index 84% rename from testdata/TestFromString/large_blockquote.golden rename to testdata/TestCommonmark/blockquote/output.default.golden index 7b709ea..261bab9 100644 --- a/testdata/TestFromString/large_blockquote.golden +++ b/testdata/TestCommonmark/blockquote/output.default.golden @@ -1,3 +1,6 @@ +> Some Quote +> Next Line + > Allowing an unimportant mistake to pass without comment is a wonderful social grace. > > Ideological differences are no excuse for rudeness. \ No newline at end of file diff --git a/testdata/TestCommonmark/bold/goldmark.golden b/testdata/TestCommonmark/bold/goldmark.golden new file mode 100644 index 0000000..f8999b3 --- /dev/null +++ b/testdata/TestCommonmark/bold/goldmark.golden @@ -0,0 +1,12 @@ +

Some Text

+

Some Text

+

Text

+

Some Text

+

Some Text.

+

Some Text Content

+

Some Text.

+

Some Text

+

首付 19,8万 / 月供 6339元X24

+

**Not Strong** +**Still Not +Strong**

diff --git a/testdata/TestCommonmark/bold/input.html b/testdata/TestCommonmark/bold/input.html new file mode 100644 index 0000000..92a78bd --- /dev/null +++ b/testdata/TestCommonmark/bold/input.html @@ -0,0 +1,36 @@ + +

Some Text

+ + + +

Some Text

+ + + +

Text

+ + + +

SomeText

+ + + +

Some Text.

+ +

SomeTextContent

+ +

SomeText.

+ + +

Some Text

+ + + +

首付19,8 / + 月供6339元X24

+ + + +

**Not Strong** + **Still Not + Strong**

\ No newline at end of file diff --git a/testdata/TestCommonmark/bold/output.asterisks.golden b/testdata/TestCommonmark/bold/output.asterisks.golden new file mode 100644 index 0000000..a546d29 --- /dev/null +++ b/testdata/TestCommonmark/bold/output.asterisks.golden @@ -0,0 +1,21 @@ +Some **Text** + +Some **Text** + +**Text** + +Some **Text** + +Some **Text.** + +Some **Text** Content + +Some **Text.** + +Some **Text** + +#### 首付 _19,8万_ / 月供 _6339元X24_ + +\*\*Not Strong\*\* +\*\*Still Not +Strong\*\* \ No newline at end of file diff --git a/testdata/TestCommonmark/bold/output.default.golden b/testdata/TestCommonmark/bold/output.default.golden new file mode 100644 index 0000000..8f8727f --- /dev/null +++ b/testdata/TestCommonmark/bold/output.default.golden @@ -0,0 +1,17 @@ +Some **Text** + +Some **Text** + +**Text** + +Some **Text** + +Some **Text.** + +Some **Text** Content + +Some **Text.** + +Some **Text** + +#### 首付 _19,8万_ / 月供 _6339元X24_ \ No newline at end of file diff --git a/testdata/TestCommonmark/bold/output.underscores.golden b/testdata/TestCommonmark/bold/output.underscores.golden new file mode 100644 index 0000000..c3957cd --- /dev/null +++ b/testdata/TestCommonmark/bold/output.underscores.golden @@ -0,0 +1,21 @@ +Some __Text__ + +Some __Text__ + +__Text__ + +Some __Text__ + +Some __Text.__ + +Some __Text__ Content + +Some __Text.__ + +Some __Text__ + +#### 首付 _19,8万_ / 月供 _6339元X24_ + +\*\*Not Strong\*\* +\*\*Still Not +Strong\*\* \ No newline at end of file diff --git a/testdata/TestCommonmark/br_element/goldmark.golden b/testdata/TestCommonmark/br_element/goldmark.golden new file mode 100644 index 0000000..aab43ac --- /dev/null +++ b/testdata/TestCommonmark/br_element/goldmark.golden @@ -0,0 +1,7 @@ +

1. xxx

+

2. xxxx

+

3. xxx

+

+

4. golang

+

a. xx

+

b. xx

diff --git a/testdata/TestCommonmark/br_element/input.html b/testdata/TestCommonmark/br_element/input.html new file mode 100644 index 0000000..860f827 --- /dev/null +++ b/testdata/TestCommonmark/br_element/input.html @@ -0,0 +1,3 @@ + + +

1. xxx
2. xxxx
3. xxx


4. golang
a. xx
b. xx

diff --git a/testdata/TestFromString/br_adds_new_line_break.golden b/testdata/TestCommonmark/br_element/output.default.golden similarity index 100% rename from testdata/TestFromString/br_adds_new_line_break.golden rename to testdata/TestCommonmark/br_element/output.default.golden diff --git a/testdata/TestCommonmark/h1/goldmark.golden b/testdata/TestCommonmark/h1/goldmark.golden deleted file mode 100644 index 0183faf..0000000 --- a/testdata/TestCommonmark/h1/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

*The Title!

diff --git a/testdata/TestCommonmark/h1/input.html b/testdata/TestCommonmark/h1/input.html deleted file mode 100644 index 0183faf..0000000 --- a/testdata/TestCommonmark/h1/input.html +++ /dev/null @@ -1 +0,0 @@ -

*The Title!

diff --git a/testdata/TestCommonmark/h1/output.atx.golden b/testdata/TestCommonmark/h1/output.atx.golden deleted file mode 100644 index 416e938..0000000 --- a/testdata/TestCommonmark/h1/output.atx.golden +++ /dev/null @@ -1 +0,0 @@ -# \*The Title! \ No newline at end of file diff --git a/testdata/TestCommonmark/h1/output.setext.golden b/testdata/TestCommonmark/h1/output.setext.golden deleted file mode 100644 index 71ca225..0000000 --- a/testdata/TestCommonmark/h1/output.setext.golden +++ /dev/null @@ -1,2 +0,0 @@ -\*The Title! -============ \ No newline at end of file diff --git a/testdata/TestCommonmark/h2/goldmark.golden b/testdata/TestCommonmark/h2/goldmark.golden deleted file mode 100644 index 514a9a3..0000000 --- a/testdata/TestCommonmark/h2/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

*The Title!

diff --git a/testdata/TestCommonmark/h2/input.html b/testdata/TestCommonmark/h2/input.html deleted file mode 100644 index 514a9a3..0000000 --- a/testdata/TestCommonmark/h2/input.html +++ /dev/null @@ -1 +0,0 @@ -

*The Title!

diff --git a/testdata/TestCommonmark/h2/output.atx.golden b/testdata/TestCommonmark/h2/output.atx.golden deleted file mode 100644 index 2fae4d6..0000000 --- a/testdata/TestCommonmark/h2/output.atx.golden +++ /dev/null @@ -1 +0,0 @@ -## \*The Title! \ No newline at end of file diff --git a/testdata/TestCommonmark/h2/output.setext.golden b/testdata/TestCommonmark/h2/output.setext.golden deleted file mode 100644 index 20c4f3a..0000000 --- a/testdata/TestCommonmark/h2/output.setext.golden +++ /dev/null @@ -1,2 +0,0 @@ -\*The Title! ------------- \ No newline at end of file diff --git a/testdata/TestCommonmark/h3/goldmark.golden b/testdata/TestCommonmark/h3/goldmark.golden deleted file mode 100644 index 24dc3e3..0000000 --- a/testdata/TestCommonmark/h3/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

The Title

diff --git a/testdata/TestCommonmark/h3/input.html b/testdata/TestCommonmark/h3/input.html deleted file mode 100644 index 24dc3e3..0000000 --- a/testdata/TestCommonmark/h3/input.html +++ /dev/null @@ -1 +0,0 @@ -

The Title

diff --git a/testdata/TestCommonmark/h3/output.atx.golden b/testdata/TestCommonmark/h3/output.atx.golden deleted file mode 100644 index e7127a3..0000000 --- a/testdata/TestCommonmark/h3/output.atx.golden +++ /dev/null @@ -1 +0,0 @@ -### The Title \ No newline at end of file diff --git a/testdata/TestCommonmark/h3/output.setext.golden b/testdata/TestCommonmark/h3/output.setext.golden deleted file mode 100644 index e7127a3..0000000 --- a/testdata/TestCommonmark/h3/output.setext.golden +++ /dev/null @@ -1 +0,0 @@ -### The Title \ No newline at end of file diff --git a/testdata/TestCommonmark/heading/goldmark.golden b/testdata/TestCommonmark/heading/goldmark.golden new file mode 100644 index 0000000..b4a4733 --- /dev/null +++ b/testdata/TestCommonmark/heading/goldmark.golden @@ -0,0 +1,21 @@ +

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+

Heading with Whitespace

+

Header Containing Newlines

+

Heading One

+

Heading 2

+

#hashtag

+

not title +------

+

not title

+

not title

+ +

not title

+

not title +\-\-\-

diff --git a/testdata/TestCommonmark/heading/input.html b/testdata/TestCommonmark/heading/input.html new file mode 100644 index 0000000..64df68f --- /dev/null +++ b/testdata/TestCommonmark/heading/input.html @@ -0,0 +1,74 @@ + +

Heading 1

+ +

Heading 2

+ +

Heading 3

+ +

Heading 4

+ +
Heading 5
+ +
Heading 6
+ + + +

Heading with Whitespace

+ + + +

+ +Header +Containing + +Newlines + +

+ + + +

Heading

One

+ + + + +

Heading 2

+
+ + + +

#hashtag

+ +

+not title +------ +

+ + +

+not title +- +

+ + +

not title

+

-

+ +

+not title += +

+ + +

+not title +\-\-\- +

\ No newline at end of file diff --git a/testdata/TestCommonmark/heading/output.atx.golden b/testdata/TestCommonmark/heading/output.atx.golden new file mode 100644 index 0000000..b8a11ab --- /dev/null +++ b/testdata/TestCommonmark/heading/output.atx.golden @@ -0,0 +1,37 @@ +# Heading 1 + +## Heading 2 + +### Heading 3 + +#### Heading 4 + +##### Heading 5 + +###### Heading 6 + +## Heading with Whitespace + +## Header Containing Newlines + +# Heading One + + [**Heading 2**](/page.html) + +# \#hashtag + +not title +\-\-\---- + +not title +- + +not title + +- + +not title += + +not title +\\-\\-\\- \ No newline at end of file diff --git a/testdata/TestCommonmark/heading/output.default.golden b/testdata/TestCommonmark/heading/output.default.golden new file mode 100644 index 0000000..016723f --- /dev/null +++ b/testdata/TestCommonmark/heading/output.default.golden @@ -0,0 +1,19 @@ +# Heading 1 + +## Heading 2 + +### Heading 3 + +#### Heading 4 + +##### Heading 5 + +###### Heading 6 + +## Heading with Whitespace + +## Header Containing Newlines + +# Heading One + + [**Heading 2**](/page.html) \ No newline at end of file diff --git a/testdata/TestCommonmark/heading/output.setext.golden b/testdata/TestCommonmark/heading/output.setext.golden new file mode 100644 index 0000000..79faa87 --- /dev/null +++ b/testdata/TestCommonmark/heading/output.setext.golden @@ -0,0 +1,43 @@ +Heading 1 +========= + +Heading 2 +--------- + +### Heading 3 + +#### Heading 4 + +##### Heading 5 + +###### Heading 6 + + Heading with Whitespace +------------------------- + + Header Containing Newlines +------------------------------- + +Heading One +============== + + [**Heading 2**](/page.html) + +\#hashtag +========= + +not title +\-\-\---- + +not title +- + +not title + +- + +not title += + +not title +\\-\\-\\- \ No newline at end of file diff --git a/testdata/TestCommonmark/hr/goldmark.golden b/testdata/TestCommonmark/hr/goldmark.golden new file mode 100644 index 0000000..8ad4019 --- /dev/null +++ b/testdata/TestCommonmark/hr/goldmark.golden @@ -0,0 +1,3 @@ +

Some Content

+
+

Other Content

diff --git a/testdata/TestCommonmark/hr/input.html b/testdata/TestCommonmark/hr/input.html new file mode 100644 index 0000000..b6941fb --- /dev/null +++ b/testdata/TestCommonmark/hr/input.html @@ -0,0 +1,4 @@ + +

Some Content

+
+

Other Content

diff --git a/testdata/TestFromString/hr.golden b/testdata/TestCommonmark/hr/output.default.golden similarity index 100% rename from testdata/TestFromString/hr.golden rename to testdata/TestCommonmark/hr/output.default.golden diff --git a/testdata/TestCommonmark/image/goldmark.golden b/testdata/TestCommonmark/image/goldmark.golden new file mode 100644 index 0000000..0bc4ed8 --- /dev/null +++ b/testdata/TestCommonmark/image/goldmark.golden @@ -0,0 +1,7 @@ +

website favicon

+

alt "attribute"

+

+

![](invalid%zz

+

zzz)

+

star

+

website favicon

diff --git a/testdata/TestCommonmark/image/input.html b/testdata/TestCommonmark/image/input.html new file mode 100644 index 0000000..4e4571f --- /dev/null +++ b/testdata/TestCommonmark/image/input.html @@ -0,0 +1,43 @@ + + +website favicon +
+ + + +alt "attribute" +
+ + + + + + + + + + + + +
+ + + + +
+ + + +star +
+ + + + + website favicon + + + diff --git a/testdata/TestCommonmark/image/output.default.golden b/testdata/TestCommonmark/image/output.default.golden new file mode 100644 index 0000000..0a10349 --- /dev/null +++ b/testdata/TestCommonmark/image/output.default.golden @@ -0,0 +1,13 @@ +![website favicon](http://commonmark.org/help/images/favicon.png) + +![alt "attribute"](http://commonmark.org/help/images/favicon.png) + +![](http://example.com/image.png) + +![](invalid%zz + +zzz) + +![star](data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7) + +![website favicon](http://commonmark.org/help/images/favicon.png) \ No newline at end of file diff --git a/testdata/TestCommonmark/italic/goldmark.golden b/testdata/TestCommonmark/italic/goldmark.golden new file mode 100644 index 0000000..cca5e52 --- /dev/null +++ b/testdata/TestCommonmark/italic/goldmark.golden @@ -0,0 +1,7 @@ +

Some Text

+

Some Text

+

Some Text

+

DoubleItalic

+

Some 19,80€ Text

+

Content and no space afterward.

+

_Not Italic_

diff --git a/testdata/TestCommonmark/italic/input.html b/testdata/TestCommonmark/italic/input.html new file mode 100644 index 0000000..480d0f9 --- /dev/null +++ b/testdata/TestCommonmark/italic/input.html @@ -0,0 +1,24 @@ + +

Some Text

+ + + +

Some Text

+ + + +

Some Text

+ + + +

DoubleItalic

+ +

Some 19,80 Text

+ + + +

Content and no space afterward.

+ + + +

_Not Italic_

\ No newline at end of file diff --git a/testdata/TestCommonmark/italic/output.asterisks.golden b/testdata/TestCommonmark/italic/output.asterisks.golden new file mode 100644 index 0000000..bfd5672 --- /dev/null +++ b/testdata/TestCommonmark/italic/output.asterisks.golden @@ -0,0 +1,13 @@ +Some *Text* + +Some *Text* + +Some *Text* + +*DoubleItalic* + +Some *19,80€* Text + +*Content* and no space afterward. + +\_Not Italic\_ \ No newline at end of file diff --git a/testdata/TestCommonmark/italic/output.default.golden b/testdata/TestCommonmark/italic/output.default.golden new file mode 100644 index 0000000..0910317 --- /dev/null +++ b/testdata/TestCommonmark/italic/output.default.golden @@ -0,0 +1,11 @@ +Some _Text_ + +Some _Text_ + +Some _Text_ + +_DoubleItalic_ + +Some _19,80€_ Text + +_Content_ and no space afterward. \ No newline at end of file diff --git a/testdata/TestCommonmark/italic/output.underscores.golden b/testdata/TestCommonmark/italic/output.underscores.golden new file mode 100644 index 0000000..2fbdb34 --- /dev/null +++ b/testdata/TestCommonmark/italic/output.underscores.golden @@ -0,0 +1,13 @@ +Some _Text_ + +Some _Text_ + +Some _Text_ + +_DoubleItalic_ + +Some _19,80€_ Text + +_Content_ and no space afterward. + +\_Not Italic\_ \ No newline at end of file diff --git a/testdata/TestCommonmark/keep_remove_tag/goldmark.golden b/testdata/TestCommonmark/keep_remove_tag/goldmark.golden new file mode 100644 index 0000000..4285b55 --- /dev/null +++ b/testdata/TestCommonmark/keep_remove_tag/goldmark.golden @@ -0,0 +1 @@ +

Content

diff --git a/testdata/TestCommonmark/keep_remove_tag/input.html b/testdata/TestCommonmark/keep_remove_tag/input.html new file mode 100644 index 0000000..2b9c34f --- /dev/null +++ b/testdata/TestCommonmark/keep_remove_tag/input.html @@ -0,0 +1,45 @@ + + +

Content

+ + + +

Content

+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testdata/TestFromString/keep_tag.golden b/testdata/TestCommonmark/keep_remove_tag/output.default.golden similarity index 100% rename from testdata/TestFromString/keep_tag.golden rename to testdata/TestCommonmark/keep_remove_tag/output.default.golden diff --git a/testdata/TestCommonmark/link/goldmark.golden b/testdata/TestCommonmark/link/goldmark.golden new file mode 100644 index 0000000..e16e7cc --- /dev/null +++ b/testdata/TestCommonmark/link/goldmark.golden @@ -0,0 +1,17 @@ +

Simple Link

+

Link with Space

+

Link with Title

+

Broken Link

+

First Text
+
+Second Text

+ +

GitHub

+

first top second below

+

first left second right

+

Before close After

diff --git a/testdata/TestCommonmark/link/input.html b/testdata/TestCommonmark/link/input.html new file mode 100644 index 0000000..e2d2780 --- /dev/null +++ b/testdata/TestCommonmark/link/input.html @@ -0,0 +1,72 @@ + +Simple Link +
+ + + + Link with Space +
+ + + +Link with Title +
+ + + +Broken Link +
+ + + + +

First Text

+ +

Second Text

+
+
+ + + + + + + + + + +
+ + + +

+ first top + + second below +

+
+ + + +

first left second right

+
+ + + +

BeforecloseAfter

+
diff --git a/testdata/TestCommonmark/link/output.default.golden b/testdata/TestCommonmark/link/output.default.golden new file mode 100644 index 0000000..2854095 --- /dev/null +++ b/testdata/TestCommonmark/link/output.default.golden @@ -0,0 +1,24 @@ +[Link](http://commonmark.org/) + + [Link](http://commonmark.org/) + +[Link](http://commonmark.org/ "Some Title") + + [Link](http://example.com/test.html\r) + + [First Text\ +![](http://xxx)\ +Second Text](http://commonmark.org/) + +- [First Text\ + \ + \ + Second Text](http://commonmark.org/) + +[GitHub](https://github.com "GitHub") + +[first](http://first.com) [second](http://second.com) + +[first](http://first.com) [second](http://second.com) + +Before [Link](http://example.com) After \ No newline at end of file diff --git a/testdata/TestCommonmark/link/output.inlined.golden b/testdata/TestCommonmark/link/output.inlined.golden new file mode 100644 index 0000000..68e4e6c --- /dev/null +++ b/testdata/TestCommonmark/link/output.inlined.golden @@ -0,0 +1,24 @@ +[Simple Link](http://simple.org/) + + [Link with Space](http://space.org/) + +[Link with Title](http://title.org/ "Some Title") + + [Broken Link](http://broken.com/test.html\r) + + [First Text\ +![](http://xxx)\ +Second Text](http://multi.org/) + +- [First Text\ + \ + \ + Second Text](http://list.org/) + +[GitHub](https://github.com "GitHub") + +[first top](http://first_under.com) [second below](http://second_under.com) + +[first left](http://first_next.com) [second right](http://second_next.com) + +Before [close](http://example_close.com) After \ No newline at end of file diff --git a/testdata/TestCommonmark/link/output.referenced_collapsed.golden b/testdata/TestCommonmark/link/output.referenced_collapsed.golden new file mode 100644 index 0000000..a30bbab --- /dev/null +++ b/testdata/TestCommonmark/link/output.referenced_collapsed.golden @@ -0,0 +1,42 @@ +[Simple Link][] + + [Link with Space][] + +[Link with Title][] + + [Broken Link][] + + [First Text\ +![](http://xxx)\ +Second Text][] + +- [First Text\ + \ + \ + Second Text][] + +[GitHub][] + +[first top][] [second below][] + +[first left][] [second right][] + +Before [close][] After + +[Simple Link]: http://simple.org/ +[Link with Space]: http://space.org/ +[Link with Title]: http://title.org/ "Some Title" +[Broken Link]: http://broken.com/test.html\r +[First Text\ +![](http://xxx)\ +Second Text]: http://multi.org/ +[First Text\ +\ +\ +Second Text]: http://list.org/ +[GitHub]: https://github.com "GitHub" +[first top]: http://first_under.com +[second below]: http://second_under.com +[first left]: http://first_next.com +[second right]: http://second_next.com +[close]: http://example_close.com \ No newline at end of file diff --git a/testdata/TestCommonmark/link/output.referenced_full.golden b/testdata/TestCommonmark/link/output.referenced_full.golden new file mode 100644 index 0000000..cf024f1 --- /dev/null +++ b/testdata/TestCommonmark/link/output.referenced_full.golden @@ -0,0 +1,37 @@ +[Simple Link][1] + + [Link with Space][2] + +[Link with Title][3] + + [Broken Link][4] + + [First Text\ +![](http://xxx)\ +Second Text][5] + +- [First Text\ + \ + \ + Second Text][6] + +[GitHub][7] + +[first top][8] [second below][9] + +[first left][10] [second right][11] + +Before [close][12] After + +[1]: http://simple.org/ +[2]: http://space.org/ +[3]: http://title.org/ "Some Title" +[4]: http://broken.com/test.html\r +[5]: http://multi.org/ +[6]: http://list.org/ +[7]: https://github.com "GitHub" +[8]: http://first_under.com +[9]: http://second_under.com +[10]: http://first_next.com +[11]: http://second_next.com +[12]: http://example_close.com \ No newline at end of file diff --git a/testdata/TestCommonmark/link/output.referenced_shortcut.golden b/testdata/TestCommonmark/link/output.referenced_shortcut.golden new file mode 100644 index 0000000..6bd0cb2 --- /dev/null +++ b/testdata/TestCommonmark/link/output.referenced_shortcut.golden @@ -0,0 +1,42 @@ +[Simple Link] + + [Link with Space] + +[Link with Title] + + [Broken Link] + + [First Text\ +![](http://xxx)\ +Second Text] + +- [First Text\ + \ + \ + Second Text] + +[GitHub] + +[first top] [second below] + +[first left] [second right] + +Before [close] After + +[Simple Link]: http://simple.org/ +[Link with Space]: http://space.org/ +[Link with Title]: http://title.org/ "Some Title" +[Broken Link]: http://broken.com/test.html\r +[First Text\ +![](http://xxx)\ +Second Text]: http://multi.org/ +[First Text\ +\ +\ +Second Text]: http://list.org/ +[GitHub]: https://github.com "GitHub" +[first top]: http://first_under.com +[second below]: http://second_under.com +[first left]: http://first_next.com +[second right]: http://second_next.com +[close]: http://example_close.com \ No newline at end of file diff --git a/testdata/TestCommonmark/list/goldmark.golden b/testdata/TestCommonmark/list/goldmark.golden new file mode 100644 index 0000000..02e7de9 --- /dev/null +++ b/testdata/TestCommonmark/list/goldmark.golden @@ -0,0 +1,94 @@ + +
    +
  1. +

    First Thing

    +
  2. +
  3. +

    Second Thing

    +
  4. +
  5. +

    1

    +
  6. +
  7. +

    2

    +
  8. +
  9. +

    3

    +
  10. +
  11. +

    4

    +
  12. +
  13. +

    5

    +
  14. +
  15. +

    6

    +
  16. +
  17. +

    7

    +
  18. +
  19. +

    8

    +
  20. +
  21. +

    9

    +
  22. +
  23. +

    10

    +
  24. +
  25. +

    11

    +
  26. +
  27. +

    12

    +
  28. +
  29. +

    13

    +
  30. +
  31. +

    14

    +
  32. +
  33. +

    15

    +
  34. +
  35. +

    First Thing

    + +
  36. +
  37. +

    Second Thing

    +
  38. +
+ +

- Not List

+

1. Not List 1. Not List +1. Not List

diff --git a/testdata/TestCommonmark/list/input.html b/testdata/TestCommonmark/list/input.html new file mode 100644 index 0000000..f443da2 --- /dev/null +++ b/testdata/TestCommonmark/list/input.html @@ -0,0 +1,80 @@ + + + + + + + +
    +
  1. First Thing
  2. +
  3. Second Thing
  4. +
+ + + +
    +
  1. 1
  2. +
  3. 2
  4. +
  5. 3
  6. +
  7. 4
  8. +
  9. 5
  10. +
  11. 6
  12. +
  13. 7
  14. +
  15. 8
  16. +
  17. 9
  18. +
  19. 10
  20. +
  21. 11
  22. +
  23. 12
  24. +
  25. 13
  26. +
  27. 14
  28. +
  29. 15
  30. +
+ + + +
    +
  1. +

    First Thing

    + +
  2. +
  3. Second Thing
  4. +
+ + + + + + + + + + + + + + + +

- Not List

+ +

1. Not List 1. Not List + 1. Not List

diff --git a/testdata/TestCommonmark/list/output.asterisks.golden b/testdata/TestCommonmark/list/output.asterisks.golden new file mode 100644 index 0000000..e728005 --- /dev/null +++ b/testdata/TestCommonmark/list/output.asterisks.golden @@ -0,0 +1,44 @@ +* Some Thing +* Another Thing + +1. First Thing +2. Second Thing + +1. 1 +2. 2 +3. 3 +4. 4 +5. 5 +6. 6 +7. 7 +8. 8 +9. 9 +10. 10 +11. 11 +12. 12 +13. 13 +14. 14 +15. 15 + +1. First Thing + * Some Thing + * Another Thing +2. Second Thing + +* foo +* bar + +* List items +* Ending with +* A space + +* Indent First Thing + + Second Thing + +* Third Thing + +\- Not List + +1\. Not List 1. Not List +1\. Not List \ No newline at end of file diff --git a/testdata/TestCommonmark/list/output.dash.golden b/testdata/TestCommonmark/list/output.dash.golden new file mode 100644 index 0000000..d256abc --- /dev/null +++ b/testdata/TestCommonmark/list/output.dash.golden @@ -0,0 +1,44 @@ +- Some Thing +- Another Thing + +1. First Thing +2. Second Thing + +1. 1 +2. 2 +3. 3 +4. 4 +5. 5 +6. 6 +7. 7 +8. 8 +9. 9 +10. 10 +11. 11 +12. 12 +13. 13 +14. 14 +15. 15 + +1. First Thing + - Some Thing + - Another Thing +2. Second Thing + +- foo +- bar + +- List items +- Ending with +- A space + +- Indent First Thing + + Second Thing + +- Third Thing + +\- Not List + +1\. Not List 1. Not List +1\. Not List \ No newline at end of file diff --git a/testdata/TestCommonmark/list/output.plus.golden b/testdata/TestCommonmark/list/output.plus.golden new file mode 100644 index 0000000..f884f3f --- /dev/null +++ b/testdata/TestCommonmark/list/output.plus.golden @@ -0,0 +1,44 @@ ++ Some Thing ++ Another Thing + +1. First Thing +2. Second Thing + +1. 1 +2. 2 +3. 3 +4. 4 +5. 5 +6. 6 +7. 7 +8. 8 +9. 9 +10. 10 +11. 11 +12. 12 +13. 13 +14. 14 +15. 15 + +1. First Thing + + Some Thing + + Another Thing +2. Second Thing + ++ foo ++ bar + ++ List items ++ Ending with ++ A space + ++ Indent First Thing + + Second Thing + ++ Third Thing + +\- Not List + +1\. Not List 1. Not List +1\. Not List \ No newline at end of file diff --git a/testdata/TestCommonmark/list_nested/goldmark.golden b/testdata/TestCommonmark/list_nested/goldmark.golden new file mode 100644 index 0000000..560ad9f --- /dev/null +++ b/testdata/TestCommonmark/list_nested/goldmark.golden @@ -0,0 +1,42 @@ + +

header1

+ diff --git a/testdata/TestCommonmark/list_nested/input.html b/testdata/TestCommonmark/list_nested/input.html new file mode 100644 index 0000000..ebe7a96 --- /dev/null +++ b/testdata/TestCommonmark/list_nested/input.html @@ -0,0 +1,44 @@ + + + + + +

header1

+ + + + + diff --git a/testdata/TestCommonmark/list_nested/output.asterisks.golden b/testdata/TestCommonmark/list_nested/output.asterisks.golden new file mode 100644 index 0000000..759afe1 --- /dev/null +++ b/testdata/TestCommonmark/list_nested/output.asterisks.golden @@ -0,0 +1,17 @@ +* foo + * bar + * baz + * boo + +* Coffee +* Tea + * Black tea + * Green tea +* Milk + +# header1 + +* Bullet list + * Nested bullet + * Sub-nested bullet etc +* Bullet list item 2 \ No newline at end of file diff --git a/testdata/TestFromString/nested_lists_without_space.golden b/testdata/TestCommonmark/list_nested/output.dash.golden similarity index 74% rename from testdata/TestFromString/nested_lists_without_space.golden rename to testdata/TestCommonmark/list_nested/output.dash.golden index 12c0f6a..b30f305 100644 --- a/testdata/TestFromString/nested_lists_without_space.golden +++ b/testdata/TestCommonmark/list_nested/output.dash.golden @@ -1,3 +1,8 @@ +- foo + - bar + - baz + - boo + - Coffee - Tea - Black tea diff --git a/testdata/TestCommonmark/list_nested/output.plus.golden b/testdata/TestCommonmark/list_nested/output.plus.golden new file mode 100644 index 0000000..9ac4888 --- /dev/null +++ b/testdata/TestCommonmark/list_nested/output.plus.golden @@ -0,0 +1,17 @@ ++ foo + + bar + + baz + + boo + ++ Coffee ++ Tea + + Black tea + + Green tea ++ Milk + +# header1 + ++ Bullet list + + Nested bullet + + Sub-nested bullet etc ++ Bullet list item 2 \ No newline at end of file diff --git a/testdata/TestCommonmark/p_inside_div/goldmark.golden b/testdata/TestCommonmark/p_inside_div/goldmark.golden deleted file mode 100644 index fd0cf7b..0000000 --- a/testdata/TestCommonmark/p_inside_div/goldmark.golden +++ /dev/null @@ -1,2 +0,0 @@ -

Text

-

Some Text

diff --git a/testdata/TestCommonmark/p_inside_div/input.html b/testdata/TestCommonmark/p_inside_div/input.html deleted file mode 100644 index 7e154cc..0000000 --- a/testdata/TestCommonmark/p_inside_div/input.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Text

-

Some Text

-
diff --git a/testdata/TestCommonmark/p_inside_div/output.default.golden b/testdata/TestCommonmark/p_inside_div/output.default.golden deleted file mode 100644 index 346950e..0000000 --- a/testdata/TestCommonmark/p_inside_div/output.default.golden +++ /dev/null @@ -1,3 +0,0 @@ -Text - -Some Text \ No newline at end of file diff --git a/testdata/TestCommonmark/p_tag/goldmark.golden b/testdata/TestCommonmark/p_tag/goldmark.golden new file mode 100644 index 0000000..17a652d --- /dev/null +++ b/testdata/TestCommonmark/p_tag/goldmark.golden @@ -0,0 +1,12 @@ +

Some Content

+

Text

+

Some Text

+

Some Content

+

jmap –histo[:live]

+

Sometimes a struct field, function, type, or even a whole package becomes

+

redundant or unnecessary, but must be kept for compatibility with existing

+

programs.

+

To signal that an identifier should not be used, add a paragraph to its doc

+

comment that begins with "Deprecated:" followed by some information about the

+

deprecation.

+

There are a few examples in the standard library.

diff --git a/testdata/TestCommonmark/p_tag/input.html b/testdata/TestCommonmark/p_tag/input.html new file mode 100644 index 0000000..f3651d7 --- /dev/null +++ b/testdata/TestCommonmark/p_tag/input.html @@ -0,0 +1,43 @@ + + +

Some Content

+ + + +
+

Text

+

Some Text

+
+ + + +

Some Content

+ + + + +

jmap –histo[:live]

+ + + +

+ Sometimes a struct field, function, type, or even a whole package becomes + + + redundant or unnecessary, but must be kept for compatibility with existing + + + programs. + + + To signal that an identifier should not be used, add a paragraph to its doc + + + comment that begins with "Deprecated:" followed by some information about the + + + deprecation. + + + There are a few examples in the standard library. +

\ No newline at end of file diff --git a/testdata/TestCommonmark/p_tag/output.default.golden b/testdata/TestCommonmark/p_tag/output.default.golden new file mode 100644 index 0000000..e5dadd6 --- /dev/null +++ b/testdata/TestCommonmark/p_tag/output.default.golden @@ -0,0 +1,23 @@ +Some Content + +Text + +Some Text + +Some Content + +jmap –histo[:live] + +Sometimes a struct field, function, type, or even a whole package becomes + +redundant or unnecessary, but must be kept for compatibility with existing + +programs. + +To signal that an identifier should not be used, add a paragraph to its doc + +comment that begins with "Deprecated:" followed by some information about the + +deprecation. + +There are a few examples [in the standard library](https://golang.org/search?q=Deprecated:). \ No newline at end of file diff --git a/testdata/TestCommonmark/p_with_b/goldmark.golden b/testdata/TestCommonmark/p_with_b/goldmark.golden deleted file mode 100644 index fa306a7..0000000 --- a/testdata/TestCommonmark/p_with_b/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_b/input.html b/testdata/TestCommonmark/p_with_b/input.html deleted file mode 100644 index f37d90d..0000000 --- a/testdata/TestCommonmark/p_with_b/input.html +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_b/output.default.golden b/testdata/TestCommonmark/p_with_b/output.default.golden deleted file mode 100644 index 5b9916d..0000000 --- a/testdata/TestCommonmark/p_with_b/output.default.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Content** \ No newline at end of file diff --git a/testdata/TestCommonmark/p_with_content/goldmark.golden b/testdata/TestCommonmark/p_with_content/goldmark.golden deleted file mode 100644 index bd81d95..0000000 --- a/testdata/TestCommonmark/p_with_content/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_content/input.html b/testdata/TestCommonmark/p_with_content/input.html deleted file mode 100644 index 7231eac..0000000 --- a/testdata/TestCommonmark/p_with_content/input.html +++ /dev/null @@ -1 +0,0 @@ -

Some Content

\ No newline at end of file diff --git a/testdata/TestCommonmark/p_with_content/output.default.golden b/testdata/TestCommonmark/p_with_content/output.default.golden deleted file mode 100644 index 56d8c1a..0000000 --- a/testdata/TestCommonmark/p_with_content/output.default.golden +++ /dev/null @@ -1 +0,0 @@ -Some Content \ No newline at end of file diff --git a/testdata/TestCommonmark/p_with_span/goldmark.golden b/testdata/TestCommonmark/p_with_span/goldmark.golden deleted file mode 100644 index bd81d95..0000000 --- a/testdata/TestCommonmark/p_with_span/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_span/input.html b/testdata/TestCommonmark/p_with_span/input.html deleted file mode 100644 index 8916709..0000000 --- a/testdata/TestCommonmark/p_with_span/input.html +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_span/output.default.golden b/testdata/TestCommonmark/p_with_span/output.default.golden deleted file mode 100644 index 56d8c1a..0000000 --- a/testdata/TestCommonmark/p_with_span/output.default.golden +++ /dev/null @@ -1 +0,0 @@ -Some Content \ No newline at end of file diff --git a/testdata/TestCommonmark/p_with_strong/goldmark.golden b/testdata/TestCommonmark/p_with_strong/goldmark.golden deleted file mode 100644 index fa306a7..0000000 --- a/testdata/TestCommonmark/p_with_strong/goldmark.golden +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_strong/input.html b/testdata/TestCommonmark/p_with_strong/input.html deleted file mode 100644 index fa306a7..0000000 --- a/testdata/TestCommonmark/p_with_strong/input.html +++ /dev/null @@ -1 +0,0 @@ -

Some Content

diff --git a/testdata/TestCommonmark/p_with_strong/output.default.golden b/testdata/TestCommonmark/p_with_strong/output.default.golden deleted file mode 100644 index 5b9916d..0000000 --- a/testdata/TestCommonmark/p_with_strong/output.default.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Content** \ No newline at end of file diff --git a/testdata/TestCommonmark/p_with_strong/output.underscore.golden b/testdata/TestCommonmark/p_with_strong/output.underscore.golden deleted file mode 100644 index c083fe1..0000000 --- a/testdata/TestCommonmark/p_with_strong/output.underscore.golden +++ /dev/null @@ -1 +0,0 @@ -Some __Content__ \ No newline at end of file diff --git a/testdata/TestCommonmark/pre_code/goldmark.golden b/testdata/TestCommonmark/pre_code/goldmark.golden new file mode 100644 index 0000000..3344886 --- /dev/null +++ b/testdata/TestCommonmark/pre_code/goldmark.golden @@ -0,0 +1,22 @@ +

last_30_days

+

Who ate the most donuts this week?

+
Jeff  15
+Sam   11
+Robin  6
+
+
// Fprint formats using the default formats for its operands and writes to w.
+// Spaces are added between operands when neither is a string.
+// It returns the number of bytes written and any write error encountered.
+func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
+
+

When x = 3, that means x + 2 = 5

+
```
+
+
~~~
+
+

+Some ~~~
+totally ~~~~~~ normal
+~ code
+
+
diff --git a/testdata/TestCommonmark/pre_code/input.html b/testdata/TestCommonmark/pre_code/input.html new file mode 100644 index 0000000..da51420 --- /dev/null +++ b/testdata/TestCommonmark/pre_code/input.html @@ -0,0 +1,35 @@ + + +last_30_days + + + +
+

Who ate the most donuts this week?

+
Jeff  15
+Sam   11
+Robin  6
+
+ + + +
// Fprint formats using the default formats for its operands and writes to w.
+// Spaces are added between operands when neither is a string.
+// It returns the number of bytes written and any write error encountered.
+func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
+ + + +

When x = 3, that means x + 2 = 5

+ + + +
```
+ +
~~~
+ +

+Some ~~~
+totally ~~~~~~ normal
+~ code
+
\ No newline at end of file diff --git a/testdata/TestFromString/pre_tag_without_code_tag.golden b/testdata/TestCommonmark/pre_code/output.fenced_backtick.golden similarity index 57% rename from testdata/TestFromString/pre_tag_without_code_tag.golden rename to testdata/TestCommonmark/pre_code/output.fenced_backtick.golden index b472408..6ce763e 100644 --- a/testdata/TestFromString/pre_tag_without_code_tag.golden +++ b/testdata/TestCommonmark/pre_code/output.fenced_backtick.golden @@ -1,6 +1,34 @@ +`last_30_days` + +Who ate the most donuts this week? + +```foo+bar +Jeff 15 +Sam 11 +Robin 6 +``` + ``` // Fprint formats using the default formats for its operands and writes to w. // Spaces are added between operands when neither is a string. // It returns the number of bytes written and any write error encountered. func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +When `x = 3`, that means `x + 2 = 5` + +```` +``` +```` + +``` +~~~ +``` + +``` + +Some ~~~ +totally ~~~~~~ normal +~ code + ``` \ No newline at end of file diff --git a/testdata/TestCommonmark/pre_code/output.fenced_tilde.golden b/testdata/TestCommonmark/pre_code/output.fenced_tilde.golden new file mode 100644 index 0000000..4f269f8 --- /dev/null +++ b/testdata/TestCommonmark/pre_code/output.fenced_tilde.golden @@ -0,0 +1,34 @@ +`last_30_days` + +Who ate the most donuts this week? + +~~~foo+bar +Jeff 15 +Sam 11 +Robin 6 +~~~ + +~~~ +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +~~~ + +When `x = 3`, that means `x + 2 = 5` + +~~~ +``` +~~~ + +~~~~ +~~~ +~~~~ + +~~~~~~~ + +Some ~~~ +totally ~~~~~~ normal +~ code + +~~~~~~~ \ No newline at end of file diff --git a/testdata/TestCommonmark/pre_code/output.indented.golden b/testdata/TestCommonmark/pre_code/output.indented.golden new file mode 100644 index 0000000..6ce763e --- /dev/null +++ b/testdata/TestCommonmark/pre_code/output.indented.golden @@ -0,0 +1,34 @@ +`last_30_days` + +Who ate the most donuts this week? + +```foo+bar +Jeff 15 +Sam 11 +Robin 6 +``` + +``` +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +When `x = 3`, that means `x + 2 = 5` + +```` +``` +```` + +``` +~~~ +``` + +``` + +Some ~~~ +totally ~~~~~~ normal +~ code + +``` \ No newline at end of file diff --git a/testdata/TestCommonmark/sup_element/goldmark.golden b/testdata/TestCommonmark/sup_element/goldmark.golden new file mode 100644 index 0000000..44f39b2 --- /dev/null +++ b/testdata/TestCommonmark/sup_element/goldmark.golden @@ -0,0 +1,7 @@ +

One of the most common equations in all of physics is +E=mc2.

+

The ordinal number "fifth" can be abbreviated in various languages as follows:

+ diff --git a/testdata/TestCommonmark/sup_element/input.html b/testdata/TestCommonmark/sup_element/input.html new file mode 100644 index 0000000..b3b024e --- /dev/null +++ b/testdata/TestCommonmark/sup_element/input.html @@ -0,0 +1,12 @@ + + +

One of the most common equations in all of physics is +E=mc2.

+ + + +

The ordinal number "fifth" can be abbreviated in various languages as follows:

+ diff --git a/testdata/TestFromString/sup_element_in_list.golden b/testdata/TestCommonmark/sup_element/output.default.golden similarity index 63% rename from testdata/TestFromString/sup_element_in_list.golden rename to testdata/TestCommonmark/sup_element/output.default.golden index 6cc8d14..cfcf91e 100644 --- a/testdata/TestFromString/sup_element_in_list.golden +++ b/testdata/TestCommonmark/sup_element/output.default.golden @@ -1,3 +1,6 @@ +One of the most common equations in all of physics is +E=mc2. + The ordinal number "fifth" can be abbreviated in various languages as follows: - English: 5th diff --git a/testdata/TestFromString/blockquote.golden b/testdata/TestFromString/blockquote.golden deleted file mode 100644 index ca7db63..0000000 --- a/testdata/TestFromString/blockquote.golden +++ /dev/null @@ -1,2 +0,0 @@ -> Some Quote -> Next Line \ No newline at end of file diff --git a/testdata/TestFromString/br_does_not_add_new_line_inside_header.golden b/testdata/TestFromString/br_does_not_add_new_line_inside_header.golden deleted file mode 100644 index 5053132..0000000 --- a/testdata/TestFromString/br_does_not_add_new_line_inside_header.golden +++ /dev/null @@ -1 +0,0 @@ -# Heading One \ No newline at end of file diff --git a/testdata/TestFromString/code_block_with_fence_characters.golden b/testdata/TestFromString/code_block_with_fence_characters.golden deleted file mode 100644 index b21c5ba..0000000 --- a/testdata/TestFromString/code_block_with_fence_characters.golden +++ /dev/null @@ -1,3 +0,0 @@ -```` -``` -```` \ No newline at end of file diff --git a/testdata/TestFromString/code_block_with_fence_characters_tilde.golden b/testdata/TestFromString/code_block_with_fence_characters_tilde.golden deleted file mode 100644 index 0b60c27..0000000 --- a/testdata/TestFromString/code_block_with_fence_characters_tilde.golden +++ /dev/null @@ -1,3 +0,0 @@ -~~~~ -~~~ -~~~~ \ No newline at end of file diff --git a/testdata/TestFromString/code_block_with_multiple_fence_characters_tilde.golden b/testdata/TestFromString/code_block_with_multiple_fence_characters_tilde.golden deleted file mode 100644 index 9b996de..0000000 --- a/testdata/TestFromString/code_block_with_multiple_fence_characters_tilde.golden +++ /dev/null @@ -1,7 +0,0 @@ -~~~~~~~ - -Some ~~~ -totally ~~~~~~ normal -~ code - -~~~~~~~ \ No newline at end of file diff --git a/testdata/TestFromString/code_tag.golden b/testdata/TestFromString/code_tag.golden deleted file mode 100644 index 390279c..0000000 --- a/testdata/TestFromString/code_tag.golden +++ /dev/null @@ -1 +0,0 @@ -`last_30_days` \ No newline at end of file diff --git a/testdata/TestFromString/code_tag_inside_p.golden b/testdata/TestFromString/code_tag_inside_p.golden deleted file mode 100644 index 3ee6922..0000000 --- a/testdata/TestFromString/code_tag_inside_p.golden +++ /dev/null @@ -1 +0,0 @@ -When `x = 3`, that means `x + 2 = 5` \ No newline at end of file diff --git a/testdata/TestFromString/dont_escape_too_much.golden b/testdata/TestFromString/dont_escape_too_much.golden deleted file mode 100644 index d599e27..0000000 --- a/testdata/TestFromString/dont_escape_too_much.golden +++ /dev/null @@ -1 +0,0 @@ -jmap –histo[:live] \ No newline at end of file diff --git a/testdata/TestFromString/dont_escape_twice.golden b/testdata/TestFromString/dont_escape_twice.golden deleted file mode 100644 index 4ddd957..0000000 --- a/testdata/TestFromString/dont_escape_twice.golden +++ /dev/null @@ -1,2 +0,0 @@ -not title -\\-\\-\\- \ No newline at end of file diff --git a/testdata/TestFromString/em_in_a_h4.golden b/testdata/TestFromString/em_in_a_h4.golden deleted file mode 100644 index b5141ac..0000000 --- a/testdata/TestFromString/em_in_a_h4.golden +++ /dev/null @@ -1 +0,0 @@ -#### 首付__19,8_万_ / 月供_6339元X24_ \ No newline at end of file diff --git a/testdata/TestFromString/em_in_p_tag.golden b/testdata/TestFromString/em_in_p_tag.golden deleted file mode 100644 index 5650728..0000000 --- a/testdata/TestFromString/em_in_p_tag.golden +++ /dev/null @@ -1 +0,0 @@ -Some _Text_ \ No newline at end of file diff --git a/testdata/TestFromString/em_in_p_tag_with_whitespace.golden b/testdata/TestFromString/em_in_p_tag_with_whitespace.golden deleted file mode 100644 index 5650728..0000000 --- a/testdata/TestFromString/em_in_p_tag_with_whitespace.golden +++ /dev/null @@ -1 +0,0 @@ -Some _Text_ \ No newline at end of file diff --git a/testdata/TestFromString/empty_blockquote.golden b/testdata/TestFromString/empty_blockquote.golden deleted file mode 100644 index e69de29..0000000 diff --git a/testdata/TestFromString/empty_list_item.golden b/testdata/TestFromString/empty_list_item.golden deleted file mode 100644 index f97ce0d..0000000 --- a/testdata/TestFromString/empty_list_item.golden +++ /dev/null @@ -1,2 +0,0 @@ -- foo -- bar \ No newline at end of file diff --git a/testdata/TestFromString/escape_h1.golden b/testdata/TestFromString/escape_h1.golden deleted file mode 100644 index 04eb160..0000000 --- a/testdata/TestFromString/escape_h1.golden +++ /dev/null @@ -1 +0,0 @@ -# \#hashtag \ No newline at end of file diff --git a/testdata/TestFromString/escape_h2.golden b/testdata/TestFromString/escape_h2.golden deleted file mode 100644 index 832d713..0000000 --- a/testdata/TestFromString/escape_h2.golden +++ /dev/null @@ -1,2 +0,0 @@ -not title -- \ No newline at end of file diff --git a/testdata/TestFromString/escape_h2_with_longer_dashes.golden b/testdata/TestFromString/escape_h2_with_longer_dashes.golden deleted file mode 100644 index 53e24ac..0000000 --- a/testdata/TestFromString/escape_h2_with_longer_dashes.golden +++ /dev/null @@ -1,2 +0,0 @@ -not title -\-\-\---- \ No newline at end of file diff --git a/testdata/TestFromString/escape_italic.golden b/testdata/TestFromString/escape_italic.golden deleted file mode 100644 index 73303ed..0000000 --- a/testdata/TestFromString/escape_italic.golden +++ /dev/null @@ -1 +0,0 @@ -\_Not Italic\_ \ No newline at end of file diff --git a/testdata/TestFromString/escape_ordered_list.golden b/testdata/TestFromString/escape_ordered_list.golden deleted file mode 100644 index 3a53e0a..0000000 --- a/testdata/TestFromString/escape_ordered_list.golden +++ /dev/null @@ -1,2 +0,0 @@ -1\. Not List 1. Not List -1\. Not List \ No newline at end of file diff --git a/testdata/TestFromString/escape_pipe_characters_because_of_the_use_in_tables.golden b/testdata/TestFromString/escape_pipe_characters_because_of_the_use_in_tables.golden deleted file mode 100644 index 17f2faa..0000000 --- a/testdata/TestFromString/escape_pipe_characters_because_of_the_use_in_tables.golden +++ /dev/null @@ -1 +0,0 @@ -With \| Character \ No newline at end of file diff --git a/testdata/TestFromString/escape_strong.golden b/testdata/TestFromString/escape_strong.golden deleted file mode 100644 index edf96bc..0000000 --- a/testdata/TestFromString/escape_strong.golden +++ /dev/null @@ -1,3 +0,0 @@ -\*\*Not Strong\*\* -\*\*Still Not -Strong\*\* \ No newline at end of file diff --git a/testdata/TestFromString/escape_unordered_list.golden b/testdata/TestFromString/escape_unordered_list.golden deleted file mode 100644 index 219ba51..0000000 --- a/testdata/TestFromString/escape_unordered_list.golden +++ /dev/null @@ -1 +0,0 @@ -\- Not List \ No newline at end of file diff --git a/testdata/TestFromString/h1.golden b/testdata/TestFromString/h1.golden deleted file mode 100644 index 7b163ac..0000000 --- a/testdata/TestFromString/h1.golden +++ /dev/null @@ -1 +0,0 @@ -# Header \ No newline at end of file diff --git a/testdata/TestFromString/h2.golden b/testdata/TestFromString/h2.golden deleted file mode 100644 index acb083e..0000000 --- a/testdata/TestFromString/h2.golden +++ /dev/null @@ -1 +0,0 @@ -## Header \ No newline at end of file diff --git a/testdata/TestFromString/h6.golden b/testdata/TestFromString/h6.golden deleted file mode 100644 index 2b943ed..0000000 --- a/testdata/TestFromString/h6.golden +++ /dev/null @@ -1 +0,0 @@ -###### Header \ No newline at end of file diff --git a/testdata/TestFromString/html_in_noscript.golden b/testdata/TestFromString/html_in_noscript.golden deleted file mode 100644 index e69de29..0000000 diff --git a/testdata/TestFromString/i_inside_an_em_.golden b/testdata/TestFromString/i_inside_an_em_.golden deleted file mode 100644 index 7b6a8b3..0000000 --- a/testdata/TestFromString/i_inside_an_em_.golden +++ /dev/null @@ -1 +0,0 @@ -_DoubleItalic_ \ No newline at end of file diff --git a/testdata/TestFromString/image.golden b/testdata/TestFromString/image.golden deleted file mode 100644 index 4083b31..0000000 --- a/testdata/TestFromString/image.golden +++ /dev/null @@ -1 +0,0 @@ -![website favicon](http://commonmark.org/help/images/favicon.png) \ No newline at end of file diff --git a/testdata/TestFromString/image_inside_an_empty_link.golden b/testdata/TestFromString/image_inside_an_empty_link.golden deleted file mode 100644 index 4083b31..0000000 --- a/testdata/TestFromString/image_inside_an_empty_link.golden +++ /dev/null @@ -1 +0,0 @@ -![website favicon](http://commonmark.org/help/images/favicon.png) \ No newline at end of file diff --git a/testdata/TestFromString/image_with_alt_tag.golden b/testdata/TestFromString/image_with_alt_tag.golden deleted file mode 100644 index b9bd504..0000000 --- a/testdata/TestFromString/image_with_alt_tag.golden +++ /dev/null @@ -1 +0,0 @@ -![website "favicon"](http://commonmark.org/help/images/favicon.png) \ No newline at end of file diff --git a/testdata/TestFromString/image_with_completely_invalid_src.golden b/testdata/TestFromString/image_with_completely_invalid_src.golden deleted file mode 100644 index ce078c6..0000000 --- a/testdata/TestFromString/image_with_completely_invalid_src.golden +++ /dev/null @@ -1,3 +0,0 @@ -![](%zz - -zzz) \ No newline at end of file diff --git a/testdata/TestFromString/image_with_data_uri.golden b/testdata/TestFromString/image_with_data_uri.golden deleted file mode 100644 index 0f5fea7..0000000 --- a/testdata/TestFromString/image_with_data_uri.golden +++ /dev/null @@ -1 +0,0 @@ -![star](data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7) \ No newline at end of file diff --git a/testdata/TestFromString/image_with_empty_src.golden b/testdata/TestFromString/image_with_empty_src.golden deleted file mode 100644 index e69de29..0000000 diff --git a/testdata/TestFromString/image_with_invalid_src.golden b/testdata/TestFromString/image_with_invalid_src.golden deleted file mode 100644 index bdd68fe..0000000 --- a/testdata/TestFromString/image_with_invalid_src.golden +++ /dev/null @@ -1 +0,0 @@ -![](http://example.com/image.png) \ No newline at end of file diff --git a/testdata/TestFromString/image_with_no_src.golden b/testdata/TestFromString/image_with_no_src.golden deleted file mode 100644 index e69de29..0000000 diff --git a/testdata/TestFromString/indent_content_in_li.golden b/testdata/TestFromString/indent_content_in_li.golden deleted file mode 100644 index 48c4a79..0000000 --- a/testdata/TestFromString/indent_content_in_li.golden +++ /dev/null @@ -1,5 +0,0 @@ -- Indent First Thing - - Second Thing - -- Third Thing \ No newline at end of file diff --git a/testdata/TestFromString/italic_with_no_space_after.golden b/testdata/TestFromString/italic_with_no_space_after.golden deleted file mode 100644 index 81ba4e6..0000000 --- a/testdata/TestFromString/italic_with_no_space_after.golden +++ /dev/null @@ -1 +0,0 @@ -_Content_ and no space afterward. \ No newline at end of file diff --git a/testdata/TestFromString/link.golden b/testdata/TestFromString/link.golden deleted file mode 100644 index f9eafc7..0000000 --- a/testdata/TestFromString/link.golden +++ /dev/null @@ -1 +0,0 @@ -[Link](http://commonmark.org/) \ No newline at end of file diff --git a/testdata/TestFromString/link_with_broken_href.golden b/testdata/TestFromString/link_with_broken_href.golden deleted file mode 100644 index 1e18623..0000000 --- a/testdata/TestFromString/link_with_broken_href.golden +++ /dev/null @@ -1 +0,0 @@ -[Link](http://example.com/test.html\r) \ No newline at end of file diff --git a/testdata/TestFromString/link_with_href.golden b/testdata/TestFromString/link_with_href.golden deleted file mode 100644 index 112dbba..0000000 --- a/testdata/TestFromString/link_with_href.golden +++ /dev/null @@ -1 +0,0 @@ -[Link](https://www.google.com/maps/place/24%20Rue%20Traversiere,%2030900%20Nîmes) \ No newline at end of file diff --git a/testdata/TestFromString/link_with_svg_inlined.golden b/testdata/TestFromString/link_with_svg_inlined.golden deleted file mode 100644 index 24e7883..0000000 --- a/testdata/TestFromString/link_with_svg_inlined.golden +++ /dev/null @@ -1 +0,0 @@ -[GitHub](https://github.com "GitHub") \ No newline at end of file diff --git a/testdata/TestFromString/link_with_svg_reference_link_collapsed.golden b/testdata/TestFromString/link_with_svg_reference_link_collapsed.golden deleted file mode 100644 index 2739aae..0000000 --- a/testdata/TestFromString/link_with_svg_reference_link_collapsed.golden +++ /dev/null @@ -1,3 +0,0 @@ -[GitHub][] - -[GitHub]: https://github.com "GitHub" \ No newline at end of file diff --git a/testdata/TestFromString/link_with_svg_reference_link_full.golden b/testdata/TestFromString/link_with_svg_reference_link_full.golden deleted file mode 100644 index f51ab72..0000000 --- a/testdata/TestFromString/link_with_svg_reference_link_full.golden +++ /dev/null @@ -1,3 +0,0 @@ -[GitHub][1] - -[1]: https://github.com "GitHub" \ No newline at end of file diff --git a/testdata/TestFromString/link_with_svg_reference_link_shortcut.golden b/testdata/TestFromString/link_with_svg_reference_link_shortcut.golden deleted file mode 100644 index 747210e..0000000 --- a/testdata/TestFromString/link_with_svg_reference_link_shortcut.golden +++ /dev/null @@ -1,3 +0,0 @@ -[GitHub] - -[GitHub]: https://github.com "GitHub" \ No newline at end of file diff --git a/testdata/TestFromString/link_with_title.golden b/testdata/TestFromString/link_with_title.golden deleted file mode 100644 index d1268c8..0000000 --- a/testdata/TestFromString/link_with_title.golden +++ /dev/null @@ -1 +0,0 @@ -[Link](http://commonmark.org/ "Some Text") \ No newline at end of file diff --git a/testdata/TestFromString/links_directly_next_to_content.golden b/testdata/TestFromString/links_directly_next_to_content.golden deleted file mode 100644 index 1362b9d..0000000 --- a/testdata/TestFromString/links_directly_next_to_content.golden +++ /dev/null @@ -1 +0,0 @@ -Before [Link](http://example.com) After \ No newline at end of file diff --git a/testdata/TestFromString/links_next_to_each_other.golden b/testdata/TestFromString/links_next_to_each_other.golden deleted file mode 100644 index d6a3b87..0000000 --- a/testdata/TestFromString/links_next_to_each_other.golden +++ /dev/null @@ -1 +0,0 @@ -[first](http://first.com) [second](http://second.com) \ No newline at end of file diff --git a/testdata/TestFromString/list_items_ending_with_a_space.golden b/testdata/TestFromString/list_items_ending_with_a_space.golden deleted file mode 100644 index 23e88da..0000000 --- a/testdata/TestFromString/list_items_ending_with_a_space.golden +++ /dev/null @@ -1,3 +0,0 @@ -- List items -- Ending with -- A space \ No newline at end of file diff --git a/testdata/TestFromString/multiline_link.golden b/testdata/TestFromString/multiline_link.golden deleted file mode 100644 index 4c6ae41..0000000 --- a/testdata/TestFromString/multiline_link.golden +++ /dev/null @@ -1,3 +0,0 @@ -[First Text\ -![](http://xxx)\ -Second Text](http://commonmark.org/) \ No newline at end of file diff --git a/testdata/TestFromString/multiline_link_inside_a_list_item.golden b/testdata/TestFromString/multiline_link_inside_a_list_item.golden deleted file mode 100644 index fff5607..0000000 --- a/testdata/TestFromString/multiline_link_inside_a_list_item.golden +++ /dev/null @@ -1,4 +0,0 @@ -- [First Text\ - \ - \ - Second Text](http://commonmark.org/) \ No newline at end of file diff --git a/testdata/TestFromString/nested_list.golden b/testdata/TestFromString/nested_list.golden deleted file mode 100644 index 5ac750c..0000000 --- a/testdata/TestFromString/nested_list.golden +++ /dev/null @@ -1,4 +0,0 @@ -- foo - - bar - - baz - - boo \ No newline at end of file diff --git a/testdata/TestFromString/nested_lists_with_too_much_space.golden b/testdata/TestFromString/nested_lists_with_too_much_space.golden deleted file mode 100644 index aa2129a..0000000 --- a/testdata/TestFromString/nested_lists_with_too_much_space.golden +++ /dev/null @@ -1,8 +0,0 @@ -- Coffee - -- Tea - - Black tea - - Green tea -- Milk - -# header1 \ No newline at end of file diff --git a/testdata/TestFromString/nested_strong_tags.golden b/testdata/TestFromString/nested_strong_tags.golden deleted file mode 100644 index 7428b56..0000000 --- a/testdata/TestFromString/nested_strong_tags.golden +++ /dev/null @@ -1 +0,0 @@ -**Text** \ No newline at end of file diff --git a/testdata/TestFromString/ol.golden b/testdata/TestFromString/ol.golden deleted file mode 100644 index 8aae7cb..0000000 --- a/testdata/TestFromString/ol.golden +++ /dev/null @@ -1,2 +0,0 @@ -1. First Thing -2. Second Thing \ No newline at end of file diff --git a/testdata/TestFromString/p_tag.golden b/testdata/TestFromString/p_tag.golden deleted file mode 100644 index d54f8ba..0000000 --- a/testdata/TestFromString/p_tag.golden +++ /dev/null @@ -1 +0,0 @@ -Some Text \ No newline at end of file diff --git a/testdata/TestFromString/pre_tag.golden b/testdata/TestFromString/pre_tag.golden deleted file mode 100644 index 4d16aac..0000000 --- a/testdata/TestFromString/pre_tag.golden +++ /dev/null @@ -1,7 +0,0 @@ -Who ate the most donuts this week? - -```foo+bar -Jeff 15 -Sam 11 -Robin 6 -``` \ No newline at end of file diff --git a/testdata/TestFromString/reference_link_collapsed.golden b/testdata/TestFromString/reference_link_collapsed.golden deleted file mode 100644 index a4a6c21..0000000 --- a/testdata/TestFromString/reference_link_collapsed.golden +++ /dev/null @@ -1,3 +0,0 @@ -[Link][] - -[Link]: http://commonmark.org/ \ No newline at end of file diff --git a/testdata/TestFromString/reference_link_full.golden b/testdata/TestFromString/reference_link_full.golden deleted file mode 100644 index f24b61a..0000000 --- a/testdata/TestFromString/reference_link_full.golden +++ /dev/null @@ -1,4 +0,0 @@ -[First Link][1] [Second Link][2] - -[1]: http://commonmark.org/first -[2]: http://commonmark.org/second \ No newline at end of file diff --git a/testdata/TestFromString/reference_link_shortcut.golden b/testdata/TestFromString/reference_link_shortcut.golden deleted file mode 100644 index 289438a..0000000 --- a/testdata/TestFromString/reference_link_shortcut.golden +++ /dev/null @@ -1,3 +0,0 @@ -[Link] - -[Link]: http://commonmark.org/ \ No newline at end of file diff --git a/testdata/TestFromString/remove_iframe.golden b/testdata/TestFromString/remove_iframe.golden deleted file mode 100644 index e69de29..0000000 diff --git a/testdata/TestFromString/remove_tag.golden b/testdata/TestFromString/remove_tag.golden deleted file mode 100644 index e69de29..0000000 diff --git a/testdata/TestFromString/setext_h1.golden b/testdata/TestFromString/setext_h1.golden deleted file mode 100644 index e016d0f..0000000 --- a/testdata/TestFromString/setext_h1.golden +++ /dev/null @@ -1,2 +0,0 @@ -Header -====== \ No newline at end of file diff --git a/testdata/TestFromString/setext_h2.golden b/testdata/TestFromString/setext_h2.golden deleted file mode 100644 index f95115e..0000000 --- a/testdata/TestFromString/setext_h2.golden +++ /dev/null @@ -1,2 +0,0 @@ -Header ------- \ No newline at end of file diff --git a/testdata/TestFromString/setext_h3.golden b/testdata/TestFromString/setext_h3.golden deleted file mode 100644 index 684989d..0000000 --- a/testdata/TestFromString/setext_h3.golden +++ /dev/null @@ -1 +0,0 @@ -### Header \ No newline at end of file diff --git a/testdata/TestFromString/span_in_p_tag.golden b/testdata/TestFromString/span_in_p_tag.golden deleted file mode 100644 index d54f8ba..0000000 --- a/testdata/TestFromString/span_in_p_tag.golden +++ /dev/null @@ -1 +0,0 @@ -Some Text \ No newline at end of file diff --git a/testdata/TestFromString/strip_newlines_from_header.golden b/testdata/TestFromString/strip_newlines_from_header.golden deleted file mode 100644 index cd33844..0000000 --- a/testdata/TestFromString/strip_newlines_from_header.golden +++ /dev/null @@ -1 +0,0 @@ -### Header Containing Newlines \ No newline at end of file diff --git a/testdata/TestFromString/strong_in_p_tag.golden b/testdata/TestFromString/strong_in_p_tag.golden deleted file mode 100644 index c3c50a3..0000000 --- a/testdata/TestFromString/strong_in_p_tag.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Text** \ No newline at end of file diff --git a/testdata/TestFromString/strong_in_p_tag_whithout_whitespace.golden b/testdata/TestFromString/strong_in_p_tag_whithout_whitespace.golden deleted file mode 100644 index c3c50a3..0000000 --- a/testdata/TestFromString/strong_in_p_tag_whithout_whitespace.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Text** \ No newline at end of file diff --git a/testdata/TestFromString/strong_in_p_tag_with_punctuation.golden b/testdata/TestFromString/strong_in_p_tag_with_punctuation.golden deleted file mode 100644 index 0bec6cb..0000000 --- a/testdata/TestFromString/strong_in_p_tag_with_punctuation.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Text.** \ No newline at end of file diff --git a/testdata/TestFromString/strong_in_p_tag_with_spans.golden b/testdata/TestFromString/strong_in_p_tag_with_spans.golden deleted file mode 100644 index ee9928e..0000000 --- a/testdata/TestFromString/strong_in_p_tag_with_spans.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Text** Content \ No newline at end of file diff --git a/testdata/TestFromString/strong_in_p_tag_with_whitespace.golden b/testdata/TestFromString/strong_in_p_tag_with_whitespace.golden deleted file mode 100644 index c3c50a3..0000000 --- a/testdata/TestFromString/strong_in_p_tag_with_whitespace.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Text** \ No newline at end of file diff --git a/testdata/TestFromString/strong_in_p_tag_with_whitespace_inside.golden b/testdata/TestFromString/strong_in_p_tag_with_whitespace_inside.golden deleted file mode 100644 index 0bec6cb..0000000 --- a/testdata/TestFromString/strong_in_p_tag_with_whitespace_inside.golden +++ /dev/null @@ -1 +0,0 @@ -Some **Text.** \ No newline at end of file diff --git a/testdata/TestFromString/sup_element.golden b/testdata/TestFromString/sup_element.golden deleted file mode 100644 index 34d707d..0000000 --- a/testdata/TestFromString/sup_element.golden +++ /dev/null @@ -1,2 +0,0 @@ -One of the most common equations in all of physics is -E=mc2. \ No newline at end of file diff --git a/testdata/TestFromString/two_em_in_a_h4.golden b/testdata/TestFromString/two_em_in_a_h4.golden deleted file mode 100644 index 7c615e6..0000000 --- a/testdata/TestFromString/two_em_in_a_h4.golden +++ /dev/null @@ -1 +0,0 @@ -#### 首付 _19,8万_ / 月供 _6339元X24_ \ No newline at end of file diff --git a/testdata/TestFromString/two_p_tags.golden b/testdata/TestFromString/two_p_tags.golden deleted file mode 100644 index 346950e..0000000 --- a/testdata/TestFromString/two_p_tags.golden +++ /dev/null @@ -1,3 +0,0 @@ -Text - -Some Text \ No newline at end of file diff --git a/testdata/TestFromString/ul.golden b/testdata/TestFromString/ul.golden deleted file mode 100644 index 6f5ff4e..0000000 --- a/testdata/TestFromString/ul.golden +++ /dev/null @@ -1,2 +0,0 @@ -- Some Thing -- Another Thing \ No newline at end of file diff --git a/testdata/TestFromString/ul_in_ol.golden b/testdata/TestFromString/ul_in_ol.golden deleted file mode 100644 index fc88623..0000000 --- a/testdata/TestFromString/ul_in_ol.golden +++ /dev/null @@ -1,4 +0,0 @@ -1. First Thing - - Some Thing - - Another Thing -2. Second Thing \ No newline at end of file diff --git a/testdata/TestPlugins/table/escape_pipe/goldmark.golden b/testdata/TestPlugins/table/escape_pipe/goldmark.golden index 6bbb6c5..d38e682 100644 --- a/testdata/TestPlugins/table/escape_pipe/goldmark.golden +++ b/testdata/TestPlugins/table/escape_pipe/goldmark.golden @@ -1,3 +1,4 @@ +

With | Character

diff --git a/testdata/TestPlugins/table/escape_pipe/input.html b/testdata/TestPlugins/table/escape_pipe/input.html index 7a3ae8a..9aaae15 100644 --- a/testdata/TestPlugins/table/escape_pipe/input.html +++ b/testdata/TestPlugins/table/escape_pipe/input.html @@ -1,3 +1,7 @@ + + +

With | Character

+

diff --git a/testdata/TestPlugins/table/escape_pipe/output.default.golden b/testdata/TestPlugins/table/escape_pipe/output.default.golden index e91b4f4..93d25f2 100644 --- a/testdata/TestPlugins/table/escape_pipe/output.default.golden +++ b/testdata/TestPlugins/table/escape_pipe/output.default.golden @@ -1,3 +1,5 @@ +With \| Character + | Firstname | With \| Character | Age | | --- | --- | --- | | Jill | Smith | 50 | diff --git a/testdata/TestRealWorld/blog.golang.org/goldmark.golden b/testdata/TestRealWorld/blog.golang.org/goldmark.golden new file mode 100644 index 0000000..92a255b --- /dev/null +++ b/testdata/TestRealWorld/blog.golang.org/goldmark.golden @@ -0,0 +1,138 @@ +

Godoc: documenting Go code - The Go Blog

+

The Go Programming Language

+

Go

+

+

Documents Packages The Project Help Blogsubmit search

+

Next article

+

Introducing Gofix

+

Previous article

+

Gobs of data

+

Links

+ +

Blog index

+

The Go Blog

+

Godoc: documenting Go code

+

31 March 2011

+

The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. +Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it +should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers +to produce good documentation, the better for everyone.

+

To that end, we have developed the +godoc documentation tool. This article describes godoc's approach to documentation, and explains how +you can use our conventions and tools to write good documentation for your own projects.

+

Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation +tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from +a function's +documentation to its +implementation with one click.

+

Godoc is conceptually related to Python's +Docstring and Java's +Javadoc, but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) +nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, +the sort you would want to read even if godoc didn't exist.

+

The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly +preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside +the item it documents. For example, this is the documentation for the +fmt package's +Fprint function:

+
// Fprint formats using the default formats for its operands and writes to w.
+// Spaces are added between operands when neither is a string.
+// It returns the number of bytes written and any write error encountered.
+func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
+
+

Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention +allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes +it read better when tools truncate it for brevity, such as when they extract the first line or sentence.

+

Comments on package declarations should provide general package documentation. These comments can be short, like the +sort package's brief description:

+
// Package sort provides primitives for sorting slices and user-defined
+// collections.
+package sort
+
+

They can also be detailed like the +gob package's overview. That package uses another convention for packages that need large amounts of +introductory documentation: the package comment is placed in its own file, +doc.go, which contains only those comments and a package clause.

+

When writing package comments of any size, keep in mind that their first sentence will appear in godoc's +package list.

+

Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. +Top-level comments that begin with the word +"BUG(who)” are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” +part should be the user name of someone who could provide more information. For example, this is a known issue +from the +bytes package:

+
// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly.
+
+

Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for +compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its +doc comment that begins with "Deprecated:" followed by some information about the deprecation. There +are a few examples +in the standard library.

+

There are a few formatting rules that Godoc uses when converting comments to HTML:

+ +

Note that none of these rules requires you to do anything out of the ordinary.

+

In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including +all of the standard library, already follows the conventions.

+

Your own code can present good documentation just by having comments as described above. Any Go packages installed inside +$GOROOT/src/pkg and any +GOPATH work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify +additional paths for indexing via the +-path flag or just by running +"godoc ." in the source directory. See the +godoc documentation for more details.

+

By Andrew Gerrand

+

Related articles

+ +

Except as +noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License,

+

and code is licensed under a +BSD license.

+

Terms of Service | +Privacy Policy | +View the source code

diff --git a/testdata/TestWholeSite/blog.golang.org.html b/testdata/TestRealWorld/blog.golang.org/input.html similarity index 100% rename from testdata/TestWholeSite/blog.golang.org.html rename to testdata/TestRealWorld/blog.golang.org/input.html diff --git a/testdata/TestWholeSite/blog.golang.org.md b/testdata/TestRealWorld/blog.golang.org/output.emphasis_asterisks.golden similarity index 100% rename from testdata/TestWholeSite/blog.golang.org.md rename to testdata/TestRealWorld/blog.golang.org/output.emphasis_asterisks.golden diff --git a/testdata/TestRealWorld/blog.golang.org/output.emphasis_underscores.golden b/testdata/TestRealWorld/blog.golang.org/output.emphasis_underscores.golden new file mode 100644 index 0000000..3bf3be8 --- /dev/null +++ b/testdata/TestRealWorld/blog.golang.org/output.emphasis_underscores.golden @@ -0,0 +1,187 @@ +Godoc: documenting Go code - The Go Blog + +[The Go Programming Language](//golang.org/) + +[Go](//golang.org/) + +▽ + +[Documents](//golang.org/doc/) [Packages](//golang.org/pkg/) [The Project](//golang.org/project/) [Help](//golang.org/help/) [Blog](/)submit search + +#### Next article + +[Introducing Gofix](/introducing-gofix) + +#### Previous article + +[Gobs of data](/gobs-of-data) + +#### Links + +- [golang.org](//golang.org/) +- [Install Go](//golang.org/doc/install.html) +- [A Tour of Go](//tour.golang.org/) +- [Go Documentation](//golang.org/doc/) +- [Go Mailing List](//groups.google.com/group/golang-nuts) +- [Go on Google+](//plus.google.com/101406623878176903605) +- [Go+ Community](//plus.google.com/communities/114112804251407510571) +- [Go on Twitter](//twitter.com/golang) + +[Blog index](/index) + +# [The Go Blog](/) + +### [Godoc: documenting Go code](/godoc-documenting-go-code) + +31 March 2011 + +The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. +Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it +should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers +to produce good documentation, the better for everyone. + + +To that end, we have developed the +[godoc](https://golang.org/cmd/godoc/) documentation tool. This article describes godoc's approach to documentation, and explains how +you can use our conventions and tools to write good documentation for your own projects. + + +Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation +tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from +a function's +[documentation](https://golang.org/pkg/strings/#HasPrefix) to its +[implementation](https://golang.org/src/pkg/strings/strings.go#L493) with one click. + + +Godoc is conceptually related to Python's +[Docstring](http://www.python.org/dev/peps/pep-0257/) and Java's +[Javadoc](http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html), but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) +nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, +the sort you would want to read even if godoc didn't exist. + + +The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly +preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside +the item it documents. For example, this is the documentation for the +`fmt` package's +[`Fprint`](https://golang.org/pkg/fmt/#Fprint) function: + + +``` +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention +allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes +it read better when tools truncate it for brevity, such as when they extract the first line or sentence. + + +Comments on package declarations should provide general package documentation. These comments can be short, like the +[`sort`](https://golang.org/pkg/sort/) package's brief description: + + +``` +// Package sort provides primitives for sorting slices and user-defined +// collections. +package sort +``` + +They can also be detailed like the +[gob package](https://golang.org/pkg/encoding/gob/)'s overview. That package uses another convention for packages that need large amounts of +introductory documentation: the package comment is placed in its own file, +[doc.go](https://golang.org/src/pkg/encoding/gob/doc.go), which contains only those comments and a package clause. + + +When writing package comments of any size, keep in mind that their first sentence will appear in godoc's +[package list](https://golang.org/pkg/). + + +Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. +Top-level comments that begin with the word +`"BUG(who)”` are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” +part should be the user name of someone who could provide more information. For example, this is a known issue +from the +[bytes package](https://golang.org/pkg/bytes/#pkg-note-BUG): + + +``` +// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly. +``` + +Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for +compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its +doc comment that begins with "Deprecated:" followed by some information about the deprecation. There +are a few examples +[in the standard library](https://golang.org/search?q=Deprecated:). + + +There are a few formatting rules that Godoc uses when converting comments to HTML: + + +- Subsequent lines of text are considered part of the same paragraph; you must leave a blank line to separate paragraphs. + +- Pre-formatted text must be indented relative to the surrounding comment text (see gob's + [doc.go](https://golang.org/src/pkg/encoding/gob/doc.go) for an example). + +- URLs will be converted to HTML links; no special markup is necessary. + +Note that none of these rules requires you to do anything out of the ordinary. + + +In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including +all of the standard library, already follows the conventions. + + +Your own code can present good documentation just by having comments as described above. Any Go packages installed inside +`$GOROOT/src/pkg` and any +`GOPATH` work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify +additional paths for indexing via the +`-path` flag or just by running +`"godoc ."` in the source directory. See the +[godoc documentation](https://golang.org/cmd/godoc/) for more details. + + +By Andrew Gerrand + +## Related articles + +- [HTTP/2 Server Push](/h2push) +- [Introducing HTTP Tracing](/http-tracing) +- [Testable Examples in Go](/examples) +- [Generating code](/generate) +- [Introducing the Go Race Detector](/race-detector) +- [Go maps in action](/go-maps-in-action) +- [go fmt your code](/go-fmt-your-code) +- [Organizing Go code](/organizing-go-code) +- [Debugging Go programs with the GNU Debugger](/debugging-go-programs-with-gnu-debugger) +- [The Go image/draw package](/go-imagedraw-package) +- [The Go image package](/go-image-package) +- [The Laws of Reflection](/laws-of-reflection) +- [Error handling and Go](/error-handling-and-go) +- ["First Class Functions in Go"](/first-class-functions-in-go-and-new-go) +- [Profiling Go Programs](/profiling-go-programs) +- [A GIF decoder: an exercise in Go interfaces](/gif-decoder-exercise-in-go-interfaces) +- [Introducing Gofix](/introducing-gofix) +- [Gobs of data](/gobs-of-data) +- [C? Go? Cgo!](/c-go-cgo) +- [JSON and Go](/json-and-go) +- [Go Slices: usage and internals](/go-slices-usage-and-internals) +- [Go Concurrency Patterns: Timing out, moving on](/go-concurrency-patterns-timing-out-and) +- [Defer, Panic, and Recover](/defer-panic-and-recover) +- [Share Memory By Communicating](/share-memory-by-communicating) +- [JSON-RPC: a tale of interfaces](/json-rpc-tale-of-interfaces) + +Except as +[noted](https://developers.google.com/site-policies#restrictions), the content of this page is licensed under the Creative Commons Attribution 3.0 License, + + +and code is licensed under a +[BSD license](//golang.org/LICENSE). + + +[Terms of Service](//golang.org/doc/tos.html) \| +[Privacy Policy](//www.google.com/intl/en/policies/privacy/) \| +[View the source code](https://go.googlesource.com/blog/) \ No newline at end of file diff --git a/testdata/TestRealWorld/blog.golang.org/output.inlined.golden b/testdata/TestRealWorld/blog.golang.org/output.inlined.golden new file mode 100644 index 0000000..3bf3be8 --- /dev/null +++ b/testdata/TestRealWorld/blog.golang.org/output.inlined.golden @@ -0,0 +1,187 @@ +Godoc: documenting Go code - The Go Blog + +[The Go Programming Language](//golang.org/) + +[Go](//golang.org/) + +▽ + +[Documents](//golang.org/doc/) [Packages](//golang.org/pkg/) [The Project](//golang.org/project/) [Help](//golang.org/help/) [Blog](/)submit search + +#### Next article + +[Introducing Gofix](/introducing-gofix) + +#### Previous article + +[Gobs of data](/gobs-of-data) + +#### Links + +- [golang.org](//golang.org/) +- [Install Go](//golang.org/doc/install.html) +- [A Tour of Go](//tour.golang.org/) +- [Go Documentation](//golang.org/doc/) +- [Go Mailing List](//groups.google.com/group/golang-nuts) +- [Go on Google+](//plus.google.com/101406623878176903605) +- [Go+ Community](//plus.google.com/communities/114112804251407510571) +- [Go on Twitter](//twitter.com/golang) + +[Blog index](/index) + +# [The Go Blog](/) + +### [Godoc: documenting Go code](/godoc-documenting-go-code) + +31 March 2011 + +The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. +Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it +should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers +to produce good documentation, the better for everyone. + + +To that end, we have developed the +[godoc](https://golang.org/cmd/godoc/) documentation tool. This article describes godoc's approach to documentation, and explains how +you can use our conventions and tools to write good documentation for your own projects. + + +Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation +tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from +a function's +[documentation](https://golang.org/pkg/strings/#HasPrefix) to its +[implementation](https://golang.org/src/pkg/strings/strings.go#L493) with one click. + + +Godoc is conceptually related to Python's +[Docstring](http://www.python.org/dev/peps/pep-0257/) and Java's +[Javadoc](http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html), but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) +nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, +the sort you would want to read even if godoc didn't exist. + + +The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly +preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside +the item it documents. For example, this is the documentation for the +`fmt` package's +[`Fprint`](https://golang.org/pkg/fmt/#Fprint) function: + + +``` +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention +allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes +it read better when tools truncate it for brevity, such as when they extract the first line or sentence. + + +Comments on package declarations should provide general package documentation. These comments can be short, like the +[`sort`](https://golang.org/pkg/sort/) package's brief description: + + +``` +// Package sort provides primitives for sorting slices and user-defined +// collections. +package sort +``` + +They can also be detailed like the +[gob package](https://golang.org/pkg/encoding/gob/)'s overview. That package uses another convention for packages that need large amounts of +introductory documentation: the package comment is placed in its own file, +[doc.go](https://golang.org/src/pkg/encoding/gob/doc.go), which contains only those comments and a package clause. + + +When writing package comments of any size, keep in mind that their first sentence will appear in godoc's +[package list](https://golang.org/pkg/). + + +Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. +Top-level comments that begin with the word +`"BUG(who)”` are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” +part should be the user name of someone who could provide more information. For example, this is a known issue +from the +[bytes package](https://golang.org/pkg/bytes/#pkg-note-BUG): + + +``` +// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly. +``` + +Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for +compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its +doc comment that begins with "Deprecated:" followed by some information about the deprecation. There +are a few examples +[in the standard library](https://golang.org/search?q=Deprecated:). + + +There are a few formatting rules that Godoc uses when converting comments to HTML: + + +- Subsequent lines of text are considered part of the same paragraph; you must leave a blank line to separate paragraphs. + +- Pre-formatted text must be indented relative to the surrounding comment text (see gob's + [doc.go](https://golang.org/src/pkg/encoding/gob/doc.go) for an example). + +- URLs will be converted to HTML links; no special markup is necessary. + +Note that none of these rules requires you to do anything out of the ordinary. + + +In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including +all of the standard library, already follows the conventions. + + +Your own code can present good documentation just by having comments as described above. Any Go packages installed inside +`$GOROOT/src/pkg` and any +`GOPATH` work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify +additional paths for indexing via the +`-path` flag or just by running +`"godoc ."` in the source directory. See the +[godoc documentation](https://golang.org/cmd/godoc/) for more details. + + +By Andrew Gerrand + +## Related articles + +- [HTTP/2 Server Push](/h2push) +- [Introducing HTTP Tracing](/http-tracing) +- [Testable Examples in Go](/examples) +- [Generating code](/generate) +- [Introducing the Go Race Detector](/race-detector) +- [Go maps in action](/go-maps-in-action) +- [go fmt your code](/go-fmt-your-code) +- [Organizing Go code](/organizing-go-code) +- [Debugging Go programs with the GNU Debugger](/debugging-go-programs-with-gnu-debugger) +- [The Go image/draw package](/go-imagedraw-package) +- [The Go image package](/go-image-package) +- [The Laws of Reflection](/laws-of-reflection) +- [Error handling and Go](/error-handling-and-go) +- ["First Class Functions in Go"](/first-class-functions-in-go-and-new-go) +- [Profiling Go Programs](/profiling-go-programs) +- [A GIF decoder: an exercise in Go interfaces](/gif-decoder-exercise-in-go-interfaces) +- [Introducing Gofix](/introducing-gofix) +- [Gobs of data](/gobs-of-data) +- [C? Go? Cgo!](/c-go-cgo) +- [JSON and Go](/json-and-go) +- [Go Slices: usage and internals](/go-slices-usage-and-internals) +- [Go Concurrency Patterns: Timing out, moving on](/go-concurrency-patterns-timing-out-and) +- [Defer, Panic, and Recover](/defer-panic-and-recover) +- [Share Memory By Communicating](/share-memory-by-communicating) +- [JSON-RPC: a tale of interfaces](/json-rpc-tale-of-interfaces) + +Except as +[noted](https://developers.google.com/site-policies#restrictions), the content of this page is licensed under the Creative Commons Attribution 3.0 License, + + +and code is licensed under a +[BSD license](//golang.org/LICENSE). + + +[Terms of Service](//golang.org/doc/tos.html) \| +[Privacy Policy](//www.google.com/intl/en/policies/privacy/) \| +[View the source code](https://go.googlesource.com/blog/) \ No newline at end of file diff --git a/testdata/TestRealWorld/blog.golang.org/output.referenced_collapsed.golden b/testdata/TestRealWorld/blog.golang.org/output.referenced_collapsed.golden new file mode 100644 index 0000000..78d750e --- /dev/null +++ b/testdata/TestRealWorld/blog.golang.org/output.referenced_collapsed.golden @@ -0,0 +1,252 @@ +Godoc: documenting Go code - The Go Blog + +[The Go Programming Language][] + +[Go][] + +▽ + +[Documents][] [Packages][] [The Project][] [Help][] [Blog][]submit search + +#### Next article + +[Introducing Gofix][] + +#### Previous article + +[Gobs of data][] + +#### Links + +- [golang.org][] +- [Install Go][] +- [A Tour of Go][] +- [Go Documentation][] +- [Go Mailing List][] +- [Go on Google+][] +- [Go+ Community][] +- [Go on Twitter][] + +[Blog index][] + +# [The Go Blog][] + +### [Godoc: documenting Go code][] + +31 March 2011 + +The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. +Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it +should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers +to produce good documentation, the better for everyone. + + +To that end, we have developed the +[godoc][] documentation tool. This article describes godoc's approach to documentation, and explains how +you can use our conventions and tools to write good documentation for your own projects. + + +Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation +tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from +a function's +[documentation][] to its +[implementation][] with one click. + + +Godoc is conceptually related to Python's +[Docstring][] and Java's +[Javadoc][], but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) +nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, +the sort you would want to read even if godoc didn't exist. + + +The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly +preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside +the item it documents. For example, this is the documentation for the +`fmt` package's +[`Fprint`][] function: + + +``` +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention +allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes +it read better when tools truncate it for brevity, such as when they extract the first line or sentence. + + +Comments on package declarations should provide general package documentation. These comments can be short, like the +[`sort`][] package's brief description: + + +``` +// Package sort provides primitives for sorting slices and user-defined +// collections. +package sort +``` + +They can also be detailed like the +[gob package][]'s overview. That package uses another convention for packages that need large amounts of +introductory documentation: the package comment is placed in its own file, +[doc.go][], which contains only those comments and a package clause. + + +When writing package comments of any size, keep in mind that their first sentence will appear in godoc's +[package list][]. + + +Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. +Top-level comments that begin with the word +`"BUG(who)”` are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” +part should be the user name of someone who could provide more information. For example, this is a known issue +from the +[bytes package][]: + + +``` +// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly. +``` + +Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for +compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its +doc comment that begins with "Deprecated:" followed by some information about the deprecation. There +are a few examples +[in the standard library][]. + + +There are a few formatting rules that Godoc uses when converting comments to HTML: + + +- Subsequent lines of text are considered part of the same paragraph; you must leave a blank line to separate paragraphs. + +- Pre-formatted text must be indented relative to the surrounding comment text (see gob's + [doc.go][] for an example). + +- URLs will be converted to HTML links; no special markup is necessary. + +Note that none of these rules requires you to do anything out of the ordinary. + + +In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including +all of the standard library, already follows the conventions. + + +Your own code can present good documentation just by having comments as described above. Any Go packages installed inside +`$GOROOT/src/pkg` and any +`GOPATH` work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify +additional paths for indexing via the +`-path` flag or just by running +`"godoc ."` in the source directory. See the +[godoc documentation][] for more details. + + +By Andrew Gerrand + +## Related articles + +- [HTTP/2 Server Push][] +- [Introducing HTTP Tracing][] +- [Testable Examples in Go][] +- [Generating code][] +- [Introducing the Go Race Detector][] +- [Go maps in action][] +- [go fmt your code][] +- [Organizing Go code][] +- [Debugging Go programs with the GNU Debugger][] +- [The Go image/draw package][] +- [The Go image package][] +- [The Laws of Reflection][] +- [Error handling and Go][] +- ["First Class Functions in Go"][] +- [Profiling Go Programs][] +- [A GIF decoder: an exercise in Go interfaces][] +- [Introducing Gofix][] +- [Gobs of data][] +- [C? Go? Cgo!][] +- [JSON and Go][] +- [Go Slices: usage and internals][] +- [Go Concurrency Patterns: Timing out, moving on][] +- [Defer, Panic, and Recover][] +- [Share Memory By Communicating][] +- [JSON-RPC: a tale of interfaces][] + +Except as +[noted][], the content of this page is licensed under the Creative Commons Attribution 3.0 License, + + +and code is licensed under a +[BSD license][]. + + +[Terms of Service][] \| +[Privacy Policy][] \| +[View the source code][] + +[The Go Programming Language]: //golang.org/ +[Go]: //golang.org/ +[Documents]: //golang.org/doc/ +[Packages]: //golang.org/pkg/ +[The Project]: //golang.org/project/ +[Help]: //golang.org/help/ +[Blog]: / +[Introducing Gofix]: /introducing-gofix +[Gobs of data]: /gobs-of-data +[golang.org]: //golang.org/ +[Install Go]: //golang.org/doc/install.html +[A Tour of Go]: //tour.golang.org/ +[Go Documentation]: //golang.org/doc/ +[Go Mailing List]: //groups.google.com/group/golang-nuts +[Go on Google+]: //plus.google.com/101406623878176903605 +[Go+ Community]: //plus.google.com/communities/114112804251407510571 +[Go on Twitter]: //twitter.com/golang +[Blog index]: /index +[The Go Blog]: / +[Godoc: documenting Go code]: /godoc-documenting-go-code +[godoc]: https://golang.org/cmd/godoc/ +[documentation]: https://golang.org/pkg/strings/#HasPrefix +[implementation]: https://golang.org/src/pkg/strings/strings.go#L493 +[Docstring]: http://www.python.org/dev/peps/pep-0257/ +[Javadoc]: http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html +[`Fprint`]: https://golang.org/pkg/fmt/#Fprint +[`sort`]: https://golang.org/pkg/sort/ +[gob package]: https://golang.org/pkg/encoding/gob/ +[doc.go]: https://golang.org/src/pkg/encoding/gob/doc.go +[package list]: https://golang.org/pkg/ +[bytes package]: https://golang.org/pkg/bytes/#pkg-note-BUG +[in the standard library]: https://golang.org/search?q=Deprecated: +[doc.go]: https://golang.org/src/pkg/encoding/gob/doc.go +[godoc documentation]: https://golang.org/cmd/godoc/ +[HTTP/2 Server Push]: /h2push +[Introducing HTTP Tracing]: /http-tracing +[Testable Examples in Go]: /examples +[Generating code]: /generate +[Introducing the Go Race Detector]: /race-detector +[Go maps in action]: /go-maps-in-action +[go fmt your code]: /go-fmt-your-code +[Organizing Go code]: /organizing-go-code +[Debugging Go programs with the GNU Debugger]: /debugging-go-programs-with-gnu-debugger +[The Go image/draw package]: /go-imagedraw-package +[The Go image package]: /go-image-package +[The Laws of Reflection]: /laws-of-reflection +[Error handling and Go]: /error-handling-and-go +["First Class Functions in Go"]: /first-class-functions-in-go-and-new-go +[Profiling Go Programs]: /profiling-go-programs +[A GIF decoder: an exercise in Go interfaces]: /gif-decoder-exercise-in-go-interfaces +[Introducing Gofix]: /introducing-gofix +[Gobs of data]: /gobs-of-data +[C? Go? Cgo!]: /c-go-cgo +[JSON and Go]: /json-and-go +[Go Slices: usage and internals]: /go-slices-usage-and-internals +[Go Concurrency Patterns: Timing out, moving on]: /go-concurrency-patterns-timing-out-and +[Defer, Panic, and Recover]: /defer-panic-and-recover +[Share Memory By Communicating]: /share-memory-by-communicating +[JSON-RPC: a tale of interfaces]: /json-rpc-tale-of-interfaces +[noted]: https://developers.google.com/site-policies#restrictions +[BSD license]: //golang.org/LICENSE +[Terms of Service]: //golang.org/doc/tos.html +[Privacy Policy]: //www.google.com/intl/en/policies/privacy/ +[View the source code]: https://go.googlesource.com/blog/ \ No newline at end of file diff --git a/testdata/TestRealWorld/blog.golang.org/output.referenced_full.golden b/testdata/TestRealWorld/blog.golang.org/output.referenced_full.golden new file mode 100644 index 0000000..98c99a2 --- /dev/null +++ b/testdata/TestRealWorld/blog.golang.org/output.referenced_full.golden @@ -0,0 +1,252 @@ +Godoc: documenting Go code - The Go Blog + +[The Go Programming Language][1] + +[Go][2] + +▽ + +[Documents][4] [Packages][5] [The Project][6] [Help][7] [Blog][8]submit search + +#### Next article + +[Introducing Gofix][9] + +#### Previous article + +[Gobs of data][10] + +#### Links + +- [golang.org][11] +- [Install Go][12] +- [A Tour of Go][13] +- [Go Documentation][14] +- [Go Mailing List][15] +- [Go on Google+][16] +- [Go+ Community][17] +- [Go on Twitter][18] + +[Blog index][19] + +# [The Go Blog][20] + +### [Godoc: documenting Go code][21] + +31 March 2011 + +The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. +Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it +should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers +to produce good documentation, the better for everyone. + + +To that end, we have developed the +[godoc][22] documentation tool. This article describes godoc's approach to documentation, and explains how +you can use our conventions and tools to write good documentation for your own projects. + + +Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation +tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from +a function's +[documentation][23] to its +[implementation][24] with one click. + + +Godoc is conceptually related to Python's +[Docstring][25] and Java's +[Javadoc][26], but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) +nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, +the sort you would want to read even if godoc didn't exist. + + +The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly +preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside +the item it documents. For example, this is the documentation for the +`fmt` package's +[`Fprint`][27] function: + + +``` +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention +allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes +it read better when tools truncate it for brevity, such as when they extract the first line or sentence. + + +Comments on package declarations should provide general package documentation. These comments can be short, like the +[`sort`][28] package's brief description: + + +``` +// Package sort provides primitives for sorting slices and user-defined +// collections. +package sort +``` + +They can also be detailed like the +[gob package][29]'s overview. That package uses another convention for packages that need large amounts of +introductory documentation: the package comment is placed in its own file, +[doc.go][30], which contains only those comments and a package clause. + + +When writing package comments of any size, keep in mind that their first sentence will appear in godoc's +[package list][31]. + + +Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. +Top-level comments that begin with the word +`"BUG(who)”` are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” +part should be the user name of someone who could provide more information. For example, this is a known issue +from the +[bytes package][32]: + + +``` +// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly. +``` + +Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for +compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its +doc comment that begins with "Deprecated:" followed by some information about the deprecation. There +are a few examples +[in the standard library][33]. + + +There are a few formatting rules that Godoc uses when converting comments to HTML: + + +- Subsequent lines of text are considered part of the same paragraph; you must leave a blank line to separate paragraphs. + +- Pre-formatted text must be indented relative to the surrounding comment text (see gob's + [doc.go][34] for an example). + +- URLs will be converted to HTML links; no special markup is necessary. + +Note that none of these rules requires you to do anything out of the ordinary. + + +In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including +all of the standard library, already follows the conventions. + + +Your own code can present good documentation just by having comments as described above. Any Go packages installed inside +`$GOROOT/src/pkg` and any +`GOPATH` work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify +additional paths for indexing via the +`-path` flag or just by running +`"godoc ."` in the source directory. See the +[godoc documentation][35] for more details. + + +By Andrew Gerrand + +## Related articles + +- [HTTP/2 Server Push][36] +- [Introducing HTTP Tracing][37] +- [Testable Examples in Go][38] +- [Generating code][39] +- [Introducing the Go Race Detector][40] +- [Go maps in action][41] +- [go fmt your code][42] +- [Organizing Go code][43] +- [Debugging Go programs with the GNU Debugger][44] +- [The Go image/draw package][45] +- [The Go image package][46] +- [The Laws of Reflection][47] +- [Error handling and Go][48] +- ["First Class Functions in Go"][49] +- [Profiling Go Programs][50] +- [A GIF decoder: an exercise in Go interfaces][51] +- [Introducing Gofix][52] +- [Gobs of data][53] +- [C? Go? Cgo!][54] +- [JSON and Go][55] +- [Go Slices: usage and internals][56] +- [Go Concurrency Patterns: Timing out, moving on][57] +- [Defer, Panic, and Recover][58] +- [Share Memory By Communicating][59] +- [JSON-RPC: a tale of interfaces][60] + +Except as +[noted][61], the content of this page is licensed under the Creative Commons Attribution 3.0 License, + + +and code is licensed under a +[BSD license][62]. + + +[Terms of Service][63] \| +[Privacy Policy][64] \| +[View the source code][65] + +[1]: //golang.org/ +[2]: //golang.org/ +[4]: //golang.org/doc/ +[5]: //golang.org/pkg/ +[6]: //golang.org/project/ +[7]: //golang.org/help/ +[8]: / +[9]: /introducing-gofix +[10]: /gobs-of-data +[11]: //golang.org/ +[12]: //golang.org/doc/install.html +[13]: //tour.golang.org/ +[14]: //golang.org/doc/ +[15]: //groups.google.com/group/golang-nuts +[16]: //plus.google.com/101406623878176903605 +[17]: //plus.google.com/communities/114112804251407510571 +[18]: //twitter.com/golang +[19]: /index +[20]: / +[21]: /godoc-documenting-go-code +[22]: https://golang.org/cmd/godoc/ +[23]: https://golang.org/pkg/strings/#HasPrefix +[24]: https://golang.org/src/pkg/strings/strings.go#L493 +[25]: http://www.python.org/dev/peps/pep-0257/ +[26]: http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html +[27]: https://golang.org/pkg/fmt/#Fprint +[28]: https://golang.org/pkg/sort/ +[29]: https://golang.org/pkg/encoding/gob/ +[30]: https://golang.org/src/pkg/encoding/gob/doc.go +[31]: https://golang.org/pkg/ +[32]: https://golang.org/pkg/bytes/#pkg-note-BUG +[33]: https://golang.org/search?q=Deprecated: +[34]: https://golang.org/src/pkg/encoding/gob/doc.go +[35]: https://golang.org/cmd/godoc/ +[36]: /h2push +[37]: /http-tracing +[38]: /examples +[39]: /generate +[40]: /race-detector +[41]: /go-maps-in-action +[42]: /go-fmt-your-code +[43]: /organizing-go-code +[44]: /debugging-go-programs-with-gnu-debugger +[45]: /go-imagedraw-package +[46]: /go-image-package +[47]: /laws-of-reflection +[48]: /error-handling-and-go +[49]: /first-class-functions-in-go-and-new-go +[50]: /profiling-go-programs +[51]: /gif-decoder-exercise-in-go-interfaces +[52]: /introducing-gofix +[53]: /gobs-of-data +[54]: /c-go-cgo +[55]: /json-and-go +[56]: /go-slices-usage-and-internals +[57]: /go-concurrency-patterns-timing-out-and +[58]: /defer-panic-and-recover +[59]: /share-memory-by-communicating +[60]: /json-rpc-tale-of-interfaces +[61]: https://developers.google.com/site-policies#restrictions +[62]: //golang.org/LICENSE +[63]: //golang.org/doc/tos.html +[64]: //www.google.com/intl/en/policies/privacy/ +[65]: https://go.googlesource.com/blog/ \ No newline at end of file diff --git a/testdata/TestRealWorld/blog.golang.org/output.referenced_shortcut.golden b/testdata/TestRealWorld/blog.golang.org/output.referenced_shortcut.golden new file mode 100644 index 0000000..7757ffd --- /dev/null +++ b/testdata/TestRealWorld/blog.golang.org/output.referenced_shortcut.golden @@ -0,0 +1,252 @@ +Godoc: documenting Go code - The Go Blog + +[The Go Programming Language] + +[Go] + +▽ + +[Documents] [Packages] [The Project] [Help] [Blog]submit search + +#### Next article + +[Introducing Gofix] + +#### Previous article + +[Gobs of data] + +#### Links + +- [golang.org] +- [Install Go] +- [A Tour of Go] +- [Go Documentation] +- [Go Mailing List] +- [Go on Google+] +- [Go+ Community] +- [Go on Twitter] + +[Blog index] + +# [The Go Blog] + +### [Godoc: documenting Go code] + +31 March 2011 + +The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. +Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it +should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers +to produce good documentation, the better for everyone. + + +To that end, we have developed the +[godoc] documentation tool. This article describes godoc's approach to documentation, and explains how +you can use our conventions and tools to write good documentation for your own projects. + + +Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation +tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from +a function's +[documentation] to its +[implementation] with one click. + + +Godoc is conceptually related to Python's +[Docstring] and Java's +[Javadoc], but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) +nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, +the sort you would want to read even if godoc didn't exist. + + +The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly +preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside +the item it documents. For example, this is the documentation for the +`fmt` package's +[`Fprint`] function: + + +``` +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +func Fprint(w io.Writer, a ...interface{}) (n int, err error) { +``` + +Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention +allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes +it read better when tools truncate it for brevity, such as when they extract the first line or sentence. + + +Comments on package declarations should provide general package documentation. These comments can be short, like the +[`sort`] package's brief description: + + +``` +// Package sort provides primitives for sorting slices and user-defined +// collections. +package sort +``` + +They can also be detailed like the +[gob package]'s overview. That package uses another convention for packages that need large amounts of +introductory documentation: the package comment is placed in its own file, +[doc.go], which contains only those comments and a package clause. + + +When writing package comments of any size, keep in mind that their first sentence will appear in godoc's +[package list]. + + +Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. +Top-level comments that begin with the word +`"BUG(who)”` are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” +part should be the user name of someone who could provide more information. For example, this is a known issue +from the +[bytes package]: + + +``` +// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly. +``` + +Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for +compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its +doc comment that begins with "Deprecated:" followed by some information about the deprecation. There +are a few examples +[in the standard library]. + + +There are a few formatting rules that Godoc uses when converting comments to HTML: + + +- Subsequent lines of text are considered part of the same paragraph; you must leave a blank line to separate paragraphs. + +- Pre-formatted text must be indented relative to the surrounding comment text (see gob's + [doc.go] for an example). + +- URLs will be converted to HTML links; no special markup is necessary. + +Note that none of these rules requires you to do anything out of the ordinary. + + +In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including +all of the standard library, already follows the conventions. + + +Your own code can present good documentation just by having comments as described above. Any Go packages installed inside +`$GOROOT/src/pkg` and any +`GOPATH` work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify +additional paths for indexing via the +`-path` flag or just by running +`"godoc ."` in the source directory. See the +[godoc documentation] for more details. + + +By Andrew Gerrand + +## Related articles + +- [HTTP/2 Server Push] +- [Introducing HTTP Tracing] +- [Testable Examples in Go] +- [Generating code] +- [Introducing the Go Race Detector] +- [Go maps in action] +- [go fmt your code] +- [Organizing Go code] +- [Debugging Go programs with the GNU Debugger] +- [The Go image/draw package] +- [The Go image package] +- [The Laws of Reflection] +- [Error handling and Go] +- ["First Class Functions in Go"] +- [Profiling Go Programs] +- [A GIF decoder: an exercise in Go interfaces] +- [Introducing Gofix] +- [Gobs of data] +- [C? Go? Cgo!] +- [JSON and Go] +- [Go Slices: usage and internals] +- [Go Concurrency Patterns: Timing out, moving on] +- [Defer, Panic, and Recover] +- [Share Memory By Communicating] +- [JSON-RPC: a tale of interfaces] + +Except as +[noted], the content of this page is licensed under the Creative Commons Attribution 3.0 License, + + +and code is licensed under a +[BSD license]. + + +[Terms of Service] \| +[Privacy Policy] \| +[View the source code] + +[The Go Programming Language]: //golang.org/ +[Go]: //golang.org/ +[Documents]: //golang.org/doc/ +[Packages]: //golang.org/pkg/ +[The Project]: //golang.org/project/ +[Help]: //golang.org/help/ +[Blog]: / +[Introducing Gofix]: /introducing-gofix +[Gobs of data]: /gobs-of-data +[golang.org]: //golang.org/ +[Install Go]: //golang.org/doc/install.html +[A Tour of Go]: //tour.golang.org/ +[Go Documentation]: //golang.org/doc/ +[Go Mailing List]: //groups.google.com/group/golang-nuts +[Go on Google+]: //plus.google.com/101406623878176903605 +[Go+ Community]: //plus.google.com/communities/114112804251407510571 +[Go on Twitter]: //twitter.com/golang +[Blog index]: /index +[The Go Blog]: / +[Godoc: documenting Go code]: /godoc-documenting-go-code +[godoc]: https://golang.org/cmd/godoc/ +[documentation]: https://golang.org/pkg/strings/#HasPrefix +[implementation]: https://golang.org/src/pkg/strings/strings.go#L493 +[Docstring]: http://www.python.org/dev/peps/pep-0257/ +[Javadoc]: http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html +[`Fprint`]: https://golang.org/pkg/fmt/#Fprint +[`sort`]: https://golang.org/pkg/sort/ +[gob package]: https://golang.org/pkg/encoding/gob/ +[doc.go]: https://golang.org/src/pkg/encoding/gob/doc.go +[package list]: https://golang.org/pkg/ +[bytes package]: https://golang.org/pkg/bytes/#pkg-note-BUG +[in the standard library]: https://golang.org/search?q=Deprecated: +[doc.go]: https://golang.org/src/pkg/encoding/gob/doc.go +[godoc documentation]: https://golang.org/cmd/godoc/ +[HTTP/2 Server Push]: /h2push +[Introducing HTTP Tracing]: /http-tracing +[Testable Examples in Go]: /examples +[Generating code]: /generate +[Introducing the Go Race Detector]: /race-detector +[Go maps in action]: /go-maps-in-action +[go fmt your code]: /go-fmt-your-code +[Organizing Go code]: /organizing-go-code +[Debugging Go programs with the GNU Debugger]: /debugging-go-programs-with-gnu-debugger +[The Go image/draw package]: /go-imagedraw-package +[The Go image package]: /go-image-package +[The Laws of Reflection]: /laws-of-reflection +[Error handling and Go]: /error-handling-and-go +["First Class Functions in Go"]: /first-class-functions-in-go-and-new-go +[Profiling Go Programs]: /profiling-go-programs +[A GIF decoder: an exercise in Go interfaces]: /gif-decoder-exercise-in-go-interfaces +[Introducing Gofix]: /introducing-gofix +[Gobs of data]: /gobs-of-data +[C? Go? Cgo!]: /c-go-cgo +[JSON and Go]: /json-and-go +[Go Slices: usage and internals]: /go-slices-usage-and-internals +[Go Concurrency Patterns: Timing out, moving on]: /go-concurrency-patterns-timing-out-and +[Defer, Panic, and Recover]: /defer-panic-and-recover +[Share Memory By Communicating]: /share-memory-by-communicating +[JSON-RPC: a tale of interfaces]: /json-rpc-tale-of-interfaces +[noted]: https://developers.google.com/site-policies#restrictions +[BSD license]: //golang.org/LICENSE +[Terms of Service]: //golang.org/doc/tos.html +[Privacy Policy]: //www.google.com/intl/en/policies/privacy/ +[View the source code]: https://go.googlesource.com/blog/ \ No newline at end of file diff --git a/testdata/TestRealWorld/bonnerruderverein.de/goldmark.golden b/testdata/TestRealWorld/bonnerruderverein.de/goldmark.golden new file mode 100644 index 0000000..1bf3da2 --- /dev/null +++ b/testdata/TestRealWorld/bonnerruderverein.de/goldmark.golden @@ -0,0 +1,136 @@ +

Bonner Ruder-Verein 1882 e.V.

+

Logo

+

Bonner Ruder-Verein 1882 e.V.

+

Menu

+ +
+ +

Rudern in unserem Verein bedeutet…

+

ein unvergleichlich abwechslungsreiches Ruderrevier, ein Bootshaus in einer traumhaften Lage, eine liebevoll geführte Vereinsgastronomie, ein Top-Bootspark und – das Wichtigste – eine bunte Mischung aus interessanten, interessierten und engagierten Mitgliedern.

+

Im Mittelpunkt der Aktivitäten steht der Breitensport mit nahezu täglichen Ruderangeboten sowie regelmäßigen Wanderfahrten auf den unterschiedlichsten Flüssen Deutschlands und Europas. Rudern im BRV heißt, Ausgleichssport mit netten Leuten, ein, zwei Stunden Bewegung an der frischen Luft, und zum Abschluss ein Getränk in netter Runde. Wir trainieren nicht für Kurzstrecken-Rennen oder Meisterschaften. Wer jedoch Wanderfahrten liebt, also mehrtägige Ruder-Reisen mit Tages-Etappen von 30 bis 40 Kilometern, ist beim BRV gut aufgehoben.

+

Aktuelles

+

BRV-abend

+

25 Mai

+

+

9. Bonner Nachtlauf - Einschränkungen am Bootshaus

+

am Mittwoch, dem 30. Mai 2018 findet am Bonner Rheinufer der 9. ... +More

+

Kommende Veranstaltungen…

+
    +
  1. +

    Fronleichnamsfahrt

    +

    26. Mai - 3. Juni

    +
  2. +
  3. +

    “Anfängerfahrt” auf der Lahn

    +

    8. Juni - 10. Juni

    +
  4. +
  5. +

    Oste-Marathon

    +

    15. Juni - 17. Juni

    +
  6. +
  7. +

    Vorstandssitzung Juni

    +

    15. Juni @ 19:00 - 22:00

    +
  8. +
+

Alle Veranstaltungen anzeigen

+
+

“Wir kommen rückwärts vorwärts, wie die Ruderer.” +- Michel de Montaigne (1533-1592), französischer Philosoph und Essayist

+
+
Eindrücke
+

Rudern auf der Vilaine in Frankreich

+

+

Abends am Strand in Oberkassel

+

+

Neckarschleuse in Heilbronn

+

+

Auf dem Main

+

+

Hochwasser

+

+

Rudern in Friesland

+

+

Gepackt für die Wanderfahrt

+

+

Karo Dame in Leeuwarden

+

+

Rudern auf dem Comer See

+

+

Abends auf dem Rhein

+

+

Anfahrt

+

Klicken, um eine größere Karte zu öffnen

+

Kontakt

+

Bonner Ruder-Verein 1882 e.V.

+

Wilhelm-Spiritusufer 2

+

53113 Bonn

+

Tel. 0176 322 888 97

+

Email: info@bonnerruderverein.de

+

Bankverbindung:

+

IBAN DE15370501980031027535

+

BIC COLSDE33

+

Sparkasse Köln/Bonn

+

Informationen

+

Rhein Pegel Bonn vom WSA Köln

+

alle Rhein Pegel auf ELWIS

+

Für uns ist die Hochwassermarke II am Pegel Oberwinter maßgeblich

+

Siegpegel Eitorf

+

Impressum & Datenschutzerklärung

+

Sitemap

diff --git a/testdata/TestWholeSite/bonnerruderverein.de.html b/testdata/TestRealWorld/bonnerruderverein.de/input.html similarity index 100% rename from testdata/TestWholeSite/bonnerruderverein.de.html rename to testdata/TestRealWorld/bonnerruderverein.de/input.html diff --git a/testdata/TestWholeSite/bonnerruderverein.de.md b/testdata/TestRealWorld/bonnerruderverein.de/output.default.golden similarity index 100% rename from testdata/TestWholeSite/bonnerruderverein.de.md rename to testdata/TestRealWorld/bonnerruderverein.de/output.default.golden diff --git a/testdata/TestRealWorld/golang.org/goldmark.golden b/testdata/TestRealWorld/golang.org/goldmark.golden new file mode 100644 index 0000000..ba2b3a6 --- /dev/null +++ b/testdata/TestRealWorld/golang.org/goldmark.golden @@ -0,0 +1,31 @@ +

The Go Programming Language

+

...

+

The Go Programming Language

+

Go

+

+

Documents Packages The Project Help Blog Play submit search

+

RunFormatShare

+

Pop-out

+

Try Go

+
Hello, 世界
+
+
+

RunShare Tour

+

Hello, World!Conway's Game of LifeFibonacci ClosurePeano IntegersConcurrent piConcurrent Prime SievePeg Solitaire SolverTree Comparison

+

Go is an open source programming language that makes it easy to build +simple, reliable, and efficient software.

+

Download Go
+Binary distributions available for
+
+
+Linux, Mac OS X, Windows, and more.

+

Featured video

+

Featured articles

+

Read more

+

Build version go1.10.2.

+

Except as noted, +the content of this page is licensed under the +Creative Commons Attribution 3.0 License, +and code is licensed under a BSD license.

+

Terms of Service | +Privacy Policy

diff --git a/testdata/TestWholeSite/golang.org.html b/testdata/TestRealWorld/golang.org/input.html similarity index 100% rename from testdata/TestWholeSite/golang.org.html rename to testdata/TestRealWorld/golang.org/input.html diff --git a/testdata/TestWholeSite/golang.org.md b/testdata/TestRealWorld/golang.org/output.default.golden similarity index 100% rename from testdata/TestWholeSite/golang.org.md rename to testdata/TestRealWorld/golang.org/output.default.golden diff --git a/testdata/TestRealWorld/snippets/code_design_heading_in_link/goldmark.golden b/testdata/TestRealWorld/snippets/code_design_heading_in_link/goldmark.golden new file mode 100644 index 0000000..55015ad --- /dev/null +++ b/testdata/TestRealWorld/snippets/code_design_heading_in_link/goldmark.golden @@ -0,0 +1,19 @@ +

#zuhause_jul20
+Remote
+
+
+Datum
+
+
+31.07. - 02.08.20
+
+
+
+Uhrzeit
+
+
+Fr 15 Uhr - So 19 Uhr
+
+
+
+Details anzeigen →

diff --git a/testdata/TestRealWorld/snippets/code_design_heading_in_link/input.html b/testdata/TestRealWorld/snippets/code_design_heading_in_link/input.html new file mode 100644 index 0000000..9a9b52f --- /dev/null +++ b/testdata/TestRealWorld/snippets/code_design_heading_in_link/input.html @@ -0,0 +1,60 @@ + +
+ +
+
+

#zuhause_jul20

+ + Remote + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+
+ Datum
+ 31.07. - 02.08.20 +
+
+
+
+ + + + +
+
+ Uhrzeit
+ Fr 15 Uhr - So 19 Uhr +
+
+
+
+
+ Details anzeigen → +
+
+
+
+ \ No newline at end of file diff --git a/testdata/TestFromString/heading_in_link.golden b/testdata/TestRealWorld/snippets/code_design_heading_in_link/output.default.golden similarity index 100% rename from testdata/TestFromString/heading_in_link.golden rename to testdata/TestRealWorld/snippets/code_design_heading_in_link/output.default.golden diff --git a/testdata/TestRealWorld/snippets/nav_nested_list/goldmark.golden b/testdata/TestRealWorld/snippets/nav_nested_list/goldmark.golden new file mode 100644 index 0000000..aa11104 --- /dev/null +++ b/testdata/TestRealWorld/snippets/nav_nested_list/goldmark.golden @@ -0,0 +1,27 @@ + diff --git a/testdata/TestRealWorld/snippets/nav_nested_list/input.html b/testdata/TestRealWorld/snippets/nav_nested_list/input.html new file mode 100644 index 0000000..f8b7d86 --- /dev/null +++ b/testdata/TestRealWorld/snippets/nav_nested_list/input.html @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git a/testdata/TestFromString/nested_list_real_world.golden b/testdata/TestRealWorld/snippets/nav_nested_list/output.default.golden similarity index 100% rename from testdata/TestFromString/nested_list_real_world.golden rename to testdata/TestRealWorld/snippets/nav_nested_list/output.default.golden diff --git a/testdata/TestRealWorld/snippets/price_em_in_a_p/goldmark.golden b/testdata/TestRealWorld/snippets/price_em_in_a_p/goldmark.golden new file mode 100644 index 0000000..ba8565d --- /dev/null +++ b/testdata/TestRealWorld/snippets/price_em_in_a_p/goldmark.golden @@ -0,0 +1 @@ +

首付 19,8万 月供

diff --git a/testdata/TestRealWorld/snippets/price_em_in_a_p/input.html b/testdata/TestRealWorld/snippets/price_em_in_a_p/input.html new file mode 100644 index 0000000..fc5135f --- /dev/null +++ b/testdata/TestRealWorld/snippets/price_em_in_a_p/input.html @@ -0,0 +1 @@ +

首付19,8 月供

\ No newline at end of file diff --git a/testdata/TestFromString/em_in_a_p.golden b/testdata/TestRealWorld/snippets/price_em_in_a_p/output.default.golden similarity index 100% rename from testdata/TestFromString/em_in_a_p.golden rename to testdata/TestRealWorld/snippets/price_em_in_a_p/output.default.golden diff --git a/testdata/TestRealWorld/snippets/text_with_whitespace/goldmark.golden b/testdata/TestRealWorld/snippets/text_with_whitespace/goldmark.golden new file mode 100644 index 0000000..6d643c3 --- /dev/null +++ b/testdata/TestRealWorld/snippets/text_with_whitespace/goldmark.golden @@ -0,0 +1,12 @@ +

Aktuelles

+

BRV-abend

+

25 Mai

+

+

9. Bonner Nachtlauf - Einschränkungen am Bootshaus

+

am Mittwoch, dem 30. Mai 2018 findet am Bonner Rheinufer der 9. ... +More

+
+

Aktuelles

+

Title

+

Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vestibulum id ligula porta felis euismod semper. +More

diff --git a/testdata/TestRealWorld/snippets/text_with_whitespace/input.html b/testdata/TestRealWorld/snippets/text_with_whitespace/input.html new file mode 100644 index 0000000..1d563b6 --- /dev/null +++ b/testdata/TestRealWorld/snippets/text_with_whitespace/input.html @@ -0,0 +1,28 @@ + +
+

Aktuelles

+ + +
25 Mai
+ +

9. Bonner Nachtlauf - Einschränkungen am Bootshaus

+ + + am Mittwoch, dem 30. Mai 2018 findet am Bonner Rheinufer der 9. ... + More + + + +
+ +
+ +
+

Aktuelles

+

Title

+ + + Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Vestibulum id ligula porta felis euismod semper. + More + +
diff --git a/testdata/TestFromString/text_with_whitespace.golden b/testdata/TestRealWorld/snippets/text_with_whitespace/output.default.golden similarity index 100% rename from testdata/TestFromString/text_with_whitespace.golden rename to testdata/TestRealWorld/snippets/text_with_whitespace/output.default.golden diff --git a/testdata/TestRealWorld/snippets/turndown_demo/goldmark.golden b/testdata/TestRealWorld/snippets/turndown_demo/goldmark.golden new file mode 100644 index 0000000..6d609db --- /dev/null +++ b/testdata/TestRealWorld/snippets/turndown_demo/goldmark.golden @@ -0,0 +1,22 @@ +

Turndown Demo

+

This demonstrates turndown – an HTML to Markdown converter in JavaScript.

+

Usage

+
var turndownService = new TurndownService()
+console.log(
+  turndownService.turndown('<h1>Hello world</h1>')
+)
+
+
+

It aims to be CommonMark +compliant, and includes options to style the output. These options include:

+ diff --git a/testdata/TestRealWorld/snippets/turndown_demo/input.html b/testdata/TestRealWorld/snippets/turndown_demo/input.html new file mode 100644 index 0000000..309cf24 --- /dev/null +++ b/testdata/TestRealWorld/snippets/turndown_demo/input.html @@ -0,0 +1,29 @@ + +

Turndown Demo

+ +

This demonstrates turndown – an HTML to Markdown converter in JavaScript.

+ +

Usage

+ +
var turndownService = new TurndownService()
+console.log(
+  turndownService.turndown('<h1>Hello world</h1>')
+)
+ +
+ +

It aims to be CommonMark + compliant, and includes options to style the output. These options include:

+ + + \ No newline at end of file diff --git a/testdata/TestFromString/turndown_demo.golden b/testdata/TestRealWorld/snippets/turndown_demo/output.default.golden similarity index 100% rename from testdata/TestFromString/turndown_demo.golden rename to testdata/TestRealWorld/snippets/turndown_demo/output.default.golden diff --git a/testdata/TestRealWorld/snippets/tweet/goldmark.golden b/testdata/TestRealWorld/snippets/tweet/goldmark.golden new file mode 100644 index 0000000..b219de4 --- /dev/null +++ b/testdata/TestRealWorld/snippets/tweet/goldmark.golden @@ -0,0 +1,11 @@ +

Kroger @kroger
+
+
+As a company, it’s our responsibility to better support our Black associates, customers and allies. We know there is more work to do and will keep you updated on our progress, this is only the beginning. Black Lives Matter.
+
+
+
+June 12th 2020
+
+
+17 Retweets93 Likes

diff --git a/testdata/TestRealWorld/snippets/tweet/input.html b/testdata/TestRealWorld/snippets/tweet/input.html new file mode 100644 index 0000000..5fc1da6 --- /dev/null +++ b/testdata/TestRealWorld/snippets/tweet/input.html @@ -0,0 +1,6 @@ + +
+
Kroger @kroger
+

As a company, it’s our responsibility to better support our Black associates, customers and allies. We know there is more work to do and will keep you updated on our progress, this is only the beginning. Black Lives Matter.

+
+ \ No newline at end of file diff --git a/testdata/TestFromString/tweet.golden b/testdata/TestRealWorld/snippets/tweet/output.default.golden similarity index 100% rename from testdata/TestFromString/tweet.golden rename to testdata/TestRealWorld/snippets/tweet/output.default.golden
Firstname