Compare commits
2 Commits
89d712fcce
...
69c722a933
| Author | SHA1 | Date | |
|---|---|---|---|
| 69c722a933 | |||
| 7c37a9e413 |
@ -232,6 +232,11 @@ class MarkdownLivePreviewListener(sublime_plugin.EventListener):
|
|||||||
if markdown_view.buffer_id() == 0:
|
if markdown_view.buffer_id() == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Check if the phantom set still exists for this view ID
|
||||||
|
if markdown_view.id() not in self.phantom_sets:
|
||||||
|
# View might have been closed between modification and update
|
||||||
|
return
|
||||||
|
|
||||||
self.last_update = time.time()
|
self.last_update = time.time()
|
||||||
|
|
||||||
total_region = sublime.Region(0, markdown_view.size())
|
total_region = sublime.Region(0, markdown_view.size())
|
||||||
@ -253,10 +258,6 @@ class MarkdownLivePreviewListener(sublime_plugin.EventListener):
|
|||||||
font_scale,
|
font_scale,
|
||||||
)
|
)
|
||||||
|
|
||||||
print("--- HTML Content Sent to Phantom ---")
|
|
||||||
print(html)
|
|
||||||
print("--- End HTML Content ---")
|
|
||||||
|
|
||||||
self.phantom_sets[markdown_view.id()].update(
|
self.phantom_sets[markdown_view.id()].update(
|
||||||
[
|
[
|
||||||
sublime.Phantom(
|
sublime.Phantom(
|
||||||
|
|||||||
Binary file not shown.
@ -85,9 +85,9 @@ def markdown2html(markdown, basepath, re_render, resources, viewport_width, font
|
|||||||
# FIXME: highlight the code using Sublime's syntax
|
# FIXME: highlight the code using Sublime's syntax
|
||||||
|
|
||||||
# FIXME: report that ST doesn't support <br/> but does work with <br />... WTF?
|
# FIXME: report that ST doesn't support <br/> but does work with <br />... WTF?
|
||||||
# Add font scaling CSS rule
|
# Add font scaling CSS rule - REMOVED as MiniHTML doesn't support transform/font-size scaling this way
|
||||||
font_scale_css = "body {{ transform: scale({}); transform-origin: top left; }}\n".format(font_scale)
|
# font_scale_css = "body {{ transform: scale({}); transform-origin: top left; }}\n".format(font_scale)
|
||||||
stylesheet = font_scale_css + resources["stylesheet"]
|
stylesheet = resources["stylesheet"] # Use only the base stylesheet
|
||||||
|
|
||||||
return "<style>\n{}\n</style>\n\n{}".format(stylesheet, soup).replace(
|
return "<style>\n{}\n</style>\n\n{}".format(stylesheet, soup).replace(
|
||||||
"<br/>", "<br />"
|
"<br/>", "<br />"
|
||||||
|
|||||||
Reference in New Issue
Block a user