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

Codeblocks broken: TypeError: BlockHtmlFormatter.wrap() missing 1 required positional argument: 'outfile' #28

Open
jose1711 opened this issue Jul 12, 2024 · 0 comments

Comments

@jose1711
Copy link

```
foo
```

Renders the following error:

  File "markdowneditor/lib/python3.12/site-packages/pygments/__init__.py", line 82, in highlight
    return format(lex(code, lexer), formatter, outfile)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "markdowneditor/lib/python3.12/site-packages/pygments/__init__.py", line 64, in format
    formatter.format(tokens, realoutfile)
  File "markdowneditor/lib/python3.12/site-packages/pygments/formatter.py", line 124, in format
    return self.format_unencoded(tokensource, outfile)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "markdowneditor/lib/python3.12/site-packages/pygments/formatters/html.py", line 979, in format_unencoded
    source = self.wrap(source)
             ^^^^^^^^^^^^^^^^^
TypeError: BlockHtmlFormatter.wrap() missing 1 required positional argument: 'outfile'
127.0.0.1 - - [12/Jul/2024 09:41:07] "POST /ajax/preview HTTP/1.1" 500 753

A workaround is to downgrade Pygments to version 2.11.2 which seems to be the last compatible version.

pip install Pygments==2.11.2

Seems related to pygments/pygments#2101

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

1 participant