projects
/
pyblosxom-markdown2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eda9dfa
)
Get rid of the to_ascii function that was stripping non-ascii characters
author
Sean Hammond
<seanhammond@lavabit.com>
Tue, 28 Sep 2010 00:43:32 +0000
(
01:43
+0100)
committer
Sean Hammond
<seanhammond@lavabit.com>
Tue, 28 Sep 2010 00:43:32 +0000
(
01:43
+0100)
from blog posts.
markdown-plugin.py
patch
|
blob
|
history
diff --git
a/markdown-plugin.py
b/markdown-plugin.py
index 6b03ed92cb96b5e57a71fbd3f3255196b9130d2e..522823d843b7cfeaa854e75172e567c102093570 100644
(file)
--- a/
markdown-plugin.py
+++ b/
markdown-plugin.py
@@
-70,19
+70,9
@@
def cb_preformat(args):
if args['parser'] == PREFORMATTER_ID:
return parse(''.join(args['story']))
if args['parser'] == PREFORMATTER_ID:
return parse(''.join(args['story']))
-def to_ascii(char):
- """Return char if char is an ASCII character, '?' otherwise."""
- if ord(char) < 128:
- return char
- else:
- return '?'
-
def parse(story):
def parse(story):
- # Replace any non-ascii characters in the story with '?', so that
- # python-markdown doesn't crash.
- ascii = "".join([to_ascii(x) for x in story])
# Convert the ASCII text to HTML with python-markdown.
# Convert the ASCII text to HTML with python-markdown.
- html = md.convert(
ascii
)
+ html = md.convert(
story
)
# Reset python-markdown ready for next time.
md.reset()
return html
# Reset python-markdown ready for next time.
md.reset()
return html
Benjamin Mako Hill
||
Want to submit a patch?