diff options
author | Waylan Limberg <waylan@gmail.com> | 2010-07-12 16:04:46 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2010-07-12 16:04:46 -0400 |
commit | ddc27d5f2479f16c1d84f3fb6107c6bd3acb2122 (patch) | |
tree | 18ba20a841df44ecb4d32b3558dc678206cd3d72 /docs/using_as_module.txt | |
parent | a4229ae1cd9370903f5795b9980d3c95cbe05283 (diff) | |
download | markdown-ddc27d5f2479f16c1d84f3fb6107c6bd3acb2122.tar.gz markdown-ddc27d5f2479f16c1d84f3fb6107c6bd3acb2122.tar.bz2 markdown-ddc27d5f2479f16c1d84f3fb6107c6bd3acb2122.zip |
Updated docs for recent changes to options accepted by the Markdown class and the import paths of various things used by extensions.
Diffstat (limited to 'docs/using_as_module.txt')
-rw-r--r-- | docs/using_as_module.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/using_as_module.txt b/docs/using_as_module.txt index 130d0a7..9031c4e 100644 --- a/docs/using_as_module.txt +++ b/docs/using_as_module.txt @@ -39,8 +39,12 @@ class yourself and then use ``convert()`` to generate HTML: md = markdown.Markdown( extensions=['footnotes'], extension_configs= {'footnotes' : ('PLACE_MARKER','~~~~~~~~')}, - safe_mode=True, - output_format='html4' + output_format='html4', + safe_mode="replace", + html_replacement_text="--NO HTML ALLOWED--", + tab_length=8, + enable_attributes=False, + smart_emphasis=False, ) return md.convert(some_text) @@ -106,15 +110,11 @@ still create links using Markdown syntax.) * To replace HTML, set ``safe_mode="replace"`` (``safe_mode=True`` still works for backward compatibility with older versions). The HTML will be replaced - with the text defined in ``markdown.HTML_REMOVED_TEXT`` which defaults to + with the text assigned to ``html_replacement_text`` which defaults to ``[HTML_REMOVED]``. To replace the HTML with something else: - markdown.HTML_REMOVED_TEXT = "--RAW HTML IS NOT ALLOWED--" - md = markdown.Markdown(safe_mode="replace") - - **Note**: You could edit the value of ``HTML_REMOVED_TEXT`` directly in - markdown/__init__.py but you will need to remember to do so every time you - upgrade to a newer version of Markdown. Therefore, this is not recommended. + md = markdown.Markdown(safe_mode="replace", + html_replacement_text="--RAW HTML NOT ALLOWED--") * To remove HTML, set ``safe_mode="remove"``. Any raw HTML will be completely stripped from the text with no warning to the author. |