Codebase list commonmark-bkrs / upstream/0.5.4+git20151230.c0786fb
Import upstream version 0.5.4+git20151230.c0786fb, md5 31f8bcad2aad7e240b092f8f602ed8b9 Debian Janitor 3 years ago
4 changed file(s) with 33 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
88 # renderer = CommonMark.HtmlRenderer()
99 # print(renderer.render(parser.parse('Hello *world*')))
1010 import re, sys, argparse, json
11 from warnings import warn
1112
1213 # if python3 use html.parser and urllib.parse, else use HTMLParser and urllib
1314 if sys.version_info >= (3, 0):
12921293 elif inline.t == "Code":
12931294 return self.inTags('code', [], self.escape(inline.c))
12941295 else:
1295 print("Unknown inline type " + inline.t)
1296 warn("Unknown inline type " + inline.t)
12961297 return ""
12971298
12981299 def renderInlines(self, inlines):
13621363 elif (block.t == "HorizontalRule"):
13631364 return self.inTags("hr", [], "", True)
13641365 else:
1365 print("Unknown block type" + block.t)
1366 warn("Unknown block type" + block.t)
13661367 return ""
13671368
13681369 def renderBlocks(self, blocks, in_tight_list=None):
+0
-8
MANIFEST.in less more
0 include README.md
1 include LICENSE
2 include .gitignore
3 include spec.txt
4 include CommonMark/CommonMark.py
5 include CommonMark/entitytrans.py
6 include CommonMark/test/test-CommonMark.py
7 include docs/CommonMark.py.html
0 Metadata-Version: 1.1
1 Name: CommonMark
2 Version: 0.5.4
3 Summary: Python parser for the CommonMark Markdown spec
4 Home-page: https://github.com/rolandshoemaker/CommonMark-py
5 Author: Bibek Kafle <bkafle662@gmail.com>, Roland Shoemaker <rolandshoemaker@gmail.com>
6 Author-email: rolandshoemaker@gmail.com
7 License: BSD License
8 Download-URL: https://github.com/rolandshoemaker/CommonMark-py/tarball/v0.5.4
9 Description: UNKNOWN
10 Keywords: markup,markdown,commonmark
11 Platform: UNKNOWN
12 Classifier: Programming Language :: Python
13 Classifier: Programming Language :: Python :: 2
14 Classifier: Programming Language :: Python :: 3
15 Classifier: Development Status :: 4 - Beta
16 Classifier: Environment :: Other Environment
17 Classifier: Environment :: Console
18 Classifier: Intended Audience :: Developers
19 Classifier: License :: OSI Approved :: BSD License
20 Classifier: Operating System :: OS Independent
21 Classifier: Topic :: Documentation
22 Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
23 Classifier: Topic :: Software Development :: Documentation
24 Classifier: Topic :: Software Development :: Libraries :: Python Modules
25 Classifier: Topic :: Text Processing :: Markup
26 Classifier: Topic :: Utilities
00 CommonMark-py
11 =============
22
3 **NOTE:** This repo is no longer maintained and most likely contains numerous bugs, for the up to date and safe version you want [`rtfd/CommonMark-py`](https://github.com/rtfd/CommonMark-py).
4
35 Pure Python port of [jgm](https://github.com/jgm)'s [stmd.js](https://github.com/jgm/stmd/blob/master/js/stmd.js), a Markdown parser and renderer for the [CommonMark](http://commonmark.org) specification, using only native modules. Once both this project and the CommonMark specification are stable we will release the first `1.0` version and attempt to keep up to date with changes in `stmd.js`.
46
5 We are currently at the same development stage (actually a bit ahead because we have implemented HTML entity conversion and href URL escaping) as `stmd.js`. Since Python versions pre-3.4 use outdated (i.e. not HTML5 spec) entity conversion, I've converted the 3.4 implementation into a single file, `entitytrans.py` which so far seems to work (all tests pass on 2.7, 3.3, and 3.4).
7 We are currently at the same development stage (actually a bit ahead because we have implemented HTML entity conversion and href URL escaping) as `stmd.js`. Since Python versions pre-3.4 use outdated (i.e. not HTML5 spec) entity conversion, I've converted the 3.4 implementation into a single file, `entitytrans.py` which so far seems to work (all tests pass on 2.7, 3.3, 3.4, PyPy, and PyPy3).
68
79 **Current version:** 0.5.4
810