Work in extended mode (default).

Behavior changes when using extended mode:

  • Lists and code blocks end a paragraph

    In normal markdown the following:

This is a paragraph
* and this is not a list

Will produce:

<p>This is a paragraph
* and this is not a list</p>

When using extended mode this changes to:

<p>This is a paragraph</p>
<ul>
<li>and this is not a list</li>
</ul>
  • Fences code blocks

    If you don't want to indent your all your code with 4 spaces, you can wrap your code in ``` or ~~~.

    Here's an example:

fun test do
   print "Hello World!"
end
  • Code blocks meta

    If you want to use syntax highlighting tools, most of them need to know what kind of language they are highlighting. You can add an optional language identifier after the fence declaration to output it in the HTML render.

import markdown

print "# Hello World!".md_to_html

Becomes

<pre class="nit"><code>import markdown

print "Hello World!".md_to_html
</code></pre>
  • Underscores (Emphasis)

    Underscores in the middle of a word like:

Con_cat_this

normally produces this:

<p>Con<em>cat</em>this</p>

With extended mode they don't result in emphasis.

<p>Con_cat_this</p>
  • Strikethrough

    Like in GFM, strikethrought span is marked with ~~.

~~Mistaken text.~~

becomes

<del>Mistaken text.</del>

Property definitions

markdown $ MarkdownProcessor :: ext_mode=
	# Work in extended mode (default).
	#
	# Behavior changes when using extended mode:
	#
	# * Lists and code blocks end a paragraph
	#
	#   In normal markdown the following:
	#
	# ~~~md
	# This is a paragraph
	# * and this is not a list
	# ~~~
	#
	#   Will produce:
	#
	# ~~~html
	# <p>This is a paragraph
	# * and this is not a list</p>
	# ~~~
	#
	#   When using extended mode this changes to:
	#
	# ~~~html
	# <p>This is a paragraph</p>
	# <ul>
	# <li>and this is not a list</li>
	# </ul>
	# ~~~
	#
	# * Fences code blocks
	#
	#   If you don't want to indent your all your code with 4 spaces,
	#   you can wrap your code in ``` ``` ``` or `~~~`.
	#
	#   Here's an example:
	#
	# ~~~md
	# fun test do
	#    print "Hello World!"
	# end
	# ~~~
	#
	# * Code blocks meta
	#
	#   If you want to use syntax highlighting tools, most of them need to know what kind
	#   of language they are highlighting.
	#   You can add an optional language identifier after the fence declaration to output
	#   it in the HTML render.
	#
	# ```nit
	# import markdown
	#
	# print "# Hello World!".md_to_html
	# ```
	#
	#   Becomes
	#
	# ~~~html
	# <pre class="nit"><code>import markdown
	#
	# print "Hello World!".md_to_html
	# </code></pre>
	# ~~~
	#
	# * Underscores (Emphasis)
	#
	#   Underscores in the middle of a word like:
	#
	# ~~~md
	# Con_cat_this
	# ~~~
	#
	#   normally produces this:
	#
	# ~~~html
	# <p>Con<em>cat</em>this</p>
	# ~~~
	#
	#   With extended mode they don't result in emphasis.
	#
	# ~~~html
	# <p>Con_cat_this</p>
	# ~~~
	#
	# * Strikethrough
	#
	#   Like in [GFM](https://help.github.com/articles/github-flavored-markdown),
	#   strikethrought span is marked with `~~`.
	#
	# ~~~md
	# ~~Mistaken text.~~
	# ~~~
	#
	#   becomes
	#
	# ~~~html
	# <del>Mistaken text.</del>
	# ~~~
	var ext_mode = true
lib/markdown/markdown.nit:33,2--131,20