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 33## python-markdown2 2.4.0 (not yet released)
44
55- [ pull #377 ] Fixed bug breaking strings elements in metadata lists
6+ - [ pull #380 ] When rendering fenced code blocks, also add the ` language-LANG ` class
67
78
89## python-markdown2 2.3.10
Original file line number Diff line number Diff line change @@ -47,3 +47,4 @@ Gareth Simpson (github.com/xurble)
4747Kat Hagan (github.com/codebykat)
4848Stɑrry Shivɑm (github.com/starry69)
4949André 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):
18841884 pre_class_str = self ._html_class_str_from_tag ("pre" )
18851885
18861886 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 )
18881888 else :
18891889 code_class_str = self ._html_class_str_from_tag ("code" )
18901890
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
22</ code > </ pre >
33
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
115</ code > </ pre >
126
137< p > That's using the < em > fenced-code-blocks</ em > and < em > highlightjs-lang</ em > extra.</ p >
148
159< p > Here is an empty one (just to check):</ p >
1610
17- < pre > < code class ="cpp ">
11+ < pre > < code class ="cpp language-cpp ">
1812</ code > </ pre >
1913
2014< p > Here is one at the end of the file:</ p >
2115
22- < pre > < code class ="cpp "> is indentation maintained?
16+ < pre > < code class ="cpp language-cpp "> is indentation maintained?
2317</ code > </ pre >
Original file line number Diff line number Diff line change 22here is some cpp code
33```
44
5- ```lang-cpp
6- some lang-cpp code
7- ```
8-
9- ```language-cpp
10- and some language-cpp code
11- ```
12-
135```nohighlight
146some code without highlighting
157```
You can’t perform that action at this time.
0 commit comments