Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OmniMarkupPreviewer's pygments conflicts with Evenote's one #106

Closed
Explorare opened this issue Aug 29, 2015 · 3 comments
Closed

OmniMarkupPreviewer's pygments conflicts with Evenote's one #106

Explorare opened this issue Aug 29, 2015 · 3 comments
Labels
Milestone

Comments

@Explorare
Copy link

Evernote package will cause OmniMarkupPreviewer crashed when open doc with code blocks like this

[PowerAdapter] -(Power)--> [Arndale] --(RS232)--> [LinuxHost]
                                |                    |
                             (ether)               (ether)
                                |                    |
                           [Ether switch] <---------+

And here is error log

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 problem is also submitted here in issue for OmniMarkupPreviewer.

Please help, thanks.

@bordaigorl
Copy link
Owner

@Explorare thanks a lot for bringing my attention to this.
I am planning to update pygments to v2.0.2 (see #102) I wonder if that would help.
I'll see if I can avoid fiddinling with sys.path to load pygments so the two packages can coexist.

@bordaigorl bordaigorl added this to the Version 2.6.1 milestone Sep 1, 2015
@bordaigorl bordaigorl added the bug label Sep 1, 2015
@bordaigorl
Copy link
Owner

I just pushed some changes in devel among which b68963a
that updates pygments.
Could you maybe test if this solves the issue? Thanks!

@bordaigorl bordaigorl changed the title Cause OmniMarkupPreviewer crashed when open doc with code blocks OmniMarkupPreviewer's pygments conflicts with Evenote's one Sep 2, 2015
@Explorare
Copy link
Author

Problem fixed. It works well again. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants