diff --git a/markdown_test.go b/markdown_test.go index 625da6a..cabc866 100644 --- a/markdown_test.go +++ b/markdown_test.go @@ -12,7 +12,7 @@ import ( // for each pair of .text/.html files in the given subdirectory // of `./tests' compare the expected html output with // the output of Parser.Markdown. -func runDirTests(dir string, t *testing.T) { +func runDirTests(dir string, opt *Extensions, t *testing.T) { dirPath := filepath.Join("tests", dir) f, err := os.Open(dirPath) @@ -29,7 +29,7 @@ func runDirTests(dir string, t *testing.T) { var buf bytes.Buffer fHTML := ToHTML(&buf) fGroff := ToGroffMM(&buf) - p := NewParser(nil) + p := NewParser(opt) for _, name := range names { if filepath.Ext(name) != ".text" { continue @@ -75,7 +75,11 @@ func compareOutput(w *bytes.Buffer, f Formatter, ext string, textPath string, p } func TestMarkdown103(t *testing.T) { - runDirTests("md1.0.3", t) + runDirTests("md1.0.3", nil, t) +} + +func TestMarkdownIssues(t *testing.T) { + runDirTests("issues", &Extensions{Notes: true}, t) } // This test will make the test run fail with a diff --git a/tests/issues/footnotes-10.html b/tests/issues/footnotes-10.html new file mode 100644 index 0000000..fe5a9b6 --- /dev/null +++ b/tests/issues/footnotes-10.html @@ -0,0 +1,27 @@ +

Here is a footnote reference,[1] and another.[2]

+ +

This paragraph won't be part of the note, because it +isn't indented.

+ +
+
    + +
  1. +

    Here is the footnote.

    [back] +
  2. + +
  3. +

    Here's one with multiple blocks.

    + +

    Subsequent paragraphs are indented to show that they +belong to the previous footnote.

    + +
    { some.code }
    +
    + +

    The whole paragraph can be indented, or just the first +line. In this way, multi-paragraph footnotes work like +multi-paragraph list items.

    [back] +
  4. + +
diff --git a/tests/issues/footnotes-10.mm b/tests/issues/footnotes-10.mm new file mode 100644 index 0000000..c540589 --- /dev/null +++ b/tests/issues/footnotes-10.mm @@ -0,0 +1,25 @@ +.P +Here is a footnote reference,\*F +.FS +.P +Here is the footnote. +.FE + and another.\*F +.FS +.P +Here's one with multiple blocks. +.P +Subsequent paragraphs are indented to show that they +belong to the previous footnote. +.VERBON 2 +{ some.code } +.VERBOFF +.P +The whole paragraph can be indented, or just the first +line. In this way, multi-paragraph footnotes work like +multi-paragraph list items. +.FE + +.P +This paragraph won't be part of the note, because it +isn't indented. diff --git a/tests/issues/footnotes-10.text b/tests/issues/footnotes-10.text new file mode 100644 index 0000000..3992bf2 --- /dev/null +++ b/tests/issues/footnotes-10.text @@ -0,0 +1,17 @@ +Here is a footnote reference,[^1] and another.[^longnote] + +[^1]: Here is the footnote. + +[^longnote]: Here's one with multiple blocks. + + Subsequent paragraphs are indented to show that they +belong to the previous footnote. + + { some.code } + + The whole paragraph can be indented, or just the first + line. In this way, multi-paragraph footnotes work like + multi-paragraph list items. + +This paragraph won't be part of the note, because it +isn't indented.