Skip to content

Commit bebb9b6

Browse files
committed
Clean up a few typos and formatting issues.
1 parent 9eb5706 commit bebb9b6

File tree

2 files changed

+51
-55
lines changed

2 files changed

+51
-55
lines changed

docs/extensions/toc.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@ The following options are provided to configure the output:
9090
Set to `True` or a string to generate permanent links at the end of each header.
9191
Useful with Sphinx stylesheets.
9292

93-
When set to `True` the paragraph symbol (¶ -- `¶`) is used as the link
93+
When set to `True` the paragraph symbol (¶ or "`¶`") is used as the link
9494
text. When set to a string, the provided string is used as the link text.
9595

9696
* **`baselevel`**:
97-
Base level for headers.
98-
99-
Default: `1`
97+
Base level for headers. Defaults to `1`.
10098

10199
The `baselevel` setting allows the header levels to be automatically adjusted to
102100
fit within the hierarchy of your html templates. For example, suppose the
@@ -106,7 +104,7 @@ The following options are provided to configure the output:
106104
>>> text = '''
107105
... #Some Header
108106
... ## Next Level'''
109-
>>> from markdown.extensions.toc import TocExtension
107+
>>> from markdown.extensions.toc import TocExtension
110108
>>> html = markdown.markdown(text, extensions=[TocExtension(baselevel=3)])
111109
>>> print html
112110
<h3 id="some_header">Some Header</h3>
@@ -126,6 +124,4 @@ The following options are provided to configure the output:
126124
The callable must return a string appropriate for use in HTML `id` attributes.
127125

128126
* **`separator`**:
129-
Word separator. Character which replaces whitespace in id.
130-
131-
Default: `-`
127+
Word separator. Character which replaces whitespace in id. Defaults to "`-`".

docs/release-2.6.txt

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,58 @@ Python-Markdown version 2.6 supports Python versions 2.7, 3.2, 3.3, and 3.4.
1515
Backwards-incompatible Changes
1616
------------------------------
1717

18-
* Both `safe_mode` and the associated `html_replacement_text` keywords are deprecated
19-
in version 2.6 and will raise a **`DeprecationWarning`**. The `safe_mode` and
20-
`html_replacement_text` keywords will be ignored in version 2.7. The so-called
21-
"safe mode" was never actually "safe" which has resulted in many people having a false
22-
sense of security when using it. As an alternative, the developers of Python-Markdown
23-
recommend that any untrusted content be passed through an HTML sanitizer (like [Bleach])
24-
after being converted to HTML by markdown.
18+
* Both `safe_mode` and the associated `html_replacement_text` keywords are deprecated
19+
in version 2.6 and will raise a **`DeprecationWarning`**. The `safe_mode` and
20+
`html_replacement_text` keywords will be ignored in version 2.7. The so-called
21+
"safe mode" was never actually "safe" which has resulted in many people having a false
22+
sense of security when using it. As an alternative, the developers of Python-Markdown
23+
recommend that any untrusted content be passed through an HTML sanitizer (like [Bleach])
24+
after being converted to HTML by markdown.
2525

2626
If your code previously looked like this:
2727

28-
html = markdown.markdown(text, safe_mode=True)
28+
html = markdown.markdown(text, safe_mode=True)
2929

30-
Then it is recommended that you change your code to read something like this:
30+
Then it is recommended that you change your code to read something like this:
3131

32-
import bleach
32+
import bleach
3333
html = bleach.clean(markdown.markdown(text))
3434

35-
If you are not interested in sanitizing untrusted text, but simply desire to escape
36-
raw HTML, then that can be accomplished through an extension which removes HTML parsing:
35+
If you are not interested in sanitizing untrusted text, but simply desire to escape
36+
raw HTML, then that can be accomplished through an extension which removes HTML parsing:
3737

38-
from markdown.extensions import Extension
38+
from markdown.extensions import Extension
3939

40-
class EscapeHtml(Extension):
41-
def extendMarkdown(self, md, md_globals):
42-
del md.preprocessors['html_block']
43-
del md.inlinePatterns['html']
40+
class EscapeHtml(Extension):
41+
def extendMarkdown(self, md, md_globals):
42+
del md.preprocessors['html_block']
43+
del md.inlinePatterns['html']
4444

45-
html = markdown.markdown(text, extensions=[EscapeHtml()])
45+
html = markdown.markdown(text, extensions=[EscapeHtml()])
4646

47-
As the HTML would not be parsed with the above Extension, then the searializer will
48-
escape the raw HTML, which is exactly what happens now when `safe_mode="escape"`.
47+
As the HTML would not be parsed with the above Extension, then the searializer will
48+
escape the raw HTML, which is exactly what happens now when `safe_mode="escape"`.
4949

5050
[Bleach]: http://bleach.readthedocs.org/
5151

