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
502 stars 75 forks source link

404 error in preview, buffer_id(50) #144

Open 8ovehat1r opened 2 years ago

8ovehat1r commented 2 years ago

when I tried to preview my markdown in browser, I saw this:

Sorry, the requested URL 'http://127.0.0.1:51004/view/50' caused an error:

'buffer_id(50) is not valid (closed or unsupported file format)'

**NOTE:** If you run multiple instances of Sublime Text, you may want to adjust
the `server_port` option in order to get this plugin work again.

this is what in console:

OmniMarkupPreviewer: [INFO] Launching web browser for http://127.0.0.1:51004/view/50
OmniMarkupPreviewer: [ERROR] Exception occured while rendering using MarkdownRenderer
  Traceback (most recent call last):
    File "/Users/liujiageng/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 266, in render_text
    rendered_text = renderer.render(text, filename=filename)
    File "/Users/liujiageng/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/MarkdownRenderer.py", line 48, in render
    extensions=self.extensions)
    File "/Users/liujiageng/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 386, in markdown
    md = Markdown(**kwargs)
    File "/Users/liujiageng/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 97, in __init__
    configs=kwargs.get('extension_configs', {}))
    File "/Users/liujiageng/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 123, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, {}))
    File "/Users/liujiageng/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 162, in build_extension
    module = importlib.import_module(ext_name)
    File "./python3.3/importlib/__init__.py", line 90, in import_module
    File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1529, in _find_and_load_unlocked
  ImportError: No module named 'fenced_code'
adamkerz commented 1 year ago

You can disable that extension (all extensions) by adding user settings OmniMarkupPreviewer.sublime-settings:

    "renderer_options-MarkdownRenderer": {
        "extensions": []
    }

This is the quick fix I've always used as I haven't bothered to figure out the exact problem, possibly just installing the markdown extension, although this page says they are installed by default... https://python-markdown.github.io/extensions/

unifreak commented 1 year ago

Same here, on Ubuntu 22.10, with sublime text 4143 and firefox. Got the error even having python's markdown extension installed. This project seems unmaintained.

image

The code highlighting is broken, too, with or without those extensions.