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
Code block not transformed correctly release 1.0.4 #1692
Comments
@chenfj068 |
Looking at the source of your comment, it appears that you have not included a blank line both before and after your code blocks. That could be the cause. However, without a proper example, it's hard to say. Please provide an example as source Markdown, not rendered HTML. In other words, copy a sample document in and nest the entire document in a code block. |
some code piece like this, I rendered the .md file with python-markdown,output html was not correct. |
I edited your comment to include the entire Markdown document in a code block. Did I get that correct? It is still not clear to me what your problem is. In any event, if you are having a problem with Markdown rendering then that is an issue for Python-Markdown that you should report upstream. However, note that Python-Markdown is a Markdown parser, not a Commonmark parser (which is what GitHub uses). There are known differences between them. |
Are you including Python Markdown's |
@facelessuser MkDocs includes |
Oh, I did not know that, I thought it was just Well, I'm out of ideas without a clear reproducible example. |
Thanks @facelessuser @waylan |
If you are directly calling Python-Markdown, then you need to explicitly include the extension. If you are using MkDocs, the extension is included for you. @facelessuser, the docs for the markdown_extensions config setting state:
Although, technically, the |
Sure, I didn't doubt it was documented, only that I didn't realize it. Like I said, I'm just glad my extension overrides it safely 🙂 . |
Thanks all |
Sorry guys, I seem to be hit by this bug. Bug occurs for themes |
@marcvs what is the generated HTML for the code block. You may need to use your browser's "view source" or "inspect" tool to obtain the HTML. And please, do not paste your entire page, only the relevant section for the code block. |
This is the output in html:
|
That is a valid code block. If it is not displaying correctly, then that would be an issue with the theme's CSS. Is this a problem for all code blocks or only this specific one? |
It's a problem for all code blocks that I have. I'm using four in the project. Most with triple backtick, one with four spaces. Both result in being surrounded with
|
Can you provide an example of the Markdown for a code block? |
|
I.e. literally, the text entered in github |
Screenshot of source here |
My generated html file includes several css files:
Only if I comment out the first, changes in the latter become visible. Also the code is then fromatted correctly. Unfortunately most formatting seems to be done in that first file, which seems to be some kind of compiled/optimised css code. I uncompiled it and compared it with the working css. (I have no clue about css).
|
I can't replicate your behavior. Regardless, note that the Any local modifications to the upstream theme to make it fit better with MkDocs are done in the Finally, note that the |
Thanks for the background info. I can patch that file locally as a workaround.
Sure. But for the record: the same problem (no linebreaks found, "code" or "pre code" statement in theme_extra.css ignored) occurs for the shipped |
I'm running into this same problem, you can see a reproducible example by just cloning https://github.com/segrelab/comets-manual I am not sure by reading the above whether this is the right place to ask, or I should ask the readthedocs folks? |
markdown code block not correct transformed,
eg .
the transformed content is
It seems that the newline characters are escaped
The text was updated successfully, but these errors were encountered: