revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

ST 3175 Breaks Preview With Code #430

Open tajmone opened 6 years ago

tajmone commented 6 years ago

After the last update to ST 3175, previewing documents containing code blocks with a syntax unknown to Pygments stopped working. It seems to fail both if you don't specify the syntax (and the syntax can't be guessed by Pygments) and if you specify an unsupported syntax (where the expectation would be that Pygments ignores it).

The console reports a long list of errors tied to Pygments. Here is a pasted copy of the errors log (username changed):

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1066, in run_
    return self.run(edit, **args)
  File "C:\Users\myUserName\AppData\Roaming\Sublime Text 3\Installed Packages\MarkdownPreview.sublime-package\markdown_preview.py", line 907, in run
  File "C:\Users\myUserName\AppData\Roaming\Sublime Text 3\Installed Packages\MarkdownPreview.sublime-package\markdown_preview.py", line 496, in run
  File "C:\Users\myUserName\AppData\Roaming\Sublime Text 3\Installed Packages\MarkdownPreview.sublime-package\markdown_preview.py", line 425, in convert_markdown
  File "C:\Users\myUserName\AppData\Roaming\Sublime Text 3\Installed Packages\MarkdownPreview.sublime-package\markdown_preview.py", line 821, in parser_specific_convert
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\PYTHON~1\st3\markdown\__init__.py", line 368, in convert
    self.lines = prep.run(self.lines)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\superfences.py", line 564, in run
    lines = self.search_nested(lines)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\superfences.py", line 483, in search_nested
    self.eval_fence(ws, content, start, end)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\superfences.py", line 331, in eval_fence
    self.process_nested_block(ws, content, start, end)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\superfences.py", line 370, in process_nested_block
    code = entry["formatter"](self.rebuild_block(self.code), self.lang)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\superfences.py", line 530, in highlight
    linespecial=linespecial
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\highlight.py", line 171, in highlight
    lexer = self.get_lexer(src, language)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pymdownx\st3\pymdownx\highlight.py", line 148, in get_lexer
    lexer = guess_lexer(src)
  File "C:\Users\PK6A24~1.DIC\AppData\Roaming\SUBLIM~1\Packages\pygments\all\pygments\lexers\__init__.py", line 252, in guess_lexer
    raise ClassNotFound('no lexer matching the text found')
pygments.util.ClassNotFound: no lexer matching the text found
revolunet commented 6 years ago

Hi,

Can you please post to the new repo URL ? https://github.com/facelessuser/MarkdownPreview

Thanks !