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

[Markdown Preview] Plugin doesn't work #4657

Closed
Vivalzar opened this issue Dec 9, 2022 · 5 comments
Closed

[Markdown Preview] Plugin doesn't work #4657

Vivalzar opened this issue Dec 9, 2022 · 5 comments

Comments

@Vivalzar
Copy link

Vivalzar commented Dec 9, 2022

None of the command provided by the plugin work. The following error happens every time we try to use one:

Init: cuda_markdown_preview
Traceback (most recent call last):
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\__init__.py", line 10, in <module>
    import markdown
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\__init__.py", line 22, in <module>
    from .core import Markdown, markdown, markdownFromFile
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\core.py", line 27, in <module>
    from .preprocessors import build_preprocessors
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\preprocessors.py", line 29, in <module>
    from .htmlparser import HTMLExtractor
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\htmlparser.py", line 31, in <module>
    spec.loader.exec_module(htmlparser)
AttributeError: 'zipimporter' object has no attribute 'exec_module'
ERROR: Exception in CudaText for cuda_markdown_preview.run: AttributeError: 'zipimporter' object has no attribute 'exec_module'
@Alexey-T
Copy link
Owner

Alexey-T commented Dec 9, 2022

Known error, reason is old python (preinstalled version 3.8). you can install newer python from addons manager, OK?

@Vivalzar
Copy link
Author

Vivalzar commented Dec 9, 2022

Just installed Python 3.11.
Got another error now:

Init: cuda_markdown_preview
Traceback (most recent call last):
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\__init__.py", line 12, in <module>
    md = markdown.Markdown(extensions=ext)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\core.py", line 96, in __init__
    self.registerExtensions(extensions=kwargs.get('extensions', []),
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\core.py", line 125, in registerExtensions
    ext.extendMarkdown(self)
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\mdx_partial_gfm\__init__.py", line 62, in extendMarkdown
    gfm.AutolinkExtension().extendMarkdown(md)
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\gfm\autolink.py", line 75, in extendMarkdown
    md.inlinePatterns.register(AutolinkPattern(URL_RE, md), "gfm-autolink", 100)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\APPLIS\cudatext\py\cuda_markdown_preview\markdown\inlinepatterns.py", line 209, in __init__
    self.compiled_re = re.compile(r"^(.*?)%s(.*)$" % pattern,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "re\__init__.py", line 227, in compile
  File "re\__init__.py", line 294, in _compile
  File "re\_compiler.py", line 743, in compile
  File "re\_parser.py", line 980, in parse
  File "re\_parser.py", line 455, in _parse_sub
  File "re\_parser.py", line 841, in _parse
re.error: global flags not at the start of the expression at position 6
ERROR: Exception in CudaText for cuda_markdown_preview.run: error: global flags not at the start of the expression at position 6

@MiroslavMatas
Copy link

try to remove 3.11 and install 3.10, it works fine on my side

image

@Vivalzar
Copy link
Author

Vivalzar commented Dec 9, 2022

Ok, it works now. Thank you very much.

@Vivalzar Vivalzar closed this as completed Dec 9, 2022
@Alexey-T
Copy link
Owner

Alexey-T commented Dec 9, 2022

I posted the report to upstream Python-Markdown/markdown#1312

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

No branches or pull requests

3 participants