@@ -86,7 +86,7 @@ The following options are available on the `markdown.markdown` function:
86
86
87
87
If an extension name is provided as a string, the extension must be
88
88
importable as a python module on your PYTHONPATH. Python's dot notation is
89
- supported . Therefore, to import the 'extra' extension, one could do
89
+ required . Therefore, to import the 'extra' extension, one could do
90
90
`extensions=['markdown.extensions.extra']`
91
91
92
92
Additionally, a Class may be specified in the name. The class must be at the end of
@@ -102,7 +102,7 @@ The following options are available on the `markdown.markdown` function:
102
102
103
103
!!! note
104
104
You should only need to specify the class name if more than one extension
105
- is defined within the same module. The extensions that come with
105
+ is defined within the same module. The extensions that come with
106
106
Python-Markdown do *not* need to have the class name specified. However,
107
107
doing so will not effect the behavior of the parser.
108
108
@@ -163,61 +163,6 @@ The following options are available on the `markdown.markdown` function:
163
163
`"html4"`) be used as the more general formats (`"xhtml"` or `"html"`) may
164
164
change in the future if it makes sense at that time.
165
165
166
- * __`safe_mode`__{: #safe_mode }: Disallow raw HTML.
167
-
168
- !!! warning
169
- "`safe_mode`" is deprecated and should not be used.
170
-
171
- HTML sanitizers (like [Bleach]) provide a better solution for
172
- dealing with markdown text submitted by untrusted users.
173
-
174
- import markdown
175
- import bleach
176
- html = bleach.clean(markdown.markdown(untrusted_text))
177
-
178
- See the [release notes] for more info.
179
-
180
- [Bleach]: https://github.com/jsocol/bleach
181
- [release notes]: release-2.6.html
182
-
183
- The following values are accepted:
184
-
185
- * `False` (Default): Raw HTML is passed through unaltered.
186
-
187
- * `replace`: Replace all HTML blocks with the text assigned to
188
- `html_replacement_text` To maintain backward compatibility, setting
189
- `safe_mode=True` will have the same effect as `safe_mode='replace'`.
190
-
191
- To replace raw HTML with something other than the default, do:
192
-
193
- md = markdown.Markdown(safe_mode='replace',
194
- html_replacement_text='--RAW HTML NOT ALLOWED--')
195
-
196
- * `remove`: All raw HTML will be completely stripped from the text with
197
- no warning to the author.
198
-
199
- * `escape`: All raw HTML will be escaped and included in the document.
200
-
201
- For example, the following source:
202
-
203
- Foo <b>bar</b>.
204
-
205
- Will result in the following HTML:
206
-
207
- <p>Foo <b>bar</b>.</p>
208
-
209
- !!! Note
210
- "safe_mode" also alters the default value for the
211
- [`enable_attributes`](#enable_attributes) option.
212
-
213
-
214
- * __`html_replacement_text`__{: #html_replacement_text }: Text used when
215
- safe_mode is set to `replace`. Defaults to `[HTML_REMOVED]`.
216
-
217
- !!! warning
218
- "`html_replacement_text`" is deprecated and should not be used.
219
- See the [release notes] for more info.
220
-
221
166
* __`tab_length`__{: #tab_length }: Length of tabs in the source. Default: 4
222
167
223
168
* __`enable_attributes`__{: #enable_attributes}: Enable the conversion of
0 commit comments