revolunet / sublimetext-markdown-preview

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

Stopped working on SublimeText 2 Windows #307

Closed DannyBen closed 8 years ago

DannyBen commented 8 years ago

I no longer have the "Preview Markdown" option in the menu.

Uninstall and reinstall did not help.

It worked several days ago.

facelessuser commented 8 years ago

Are you seeing errors in the console?

facelessuser commented 8 years ago

Please also provide as much detail as you can, system etc.

facelessuser commented 8 years ago

Also, did you restart after the update? A big update like the one pushed out will likely not reload well via Package Control and will require a Sublime restart.

facelessuser commented 8 years ago

I did test this before the release, and I just verified again that it is working for me in both OSX and Windows ST2, so you will need to provide more details. For further investigation.

DannyBen commented 8 years ago

Ok. More details.

0. System

1. Package Control Remove - console output

Package Control: The package Markdown Preview has been removed and will be cleaned up on the next restart
reloading /C/Users/Danny/AppData/Roaming/Sublime Text 2/Packages/User/Package Control.sublime-settings
Package Control: The orphaned dependency pygments has been removed
Unloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\01-pygments.py
Package Control: The orphaned dependency pyyaml has been removed
Unloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\50-pyyaml.py

2. Restarted sublime

3. Package Control Install - console output

Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\helper.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\abbr.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\admonition.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\attr_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\codehilite.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\def_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\delete.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\extra.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\fenced_code.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\footnotes.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\github.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\githubemoji.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\headeranchor.py
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 62, in reload_plugin
  File ".\helper.py", line 67, in <module>
    __import__(package)
  File ".\markdown\extensions\headeranchor.py", line 35, in <module>
    from .toc import slugify, stashedHTML2text, unique, TocExtension
  File ".\markdown\extensions\toc.py", line 23, in <module>
    import unicodedata
ImportError: No module named unicodedata
Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown_settings.py
Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown_wrapper.py
Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\MarkdownPreview.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\abbr.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\admonition.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\attr_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\codehilite.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\def_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\delete.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\extra.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\fenced_code.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\footnotes.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\github.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\githubemoji.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\headeranchor.py
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 62, in reload_plugin
  File ".\MarkdownPreview.py", line 49, in <module>
    from helper import INSTALLED_DIRECTORY
  File ".\helper.py", line 67, in <module>
    __import__(package)
  File ".\markdown\extensions\headeranchor.py", line 35, in <module>
    from .toc import slugify, stashedHTML2text, unique, TocExtension
  File ".\markdown\extensions\toc.py", line 23, in <module>
    import unicodedata
ImportError: No module named unicodedata
found 8 files for base name Main.sublime-menu
theme loaded
reloading /C/Users/Danny/AppData/Roaming/Sublime Text 2/Packages/User/Preferences.sublime-settings
found 1 files for base name Soda Light Modded.sublime-theme
theme loaded

Let me know what else you need.

facelessuser commented 8 years ago

I think that is all I need. It can't find unicodedata. I need to revisit why some systems can't find this on ST2. I think some of Markdown Previews internal dependencies had some hacks for this, but when we removed the internal dependencies for package control managed dependencies, we lost the advantage of those ST2 specific hacks. I need to put those back in.

I will add the fix later, but I will need you to test them locally for verification as I am not experiencing this problem.

DannyBen commented 8 years ago

Sure thing.

cjhgo commented 8 years ago

i suffer the same problem.hope the fix.

facelessuser commented 8 years ago

Found the hack: https://github.com/revolunet/sublimetext-markdown-preview/commit/b631e1d57221a6a3fec582258e5cfd15d1f855cd.

Will probably need to put this at the top level in MarkdownPreview.py. I will get to this after work today.

Albinutte commented 8 years ago

Looks like my problem, thanks for looking into it

facelessuser commented 8 years ago

If someone with unicodedata trouble can try out #308 pull request and let me know if it solves your problems, I will be able to push out a new bug fix release.

hkant commented 8 years ago

my sublime2 in windows 8 also can not show markdown preview .and the console show "Reloading plugin extension C:\Users\myPC\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\headeranchor.py Traceback (most recent call last): File ".\sublime_plugin.py", line 62, in reload_plugin File ".\helper.py", line 67, in import(package) File ".\markdown\extensions\headeranchor.py", line 35, in from .toc import slugify, stashedHTML2text, unique, TocExtension File ".\markdown\extensions\toc.py", line 23, in import unicodedata ImportError: No module named unicodedata"

facelessuser commented 8 years ago

"me too" isn't going to get this fixed, I need someone to confirm that #308 fixes the issue.

hkant commented 8 years ago

i fix my problem by the method of commit " b631e1d57221a6a3fec582258e5cfd15d1f855cd": from ..util import HTML_PLACEHOLDER_RE, parseBoolValue import re import logging -import unicodedata +try:

@facelessuser you modify the file of headerid.py,but there is also a same problem in the file of markdown\extensions\toc.py

facelessuser commented 8 years ago

@hkant Please see #308. The link to the commit was only showing what needed to be done to import unicodedata. Yes I admit that location alone was not enough, but since #308 moves it to be one of the first imports, it should be in the path by time toc or headerid or whatever calls it.

facelessuser commented 8 years ago

It is possible we need to place it here as well https://github.com/revolunet/sublimetext-markdown-preview/blob/master/markdown_wrapper.py.

facelessuser commented 8 years ago

It actually appears that we should drop this in helper.py as Sublime seems to load them alphabetically.

facelessuser commented 8 years ago

308 has been updated with unicodedata loading in helper.py

DannyBen commented 8 years ago

Looks like #308 is working. I just copied the modified files and placed them where they need to be.

The console now looks clean of errors and the "Markdown Preview" menu items are back.

facelessuser commented 8 years ago

Thanks, I will go ahead and push it out.

DannyBen commented 8 years ago

Thanks for the quick fix.