quotes(default: `false`) + * `:superscript` - Parse super^script (default: `false`) + * `:math` - Parse TeX $$math$$ syntax, Kramdown style (default: `false`) + * `:no_intra_emphasis` - Disable emphasis_between_words (default: `false`) + * `:space_headers` - Require a space after '#' in headers (default: `false`) + * `:math_explicit` - Instead of guessing by context, parse $inline math$ and $$always block math$$ (requires `math: true`) (default: `false`) + * `:disable_indented_code` - Don't parse indented code blocks (default: `false`) + * `:skip_html` - Strip all HTML tags (default: `false`) + * `:escape` - Escape all HTML (default: `false`) + * `:hard_wrap` - Render each linebreak as
/
end
+
+ test :strikethrough do
+ markdown = "~~strike~~"
+ html = Markdown.to_html(markdown, strikethrough: true)
+ assert html == "strike
\n"
+ end
+
+ test :underline do
+ markdown = "_underline_"
+ html = Markdown.to_html(markdown, underline: true)
+ assert html == "underline
\n"
+ end
+
+ test :highlight do
+ markdown = "==highlight=="
+ html = Markdown.to_html(markdown, highlight: true)
+ assert html == "highlight
\n"
+ end
+
+ test :quote do
+ markdown = "\"quotes\""
+ html = Markdown.to_html(markdown, quote: true)
+ assert html == "quotes
\n"
+ end
+
+ test :superscript do
+ markdown = "super^script"
+ html = Markdown.to_html(markdown, superscript: true)
+ assert html == "superscript
\n"
+ end
+
+ test :math do
+ markdown = "Euler's formula is remarkable: $$e^{i\\pi} + 1 = 0$$"
+ html = Markdown.to_html(markdown, math: true)
+ assert html == "Euler's formula is remarkable: \\(e^{i\\pi} + 1 = 0\\)
\n"
+ end
+
+ test :no_intra_emphasis do
+ markdown = "Disable emphasis_between_words"
+ html = Markdown.to_html(markdown, no_intra_emphasis: true)
+ assert html == "Disable emphasis_between_words
\n"
+ end
+
+ test :space_headers do
+ markdown = """
+ #Not a headline
+ """
+
+ html = Markdown.to_html(markdown, space_headers: true)
+ assert html == "#Not a headline
\n"
+ end
+
+ test :math_explicit do
+ markdown = """
+ Euler's formula is remarkable: $$e^{i\\pi} + 1 = 0$$
+ """
+
+ html = Markdown.to_html(markdown, math: true, math_explicit: true)
+ assert html == "Euler's formula is remarkable: \\[e^{i\\pi} + 1 = 0\\]
\n"
+ end
+
+ test :disable_indented_code do
+ markdown = """
+ msg = "Not rendered as code block"
+ """
+
+ html = Markdown.to_html(markdown, disable_indented_code: true)
+ assert html == "msg = "Not rendered as code block"
\n"
+ end
+
+ test :skip_html do
+ markdown = "Some html"
+
+ html = Markdown.to_html(markdown, skip_html: true)
+ assert html == "Some html
\n"
+ end
+
+ test :escape_html do
+ markdown = "Some html"
+
+ html = Markdown.to_html(markdown, escape: true)
+ assert html == "Some <b>html</b>
\n"
+ end
+
+ test :hard_wraps do
+ markdown = """
+ Hard wraps
+ between lines
+ """
+
+ html = Markdown.to_html(markdown, hard_wrap: true)
+ assert html == "Hard wraps
\nbetween lines
\n"
+ end
+
+ test :use_xhtml do
+ markdown = """
+ Emit tags
+
+ ---
+
+ compatible with XHTML
+ """
+
+ html = Markdown.to_html(markdown, use_xhtml: true)
+ assert html == "Emit tags
\n\n
\n\ncompatible with XHTML
\n"
+ end
end