Import upstream version 0.5.4+git20151230.c0786fb, md5 31f8bcad2aad7e240b092f8f602ed8b9
Debian Janitor
3 years ago
8 | 8 |
# renderer = CommonMark.HtmlRenderer()
|
9 | 9 |
# print(renderer.render(parser.parse('Hello *world*')))
|
10 | 10 |
import re, sys, argparse, json
|
|
11 |
from warnings import warn
|
11 | 12 |
|
12 | 13 |
# if python3 use html.parser and urllib.parse, else use HTMLParser and urllib
|
13 | 14 |
if sys.version_info >= (3, 0):
|
|
1292 | 1293 |
elif inline.t == "Code":
|
1293 | 1294 |
return self.inTags('code', [], self.escape(inline.c))
|
1294 | 1295 |
else:
|
1295 | |
print("Unknown inline type " + inline.t)
|
|
1296 |
warn("Unknown inline type " + inline.t)
|
1296 | 1297 |
return ""
|
1297 | 1298 |
|
1298 | 1299 |
def renderInlines(self, inlines):
|
|
1362 | 1363 |
elif (block.t == "HorizontalRule"):
|
1363 | 1364 |
return self.inTags("hr", [], "", True)
|
1364 | 1365 |
else:
|
1365 | |
print("Unknown block type" + block.t)
|
|
1366 |
warn("Unknown block type" + block.t)
|
1366 | 1367 |
return ""
|
1367 | 1368 |
|
1368 | 1369 |
def renderBlocks(self, blocks, in_tight_list=None):
|
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
|
0 | 0 |
CommonMark-py
|
1 | 1 |
=============
|
2 | 2 |
|
|
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 |
|
3 | 5 |
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`.
|
4 | 6 |
|
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).
|
6 | 8 |
|
7 | 9 |
**Current version:** 0.5.4
|
8 | 10 |
|