52-
* Positional arguments on the `markdown.Markdown()` are deprecated as are
53-
all except the `text` argument on the `markdown.markdown()` wrapper function.
54-
Using positional argument will raise a **`DeprecationWarning`** in 2.6 and an error
55-
in version 2.7. Only keyword arguments should be used. For example, if your code
56-
previosuly looked like this:
52+
* Positional arguments on the `markdown.Markdown()` class are deprecated as are
53+
all except the `text` argument on the `markdown.markdown()` wrapper function.
54+
Using positional arguments will raise a **`DeprecationWarning`** in 2.6 and an error
55+
in version 2.7. Only keyword arguments should be used. For example, if your code
56+
previosuly looked like this:
5757

58-
html = markdown.markdown(text, ['extra'])
58+
html = markdown.markdown(text, [SomeExtension()])
5959

60-
Then it is recommended that you change it to read something like this:
60+
Then it is recommended that you change it to read something like this:
6161

62-
html = markdown.markdown(text, extensions=['extra'])
62+
html = markdown.markdown(text, extensions=[SomeExtension()])
6363

64-
!!! Note
65-
This change is being made as a result of deprecating `"safe_mode"` as the
66-
`safe_mode` argumnet was one of the positional arguments. When that argument
67-
is removed, the two arguments following it will no longer be at the correct
68-
position. It is recomended that you always use keywords when they are supported
69-
for this reason.
64+
!!! Note
65+
This change is being made as a result of deprecating `"safe_mode"` as the
66+
`safe_mode` argument was one of the positional arguments. When that argument
67+
is removed, the two arguments following it will no longer be at the correct
68+
position. It is recomended that you always use keywords when they are supported
69+
for this reason.
7070

7171
* In previous versions of Python-Markdown, the builtin extensions received
7272
special status and did not require the full path to be provided. Additionaly,
@@ -80,7 +80,7 @@ Backwards-incompatible Changes
8080

8181
You should change your code to the following:
8282

83-
markdown.markdown(text, extensions=['markdown.extensions.extra'])
83+
markdown.markdown(text, extensions=['markdown.extensions.extra'])
8484

8585
The same applies to the command line:
8686

@@ -89,12 +89,12 @@ Backwards-incompatible Changes
8989
See the [documentation](reference.html#extensions) for a full explaination
9090
of the current behavior.
9191

92-
* The previously documented method of appending the extension configs as
93-
a string to the extension name is deprecated and will raise a
94-
**`DeprecationWarning`** in version 2.6 and an error in 2.7.
95-
The [extension_configs](reference.html#extension_configs) keyword should
96-
be used instead. See the [documentation](reference.html#extension-configs)
97-
for a full explaination of the current behavior.
92+
* The previously documented method of appending the extension configs as
93+
a string to the extension name is deprecated and will raise a
94+
**`DeprecationWarning`** in version 2.6 and an error in 2.7.
95+
The [extension_configs](reference.html#extension_configs) keyword should
96+
be used instead. See the [documentation](reference.html#extension-configs)
97+
for a full explaination of the current behavior.
9898

9999
* The [HeaderId][hid] Extension is pending deprecation and will raise a
100100
**`PendingDeprecationWarning`** in version 2.6. The extension will be
@@ -107,7 +107,7 @@ Backwards-incompatible Changes
107107
defined in the Table of Contents extension and should adjust their import
108108
statements accordingly (`from markdown.extensions.toc import slugify, unique`).
109109

110-
[hid]: extensions/headerid.html
110+
[hid]: extensions/header_id.html
111111

112112
What's New in Python-Markdown 2.6
113113
---------------------------------
@@ -129,16 +129,16 @@ What's New in Python-Markdown 2.6
129129

130130
* The extension now assigns the Table of Contents to the `toc` attribute of
131131
the Markdown class regardless of whether a "marker" was found in the document.
132-
Third party frameworks no longer need to insert a "marker," run the document
133-
through Markdown, then extract the TOC from the document.
132+
Third party frameworks no longer need to insert a "marker," run the document
133+
through Markdown, then extract the TOC from the document.
134134

135135
* The TOC Extension is now a "registered extension." Therefore, when the `reset`
136136
method of the Markdown class is called, the `toc` attribute on the Markdown
137-
class is cleared (set to an empty string).
137+
class is cleared (set to an empty string).
138138

139139
* When the `marker` config option is set to an empty string, the parser completely
140140
skips the process of searching the document for markers. This should save parsing
141-
time when the TOC Extension is being used only to assign ids to headers.
141+
time when the TOC Extension is being used only to assign ids to headers.
142142

143143
* A `separator` config option has been added allowing users to override the
144144
separator character used by the slugify function.
@@ -153,7 +153,7 @@ What's New in Python-Markdown 2.6
153153
will not directly effect end users, the code is being better tested which will
154154
benefit everyone.
155155

156-
[fake8]: http://flake8.readthedocs.org/en/latest/
156+
[flake8]: http://flake8.readthedocs.org/en/latest/
157157

158158
* Various bug fixes have been made. See the
159159
[commit log](https://github.com/waylan/Python-Markdown/commits/master)

0 commit comments

Comments
 (0)