From 42dde328a119e3d285c1cbac506fb5a2cbffbf21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Tue, 1 Jan 2019 18:10:38 +0100 Subject: [PATCH] Fix #127, disable footnote extension. Interestingly, the footnote extension seems to break markdown printing of footnotes. --- .../scala/mdoc/internal/markdown/Markdown.scala | 1 - ...docExtensions.scala => MdocExtensions.scala} | 1 - ...nsion.scala => MdocFormatterExtension.scala} | 0 ...xtension.scala => MdocParserExtension.scala} | 0 .../scala/tests/markdown/FootnoteSuite.scala | 17 +++++++++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-) rename mdoc/src/main/scala/mdoc/internal/markdown/{mdocExtensions.scala => MdocExtensions.scala} (98%) rename mdoc/src/main/scala/mdoc/internal/markdown/{mdocFormatterExtension.scala => MdocFormatterExtension.scala} (100%) rename mdoc/src/main/scala/mdoc/internal/markdown/{mdocParserExtension.scala => MdocParserExtension.scala} (100%) create mode 100644 tests/unit/src/test/scala/tests/markdown/FootnoteSuite.scala diff --git a/mdoc/src/main/scala/mdoc/internal/markdown/Markdown.scala b/mdoc/src/main/scala/mdoc/internal/markdown/Markdown.scala index c04ca6424..cc26b74c9 100644 --- a/mdoc/src/main/scala/mdoc/internal/markdown/Markdown.scala +++ b/mdoc/src/main/scala/mdoc/internal/markdown/Markdown.scala @@ -6,7 +6,6 @@ import com.vladsch.flexmark.ast.NodeVisitor import com.vladsch.flexmark.ast.VisitHandler import com.vladsch.flexmark.formatter.internal.Formatter import com.vladsch.flexmark.html.HtmlRenderer -import com.vladsch.flexmark.html.HtmlRenderer.HtmlRendererExtension import com.vladsch.flexmark.parser.Parser import com.vladsch.flexmark.util.options.DataKey import com.vladsch.flexmark.util.options.MutableDataSet diff --git a/mdoc/src/main/scala/mdoc/internal/markdown/mdocExtensions.scala b/mdoc/src/main/scala/mdoc/internal/markdown/MdocExtensions.scala similarity index 98% rename from mdoc/src/main/scala/mdoc/internal/markdown/mdocExtensions.scala rename to mdoc/src/main/scala/mdoc/internal/markdown/MdocExtensions.scala index 83910bd45..84d06c606 100644 --- a/mdoc/src/main/scala/mdoc/internal/markdown/mdocExtensions.scala +++ b/mdoc/src/main/scala/mdoc/internal/markdown/MdocExtensions.scala @@ -38,7 +38,6 @@ object MdocExtensions { AutolinkExtension.create(), TablesExtension.create(), EmojiExtension.create(), - FootnoteExtension.create(), StrikethroughExtension.create(), TocExtension.create(), InsExtension.create(), diff --git a/mdoc/src/main/scala/mdoc/internal/markdown/mdocFormatterExtension.scala b/mdoc/src/main/scala/mdoc/internal/markdown/MdocFormatterExtension.scala similarity index 100% rename from mdoc/src/main/scala/mdoc/internal/markdown/mdocFormatterExtension.scala rename to mdoc/src/main/scala/mdoc/internal/markdown/MdocFormatterExtension.scala diff --git a/mdoc/src/main/scala/mdoc/internal/markdown/mdocParserExtension.scala b/mdoc/src/main/scala/mdoc/internal/markdown/MdocParserExtension.scala similarity index 100% rename from mdoc/src/main/scala/mdoc/internal/markdown/mdocParserExtension.scala rename to mdoc/src/main/scala/mdoc/internal/markdown/MdocParserExtension.scala diff --git a/tests/unit/src/test/scala/tests/markdown/FootnoteSuite.scala b/tests/unit/src/test/scala/tests/markdown/FootnoteSuite.scala new file mode 100644 index 000000000..0be590b23 --- /dev/null +++ b/tests/unit/src/test/scala/tests/markdown/FootnoteSuite.scala @@ -0,0 +1,17 @@ +package tests.markdown + +class FootnoteSuite extends BaseMarkdownSuite { + check( + "basic", + """ + |Paragraph with a footnote reference[^1] + | + |[^1]: Footnote text added at the bottom of the document + | + """.stripMargin, + """|Paragraph with a footnote reference[^1] + | + |[^1]: Footnote text added at the bottom of the document + """.stripMargin + ) +}