math2001 / MarkdownLivePreview

A Sublime Text 3 plugin to preview your markdown as you type
https://math2001.github.io/MarkdownLivePreview
MIT License
304 stars 37 forks source link

Preview does not work. Output in console: xml.parsers.expat.ExpatError: not well-formed #57

Closed algo99 closed 6 years ago

algo99 commented 6 years ago

SublimeText: 3168 After loading README.md with the only content:

To generate HTML documentation manually

Traceback (most recent call last):
  File "/home/zrk/sublime_text/sublime_plugin.py", line 509, in on_load_async
    callback.on_load_async(v)
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/MarkdownLivePreview.py", line 97, in on_load_async
    md_view, preview = self.update(view)
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/MarkdownLivePreview.py", line 64, in update
    show_html(view, preview)
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/MLPApi.py", line 76, in show_html
    html = markdown2html(get_view_content(md_view), os.path.dirname(md_view.file_name()), md_view.settings().get('color_scheme'))
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/MLPApi.py", line 40, in markdown2html
    html = '<style>\n{}\n</style>\n'.format(get_style(color_scheme))
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/functions.py", line 131, in get_style
    css += pygments_from_theme(get_resource(color_scheme))
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/lib/pygments_from_theme.py", line 86, in pygments_from_theme
    settings = get_settings(color_scheme_content)
  File "/home/zrk/.config/sublime-text-3/Installed Packages/MarkdownLivePreview.sublime-package/lib/pygments_from_theme.py", line 60, in get_settings
    dom = parseString(color_scheme_content)
  File "./python3.3/xml/dom/minidom.py", line 1970, in parseString
  File "./python3.3/xml/dom/expatbuilder.py", line 926, in parseString
  File "./python3.3/xml/dom/expatbuilder.py", line 221, in parseString
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
logworthy commented 6 years ago

I have the same issue. As far as I can tell, MarkdownLivePreview is expecting a theme in the textmate/XML format and is instead finding one in the sublime/JSON format, which was the case for the default Monokai theme I was using.

In my case I was able to work around the issue by installing and switching to Monokai Extended, which uses textmate/XML.

math2001 commented 6 years ago

Discussed in #64. Should be fixed soon. :+1: @logworthy