7
7
8
8
## Backwards-incompatible changes
9
9
10
- ### The ` table ` extension now uses a ` style ` attribute instead of ` align ` attribute for alignment.
10
+ ### The ` tables ` extension now uses a ` style ` attribute instead of an ` align ` attribute for alignment.
11
11
12
- The [ HTML4 spec] [ spec4 ] specifically
13
- deprecates the use of the ` align ` attribute and it does not appear at all in the
14
- [ HTML5 spec ] [ spec5 ] . Therefore, by default, the [ table ] extension will now use the ` style `
15
- attribute (setting just the ` text-align ` property) in ` td ` and ` th ` blocks.
12
+ The [ HTML4 spec] [ spec4 ] specifically deprecates the use of the ` align ` attribute
13
+ and it does not appear at all in the [ HTML5 spec ] [ spec5 ] . Therefore, by default,
14
+ the [ tables ] extension will now use the ` style ` attribute (setting just the
15
+ ` text-align ` property) in ` td ` and ` th ` blocks.
16
16
17
17
[ spec4 ] : https://www.w3.org/TR/html4/present/graphics.html#h-15.1.2
18
18
[ spec5 ] : https://www.w3.org/TR/html53/tabular-data.html#attributes-common-to-td-and-th-elements
19
+ [ tables ] : ../extensions/tables.md
19
20
20
- The former behavior is available by setting the setting ` use_align_attribute ` configuration
21
- option to ` True ` when adding the extension.
21
+ The former behavior is available by setting the ` use_align_attribute `
22
+ configuration option to ` True ` when enabling the extension.
22
23
23
24
For example, to configure the old ` align ` behavior:
24
25
@@ -28,12 +29,11 @@ from markdown.extensions.tables import TableExtension
28
29
markdown.markdown(src, extensions = [TableExtension(use_align_attribute = True )])
29
30
```
30
31
31
- In addition, tests were moved to the modern test environment.
32
-
33
32
### Backslash unescaping moved to Treeprocessor (#1131 ).
34
33
35
- Unescaping backslash escapes has been moved to a Treeprocessor. However, it is
36
- recognized that various third-party extensions may be calling the old class at
34
+ Unescaping backslash escapes has been moved to a Treeprocessor, which enables
35
+ proper HTML escaping during serialization. However, it is recognized that
36
+ various third-party extensions may be calling the old class at
37
37
` postprocessors.UnescapePostprocessor ` . Therefore, the old class remains in the
38
38
code base, but has been deprecated and will be removed in a future release. The
39
39
new class ` treeprocessors.UnescapeTreeprocessor ` should be used instead.
@@ -43,7 +43,7 @@ new class `treeprocessors.UnescapeTreeprocessor` should be used instead.
43
43
Various objects were deprecated in version 3.0 and began raising deprecation
44
44
warnings (see the [ version 3.0 release notes] for details). Any of those objects
45
45
which remained in version 3.3 have been removed from the code base in version 3.4
46
- and will now raise errors. A summary of the objects are provided below.
46
+ and will now raise errors. The relevant objects are listed below.
47
47
48
48
[ version 3.0 release notes ] : release-3.0.md
49
49
@@ -56,7 +56,7 @@ and will now raise errors. A summary of the objects are provided below.
56
56
| ` markdown.util.text_type ` | ` str ` |
57
57
| ` markdown.util.int2str ` | ` chr ` |
58
58
| ` markdown.util.iterrange ` | ` range ` |
59
- | ` markdown.util.isBlockLevel ` | ` markdown.Markdown.is_block_level ` |
59
+ | ` markdown.util.isBlockLevel ` | ` markdown.Markdown() .is_block_level ` |
60
60
| ` markdown.util.Processor().markdown ` | ` markdown.util.Processor().md ` |
61
61
| ` markdown.util.Registry().__setitem__ ` | ` markdown.util.Registry().register ` |
62
62
| ` markdown.util.Registry().__delitem__ ` | ` markdown.util.Registry().deregister ` |
@@ -70,38 +70,44 @@ valid parameter and will raise an error if provided.
70
70
71
71
The following new features have been included in the 3.4 release:
72
72
73
- * Use ` style ` attribute in tables for alignment instead of ` align ` for better CSS
74
- inter-operation. The old behavior is available by setting ` use_align_attribute=True ` when
75
- adding the extension.
76
73
77
- * Some new configuration options have been added to the [ footnotes] ( ../extensions/footnotes.md )
78
- extension (#1218 ):
74
+ * Some new configuration options have been added to the
75
+ [ footnotes] ( ../extensions/footnotes.md ) extension (#1218 ):
76
+
77
+ * Small refactor of the ` BACKLINK_TITLE ` option; The use of ` format() `
78
+ instead of "old" ` %d ` formatter allows one to specify text without the
79
+ need to have the number of the footnote in it (like footnotes on
80
+ Wikipedia for example). The modification is backward compatible so no
81
+ configuration change is required.
82
+
83
+ * Addition of a new option ` SUPERSCRIPT_TEXT ` that allows one to specify a
84
+ custom placeholder for the footnote itself in the text.
85
+ Ex: ` [{}] ` will give ` <sup>[1]</sup> ` , ` ({}) ` will give ` <sup>(1)</sup> ` ,
86
+ or by default, the current behavior: ` <sup>1</sup> ` .
79
87
80
- * Small refactor of the ` BACKLINK_TITLE ` option; The use of ` format() ` instead
81
- of "old" ` %d ` formatter allows to specify text without the need to have the
82
- number of the footnote in it (like footnotes on Wikipedia for example).
83
- The modification is backward compatible so no configuration change is required.
88
+ * The [ Table of Contents] ( ../extensions/toc.md ) extension now accepts a
89
+ ` toc_class ` parameter which can be used to set the CSS class(es) on the
90
+ ` <div> ` that contains the Table of Contents (#1224 ).
84
91
85
- * Addition of a new option ` SUPERSCRIPT_TEXT ` that allows to specify a custom
86
- placeholder for the footnote itself in the text.
87
- Ex: ` [{}] ` will give <sup >[ 1] </sup >, ` ({}) ` will give <sup >(1)</sup >,
88
- or just by default, the current behavior: <sup >1</sup >.
92
+ * The CodeHilite extension now supports a ` pygments_formatter ` option that can
93
+ be set to a custom formatter class (#1187 ).
89
94
90
- * The [ Table of Contents] ( ../extensions/toc.md ) extension now accepts a ` toc_class `
91
- parameter which can be used to set the CSS class(es) on the ` <div> ` that contains the
92
- Table of Contents (#1224 ).
95
+ - If ` pygments_formatter ` is set to a string (ex: ` 'html' ` ), Pygments'
96
+ default formatter by that name is used.
97
+ - If ` pygments_formatter ` is set to a formatter class (or any callable
98
+ which returns a formatter instance), then an instance of that class is
99
+ used.
93
100
94
- * The CodeHilite extension now supports a ` pygments_formatter ` option that can be set to
95
- use a custom formatter class with Pygments (#1187 ). Additionally, the specified
96
- Pygments formatter is passed an extra option ` lang_str ` to denote the language of
97
- the code block (#1258 ).
98
- - If set to a string like ` 'html' ` , we get the default formatter by that name.
99
- - If set to a class (or any callable), it is called with all the options to get a
100
- formatter instance.
101
+ The formatter class is now passed an additional option, ` lang_str ` , to
102
+ denote the language of the code block (#1258 ). While Pygments' built-in
103
+ formatters will ignore the option, a custom formatter assigned to the
104
+ ` pygments_formatter ` option can make use of the ` lang_str ` to include the
105
+ code block's language in the output.
101
106
102
107
## Bug fixes
103
108
104
109
The following bug fixes are included in the 3.4 release:
105
110
106
111
* Extension entry-points are only loaded if needed (#1216 ).
107
- * Added additional checks to the ` <pre><code> ` handling of ` PrettifyTreeprocessor ` (#1261 , #1263 ).
112
+ * Added additional checks to the ` <pre><code> ` handling of
113
+ ` PrettifyTreeprocessor ` (#1261 , #1263 ).
0 commit comments