fix typo, add a tiny bit of doc to the code
This commit is contained in:
@ -69,7 +69,6 @@ def markdown2html(md, basepath):
|
|||||||
# exception, again, because <pre> aren't supported by the phantoms
|
# exception, again, because <pre> aren't supported by the phantoms
|
||||||
html = html.replace(' espace;', '<i class="space">.</i>')
|
html = html.replace(' espace;', '<i class="space">.</i>')
|
||||||
html = replace_img_src_base64(html, basepath=os.path.dirname(basepath))
|
html = replace_img_src_base64(html, basepath=os.path.dirname(basepath))
|
||||||
sublime.set_clipboard(html)
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
def show_html(md_view, preview):
|
def show_html(md_view, preview):
|
||||||
|
|||||||
@ -90,7 +90,6 @@ def get_settings():
|
|||||||
def pre_with_br(html):
|
def pre_with_br(html):
|
||||||
"""Because the phantoms of sublime text does not support <pre> blocks
|
"""Because the phantoms of sublime text does not support <pre> blocks
|
||||||
this function replaces every \n with a <br> in a <pre>"""
|
this function replaces every \n with a <br> in a <pre>"""
|
||||||
# Need to use bs4
|
|
||||||
soup = BeautifulSoup(html)
|
soup = BeautifulSoup(html)
|
||||||
for pre in soup.find_all('pre'):
|
for pre in soup.find_all('pre'):
|
||||||
code = pre.find('code')
|
code = pre.find('code')
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
'pre_tables' transform *html* tables into markdown tables, and put them in some <pre><code> tags
|
||||||
|
"""
|
||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
def python_table(s_table):
|
def python_table(s_table):
|
||||||
|
|||||||
Reference in New Issue
Block a user