foo→baz→→bim
- *
- */
- parsed.assertEquals(indentedCodeBlock("foo\tbaz\t\tbim"))
- }
-
- @Test
- fun `should parse spec sample 2 correctly (Tabs)`() {
- val parsed = processor.processMarkdownDocument(" \tfoo\tbaz\t\tbim")
-
- /*
- * Expected HTML:
- * foo→baz→\tbim
- *
- */
- parsed.assertEquals(indentedCodeBlock("foo\tbaz\t\tbim"))
- }
-
- @Test
- fun `should parse spec sample 3 correctly (Tabs)`() {
- val parsed = processor.processMarkdownDocument(" a\ta\n ὐ\ta")
-
- /*
- * Expected HTML:
- * a→a
- * ὐ→a
- *
- */
- parsed.assertEquals(indentedCodeBlock("a\ta\nὐ\ta"))
- }
-
- @Test
- fun `should parse spec sample 4 correctly (Tabs)`() {
- val parsed = processor.processMarkdownDocument(" - foo\n\n\tbar")
-
- /*
- * Expected HTML:
- * foo
- *bar
- *foo
- * bar
- *
- * - *- */ - parsed.assertEquals(blockQuote(indentedCodeBlock(" foo"))) - } - - @Test - fun `should parse spec sample 7 correctly (Tabs)`() { - val parsed = processor.processMarkdownDocument("-\t\tfoo") - - /* - * Expected HTML: - *- *foo - *
foo
- *
- * foo
- * bar
- *
- */
- parsed.assertEquals(indentedCodeBlock("foo\nbar"))
- }
-
- @Test
- fun `should parse spec sample 9 correctly (Tabs)`() {
- val parsed = processor.processMarkdownDocument(" - foo\n - bar\n\t - baz")
-
- /*
- * Expected HTML:
- * !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
- */ - parsed.assertEquals(paragraph("\\!\"#\$%&'\\(\\)\\*+,-./:;\\<=\\>?@\\[\\\\\\]^\\_\\`{|}\\~")) - } - - @Test - fun `should parse spec sample 13 correctly (Backslash escapes)`() { - val parsed = processor.processMarkdownDocument("\\\t\\A\\a\\ \\3\\φ\\«") - - /* - * Expected HTML: - *\→\A\a\ \3\φ\«
- */ - parsed.assertEquals(paragraph("\\\t\\A\\a\\ \\3\\φ\\«")) - } - - @Test - fun `should parse spec sample 14 correctly (Backslash escapes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |\*not emphasized* - |\*not emphasized* - * <br/> not a tag - * [not a link](/foo) - * `not code` - * 1. not a list - * * not a list - * # not a heading - * [foo]: /url "not a reference" - * ö not a character entity
- */ - parsed.assertEquals( - paragraph( - "\\*not emphasized\\* " + - "\\\emphasis
- */ - parsed.assertEquals(paragraph("\\*emphasis*")) - } - - @Test - fun `should parse spec sample 16 correctly (Backslash escapes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo\ - |bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- * bar
\[\`
\[\]
- *
- */
- parsed.assertEquals(indentedCodeBlock("\\[\\]"))
- }
-
- @Test
- fun `should parse spec sample 19 correctly (Backslash escapes)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |~~~
- |\[\]
- |~~~
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * \[\]
- *
- */
- parsed.assertEquals(fencedCodeBlock("\\[\\]"))
- }
-
- @Test
- fun `should parse spec sample 20 correctly (Backslash escapes)`() {
- val parsed = processor.processMarkdownDocument("foo
- *
- */
- parsed.assertEquals(fencedCodeBlock("foo", MimeType.Known.fromMarkdownLanguageName("foo\\+bar")))
- }
-
- @Test
- fun `should parse spec sample 25 correctly (Entity and numeric character references)`() {
- @Suppress("CheckDtdRefs") // Malformed on purpose
- val parsed =
- processor.processMarkdownDocument(
- """
- | & © Æ Ď
- |¾ ℋ ⅆ
- |∲ ≧̸
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * & © Æ Ď - * ¾ ℋ ⅆ - * ∲ ≧̸
- */ - parsed.assertEquals(paragraph(" & © Æ Ď ¾ ℋ ⅆ ∲ ≧̸")) - } - - @Test - fun `should parse spec sample 26 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("# Ӓ Ϡ ") - - /* - * Expected HTML: - *# Ӓ Ϡ �
- */ - parsed.assertEquals(paragraph("# Ӓ Ϡ �")) - } - - @Test - fun `should parse spec sample 27 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("" ആ ಫ") - - /* - * Expected HTML: - *" ആ ಫ
- */ - parsed.assertEquals(paragraph("\" ആ ಫ")) - } - - @Suppress("CheckDtdRefs") - @Test - fun `should parse spec sample 28 correctly (Entity and numeric character references)`() { - val parsed = - processor.processMarkdownDocument( - """ - |  &x; - | - |abcdef0; - |&ThisIsNotDefined; &hi?; - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *  &x; &#; &#x; - * � - * &#abcdef0; - * &ThisIsNotDefined; &hi?;
- */ - parsed.assertEquals( - paragraph("  &x; abcdef0; &ThisIsNotDefined; &hi?;"), - ) - } - - @Test - fun `should parse spec sample 29 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("©") - - /* - * Expected HTML: - *©
- */ - parsed.assertEquals(paragraph("©")) - } - - @Suppress("CheckDtdRefs") // Malformed on purpose - @Test - fun `should parse spec sample 30 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("&MadeUpEntity;") - - /* - * Expected HTML: - *&MadeUpEntity;
- */ - parsed.assertEquals(paragraph("&MadeUpEntity;")) - } - - @Test - fun `should parse spec sample 31 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(htmlBlock("")) - } - - @Test - fun `should parse spec sample 32 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("[foo](/föö \"föö\")") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/föö \"föö\")")) - } - - @Test - fun `should parse spec sample 33 correctly (Entity and numeric character references)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] - | - |[foo]: /föö "föö" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - - parsed.assertEquals(paragraph("[foo](/föö \"föö\")")) - } - - @Test - fun `should parse spec sample 34 correctly (Entity and numeric character references)`() { - val parsed = - processor.processMarkdownDocument( - """ - |``` föö - |foo - |``` - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *
- */
- parsed.assertEquals(fencedCodeBlock("foo", mimeType = MimeType.Known.fromMarkdownLanguageName("föö")))
- }
-
- @Test
- fun `should parse spec sample 35 correctly (Entity and numeric character references)`() {
- val parsed = processor.processMarkdownDocument("`föö`")
-
- /*
- * Expected HTML:
- * föö
föfö
- *
- */
- parsed.assertEquals(indentedCodeBlock("föfö"))
- }
-
- @Test
- fun `should parse spec sample 37 correctly (Entity and numeric character references)`() {
- val parsed = processor.processMarkdownDocument("*foo*\n*foo*")
-
- /*
- * Expected HTML:
- * *foo* - * foo
- */ - parsed.assertEquals(paragraph("\\*foo\\* *foo*")) - } - - @Test - fun `should parse spec sample 38 correctly (Entity and numeric character references)`() { - val parsed = - processor.processMarkdownDocument( - """ - |* foo - | - |* foo - """ - .trimMargin(), - ) - - /* - * Expected HTML: - ** foo
- *foo - * - * bar
- */ - parsed.assertEquals(paragraph("foo\n\nbar")) - } - - @Test - fun `should parse spec sample 40 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument(" foo") - - /* - * Expected HTML: - *\tfoo
- */ - parsed.assertEquals(paragraph("\tfoo")) - } - - @Test - fun `should parse spec sample 41 correctly (Entity and numeric character references)`() { - val parsed = processor.processMarkdownDocument("[a](url "tit")") - - /* - * Expected HTML: - *[a](url "tit")
- */ - parsed.assertEquals(paragraph("\\[a\\]\\(url \"tit\"\\)")) - } - - @Test - fun `should parse spec sample 42 correctly (Precedence)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- `one - |- two` - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *+++
- */ - parsed.assertEquals(paragraph("+++")) - } - - @Test - fun `should parse spec sample 45 correctly (Thematic breaks)`() { - val parsed = processor.processMarkdownDocument("===") - - /* - * Expected HTML: - *===
- */ - parsed.assertEquals(paragraph("===")) - } - - @Test - fun `should parse spec sample 46 correctly (Thematic breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |-- - |** - |__ - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *-- - * ** - * __
- */ - parsed.assertEquals(paragraph("-- \\*\\* \\_\\_")) - } - - @Test - fun `should parse spec sample 47 correctly (Thematic breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | *** - | *** - | *** - """ - .trimMargin(), - ) - - /* - * Expected HTML: - ****
- *
- */
- parsed.assertEquals(indentedCodeBlock("***"))
- }
-
- @Test
- fun `should parse spec sample 49 correctly (Thematic breaks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |Foo
- | ***
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * Foo - * ***
- */ - parsed.assertEquals(paragraph("Foo \\*\\*\\*")) - } - - @Test - fun `should parse spec sample 50 correctly (Thematic breaks)`() { - val parsed = processor.processMarkdownDocument("_____________________________________") - - /* - * Expected HTML: - *_ _ _ _ a
- *a------
- *---a---
- */ - parsed.assertEquals( - paragraph("\\_ \\_ \\_ \\_ a"), - paragraph("a------"), - paragraph("---a---"), - ) - } - - @Test - fun `should parse spec sample 56 correctly (Thematic breaks)`() { - val parsed = processor.processMarkdownDocument(" *-*") - - /* - * Expected HTML: - *-
- */ - parsed.assertEquals(paragraph("*-*")) - } - - @Test - fun `should parse spec sample 57 correctly (Thematic breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - |*** - |- bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo
- *bar
- */ - parsed.assertEquals( - paragraph("Foo"), - ThematicBreak, - paragraph("bar"), - ) - } - - @Test - fun `should parse spec sample 59 correctly (Thematic breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo - |--- - |bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar
- */ - parsed.assertEquals( - heading(2, "Foo"), - paragraph("bar"), - ) - } - - @Test - fun `should parse spec sample 60 correctly (Thematic breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |* Foo - |* * * - |* Bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *####### foo
- */ - parsed.assertEquals(paragraph("####### foo")) - } - - @Test - fun `should parse spec sample 64 correctly (ATX headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |#5 bolt - | - |#hashtag - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *#5 bolt
- *#hashtag
- */ - parsed.assertEquals( - paragraph("#5 bolt"), - paragraph("#hashtag"), - ) - } - - @Test - fun `should parse spec sample 65 correctly (ATX headings)`() { - val parsed = processor.processMarkdownDocument("\\## foo") - - /* - * Expected HTML: - *## foo
- */ - parsed.assertEquals(paragraph("## foo")) - } - - @Test - fun `should parse spec sample 66 correctly (ATX headings)`() { - val parsed = processor.processMarkdownDocument("# foo *bar* \\*baz\\*") - - /* - * Expected HTML: - *# foo
- *
- */
- parsed.assertEquals(indentedCodeBlock("# foo"))
- }
-
- @Test
- fun `should parse spec sample 70 correctly (ATX headings)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |foo
- | # bar
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * foo - * # bar
- */ - parsed.assertEquals(paragraph("foo # bar")) - } - - @Test - fun `should parse spec sample 71 correctly (ATX headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |## foo ## - | ### bar ### - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo bar
- *Bar foo
- */ - parsed.assertEquals( - paragraph("Foo bar"), - heading(level = 1, "baz"), - paragraph("Bar foo"), - ) - } - - @Test - fun `should parse spec sample 79 correctly (ATX headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |## - |# - |### ### - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - * - * - */ - parsed.assertEquals( - heading(level = 2, ""), - heading(level = 1, ""), - heading(level = 3, ""), - ) - } - - @Test - fun `should parse spec sample 80 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo *bar* - |========= - | - |Foo *bar* - |--------- - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo
- * ---
- *
- * Foo
- *
- * Foo - * ---
- */ - parsed.assertEquals(paragraph("Foo ---")) - } - - @Test - fun `should parse spec sample 88 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo - |= = - | - |Foo - |--- - - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo - * = =
- *Foo
- *`
- *of dashes"/>
- */ - parsed.assertEquals( - heading(level = 2, "\\`Foo"), - paragraph("\\`"), - heading(level = 2, "\\"), - ) - } - - @Test - fun `should parse spec sample 92 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> Foo - |--- - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- *Foo
- *
- *- */ - parsed.assertEquals(blockQuote(paragraph("foo bar ==="))) - } - - @Test - fun `should parse spec sample 94 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- Foo - |--- - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * bar - * ===
- *
Baz
- */ - parsed.assertEquals( - ThematicBreak, - heading(level = 2, "Foo"), - heading(level = 2, "Bar"), - paragraph("Baz"), - ) - } - - @Test - fun `should parse spec sample 97 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - |==== - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *====
- */ - parsed.assertEquals(paragraph("====")) - } - - @Test - fun `should parse spec sample 98 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |--- - |--- - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *
- * - *- *foo
- *
Foo
- *baz
- */ - parsed.assertEquals( - paragraph("Foo"), - heading(level = 2, "bar"), - paragraph("baz"), - ) - } - - @Test - fun `should parse spec sample 104 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo - |bar - | - |--- - | - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo - * bar
- *baz
- */ - parsed.assertEquals( - paragraph("Foo bar"), - ThematicBreak, - paragraph("baz"), - ) - } - - @Test - fun `should parse spec sample 105 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo - |bar - |* * * - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo - * bar
- *baz
- */ - parsed.assertEquals( - paragraph("Foo bar"), - ThematicBreak, - paragraph("baz"), - ) - } - - @Test - fun `should parse spec sample 106 correctly (Setext headings)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo - |bar - |\--- - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo - * bar - * --- - * baz
- */ - parsed.assertEquals(paragraph("Foo bar --- baz")) - } - - @Test - fun `should parse spec sample 107 correctly (Indented code blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | a simple - | indented code block - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *a simple
- * indented code block
- *
- */
- parsed.assertEquals(indentedCodeBlock("a simple\n indented code block"))
- }
-
- @Test
- fun `should parse spec sample 108 correctly (Indented code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | - foo
- |
- | bar
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * foo
- *bar
- *foo
- *<a/>
- * *hi*
- *
- * - one
- *
- */
- parsed.assertEquals(indentedCodeBlock("\n*hi*\n\n- one"))
- }
-
- @Test
- fun `should parse spec sample 111 correctly (Indented code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | chunk1
- |
- | chunk2
- |
- |
- |
- | chunk3
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * chunk1
- *
- * chunk2
- *
- *
- *
- * chunk3
- *
- */
- parsed.assertEquals(indentedCodeBlock("chunk1\n\nchunk2\n\n\n\nchunk3"))
- }
-
- @Test
- fun `should parse spec sample 112 correctly (Indented code blocks)`() {
- val parsed = processor.processMarkdownDocument(" chunk1\n \n chunk2")
-
- /*
- * Expected HTML:
- * chunk1
- * ••
- * chunk2
- *
- */
- parsed.assertEquals(indentedCodeBlock("chunk1\n \n chunk2"))
- }
-
- @Test
- fun `should parse spec sample 113 correctly (Indented code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |Foo
- | bar
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * Foo - * bar
- */ - parsed.assertEquals(paragraph("Foo bar")) - } - - @Test - fun `should parse spec sample 114 correctly (Indented code blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | foo - |bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *
- * bar
- */ - parsed.assertEquals( - indentedCodeBlock("foo"), - paragraph("bar"), - ) - } - - @Test - fun `should parse spec sample 115 correctly (Indented code blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |# Heading - | foo - |Heading - |------ - | foo - |---- - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *
- * foo
- *
- * foo
- * bar
- *
- */
- parsed.assertEquals(indentedCodeBlock(" foo\nbar"))
- }
-
- @Test
- fun `should parse spec sample 117 correctly (Indented code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |
- |
- | foo
- |
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * foo
- *
- */
- parsed.assertEquals(indentedCodeBlock("foo"))
- }
-
- @Test
- fun `should parse spec sample 118 correctly (Indented code blocks)`() {
- val parsed = processor.processMarkdownDocument(" foo ")
-
- /*
- * Expected HTML:
- * foo••
- *
- */
- parsed.assertEquals(indentedCodeBlock("foo "))
- }
-
- @Test
- fun `should parse spec sample 119 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |```
- |<
- | >
- |```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * <
- * >
- *
- */
- parsed.assertEquals(fencedCodeBlock("<\n >"))
- }
-
- @Test
- fun `should parse spec sample 120 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |~~~
- |<
- | >
- |~~~
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * <
- * >
- *
- */
- parsed.assertEquals(fencedCodeBlock("<\n >"))
- }
-
- @Test
- fun `should parse spec sample 121 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |``
- |foo
- |``
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * foo
aaa
- * ~~~
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n~~~"))
- }
-
- @Test
- fun `should parse spec sample 123 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |~~~
- |aaa
- |```
- |~~~
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * ```
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n```"))
- }
-
- @Test
- fun `should parse spec sample 124 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |````
- |aaa
- |```
- |``````
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * ```
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n```"))
- }
-
- @Test
- fun `should parse spec sample 125 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |~~~~
- |aaa
- |~~~
- |~~~~
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * ~~~
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n~~~"))
- }
-
- @Test
- fun `should parse spec sample 126 correctly (Fenced code blocks)`() {
- val parsed = processor.processMarkdownDocument("```")
-
- /*
- * Expected HTML:
- *
- */
- parsed.assertEquals(fencedCodeBlock(""))
- }
-
- @Test
- fun `should parse spec sample 127 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |`````
- |
- |```
- |aaa
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- *
- * ```
- * aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("\n```\naaa"))
- }
-
- @Test
- fun `should parse spec sample 128 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |> ```
- |> aaa
- |
- |bbb
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * - *- *- *aaa - *
bbb
- */ - parsed.assertEquals( - blockQuote(fencedCodeBlock("aaa")), - paragraph("bbb"), - ) - } - - @Test - fun `should parse spec sample 129 correctly (Fenced code blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |``` - | - | - |``` - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *
- * ••
- *
- */
- parsed.assertEquals(fencedCodeBlock("\n "))
- }
-
- @Test
- fun `should parse spec sample 130 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |```
- |```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- *
- */
- parsed.assertEquals(fencedCodeBlock(""))
- }
-
- @Test
- fun `should parse spec sample 131 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | ```
- | aaa
- |aaa
- |```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\naaa"))
- }
-
- @Test
- fun `should parse spec sample 132 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | ```
- |aaa
- | aaa
- |aaa
- | ```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * aaa
- * aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\naaa\naaa"))
- }
-
- @Test
- fun `should parse spec sample 133 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | ```
- | aaa
- | aaa
- | aaa
- | ```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * aaa
- * aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n aaa\naaa"))
- }
-
- @Test
- fun `should parse spec sample 134 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | ```
- | aaa
- | ```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * ```
- * aaa
- * ```
- *
- */
- parsed.assertEquals(indentedCodeBlock("```\naaa\n```"))
- }
-
- @Test
- fun `should parse spec sample 135 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |```
- |aaa
- | ```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa"))
- }
-
- @Test
- fun `should parse spec sample 136 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | ```
- |aaa
- | ```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa"))
- }
-
- @Test
- fun `should parse spec sample 137 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |```
- |aaa
- | ```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aaa
- * ```
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n ```"))
- }
-
- @Test
- fun `should parse spec sample 138 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |``` ```
- |aaa
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- *
- * aaa
aaa
- * ~~~ ~~
- *
- */
- parsed.assertEquals(fencedCodeBlock("aaa\n~~~ ~~"))
- }
-
- @Test
- fun `should parse spec sample 140 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |foo
- |```
- |bar
- |```
- |baz
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * foo
- *bar
- *
- * baz
- */ - parsed.assertEquals( - paragraph("foo"), - fencedCodeBlock("bar"), - paragraph("baz"), - ) - } - - @Test - fun `should parse spec sample 141 correctly (Fenced code blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo - |--- - |~~~ - |bar - |~~~ - |# baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar
- *
- * def foo(x)
- * return 3
- * end
- *
- */
- parsed.assertEquals(
- fencedCodeBlock(
- "def foo(x)\n return 3\nend",
- mimeType = MimeType.Known.fromMarkdownLanguageName("ruby"),
- ),
- )
- }
-
- @Test
- fun `should parse spec sample 143 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |~~~~ ruby startline=3 $%@#$
- |def foo(x)
- | return 3
- |end
- |~~~~~~~
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * def foo(x)
- * return 3
- * end
- *
- */
- parsed.assertEquals(
- fencedCodeBlock(
- "def foo(x)\n return 3\nend",
- mimeType = MimeType.Known.fromMarkdownLanguageName("ruby"),
- ),
- )
- }
-
- @Test
- fun `should parse spec sample 144 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |````;
- |````
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- *
- */
- parsed.assertEquals(
- fencedCodeBlock(
- "",
- mimeType = MimeType.Known.fromMarkdownLanguageName(";"),
- ),
- )
- }
-
- @Test
- fun `should parse spec sample 145 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |``` aa ```
- |foo
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * aa
- * foo
foo
- *
- */
- parsed.assertEquals(
- fencedCodeBlock(
- "foo",
- mimeType = MimeType.Known.fromMarkdownLanguageName("aa"),
- ),
- )
- }
-
- @Test
- fun `should parse spec sample 147 correctly (Fenced code blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |```
- |``` aaa
- |```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * ``` aaa
- *
- */
- parsed.assertEquals(fencedCodeBlock("``` aaa"))
- }
-
- @Test
- fun `should parse spec sample 148 correctly (HTML blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |
- |- |**Hello**, - | - |_world_. - |- | |
- * - * **Hello**, - *- * |
\n\n**Hello**,"), - paragraph("_world_."), - htmlBlock(" |
- | hi - | | - |
- * hi - * | - *
okay.
- */ - parsed.assertEquals( - htmlBlock( - """ - |- | hi - | | - |
Markdown
- *bar
- */ - parsed.assertEquals( - htmlBlock("- |foo - | |
- * foo - * |
- |foo - | |
foo
- *foo
- |import Text.HTML.TagSoup
- |
- |main :: IO ()
- |main = print $ parseTags tags
- |
- |okay
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- *
- * import Text.HTML.TagSoup
- *
- * main :: IO ()
- * main = print $ parseTags tags
- *
- * okay
- */ - parsed.assertEquals( - htmlBlock( - """ - |
- |import Text.HTML.TagSoup
- |
- |main :: IO ()
- |main = print $ parseTags tags
- |
- """
- .trimMargin(),
- ),
- paragraph("okay"),
- )
- }
-
- @Test
- fun `should parse spec sample 170 correctly (HTML blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |
- |okay
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- *
- * okay
- */ - parsed.assertEquals( - htmlBlock( - """ - | - """ - .trimMargin(), - ), - paragraph("okay"), - ) - } - - @Test - fun `should parse spec sample 171 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals( - htmlBlock( - """ - | - """ - .trimMargin(), - ), - ) - } - - @Test - fun `should parse spec sample 172 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - |okay - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - *okay
- */ - parsed.assertEquals( - htmlBlock( - """ - | - """ - .trimMargin(), - ), - paragraph("okay"), - ) - } - - @Test - fun `should parse spec sample 173 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - |*foo* - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - *foo
- */ - parsed.assertEquals( - htmlBlock(""), - paragraph("*foo*"), - ) - } - - @Test - fun `should parse spec sample 177 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |*bar* - |*baz* - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * *bar* - *baz
- */ - parsed.assertEquals( - htmlBlock("*bar*"), - paragraph("*baz*"), - ) - } - - @Test - fun `should parse spec sample 178 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |1. *bar* - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * 1. *bar* - */ - parsed.assertEquals( - htmlBlock( - """ - |1. *bar* - """ - .trimMargin(), - ), - ) - } - - @Test - fun `should parse spec sample 179 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - |okay - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - *okay
- */ - parsed.assertEquals( - htmlBlock( - """ - | - """ - .trimMargin(), - ), - paragraph("okay"), - ) - } - - @Test - fun `should parse spec sample 180 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |'; - | - |?> - |okay - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * '; - * - * ?> - *okay
- */ - parsed.assertEquals( - htmlBlock( - """ - |'; - | - |?> - """ - .trimMargin(), - ), - paragraph("okay"), - ) - } - - @Test - fun `should parse spec sample 181 correctly (HTML blocks)`() { - val parsed = processor.processMarkdownDocument("") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(htmlBlock("")) - } - - @Test - fun `should parse spec sample 182 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - |okay - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - *okay
- */ - parsed.assertEquals( - htmlBlock( - """ - | - """ - .trimMargin(), - ), - paragraph("okay"), - ) - } - - @Test - fun `should parse spec sample 183 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - | - | - | - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - *<!-- foo -->
- *
- */
- parsed.assertEquals(
- htmlBlock(" "),
- indentedCodeBlock(""),
- )
- }
-
- @Test
- fun `should parse spec sample 184 correctly (HTML blocks)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | <div>
- *
- */
- parsed.assertEquals(
- htmlBlock(" Foo
- *Foo - * - * baz
- */ - parsed.assertEquals(paragraph("Foo baz")) - } - - @Test - fun `should parse spec sample 188 correctly (HTML blocks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Emphasized text.
- *- |Hi - | | - | - |
- * Hi - * | - *
\nHi\n | "), - htmlBlock("
- | Hi - | | - | - |
\n Hi\n | "), - htmlBlock("
[foo]: /url 'title
- *with blank line'
- *[foo]
- */ - parsed.assertEquals( - paragraph("\\[foo\\]: /url 'title"), - paragraph("with blank line'"), - paragraph("\\[foo\\]"), - ) - } - - @Test - fun `should parse spec sample 198 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: - |/url - | - |[foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url)")) - } - - @Test - fun `should parse spec sample 199 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: - | - |[foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo]:
- *[foo]
- */ - parsed.assertEquals( - paragraph("\\[foo\\]:"), - paragraph("\\[foo\\]"), - ) - } - - @Test - fun `should parse spec sample 200 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: <> - | - |[foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo]()")) - } - - @Test - fun `should parse spec sample 201 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]:[foo]:
[foo]
- */ - parsed.assertEquals( - paragraph("\\[foo\\]:bar
- */ - parsed.assertEquals(paragraph("bar")) - } - - @Test - fun `should parse spec sample 209 correctly (Link reference definitions)`() { - val parsed = processor.processMarkdownDocument("[foo]: /url \"title\" ok") - - /* - * Expected HTML: - *[foo]: /url "title" ok
- */ - parsed.assertEquals(paragraph("\\[foo\\]: /url \"title\" ok")) - } - - @Test - fun `should parse spec sample 210 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: /url - |"title" ok - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *"title" ok
- */ - parsed.assertEquals(paragraph("\"title\" ok")) - } - - @Test - fun `should parse spec sample 211 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - | [foo]: /url "title" - | - |[foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo]: /url "title"
- *
- * [foo]
- */ - parsed.assertEquals( - indentedCodeBlock("[foo]: /url \"title\""), - paragraph("\\[foo\\]"), - ) - } - - @Test - fun `should parse spec sample 212 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |``` - |[foo]: /url - |``` - | - |[foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo]: /url
- *
- * [foo]
- */ - parsed.assertEquals( - fencedCodeBlock("[foo]: /url"), - paragraph("\\[foo\\]"), - ) - } - - @Test - fun `should parse spec sample 213 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |Foo - |[bar]: /baz - | - |[bar] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo - * [bar]: /baz
- *[bar]
- */ - parsed.assertEquals( - paragraph("Foo \\[bar\\]: /baz"), - paragraph("\\[bar\\]"), - ) - } - - @Test - fun `should parse spec sample 214 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |# [Foo] - |[foo]: /url - |> bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- */ - parsed.assertEquals( - heading(level = 1, "[Foo](/url)"), - blockQuote(paragraph("bar")), - ) - } - - @Test - fun `should parse spec sample 215 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: /url - |bar - |=== - |[foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar
- *
=== - * foo
- */ - parsed.assertEquals(paragraph("=== [foo](/url)")) - } - - @Test - fun `should parse spec sample 217 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: /foo-url "foo" - |[bar]: /bar-url - | "bar" - |[baz]: /baz-url - | - |[foo], - |[bar], - |[baz] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals( - paragraph("[foo](/foo-url \"foo\"), [bar](/bar-url \"bar\"), [baz](/baz-url)"), - ) - } - - @Test - fun `should parse spec sample 218 correctly (Link reference definitions)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] - | - |> [foo]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - *- *- */ - parsed.assertEquals( - paragraph("[foo](/url)"), - blockQuote(), - ) - } - - @Test - fun `should parse spec sample 219 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - |aaa - | - |bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *
aaa
- *bbb
- */ - parsed.assertEquals( - paragraph("aaa"), - paragraph("bbb"), - ) - } - - @Test - fun `should parse spec sample 220 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - |aaa - |bbb - | - |ccc - |ddd - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa - * bbb
- *ccc - * ddd
- */ - parsed.assertEquals( - paragraph("aaa bbb"), - paragraph("ccc ddd"), - ) - } - - @Test - fun `should parse spec sample 221 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - |aaa - | - | - |bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa
- *bbb
- */ - parsed.assertEquals( - paragraph("aaa"), - paragraph("bbb"), - ) - } - - @Test - fun `should parse spec sample 222 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - | aaa - | bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa - * bbb
- */ - parsed.assertEquals(paragraph("aaa bbb")) - } - - @Test - fun `should parse spec sample 223 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - |aaa - | bbb - | ccc - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa - * bbb - * ccc
- */ - parsed.assertEquals(paragraph("aaa bbb ccc")) - } - - @Test - fun `should parse spec sample 224 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - | aaa - |bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa - * bbb
- */ - parsed.assertEquals(paragraph("aaa bbb")) - } - - @Test - fun `should parse spec sample 225 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - | aaa - |bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa
- *
- * bbb
- */ - parsed.assertEquals( - indentedCodeBlock("aaa"), - paragraph("bbb"), - ) - } - - @Test - fun `should parse spec sample 226 correctly (Paragraphs)`() { - val parsed = - processor.processMarkdownDocument( - """ - |aaa - |bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *aaa
- * bbb
aaa
- *- *- */ - parsed.assertEquals( - blockQuote( - heading(level = 1, "Foo"), - paragraph("bar baz"), - ), - ) - } - - @Test - fun `should parse spec sample 229 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |># Foo - |>bar - |> baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo
- *bar - * baz
- *
- *- */ - parsed.assertEquals( - blockQuote( - heading(level = 1, "Foo"), - paragraph("bar baz"), - ), - ) - } - - @Test - fun `should parse spec sample 230 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - | > # Foo - | > bar - | > baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo
- *bar - * baz
- *
- *- */ - parsed.assertEquals( - blockQuote( - heading(level = 1, "Foo"), - paragraph("bar baz"), - ), - ) - } - - @Test - fun `should parse spec sample 231 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - | > # Foo - | > bar - | > baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo
- *bar - * baz
- *
> # Foo
- * > bar
- * > baz
- *
- */
- parsed.assertEquals(indentedCodeBlock("> # Foo\n> bar\n> baz"))
- }
-
- @Test
- fun `should parse spec sample 232 correctly (Block quotes)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |> # Foo
- |> bar
- |baz
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * - *- */ - parsed.assertEquals( - blockQuote( - heading(level = 1, "Foo"), - paragraph("bar baz"), - ), - ) - } - - @Test - fun `should parse spec sample 233 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> bar - |baz - |> foo - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Foo
- *bar - * baz
- *
- *- */ - parsed.assertEquals(blockQuote(paragraph("bar baz foo"))) - } - - @Test - fun `should parse spec sample 234 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> foo - |--- - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar - * baz - * foo
- *
- *- *foo
- *
- *- *- *
- *- foo
- *
- *- *- *foo - *
bar
- *
- */
- parsed.assertEquals(
- blockQuote(indentedCodeBlock("foo")),
- indentedCodeBlock("bar"),
- )
- }
-
- @Test
- fun `should parse spec sample 237 correctly (Block quotes)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |> ```
- |foo
- |```
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * - *- *- *
foo
- *
- */
- parsed.assertEquals(
- blockQuote(fencedCodeBlock("")),
- paragraph("foo"),
- fencedCodeBlock(""),
- )
- }
-
- @Test
- fun `should parse spec sample 238 correctly (Block quotes)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |> foo
- | - bar
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * - *- */ - parsed.assertEquals(blockQuote(paragraph("foo - bar"))) - } - - @Test - fun `should parse spec sample 239 correctly (Block quotes)`() { - val parsed = processor.processMarkdownDocument(">") - - /* - * Expected HTML: - *foo - * - bar
- *
- *- */ - parsed.assertEquals(blockQuote()) - } - - @Test - fun `should parse spec sample 240 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> - |> - |> - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *
- *- */ - parsed.assertEquals(blockQuote()) - } - - @Test - fun `should parse spec sample 241 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> - |> foo - |> - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *
- *- */ - parsed.assertEquals(blockQuote(paragraph("foo"))) - } - - @Test - fun `should parse spec sample 242 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> foo - | - |> bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *
- *- *foo
- *
- *- */ - parsed.assertEquals( - blockQuote(paragraph("foo")), - blockQuote(paragraph("bar")), - ) - } - - @Test - fun `should parse spec sample 243 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> foo - |> bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar
- *
- *- */ - parsed.assertEquals(blockQuote(paragraph("foo bar"))) - } - - @Test - fun `should parse spec sample 244 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> foo - |> - |> bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * bar
- *
- *- */ - parsed.assertEquals( - blockQuote( - paragraph("foo"), - paragraph("bar"), - ), - ) - } - - @Test - fun `should parse spec sample 245 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo - |> bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *bar
- *
foo
- *- *- */ - parsed.assertEquals( - paragraph("foo"), - blockQuote(paragraph("bar")), - ) - } - - @Test - fun `should parse spec sample 246 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> aaa - |*** - |> bbb - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar
- *
- *- *aaa
- *
- *- */ - parsed.assertEquals( - blockQuote(paragraph("aaa")), - ThematicBreak, - blockQuote(paragraph("bbb")), - ) - } - - @Test - fun `should parse spec sample 247 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> bar - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bbb
- *
- *- */ - parsed.assertEquals(blockQuote(paragraph("bar baz"))) - } - - @Test - fun `should parse spec sample 248 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> bar - | - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar - * baz
- *
- *- *bar
- *
baz
- */ - parsed.assertEquals( - blockQuote(paragraph("bar")), - paragraph("baz"), - ) - } - - @Test - fun `should parse spec sample 249 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> bar - |> - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- *bar
- *
baz
- */ - parsed.assertEquals( - blockQuote(paragraph("bar")), - paragraph("baz"), - ) - } - - @Test - fun `should parse spec sample 250 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> > > foo - |bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- */ - parsed.assertEquals( - blockQuote( - blockQuote( - blockQuote(paragraph("foo bar")), - ), - ), - ) - } - - @Test - fun `should parse spec sample 251 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |>>> foo - |> bar - |>>baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- *- *- *foo - * bar
- *
- *- */ - parsed.assertEquals( - blockQuote( - blockQuote( - blockQuote(paragraph("foo bar baz")), - ), - ), - ) - } - - @Test - fun `should parse spec sample 252 correctly (Block quotes)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> code - | - |> not code - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- *- *- *foo - * bar - * baz
- *
- *- *- *code - *
- *- */ - parsed.assertEquals( - blockQuote(indentedCodeBlock("code")), - blockQuote(paragraph("not code")), - ) - } - - @Test - fun `should parse spec sample 253 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |A paragraph - |with two lines. - | - | indented code - | - |> A block quote. - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *not code
- *
A paragraph - * with two lines.
- *indented code
- *
- * - *- */ - parsed.assertEquals( - paragraph("A paragraph with two lines."), - indentedCodeBlock("indented code"), - blockQuote(paragraph("A block quote.")), - ) - } - - @Test - fun `should parse spec sample 254 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |1. A paragraph - | with two lines. - | - | indented code - | - | > A block quote. - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *A block quote.
- *
A paragraph - * with two lines.
- *indented code
- *
- * - *- *A block quote.
- *
two
- */ - parsed.assertEquals( - unorderedList(listItem(paragraph("one"))), - paragraph("two"), - ) - } - - @Test - fun `should parse spec sample 256 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- one - | - | two - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *one
- *two
- * two
- *
- */
- parsed.assertEquals(
- unorderedList(listItem(paragraph("one"))),
- indentedCodeBlock(" two"),
- )
- }
-
- @Test
- fun `should parse spec sample 258 correctly (List items)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | - one
- |
- | two
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * one
- *two
- *- *- */ - parsed.assertEquals( - blockQuote( - blockQuote( - orderedList( - listItem(paragraph("one"), paragraph("two")), - isTight = false, - ), - ), - ), - ) - } - - @Test - fun `should parse spec sample 260 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |>>- one - |>> - | > > two - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- *- *
- *- - *
- *one
- *two
- *
- *- */ - parsed.assertEquals( - blockQuote( - blockQuote( - unorderedList(listItem(paragraph("one"))), - paragraph("two"), - ), - ), - ) - } - - @Test - fun `should parse spec sample 261 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |-one - | - |2.two - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *- *- *
- *- one
- *two
- *
-one
- *2.two
- */ - parsed.assertEquals( - paragraph("-one"), - paragraph("2.two"), - ) - } - - @Test - fun `should parse spec sample 262 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - | - | - | bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *bar
- *foo
- *bar
- *
- * baz
- *- *- *bam
- *
Foo
- *bar
- *
- *
- * baz
- *
- * 1234567890. not ok
- */ - parsed.assertEquals(paragraph("1234567890. not ok")) - } - - @Test - fun `should parse spec sample 267 correctly (List items)`() { - val parsed = processor.processMarkdownDocument("0. ok") - - /* - * Expected HTML: - *-1. not ok
- */ - parsed.assertEquals(paragraph("-1. not ok")) - } - - @Test - fun `should parse spec sample 270 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - | - | bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *bar
- *
- * foo
- *bar
- *
- * indented code
- *
- * paragraph
- *more code
- *
- */
- parsed.assertEquals(
- indentedCodeBlock("indented code"),
- paragraph("paragraph"),
- indentedCodeBlock("more code"),
- )
- }
-
- @Test
- fun `should parse spec sample 273 correctly (List items)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |1. indented code
- |
- | paragraph
- |
- | more code
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * indented code
- *
- * paragraph
- *more code
- *
- * indented code
- *
- * paragraph
- *more code
- *
- * foo
- *bar
- */ - parsed.assertEquals( - paragraph("foo"), - paragraph("bar"), - ) - } - - @Test - fun `should parse spec sample 276 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - | - | bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *bar
- */ - parsed.assertEquals( - unorderedList(listItem(paragraph("foo"))), - paragraph("bar"), - ) - } - - @Test - fun `should parse spec sample 277 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - | - | bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- *bar
- *bar
- *
- * baz
- *
- * foo
- */ - parsed.assertEquals( - unorderedList(listItem()), - paragraph("foo"), - ) - } - - @Test - fun `should parse spec sample 281 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - |- - |- bar - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * *
- *foo - * 1.
- */ - parsed.assertEquals( - paragraph("foo \\*"), - paragraph("foo 1."), - ) - } - - @Test - fun `should parse spec sample 286 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - | 1. A paragraph - | with two lines. - | - | indented code - | - | > A block quote. - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *A paragraph - * with two lines.
- *indented code
- *
- * - *- *A block quote.
- *
A paragraph - * with two lines.
- *indented code
- *
- * - *- *A block quote.
- *
A paragraph - * with two lines.
- *indented code
- *
- * - *- *A block quote.
- *
1. A paragraph
- * with two lines.
- *
- * indented code
- *
- * > A block quote.
- *
- */
- parsed.assertEquals(
- indentedCodeBlock(
- """
- |1. A paragraph
- | with two lines.
- |
- | indented code
- |
- | > A block quote.
- """
- .trimMargin(),
- ),
- )
- }
-
- @Test
- fun `should parse spec sample 290 correctly (List items)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- | 1. A paragraph
- |with two lines.
- |
- | indented code
- |
- | > A block quote.
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * A paragraph - * with two lines.
- *indented code
- *
- * - *- *A block quote.
- *
- *- */ - parsed.assertEquals( - blockQuote( - orderedList(listItem(blockQuote(paragraph("Blockquote continued here.")))), - ), - ) - } - - @Test - fun `should parse spec sample 293 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |> 1. > Blockquote - |> continued here. - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *
- *- - *
- *- *- *Blockquote - * continued here.
- *
- *- */ - parsed.assertEquals( - blockQuote( - orderedList(listItem(blockQuote(paragraph("Blockquote continued here.")))), - ), - ) - } - - @Test - fun `should parse spec sample 294 correctly (List items)`() { - val parsed = - processor.processMarkdownDocument( - """ - |- foo - | - bar - | - baz - | - boo - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *- *
- *- - *
- *- *- *Blockquote - * continued here.
- *
Foo
- *The number of windows in my house is - * 14. The number of doors is 6.
- */ - parsed.assertEquals( - paragraph("The number of windows in my house is 14. The number of doors is 6."), - ) - } - - @Test - fun `should parse spec sample 305 correctly (Lists)`() { - val parsed = - processor.processMarkdownDocument( - """ - |The number of windows in my house is - |1. The number of doors is 6. - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *The number of windows in my house is
- *foo
- *bar
- *baz
- *baz
- *bim
- *foo
- *notcode
- *foo
- *code
- *
- */
- parsed.assertEquals(
- unorderedList(
- listItem(paragraph("foo"), paragraph("notcode")),
- listItem(paragraph("foo")),
- isTight = false,
- ),
- htmlBlock(""),
- indentedCodeBlock("code"),
- )
- }
-
- @Test
- fun `should parse spec sample 310 correctly (Lists)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |- a
- | - b
- | - c
- | - d
- | - e
- | - f
- |- g
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * a
- *b
- *c
- *a
- *b
- *3. c
- *
- */
- parsed.assertEquals(
- orderedList(
- listItem(paragraph("a")),
- listItem(paragraph("b")),
- isTight = false,
- ),
- indentedCodeBlock("3. c"),
- )
- }
-
- @Test
- fun `should parse spec sample 314 correctly (Lists)`() {
- val parsed =
- processor.processMarkdownDocument(
- """
- |- a
- |- b
- |
- |- c
- """
- .trimMargin(),
- )
-
- /*
- * Expected HTML:
- * a
- *b
- *c
- *a
- *c
- *a
- *b
- *c
- *d
- *a
- *b
- *d
- *b
- *
- *
- *
- * b
- *c
- *- *- *b
- *
- *- *b
- *
c
- *
- * foo
- *
- * bar
- *foo
- *baz
- *a
- *d
- *hi
lo`
foo
foo ` bar
``
``
a
b
- *
foo bar baz
foo
foo bar baz
foo\
bar`
foo`bar
foo `` bar
*foo*
[not a link](/foo
)
<a href="
">`
<http://foo.bar.
baz>`
```foo``
- */ - parsed.assertEquals(paragraph("\\`\\`\\`foo\\`\\`")) - } - - @Test - fun `should parse spec sample 348 correctly (Code spans)`() { - val parsed = processor.processMarkdownDocument("`foo") - - /* - * Expected HTML: - *`foo
- */ - parsed.assertEquals(paragraph("\\`foo")) - } - - @Test - fun `should parse spec sample 349 correctly (Code spans)`() { - val parsed = processor.processMarkdownDocument("`foo``bar``") - - /* - * Expected HTML: - *`foobar
foo bar
- */ - parsed.assertEquals(paragraph("*foo bar*")) - } - - @Test - fun `should parse spec sample 351 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("a * foo bar*") - - /* - * Expected HTML: - *a * foo bar*
- */ - parsed.assertEquals(paragraph("a \\* foo bar\\*")) - } - - @Test - fun `should parse spec sample 352 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("a*\"foo\"*") - - /* - * Expected HTML: - *a*"foo"*
- */ - parsed.assertEquals(paragraph("a\\*\"foo\"\\*")) - } - - @Test - fun `should parse spec sample 353 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("* a *") - - /* - * Expected HTML: - ** a *
- */ - parsed.assertEquals(paragraph("\\* a \\*")) - } - - @Test - fun `should parse spec sample 354 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo*bar*") - - /* - * Expected HTML: - *foobar
- */ - parsed.assertEquals(paragraph("foo*bar*")) - } - - @Test - fun `should parse spec sample 355 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("5*6*78") - - /* - * Expected HTML: - *5678
- */ - parsed.assertEquals(paragraph("5*6*78")) - } - - @Test - fun `should parse spec sample 356 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo bar_") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("_foo bar_")) - } - - @Test - fun `should parse spec sample 357 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_ foo bar_") - - /* - * Expected HTML: - *_ foo bar_
- */ - parsed.assertEquals(paragraph("\\_ foo bar\\_")) - } - - @Test - fun `should parse spec sample 358 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("a_\"foo\"_") - - /* - * Expected HTML: - *a_"foo"_
- */ - parsed.assertEquals(paragraph("a\\_\"foo\"\\_")) - } - - @Test - fun `should parse spec sample 359 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo_bar_") - - /* - * Expected HTML: - *foo_bar_
- */ - parsed.assertEquals(paragraph("foo\\_bar\\_")) - } - - @Test - fun `should parse spec sample 360 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("5_6_78") - - /* - * Expected HTML: - *5_6_78
- */ - parsed.assertEquals(paragraph("5\\_6\\_78")) - } - - @Test - fun `should parse spec sample 361 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("пристаням_стремятся_") - - /* - * Expected HTML: - *пристаням_стремятся_
- */ - parsed.assertEquals(paragraph("пристаням\\_стремятся\\_")) - } - - @Test - fun `should parse spec sample 362 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("aa_\"bb\"_cc") - - /* - * Expected HTML: - *aa_"bb"_cc
- */ - parsed.assertEquals(paragraph("aa\\_\"bb\"\\_cc")) - } - - @Test - fun `should parse spec sample 363 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo-_(bar)_") - - /* - * Expected HTML: - *foo-(bar)
- */ - parsed.assertEquals(paragraph("foo-_\\(bar\\)_")) - } - - @Test - fun `should parse spec sample 364 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo*") - - /* - * Expected HTML: - *_foo*
- */ - parsed.assertEquals(paragraph("\\_foo\\*")) - } - - @Test - fun `should parse spec sample 365 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo bar *") - - /* - * Expected HTML: - **foo bar *
- */ - parsed.assertEquals(paragraph("\\*foo bar \\*")) - } - - @Test - fun `should parse spec sample 366 correctly (Emphasis and strong emphasis)`() { - val parsed = - processor.processMarkdownDocument( - """ - |*foo bar - |* - """ - .trimMargin(), - ) - - /* - * Expected HTML: - **foo bar - * *
- */ - parsed.assertEquals(paragraph("\\*foo bar \\*")) - } - - @Test - fun `should parse spec sample 367 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*(*foo)") - - /* - * Expected HTML: - **(*foo)
- */ - parsed.assertEquals(paragraph("\\*\\(\\*foo\\)")) - } - - @Test - fun `should parse spec sample 368 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*(*foo*)*") - - /* - * Expected HTML: - *(foo)
- */ - parsed.assertEquals(paragraph("*\\(*foo*\\)*")) - } - - @Test - fun `should parse spec sample 369 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo*bar") - - /* - * Expected HTML: - *foobar
- */ - parsed.assertEquals(paragraph("*foo*bar")) - } - - @Test - fun `should parse spec sample 370 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo bar _") - - /* - * Expected HTML: - *_foo bar _
- */ - parsed.assertEquals(paragraph("\\_foo bar \\_")) - } - - @Test - fun `should parse spec sample 371 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_(_foo)") - - /* - * Expected HTML: - *_(_foo)
- */ - parsed.assertEquals(paragraph("\\_\\(\\_foo\\)")) - } - - @Test - fun `should parse spec sample 372 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_(_foo_)_") - - /* - * Expected HTML: - *(foo)
- */ - parsed.assertEquals(paragraph("_\\(_foo_\\)_")) - } - - @Test - fun `should parse spec sample 373 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo_bar") - - /* - * Expected HTML: - *_foo_bar
- */ - parsed.assertEquals(paragraph("\\_foo\\_bar")) - } - - @Test - fun `should parse spec sample 374 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_пристаням_стремятся") - - /* - * Expected HTML: - *_пристаням_стремятся
- */ - parsed.assertEquals(paragraph("\\_пристаням\\_стремятся")) - } - - @Test - fun `should parse spec sample 375 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo_bar_baz_") - - /* - * Expected HTML: - *foo_bar_baz
- */ - parsed.assertEquals(paragraph("_foo\\_bar\\_baz_")) - } - - @Test - fun `should parse spec sample 376 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_(bar)_.") - - /* - * Expected HTML: - *(bar).
- */ - parsed.assertEquals(paragraph("_\\(bar\\)_.")) - } - - @Test - fun `should parse spec sample 377 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo bar**") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("**foo bar**")) - } - - @Test - fun `should parse spec sample 378 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("** foo bar**") - - /* - * Expected HTML: - *** foo bar**
- */ - parsed.assertEquals(paragraph("\\*\\* foo bar\\*\\*")) - } - - @Test - fun `should parse spec sample 379 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("a**\"foo\"**") - - /* - * Expected HTML: - *a**"foo"**
- */ - parsed.assertEquals(paragraph("a\\*\\*\"foo\"\\*\\*")) - } - - @Test - fun `should parse spec sample 380 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo**bar**") - - /* - * Expected HTML: - *foobar
- */ - parsed.assertEquals(paragraph("foo**bar**")) - } - - @Test - fun `should parse spec sample 381 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo bar__") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("__foo bar__")) - } - - @Test - fun `should parse spec sample 382 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__ foo bar__") - - /* - * Expected HTML: - *__ foo bar__
- */ - parsed.assertEquals(paragraph("\\_\\_ foo bar\\_\\_")) - } - - @Test - fun `should parse spec sample 383 correctly (Emphasis and strong emphasis)`() { - val parsed = - processor.processMarkdownDocument( - """ - |__ - |foo bar__ - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *__ - * foo bar__
- */ - parsed.assertEquals(paragraph("\\_\\_ foo bar\\_\\_")) - } - - @Test - fun `should parse spec sample 384 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("a__\"foo\"__") - - /* - * Expected HTML: - *a__"foo"__
- */ - parsed.assertEquals(paragraph("a\\_\\_\"foo\"\\_\\_")) - } - - @Test - fun `should parse spec sample 385 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo__bar__") - - /* - * Expected HTML: - *foo__bar__
- */ - parsed.assertEquals(paragraph("foo\\_\\_bar\\_\\_")) - } - - @Test - fun `should parse spec sample 386 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("5__6__78") - - /* - * Expected HTML: - *5__6__78
- */ - parsed.assertEquals(paragraph("5\\_\\_6\\_\\_78")) - } - - @Test - fun `should parse spec sample 387 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("пристаням__стремятся__") - - /* - * Expected HTML: - *пристаням__стремятся__
- */ - parsed.assertEquals(paragraph("пристаням\\_\\_стремятся\\_\\_")) - } - - @Test - fun `should parse spec sample 388 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo, __bar__, baz__") - - /* - * Expected HTML: - *foo, bar, baz
- */ - parsed.assertEquals(paragraph("__foo, __bar__, baz__")) - } - - @Test - fun `should parse spec sample 389 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo-__(bar)__") - - /* - * Expected HTML: - *foo-(bar)
- */ - parsed.assertEquals(paragraph("foo-__\\(bar\\)__")) - } - - @Test - fun `should parse spec sample 390 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo bar **") - - /* - * Expected HTML: - ***foo bar **
- */ - parsed.assertEquals(paragraph("\\*\\*foo bar \\*\\*")) - } - - @Test - fun `should parse spec sample 391 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**(**foo)") - - /* - * Expected HTML: - ***(**foo)
- */ - parsed.assertEquals(paragraph("\\*\\*\\(\\*\\*foo\\)")) - } - - @Test - fun `should parse spec sample 392 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*(**foo**)*") - - /* - * Expected HTML: - *(foo)
- */ - parsed.assertEquals(paragraph("*\\(**foo**\\)*")) - } - - @Test - fun `should parse spec sample 393 correctly (Emphasis and strong emphasis)`() { - val parsed = - processor.processMarkdownDocument( - """ - |**Gomphocarpus (*Gomphocarpus physocarpus*, syn. - |*Asclepias physocarpa*)** - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *Gomphocarpus (Gomphocarpus physocarpus, syn. - * Asclepias physocarpa)
- */ - parsed.assertEquals( - paragraph( - "**Gomphocarpus \\(*Gomphocarpus physocarpus*, syn. *Asclepias physocarpa*\\)**", - ), - ) - } - - @Test - fun `should parse spec sample 394 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo \"*bar*\" foo**") - - /* - * Expected HTML: - *foo "bar" foo
- */ - parsed.assertEquals(paragraph("**foo \"*bar*\" foo**")) - } - - @Test - fun `should parse spec sample 395 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo**bar") - - /* - * Expected HTML: - *foobar
- */ - parsed.assertEquals(paragraph("**foo**bar")) - } - - @Test - fun `should parse spec sample 396 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo bar __") - - /* - * Expected HTML: - *__foo bar __
- */ - parsed.assertEquals(paragraph("\\_\\_foo bar \\_\\_")) - } - - @Test - fun `should parse spec sample 397 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__(__foo)") - - /* - * Expected HTML: - *__(__foo)
- */ - parsed.assertEquals(paragraph("\\_\\_\\(\\_\\_foo\\)")) - } - - @Test - fun `should parse spec sample 398 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_(__foo__)_") - - /* - * Expected HTML: - *(foo)
- */ - parsed.assertEquals(paragraph("_\\(__foo__\\)_")) - } - - @Test - fun `should parse spec sample 399 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo__bar") - - /* - * Expected HTML: - *__foo__bar
- */ - parsed.assertEquals(paragraph("\\_\\_foo\\_\\_bar")) - } - - @Test - fun `should parse spec sample 400 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__пристаням__стремятся") - - /* - * Expected HTML: - *__пристаням__стремятся
- */ - parsed.assertEquals(paragraph("\\_\\_пристаням\\_\\_стремятся")) - } - - @Test - fun `should parse spec sample 401 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo__bar__baz__") - - /* - * Expected HTML: - *foo__bar__baz
- */ - parsed.assertEquals(paragraph("__foo\\_\\_bar\\_\\_baz__")) - } - - @Test - fun `should parse spec sample 402 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__(bar)__.") - - /* - * Expected HTML: - *(bar).
- */ - parsed.assertEquals(paragraph("__\\(bar\\)__.")) - } - - @Test - fun `should parse spec sample 403 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo [bar](/url)*") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("*foo [bar](/url)*")) - } - - @Test - fun `should parse spec sample 404 correctly (Emphasis and strong emphasis)`() { - val parsed = - processor.processMarkdownDocument( - """ - |*foo - |bar* - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * bar
- */ - parsed.assertEquals(paragraph("*foo bar*")) - } - - @Test - fun `should parse spec sample 405 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo __bar__ baz_") - - /* - * Expected HTML: - *foo bar baz
- */ - parsed.assertEquals(paragraph("_foo __bar__ baz_")) - } - - @Test - fun `should parse spec sample 406 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo _bar_ baz_") - - /* - * Expected HTML: - *foo bar baz
- */ - parsed.assertEquals(paragraph("_foo _bar_ baz_")) - } - - @Test - fun `should parse spec sample 407 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo_ bar_") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("__foo_ bar_")) - } - - @Test - fun `should parse spec sample 408 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo *bar**") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("*foo *bar**")) - } - - @Test - fun `should parse spec sample 409 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo **bar** baz*") - - /* - * Expected HTML: - *foo bar baz
- */ - parsed.assertEquals(paragraph("*foo **bar** baz*")) - } - - @Test - fun `should parse spec sample 410 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo**bar**baz*") - - /* - * Expected HTML: - *foobarbaz
- */ - parsed.assertEquals(paragraph("*foo**bar**baz*")) - } - - @Test - fun `should parse spec sample 411 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo**bar*") - - /* - * Expected HTML: - *foo**bar
- */ - parsed.assertEquals(paragraph("*foo\\*\\*bar*")) - } - - @Test - fun `should parse spec sample 412 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("***foo** bar*") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("***foo** bar*")) - } - - @Test - fun `should parse spec sample 413 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo **bar***") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("*foo **bar***")) - } - - @Test - fun `should parse spec sample 414 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo**bar***") - - /* - * Expected HTML: - *foobar
- */ - parsed.assertEquals(paragraph("*foo**bar***")) - } - - @Test - fun `should parse spec sample 415 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo***bar***baz") - - /* - * Expected HTML: - *foobarbaz
- */ - parsed.assertEquals(paragraph("foo***bar***baz")) - } - - @Test - fun `should parse spec sample 416 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo******bar*********baz") - - /* - * Expected HTML: - *foobar***baz
- */ - parsed.assertEquals(paragraph("foo******bar******\\*\\*\\*baz")) - } - - @Test - fun `should parse spec sample 417 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo **bar *baz* bim** bop*") - - /* - * Expected HTML: - *foo bar baz bim bop
- */ - parsed.assertEquals(paragraph("*foo **bar *baz* bim** bop*")) - } - - @Test - fun `should parse spec sample 418 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo [*bar*](/url)*") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("*foo [*bar*](/url)*")) - } - - @Test - fun `should parse spec sample 419 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("** is not an empty emphasis") - - /* - * Expected HTML: - *** is not an empty emphasis
- */ - parsed.assertEquals(paragraph("\\*\\* is not an empty emphasis")) - } - - @Test - fun `should parse spec sample 420 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**** is not an empty strong emphasis") - - /* - * Expected HTML: - ***** is not an empty strong emphasis
- */ - parsed.assertEquals(paragraph("\\*\\*\\*\\* is not an empty strong emphasis")) - } - - @Test - fun `should parse spec sample 421 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo [bar](/url)**") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("**foo [bar](/url)**")) - } - - @Test - fun `should parse spec sample 422 correctly (Emphasis and strong emphasis)`() { - val parsed = - processor.processMarkdownDocument( - """ - |**foo - |bar** - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * bar
- */ - parsed.assertEquals(paragraph("**foo bar**")) - } - - @Test - fun `should parse spec sample 423 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo _bar_ baz__") - - /* - * Expected HTML: - *foo bar baz
- */ - parsed.assertEquals(paragraph("__foo _bar_ baz__")) - } - - @Test - fun `should parse spec sample 424 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo __bar__ baz__") - - /* - * Expected HTML: - *foo bar baz
- */ - parsed.assertEquals(paragraph("__foo __bar__ baz__")) - } - - @Test - fun `should parse spec sample 425 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("____foo__ bar__") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("____foo__ bar__")) - } - - @Test - fun `should parse spec sample 426 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo **bar****") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("**foo **bar****")) - } - - @Test - fun `should parse spec sample 427 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo *bar* baz**") - - /* - * Expected HTML: - *foo bar baz
- */ - parsed.assertEquals(paragraph("**foo *bar* baz**")) - } - - @Test - fun `should parse spec sample 428 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo*bar*baz**") - - /* - * Expected HTML: - *foobarbaz
- */ - parsed.assertEquals(paragraph("**foo*bar*baz**")) - } - - @Test - fun `should parse spec sample 429 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("***foo* bar**") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("***foo* bar**")) - } - - @Test - fun `should parse spec sample 430 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo *bar***") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("**foo *bar***")) - } - - @Test - fun `should parse spec sample 431 correctly (Emphasis and strong emphasis)`() { - val parsed = - processor.processMarkdownDocument( - """ - |**foo *bar **baz** - |bim* bop** - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo bar baz - * bim bop
- */ - parsed.assertEquals(paragraph("**foo *bar **baz** bim* bop**")) - } - - @Test - fun `should parse spec sample 432 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo [*bar*](/url)**") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("**foo [*bar*](/url)**")) - } - - @Test - fun `should parse spec sample 433 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__ is not an empty emphasis") - - /* - * Expected HTML: - *__ is not an empty emphasis
- */ - parsed.assertEquals(paragraph("\\_\\_ is not an empty emphasis")) - } - - @Test - fun `should parse spec sample 434 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("____ is not an empty strong emphasis") - - /* - * Expected HTML: - *____ is not an empty strong emphasis
- */ - parsed.assertEquals(paragraph("\\_\\_\\_\\_ is not an empty strong emphasis")) - } - - @Test - fun `should parse spec sample 435 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo ***") - - /* - * Expected HTML: - *foo ***
- */ - parsed.assertEquals(paragraph("foo \\*\\*\\*")) - } - - @Test - fun `should parse spec sample 436 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo *\\**") - - /* - * Expected HTML: - *foo *
- */ - parsed.assertEquals(paragraph("foo *\\**")) - } - - @Test - fun `should parse spec sample 437 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo *_*") - - /* - * Expected HTML: - *foo _
- */ - parsed.assertEquals(paragraph("foo *\\_*")) - } - - @Test - fun `should parse spec sample 438 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo *****") - - /* - * Expected HTML: - *foo *****
- */ - parsed.assertEquals(paragraph("foo \\*\\*\\*\\*\\*")) - } - - @Test - fun `should parse spec sample 439 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo **\\***") - - /* - * Expected HTML: - *foo *
- */ - parsed.assertEquals(paragraph("foo **\\***")) - } - - @Test - fun `should parse spec sample 440 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo **_**") - - /* - * Expected HTML: - *foo _
- */ - parsed.assertEquals(paragraph("foo **\\_**")) - } - - @Test - fun `should parse spec sample 441 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo*") - - /* - * Expected HTML: - **foo
- */ - parsed.assertEquals(paragraph("\\**foo*")) - } - - @Test - fun `should parse spec sample 442 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo**") - - /* - * Expected HTML: - *foo*
- */ - parsed.assertEquals(paragraph("*foo*\\*")) - } - - @Test - fun `should parse spec sample 443 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("***foo**") - - /* - * Expected HTML: - **foo
- */ - parsed.assertEquals(paragraph("\\***foo**")) - } - - @Test - fun `should parse spec sample 444 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("****foo*") - - /* - * Expected HTML: - ****foo
- */ - parsed.assertEquals(paragraph("\\*\\*\\**foo*")) - } - - @Test - fun `should parse spec sample 445 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo***") - - /* - * Expected HTML: - *foo*
- */ - parsed.assertEquals(paragraph("**foo**\\*")) - } - - @Test - fun `should parse spec sample 446 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo****") - - /* - * Expected HTML: - *foo***
- */ - parsed.assertEquals(paragraph("*foo*\\*\\*\\*")) - } - - @Test - fun `should parse spec sample 447 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo ___") - - /* - * Expected HTML: - *foo ___
- */ - parsed.assertEquals(paragraph("foo \\_\\_\\_")) - } - - @Test - fun `should parse spec sample 448 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo _\\__") - - /* - * Expected HTML: - *foo _
- */ - parsed.assertEquals(paragraph("foo _\\__")) - } - - @Test - fun `should parse spec sample 449 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo _*_") - - /* - * Expected HTML: - *foo *
- */ - parsed.assertEquals(paragraph("foo _\\*_")) - } - - @Test - fun `should parse spec sample 450 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo _____") - - /* - * Expected HTML: - *foo _____
- */ - parsed.assertEquals(paragraph("foo \\_\\_\\_\\_\\_")) - } - - @Test - fun `should parse spec sample 451 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo __\\___") - - /* - * Expected HTML: - *foo _
- */ - parsed.assertEquals(paragraph("foo __\\___")) - } - - @Test - fun `should parse spec sample 452 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("foo __*__") - - /* - * Expected HTML: - *foo *
- */ - parsed.assertEquals(paragraph("foo __\\*__")) - } - - @Test - fun `should parse spec sample 453 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo_") - - /* - * Expected HTML: - *_foo
- */ - parsed.assertEquals(paragraph("\\__foo_")) - } - - @Test - fun `should parse spec sample 454 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo__") - - /* - * Expected HTML: - *foo_
- */ - parsed.assertEquals(paragraph("_foo_\\_")) - } - - @Test - fun `should parse spec sample 455 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("___foo__") - - /* - * Expected HTML: - *_foo
- */ - parsed.assertEquals(paragraph("\\___foo__")) - } - - @Test - fun `should parse spec sample 456 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("____foo_") - - /* - * Expected HTML: - *___foo
- */ - parsed.assertEquals(paragraph("\\_\\_\\__foo_")) - } - - @Test - fun `should parse spec sample 457 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo___") - - /* - * Expected HTML: - *foo_
- */ - parsed.assertEquals(paragraph("__foo__\\_")) - } - - @Test - fun `should parse spec sample 458 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo____") - - /* - * Expected HTML: - *foo___
- */ - parsed.assertEquals(paragraph("_foo_\\_\\_\\_")) - } - - @Test - fun `should parse spec sample 459 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo**") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("**foo**")) - } - - @Test - fun `should parse spec sample 460 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*_foo_*") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("*_foo_*")) - } - - @Test - fun `should parse spec sample 460b correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*_foo *bar*_*") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("*_foo *bar*_*")) - } - - @Test - fun `should parse spec sample 460c correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo *bar***") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("**foo *bar***")) - } - - @Test - fun `should parse spec sample 460d correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*_foo *bar* a_*") - - /* - * Expected HTML: - *foo bar a
- */ - parsed.assertEquals(paragraph("*_foo *bar* a_*")) - } - - @Test - fun `should parse spec sample 460e correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo *bar* a**") - - /* - * Expected HTML: - *foo bar a
- */ - parsed.assertEquals(paragraph("**foo *bar* a**")) - } - - @Test - fun `should parse spec sample 460f correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*_*foo *bar* a*_*") - - /* - * Expected HTML: - *foo bar a
- */ - parsed.assertEquals(paragraph("*_*foo *bar* a*_*")) - } - - @Test - fun `should parse spec sample 461 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo__") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("__foo__")) - } - - @Test - fun `should parse spec sample 462 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_*foo*_") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("_*foo*_")) - } - - @Test - fun `should parse spec sample 462b correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_*foo _bar_*_") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("_*foo _bar_*_")) - } - - @Test - fun `should parse spec sample 462c correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo _bar___") - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("__foo _bar___")) - } - - @Test - fun `should parse spec sample 462d correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_*foo _bar_ a*_") - - /* - * Expected HTML: - *foo bar a
- */ - parsed.assertEquals(paragraph("_*foo _bar_ a*_")) - } - - @Test - fun `should parse spec sample 462e correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__foo _bar_ a__") - - /* - * Expected HTML: - *foo bar a
- */ - parsed.assertEquals(paragraph("__foo _bar_ a__")) - } - - @Test - fun `should parse spec sample 462f correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_*foo *bar* a*_") - - /* - * Expected HTML: - *foo bar a
- */ - parsed.assertEquals(paragraph("_*foo *bar* a*_")) - } - - @Test - fun `should parse spec sample 463 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("****foo****") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("****foo****")) - } - - @Test - fun `should parse spec sample 464 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("____foo____") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("____foo____")) - } - - @Test - fun `should parse spec sample 465 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("******foo******") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("******foo******")) - } - - @Test - fun `should parse spec sample 466 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("***foo***") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("***foo***")) - } - - @Test - fun `should parse spec sample 467 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_____foo_____") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("_____foo_____")) - } - - @Test - fun `should parse spec sample 468 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo _bar* baz_") - - /* - * Expected HTML: - *foo _bar baz_
- */ - parsed.assertEquals(paragraph("*foo \\_bar* baz\\_")) - } - - @Test - fun `should parse spec sample 469 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo __bar *baz bim__ bam*") - - /* - * Expected HTML: - *foo bar *baz bim bam
- */ - parsed.assertEquals(paragraph("*foo __bar \\*baz bim__ bam*")) - } - - @Test - fun `should parse spec sample 470 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**foo **bar baz**") - - /* - * Expected HTML: - ***foo bar baz
- */ - parsed.assertEquals(paragraph("\\*\\*foo **bar baz**")) - } - - @Test - fun `should parse spec sample 471 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*foo *bar baz*") - - /* - * Expected HTML: - **foo bar baz
- */ - parsed.assertEquals(paragraph("\\*foo *bar baz*")) - } - - @Test - fun `should parse spec sample 472 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*[bar*](/url)") - - /* - * Expected HTML: - **bar*
- */ - parsed.assertEquals(paragraph("\\*[bar\\*](/url)")) - } - - @Test - fun `should parse spec sample 473 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("_foo [bar_](/url)") - - /* - * Expected HTML: - *_foo bar_
- */ - parsed.assertEquals(paragraph("\\_foo [bar\\_](/url)")) - } - - @Test - fun `should parse spec sample 474 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*") - - /* - * Expected HTML: - **
- */ - parsed.assertEquals(paragraph("\\*")) - } - - @Test - fun `should parse spec sample 475 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("**") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("\\*\\*")) - } - - @Test - fun `should parse spec sample 476 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("__") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("\\_\\_")) - } - - @Test - fun `should parse spec sample 477 correctly (Emphasis and strong emphasis)`() { - val parsed = processor.processMarkdownDocument("*a `*`*") - - /* - * Expected HTML: - *a *
a _
[link](/my uri)
- */ - parsed.assertEquals(paragraph("\\[link\\]\\(/my uri\\)")) - } - - @Test - fun `should parse spec sample 488 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link]([link](foo - * bar)
- */ - parsed.assertEquals(paragraph("\\[link\\]\\(foo bar\\)")) - } - - @Test - fun `should parse spec sample 490 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[link]([link](
[link](<foo>)
- */ - parsed.assertEquals(paragraph("\\[link\\]\\(\\[a](<b)c - * [a](<b)c> - * [a](c)
- */ - parsed.assertEquals( - paragraph( - "\\[a\\]\\(\\ \\[a\\]\\(c\\)", - ), - ) - } - - @Test - fun `should parse spec sample 494 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link](\\(foo\\))") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link](\\(foo\\))")) - } - - @Test - fun `should parse spec sample 495 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link](foo(and(bar)))") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link](foo\\(and\\(bar\\)\\))")) - } - - @Test - fun `should parse spec sample 496 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link](foo(and(bar))") - - /* - * Expected HTML: - *[link](foo(and(bar))
- */ - parsed.assertEquals(paragraph("\\[link\\]\\(foo\\(and\\(bar\\)\\)")) - } - - @Test - fun `should parse spec sample 497 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link](foo\\(and\\(bar\\))") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link](foo\\(and\\(bar\\))")) - } - - @Test - fun `should parse spec sample 498 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link]([link](/url "title "and" title")
- */ - parsed.assertEquals(paragraph("\\[link\\]\\(/url \"title \"and\" title\"\\)")) - } - - @Test - fun `should parse spec sample 508 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link](/url 'title \"and\" title')") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link](/url \"title \\\"and\\\" title\")")) - } - - @Test - fun `should parse spec sample 509 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[link]( /uri - | "title" ) - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link](/uri \"title\")")) - } - - @Test - fun `should parse spec sample 510 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link] (/uri)") - - /* - * Expected HTML: - *[link] (/uri)
- */ - parsed.assertEquals(paragraph("\\[link\\] \\(/uri\\)")) - } - - @Test - fun `should parse spec sample 511 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link [foo [bar]]](/uri)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link \\[foo \\[bar\\]\\]](/uri)")) - } - - @Test - fun `should parse spec sample 512 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link] bar](/uri)") - - /* - * Expected HTML: - *[link] bar](/uri)
- */ - parsed.assertEquals(paragraph("\\[link\\] bar\\]\\(/uri\\)")) - } - - @Test - fun `should parse spec sample 513 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link [bar](/uri)") - - /* - * Expected HTML: - *[link bar
- */ - parsed.assertEquals(paragraph("\\[link [bar](/uri)")) - } - - @Test - fun `should parse spec sample 514 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link \\[bar](/uri)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link \\[bar](/uri)")) - } - - @Test - fun `should parse spec sample 515 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[link *foo **bar** `#`*](/uri)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link *foo **bar** `#`*](/uri)")) - } - - @Test - fun `should parse spec sample 516 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[![moon](moon.jpg)](/uri)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[![moon](moon.jpg)](/uri)")) - } - - @Test - fun `should parse spec sample 517 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[foo [bar](/uri)](/uri)") - - /* - * Expected HTML: - *[foo bar](/uri)
- */ - parsed.assertEquals(paragraph("\\[foo [bar](/uri)\\]\\(/uri\\)")) - } - - @Test - fun `should parse spec sample 518 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[foo *[bar [baz](/uri)](/uri)*](/uri)") - - /* - * Expected HTML: - *[foo [bar baz](/uri)](/uri)
- */ - parsed.assertEquals(paragraph("\\[foo *\\[bar [baz](/uri)\\]\\(/uri\\)*\\]\\(/uri\\)")) - } - - @Test - fun `should parse spec sample 519 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("![[[foo](uri1)](uri2)](uri3)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![\\[\"foo\" (uri1)\\]\\(uri2\\)](uri3)")) - } - - @Test - fun `should parse spec sample 520 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("*[foo*](/uri)") - - /* - * Expected HTML: - **foo*
- */ - parsed.assertEquals(paragraph("\\*[foo\\*](/uri)")) - } - - @Test - fun `should parse spec sample 521 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[foo *bar](baz*)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo \\*bar](baz*)")) - } - - @Test - fun `should parse spec sample 522 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("*foo [bar* baz]") - - /* - * Expected HTML: - *foo [bar baz]
- */ - parsed.assertEquals(paragraph("*foo \\[bar* baz\\]")) - } - - @Test - fun `should parse spec sample 523 correctly (Links)`() { - val parsed = processor.processMarkdownDocument("[foo[foo
[foo](/uri)
[foohttp://example.com/?search=](uri)
- */ - parsed.assertEquals( - paragraph( - "\\[foo[http://example.com/?search=\\]\\(uri\\)](http://example.com/?search=]\\(uri\\))", - ), - ) - } - - @Test - fun `should parse spec sample 526 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][bar] - | - |[bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 527 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[link [foo [bar]]][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link \\[foo \\[bar\\]\\]](/uri)")) - } - - @Test - fun `should parse spec sample 528 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[link \[bar][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link \\[bar](/uri)")) - } - - @Test - fun `should parse spec sample 529 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[link *foo **bar** `#`*][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[link *foo **bar** `#`*](/uri)")) - } - - @Test - fun `should parse spec sample 530 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[![moon](moon.jpg)][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[![moon](moon.jpg)](/uri)")) - } - - @Test - fun `should parse spec sample 531 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo [bar](/uri)][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("\\[foo [bar](/uri)\\][ref](/uri)")) - } - - @Test - fun `should parse spec sample 532 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo *bar [baz][ref]*][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("\\[foo *bar [baz](/uri)*\\][ref](/uri)")) - } - - @Test - fun `should parse spec sample 533 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |*[foo*][ref] - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - **foo*
- */ - parsed.assertEquals(paragraph("\\*[foo\\*](/uri)")) - } - - @Test - fun `should parse spec sample 534 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo *bar][ref]* - | - |[ref]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo \\*bar](/uri)\\*")) - } - - @Test - fun `should parse spec sample 535 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo[foo
[foo][ref]
[foohttp://example.com/?search=][ref]
- */ - parsed.assertEquals( - paragraph( - "\\[foo[http://example.com/?search=\\]\\[ref\\]](http://example.com/?search=][ref])", - ), - ) - } - - @Test - fun `should parse spec sample 538 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][BaR] - | - |[bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 539 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[ẞ] - | - |[SS]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[ẞ](/url)")) - } - - @Test - fun `should parse spec sample 540 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[Foo - | bar]: /url - | - |[Baz][Foo bar] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[Baz](/url)")) - } - - @Test - fun `should parse spec sample 541 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] [bar] - | - |[bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo] bar
- */ - parsed.assertEquals(paragraph("\\[foo\\] [bar](/url \"title\")")) - } - - @Test - fun `should parse spec sample 542 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] - |[bar] - | - |[bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo] - * bar
- */ - parsed.assertEquals(paragraph("\\[foo\\] [bar](/url \"title\")")) - } - - @Test - fun `should parse spec sample 543 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]: /url1 - | - |[foo]: /url2 - | - |[bar][foo] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[bar](/url1)")) - } - - @Test - fun `should parse spec sample 544 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[bar][foo\!] - | - |[foo!]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[bar][foo!]
- */ - parsed.assertEquals(paragraph("\\[bar\\]\\[foo\\!\\]")) - } - - @Test - fun `should parse spec sample 545 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][ref[] - | - |[ref[]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo][ref[]
- *[ref[]: /uri
- */ - parsed.assertEquals( - paragraph("\\[foo\\]\\[ref\\[\\]"), - paragraph("\\[ref\\[\\]: /uri"), - ) - } - - @Test - fun `should parse spec sample 546 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][ref[bar]] - | - |[ref[bar]]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo][ref[bar]]
- *[ref[bar]]: /uri
- */ - parsed.assertEquals( - paragraph("\\[foo\\]\\[ref\\[bar\\]\\]"), - paragraph("\\[ref\\[bar\\]\\]: /uri"), - ) - } - - @Test - fun `should parse spec sample 547 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[[[foo]]] - | - |[[[foo]]]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[[[foo]]]
- *[[[foo]]]: /url
- */ - parsed.assertEquals( - paragraph("\\[\\[\\[foo\\]\\]\\]"), - paragraph("\\[\\[\\[foo\\]\\]\\]: /url"), - ) - } - - @Test - fun `should parse spec sample 548 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][ref\[] - | - |[ref\[]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/uri)")) - } - - @Test - fun `should parse spec sample 549 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[bar\\]: /uri - | - |[bar\\] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[bar\\\\](/uri)")) - } - - @Test - fun `should parse spec sample 550 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[] - | - |[]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[]
- *[]: /uri
- */ - parsed.assertEquals( - paragraph("\\[\\]"), - paragraph("\\[\\]: /uri"), - ) - } - - @Test - fun `should parse spec sample 551 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[ - | ] - | - |[ - | ]: /uri - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[ - * ]
- *[ - * ]: /uri
- */ - parsed.assertEquals( - paragraph("\\[ \\]"), - paragraph("\\[ \\]: /uri"), - ) - } - - @Test - fun `should parse spec sample 552 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 553 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[*foo* bar][] - | - |[*foo* bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[*foo* bar](/url \"title\")")) - } - - @Test - fun `should parse spec sample 554 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[Foo][] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[Foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 555 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] - |[] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * []
- */ - parsed.assertEquals(paragraph("[foo](/url \"title\") \\[\\]")) - } - - @Test - fun `should parse spec sample 556 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 557 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[*foo* bar] - | - |[*foo* bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[*foo* bar](/url \"title\")")) - } - - @Test - fun `should parse spec sample 558 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[[*foo* bar]] - | - |[*foo* bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo bar]
- */ - parsed.assertEquals(paragraph("\\[[*foo* bar](/url \"title\")\\]")) - } - - @Test - fun `should parse spec sample 559 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[[bar [foo] - | - |[foo]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[[bar foo
- */ - parsed.assertEquals(paragraph("\\[\\[bar [foo](/url)")) - } - - @Test - fun `should parse spec sample 560 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[Foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[Foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 561 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo] bar - | - |[foo]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo bar
- */ - parsed.assertEquals(paragraph("[foo](/url) bar")) - } - - @Test - fun `should parse spec sample 562 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |\[foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo]
- */ - parsed.assertEquals(paragraph("\\[foo\\]")) - } - - @Test - fun `should parse spec sample 563 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo*]: /url - | - |*[foo*] - """ - .trimMargin(), - ) - - /* - * Expected HTML: - **foo*
- */ - parsed.assertEquals(paragraph("\\*[foo\\*](/url)")) - } - - @Test - fun `should parse spec sample 564 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][bar] - | - |[foo]: /url1 - |[bar]: /url2 - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url2)")) - } - - @Test - fun `should parse spec sample 565 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][] - | - |[foo]: /url1 - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url1)")) - } - - @Test - fun `should parse spec sample 566 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo]() - | - |[foo]: /url1 - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo]()")) - } - - @Test - fun `should parse spec sample 567 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo](not a link) - | - |[foo]: /url1 - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo(not a link)
- */ - parsed.assertEquals(paragraph("[foo](/url1)\\(not a link\\)")) - } - - @Test - fun `should parse spec sample 568 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][bar][baz] - | - |[baz]: /url - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo]bar
- */ - parsed.assertEquals(paragraph("\\[foo\\][bar](/url)")) - } - - @Test - fun `should parse spec sample 569 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][bar][baz] - | - |[baz]: /url1 - |[bar]: /url2 - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("[foo](/url2)[baz](/url1)")) - } - - @Test - fun `should parse spec sample 570 correctly (Links)`() { - val parsed = - processor.processMarkdownDocument( - """ - |[foo][bar][baz] - | - |[baz]: /url1 - |[foo]: /url2 - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *[foo]bar
- */ - parsed.assertEquals(paragraph("\\[foo\\][bar](/url1)")) - } - - @Test - fun `should parse spec sample 571 correctly (Images)`() { - val parsed = processor.processMarkdownDocument("![foo](/url \"title\")") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 572 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![foo *bar*] - | - |[foo *bar*]: train.jpg "train & tracks" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo *bar*](train.jpg \"train & tracks\")")) - } - - @Test - fun `should parse spec sample 573 correctly (Images)`() { - val parsed = processor.processMarkdownDocument("![foo ![bar](/url)](/url2)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo ![bar](/url)](/url2)")) - } - - @Test - fun `should parse spec sample 574 correctly (Images)`() { - val parsed = processor.processMarkdownDocument("![foo [bar](/url)](/url2)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo \"bar\" (/url)](/url2)")) - } - - @Test - fun `should parse spec sample 575 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![foo *bar*][] - | - |[foo *bar*]: train.jpg "train & tracks" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo *bar*](train.jpg \"train & tracks\")")) - } - - @Test - fun `should parse spec sample 576 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![foo *bar*][foobar] - | - |[FOOBAR]: train.jpg "train & tracks" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo *bar*](train.jpg \"train & tracks\")")) - } - - @Test - fun `should parse spec sample 577 correctly (Images)`() { - val parsed = processor.processMarkdownDocument("![foo](train.jpg)") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo](train.jpg)")) - } - - @Test - fun `should parse spec sample 578 correctly (Images)`() { - val parsed = processor.processMarkdownDocument("My ![foo bar](/path/to/train.jpg \"title\" )") - - /* - * Expected HTML: - *My
- */ - parsed.assertEquals(paragraph("My ![foo bar](/path/to/train.jpg \"title\")")) - } - - @Test - fun `should parse spec sample 579 correctly (Images)`() { - val parsed = processor.processMarkdownDocument("![foo](- * []
- */ - parsed.assertEquals(paragraph("![foo](/url \"title\") \\[\\]")) - } - - @Test - fun `should parse spec sample 587 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 588 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![*foo* bar] - | - |[*foo* bar]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![*foo* bar](/url \"title\")")) - } - - @Test - fun `should parse spec sample 589 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![[foo]] - | - |[[foo]]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *![[foo]]
- *[[foo]]: /url "title"
- */ - parsed.assertEquals( - paragraph("\\!\\[\\[foo\\]\\]"), - paragraph("\\[\\[foo\\]\\]: /url \"title\""), - ) - } - - @Test - fun `should parse spec sample 590 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |![Foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("![Foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 591 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |!\[foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *![foo]
- */ - parsed.assertEquals(paragraph("\\!\\[foo\\]")) - } - - @Test - fun `should parse spec sample 592 correctly (Images)`() { - val parsed = - processor.processMarkdownDocument( - """ - |\![foo] - | - |[foo]: /url "title" - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *!foo
- */ - parsed.assertEquals(paragraph("\\![foo](/url \"title\")")) - } - - @Test - fun `should parse spec sample 593 correctly (Autolinks)`() { - val parsed = processor.processMarkdownDocument("http://foo.bar.baz/test?q=hello&id=22&boolean
- */ - parsed.assertEquals( - paragraph( - "[http://foo.bar.baz/test?q=hello&id=22&boolean](http://foo.bar.baz/test?q=hello&id=22&boolean)", - ), - ) - } - - @Test - fun `should parse spec sample 595 correctly (Autolinks)`() { - val parsed = processor.processMarkdownDocument("<http://foo.bar/baz bim>
- */ - parsed.assertEquals(paragraph("\\<foo+@bar.example.com>
- */ - parsed.assertEquals(paragraph("\\<>
- */ - parsed.assertEquals(paragraph("\\<\\>")) - } - - @Test - fun `should parse spec sample 607 correctly (Autolinks)`() { - val parsed = processor.processMarkdownDocument("< http://foo.bar >") - - /* - * Expected HTML: - *< http://foo.bar >
- */ - parsed.assertEquals(paragraph("\\< http://foo.bar \\>")) - } - - @Test - fun `should parse spec sample 608 correctly (Autolinks)`() { - val parsed = processor.processMarkdownDocument("<m:abc>
- */ - parsed.assertEquals(paragraph("\\<foo.bar.baz>
- */ - parsed.assertEquals(paragraph("\\http://example.com
- */ - parsed.assertEquals(paragraph("http://example.com")) - } - - @Test - fun `should parse spec sample 611 correctly (Autolinks)`() { - val parsed = processor.processMarkdownDocument("foo@bar.example.com") - - /* - * Expected HTML: - *foo@bar.example.com
- */ - parsed.assertEquals(paragraph("foo@bar.example.com")) - } - - @Test - fun `should parse spec sample 612 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("Foo
<33> <__>
- */ - parsed.assertEquals(paragraph("\\<33\\> \\<\\_\\_\\>")) - } - - @Test - fun `should parse spec sample 618 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("") - - /* - * Expected HTML: - *<a h*#ref="hi">
- */ - parsed.assertEquals(paragraph("\\")) - } - - @Test - fun `should parse spec sample 619 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument(" ") - - /* - * Expected HTML: - *<a href="hi'> <a href=hi'>
- */ - parsed.assertEquals(paragraph("\\ \\")) - } - - @Test - fun `should parse spec sample 620 correctly (Raw HTML)`() { - val parsed = - processor.processMarkdownDocument( - """ - |< a>< - |foo>< a>< - * foo><bar/ > - * <foo bar=baz - * bim!bop />
- */ - parsed.assertEquals( - paragraph( - "\\< a\\>\\< foo\\>\\<a href='bar'title=title>
- */ - parsed.assertEquals(paragraph("\\")) - } - - @Test - fun `should parse spec sample 622 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("</a href="foo">
- */ - parsed.assertEquals(paragraph("\\")) - } - - @Test - fun `should parse spec sample 624 correctly (Raw HTML)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo ")) - } - - @Test - fun `should parse spec sample 625 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("foo ") - - /* - * Expected HTML: - *
foo <!-- not a comment -- two hyphens -->
- */ - parsed.assertEquals(paragraph("foo \\<\\!-- not a comment -- two hyphens --\\>")) - } - - @Test - fun `should parse spec sample 626 correctly (Raw HTML)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo foo --> - | - |foo - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo <!--> foo -->
- *foo <!-- foo--->
- */ - parsed.assertEquals( - paragraph("foo \\<\\!--\\> foo --\\>"), - paragraph("foo \\<\\!-- foo---\\>"), - ) - } - - @Test - fun `should parse spec sample 627 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("foo ") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("foo ")) - } - - @Test - fun `should parse spec sample 628 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("foo ") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("foo ")) - } - - @Test - fun `should parse spec sample 629 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("foo &<]]>") - - /* - * Expected HTML: - *foo &<]]>
- */ - parsed.assertEquals(paragraph("foo &<]]>")) - } - - @Test - fun `should parse spec sample 630 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("foo ") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("foo ")) - } - - @Test - fun `should parse spec sample 631 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("foo ") - - /* - * Expected HTML: - * - */ - parsed.assertEquals(paragraph("foo ")) - } - - @Test - fun `should parse spec sample 632 correctly (Raw HTML)`() { - val parsed = processor.processMarkdownDocument("") - - /* - * Expected HTML: - *<a href=""">
- */ - parsed.assertEquals(paragraph("\\")) - } - - @Test - fun `should parse spec sample 633 correctly (Hard line breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo - |baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo
- * baz
foo
- * baz
foo
- * baz
foo
- * bar
foo
- * bar
foo
- * bar
foo
- * bar
code span
code\ span
foo\
- */ - parsed.assertEquals(paragraph("foo\\")) - } - - @Test - fun `should parse spec sample 645 correctly (Hard line breaks)`() { - val parsed = processor.processMarkdownDocument("foo ") - - /* - * Expected HTML: - *foo
- */ - parsed.assertEquals(paragraph("foo")) - } - - @Test - fun `should parse spec sample 646 correctly (Hard line breaks)`() { - val parsed = processor.processMarkdownDocument("### foo\\") - - /* - * Expected HTML: - *foo - * baz
- */ - parsed.assertEquals(paragraph("foo baz")) - } - - @Test - fun `should parse spec sample 649 correctly (Soft line breaks)`() { - val parsed = - processor.processMarkdownDocument( - """ - |foo - | baz - """ - .trimMargin(), - ) - - /* - * Expected HTML: - *foo - * baz
- */ - parsed.assertEquals(paragraph("foo baz")) - } - - @Test - fun `should parse spec sample 650 correctly (Textual content)`() { - val parsed = processor.processMarkdownDocument("hello $.;'there") - - /* - * Expected HTML: - *hello $.;'there
- */ - parsed.assertEquals(paragraph("hello \$.;'there")) - } - - @Test - fun `should parse spec sample 651 correctly (Textual content)`() { - val parsed = processor.processMarkdownDocument("Foo χρῆν") - - /* - * Expected HTML: - *Foo χρῆν
- */ - parsed.assertEquals(paragraph("Foo χρῆν")) - } - - @Test - fun `should parse spec sample 652 correctly (Textual content)`() { - val parsed = processor.processMarkdownDocument("Multiple spaces") - - /* - * Expected HTML: - *Multiple spaces
- */ - parsed.assertEquals(paragraph("Multiple spaces")) - } -} diff --git a/markdown/core/src/test/kotlin/org/jetbrains/jewel/markdown/TestUtils.kt b/markdown/core/src/test/kotlin/org/jetbrains/jewel/markdown/TestUtils.kt deleted file mode 100644 index 2827bcbd8..000000000 --- a/markdown/core/src/test/kotlin/org/jetbrains/jewel/markdown/TestUtils.kt +++ /dev/null @@ -1,243 +0,0 @@ -package org.jetbrains.jewel.markdown - -import org.intellij.lang.annotations.Language -import org.jetbrains.jewel.markdown.MarkdownBlock.BlockQuote -import org.jetbrains.jewel.markdown.MarkdownBlock.CodeBlock -import org.jetbrains.jewel.markdown.MarkdownBlock.CodeBlock.FencedCodeBlock -import org.jetbrains.jewel.markdown.MarkdownBlock.CodeBlock.IndentedCodeBlock -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading.H1 -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading.H2 -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading.H3 -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading.H4 -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading.H5 -import org.jetbrains.jewel.markdown.MarkdownBlock.Heading.H6 -import org.jetbrains.jewel.markdown.MarkdownBlock.HtmlBlock -import org.jetbrains.jewel.markdown.MarkdownBlock.Image -import org.jetbrains.jewel.markdown.MarkdownBlock.ListBlock -import org.jetbrains.jewel.markdown.MarkdownBlock.ListBlock.OrderedList -import org.jetbrains.jewel.markdown.MarkdownBlock.ListBlock.UnorderedList -import org.jetbrains.jewel.markdown.MarkdownBlock.ListItem -import org.jetbrains.jewel.markdown.MarkdownBlock.Paragraph -import org.jetbrains.jewel.markdown.MarkdownBlock.ThematicBreak -import org.junit.Assert - -fun List