File tree Expand file tree Collapse file tree 5 files changed +7
-19
lines changed Expand file tree Collapse file tree 5 files changed +7
-19
lines changed Original file line number Diff line number Diff line change 3
3
## python-markdown2 2.4.0 (not yet released)
4
4
5
5
- [ pull #377 ] Fixed bug breaking strings elements in metadata lists
6
+ - [ pull #380 ] When rendering fenced code blocks, also add the ` language-LANG ` class
6
7
7
8
8
9
## python-markdown2 2.3.10
Original file line number Diff line number Diff line change @@ -47,3 +47,4 @@ Gareth Simpson (github.com/xurble)
47
47
Kat Hagan (github.com/codebykat)
48
48
Stɑrry Shivɑm (github.com/starry69)
49
49
André Nasturas (github.com/andrenasturas)
50
+ Denis Kasak (github.com/dkasak)
Original file line number Diff line number Diff line change @@ -1884,7 +1884,7 @@ def unhash_code(codeblock):
1884
1884
pre_class_str = self ._html_class_str_from_tag ("pre" )
1885
1885
1886
1886
if "highlightjs-lang" in self .extras and lexer_name :
1887
- code_class_str = ' class="%s"' % lexer_name
1887
+ code_class_str = ' class="%s language-%s "' % ( lexer_name , lexer_name )
1888
1888
else :
1889
1889
code_class_str = self ._html_class_str_from_tag ("code" )
1890
1890
Original file line number Diff line number Diff line change 1
- < pre > < code class ="cpp "> here is some cpp code
1
+ < pre > < code class ="cpp language-cpp "> here is some cpp code
2
2
</ code > </ pre >
3
3
4
- < pre > < code class ="lang-cpp "> some lang-cpp code
5
- </ code > </ pre >
6
-
7
- < pre > < code class ="language-cpp "> and some language-cpp code
8
- </ code > </ pre >
9
-
10
- < pre > < code class ="nohighlight "> some code without highlighting
4
+ < pre > < code class ="nohighlight language-nohighlight "> some code without highlighting
11
5
</ code > </ pre >
12
6
13
7
< p > That's using the < em > fenced-code-blocks</ em > and < em > highlightjs-lang</ em > extra.</ p >
14
8
15
9
< p > Here is an empty one (just to check):</ p >
16
10
17
- < pre > < code class ="cpp ">
11
+ < pre > < code class ="cpp language-cpp ">
18
12
</ code > </ pre >
19
13
20
14
< p > Here is one at the end of the file:</ p >
21
15
22
- < pre > < code class ="cpp "> is indentation maintained?
16
+ < pre > < code class ="cpp language-cpp "> is indentation maintained?
23
17
</ code > </ pre >
Original file line number Diff line number Diff line change 2
2
here is some cpp code
3
3
```
4
4
5
- ```lang-cpp
6
- some lang-cpp code
7
- ```
8
-
9
- ```language-cpp
10
- and some language-cpp code
11
- ```
12
-
13
5
```nohighlight
14
6
some code without highlighting
15
7
```
You can’t perform that action at this time.
0 commit comments