diff --git a/MarkdownLivePreview.py b/MarkdownLivePreview.py index 932f759..848511b 100644 --- a/MarkdownLivePreview.py +++ b/MarkdownLivePreview.py @@ -91,6 +91,7 @@ class OpenMarkdownPreviewCommand(sublime_plugin.TextCommand): preview_view.set_scratch(True) preview_view.settings().set(PREVIEW_VIEW_INFOS, {}) preview_view.set_name("Preview") + # FIXME: hide number lines on preview preview_window.focus_group(0) if file_name: @@ -224,6 +225,7 @@ class MarkdownLivePreviewListener(sublime_plugin.EventListener): html = markdown2html( markdown, basepath, partial(self._update_preview, markdown_view), resources, ) + print(html) self.phantom_sets[markdown_view.id()].update( [ diff --git a/live-testing/test.md b/live-testing/test.md index 8b92215..2185d2b 100644 --- a/live-testing/test.md +++ b/live-testing/test.md @@ -1 +1,9 @@ -a_b_c \ No newline at end of file +``` +hello world +``` + +``` +second part +``` + +hello world \ No newline at end of file diff --git a/markdown2html.py b/markdown2html.py index 0cf706b..e9bd6a3 100644 --- a/markdown2html.py +++ b/markdown2html.py @@ -136,3 +136,12 @@ def load_image(url): ) ) return "data:image/png;base64," + base64.b64encode(conn.read()).decode("utf-8") + + +def independent_markdown2html(markdown): + return markdown2html( + markdown, + ".", + lambda: None, + {"base64_404_image": "", "base64_loading_image": "", "stylesheet": ""}, + ) diff --git a/resources/stylesheet.css b/resources/stylesheet.css index fb94801..e0e736e 100644 --- a/resources/stylesheet.css +++ b/resources/stylesheet.css @@ -15,8 +15,9 @@ blockquote { } pre { - display: block; - background-color: var(--very-light-bg); + display: block; + background-color: var(--very-light-bg); + margin: 10px 0; } code {