fix typo, add a tiny bit of doc to the code

This commit is contained in:
Mathieu PATUREL
2017-01-26 11:30:56 +11:00
parent c7961ce94c
commit 8cc6b2b263
3 changed files with 4 additions and 2 deletions

View File

@ -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('&nbspespace;', '<i class="space">.</i>') html = html.replace('&nbspespace;', '<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):

View File

@ -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')

View File

@ -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):