timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 74 forks source link

got crash when inserting a code block in MD. #69

Closed houcheng closed 9 years ago

houcheng commented 9 years ago

Hi, I got an exception when inserting a code block into markdown. Below is the error message shown in python console:

OmniMarkupPreviewer: [ERROR] Exception occured while rendering using MarkdownRenderer
  Traceback (most recent call last):
    File "/root/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 266, in render_text
    rendered_text = renderer.render(text, filename=filename)
    File "/root/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/MarkdownRenderer.py", line 36, in render
    extensions=self.extensions)
    File "/root/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/__init__.py", line 411, in markdown
    return md.convert(text)
    File "/root/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/__init__.py", line 288, in convert
    self.lines = prep.run(self.lines)
    File "/root/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/extensions/fenced_code.py", line 140, in run
    code = highliter.hilite()
    File "/root/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/markdown/extensions/codehilite.py", line 90, in hilite
    lexer = get_lexer_by_name(self.lang)
    File "/root/.config/sublime-text-3/Installed Packages/Evernote.sublime-package/lib/pygments/lexers/__init__.py", line 87, in get_lexer_by_name
    if _alias.lower() in aliases:
  AttributeError: 'NoneType' object has no attribute 'lower'

This is the code block I added in markdown.

[PowerAdapter] -(Power)--> [Arndale] --(RS232)--> [LinuxHost]
                                |                    |
                             (ether)               (ether)
                                |                    |
                            [Ether switch] <---------+
timonwong commented 9 years ago

Hmm, it seems the Evernote package uses a incompatible pygments, you can try to disable the Evernote package for now.

houcheng commented 9 years ago

Oppss. It is fixed by removing the Evernote package. Thanks a lot.

Explorare commented 8 years ago

Is there a way to fix this problem without remove Evernote package? I need both of the two packages a lot. I meet this error code when open README.md to OmniPackagePreviewer. Thanks

Explorare commented 8 years ago

Maintainer of <sublime-evernote> has updated a hotfix and this problem has been solved. More details here