trentm/python-markdown2

[Documentation] - Extra Line Break Documentation weirdness

nv1t opened this issue · 1 comments

nv1t commented

The Documentation for the extra "Line breaks" states the usage as

markdown2.markdown(your_text, extras={'breaks': {'on_newline': True, 'on_backslash': True}})

That is the only place in the documentation where "extras" argument is a dictionary. This is not clear on what to do here?

The extras kwarg format is a mapping of extra names to configuration values, as seen in the example above. It can also be supplied as a list of extra names, which is sufficient in most examples.

# this example is valid
markdown2.markdown(text, extras=['fenced-code-blocks', 'breaks'])
# this is equivalent to the above example and is what is used generated inside the Markdown class
markdown2.markdown(text, extras={'fenced-code-blocks': None, 'breaks': None})
# this version supplies additional configuration to the `breaks` extra
markdown2.markdown(text, extras={'breaks': {'on_newline': True, 'on_backslash': True}})

The Extras wiki page has a section on this as well