File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22History
33=======
44
5+ 0.2.1 (2019-05-31)
6+ ------------------
7+
8+ * Fix Platform Section Markdown Extension bug with code blocks
9+
5100.2.0 (2019-05-29)
611------------------
712
Original file line number Diff line number Diff line change 22
33__author__ = """Jason Emerick"""
44__email__ = 'jason@mobelux.com'
5- __version__ = '0.2.0 '
5+ __version__ = '0.2.1 '
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class PlatformSectionPreprocessor(Preprocessor):
2020 RE = re .compile (r'''
2121^@!\[(?P<sections>[\w,]+)\]\W*\n
2222(?P<content>.*?)(?<=\n)
23- \W* !@\W*$''' , re .MULTILINE | re .DOTALL | re .VERBOSE )
23+ !@\W*$''' , re .MULTILINE | re .DOTALL | re .VERBOSE )
2424
2525 def __init__ (self , platform_section , ** kwargs ):
2626 self .platform_section = platform_section .lower ().strip ()
Original file line number Diff line number Diff line change 11[bumpversion]
2- current_version = 0.2.0
2+ current_version = 0.2.1
33commit = True
44tag = True
55
Original file line number Diff line number Diff line change 2020
2121setup (
2222 name = 'docdown' ,
23- version = '0.2.0 ' ,
23+ version = '0.2.1 ' ,
2424 description = "DocDown is a Markdown extension for source code documentation." ,
2525 long_description = readme + '\n \n ' + history ,
2626 author = "Jason Emerick, Justin Michalicek" ,
Original file line number Diff line number Diff line change @@ -115,6 +115,23 @@ def test_multiple_sections(self):
115115 expected_output = '<p>some content\n shown</p>'
116116 self .assertEqual (expected_output , html )
117117
118+ def test_section_with_code_snippet (self ):
119+ text = ('@![Android]\n '
120+ 'some Android content shown\n \n '
121+ '``` java\n '
122+ 'String java = "asdf";\n '
123+ '```\n '
124+ '!@\n ' )
125+
126+ html = markdown .markdown (
127+ text ,
128+ extension_configs = self .build_config_for_platform_section ('Android' ),
129+ extensions = self .MARKDOWN_EXTENSIONS ,
130+ output_format = 'html5'
131+ )
132+ expected_output = '<p>some Android content shown</p>\n <p><code>java\n String java = "asdf";</code></p>'
133+ self .assertEqual (expected_output , html )
134+
118135 def test_multiple_sections_with_code_snippet (self ):
119136 text = ('@![iOS]\n '
120137 'some iOS content not shown\n \n '
@@ -133,5 +150,5 @@ def test_multiple_sections_with_code_snippet(self):
133150 extensions = self .MARKDOWN_EXTENSIONS ,
134151 output_format = 'html5'
135152 )
136- expected_output = '<p>some Android content shown</p>\n <p>``` java\n String java = "asdf";</p>'
153+ expected_output = '<p>some Android content shown</p>\n <p><code> java\n String java = "asdf";</code> </p>'
137154 self .assertEqual (expected_output , html )
You can’t perform that action at this time.
0 commit comments