Blog »

OborWiki feature update: Markdown parser options

January 08, 2018, at 04:47 PM by Obormot in Features, Updates (0 comments)

The Markdown recipe installed on OborWiki1 has been updated; it now allows you to set parser options via the (:markdown:) directive.

Available parser options are all of the configuration options listed on the PHP Markdown reference page, plus two additional options:

extra
Enable Markdown Extra. Can be 1 or 0 (default).
classic
Use the classic version of the PHP Markdown library. Can be 1 or 0 (default).

Selected parser options are demonstrated below. (For complete info on all options, go to the PHP Markdown reference page.)

Contents

The first of each pair of examples is always the default setting.

tab_width

(:markdown tab_width=4 :)
 	foo
		bar
(:markdownend:)
foo
    bar
(:markdown tab_width=8 :)
 	foo
		bar
(:markdownend:)
foo
        bar

hard_wrap

(:markdown hard_wrap=0 :)
foo
bar
(:markdownend:)

foo bar

(:markdown hard_wrap=1 :)
foo
bar
(:markdownend:)

foo
bar

no_markup

(:markdown no_markup=0 :)
<strong>Bold text</strong>
(:markdownend:)

Bold text

(:markdown no_markup=1 :)
<strong>Bold text</strong>
(:markdownend:)

<strong>Bold text</strong>

no_entities

(:markdown no_entities=0 :)
The HTML code for an em-dash is &mdash;
(:markdownend:)

The HTML code for an em-dash is —

(:markdown no_entities=1 :)
The HTML code for an em-dash is &mdash;
(:markdownend:)

The HTML code for an em-dash is &mdash;

1 Off by default; you can enable it via the Configurator.

Leave a reply
Your name (required):

Your comment (required):


Enter value: Captcha