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

Inconsistent markdown processing between github and wiki #22

Open
LukeEff opened this issue Mar 27, 2023 · 3 comments
Open

Inconsistent markdown processing between github and wiki #22

LukeEff opened this issue Mar 27, 2023 · 3 comments

Comments

@LukeEff
Copy link
Contributor

LukeEff commented Mar 27, 2023

I noticed in a recent PR I merged the markdown has not formatted as I expected in the wiki.Particularly, Most of the indented lists were not recognized by the live website.

Here's an example of the discrepancy.
correct
screen

And here's the code: https://github.com/risk-of-thunder/R2Wiki/blob/master/docs/Mod-Creation/C%23-Programming/Debugging-Your-Mods.md?plain=1#L165-L189

If this is working as intended, is there a syntax issue (such as improper spacing) that results in it not processing properly?
Also, is there a markdown processing plugin that can be installed that better reflects the "live website"?

@xiaoxiao921
Copy link
Member

xiaoxiao921 commented Mar 27, 2023

Yeah I had to fix it manually, this is most likely due to mkdocs having a different processor than the one used by mkdocs GitHub I'm afraid

@LukeEff
Copy link
Contributor Author

LukeEff commented Mar 27, 2023

You're right, I'm looking through the wiki right now.

mkdocs claims to use the Python Markdown library for translating the Markdown to html.

I have successfully replicated the issue by using their interpreter via a script i threw together:

import markdown

with open("docs/Mod-Creation/C#-Programming/Debugging-Your-Mods.md", "r", encoding="utf-8") as input_file:
    text = input_file.read()
    html = markdown.markdown(text)
    print(html)

@LukeEff
Copy link
Contributor Author

LukeEff commented Mar 27, 2023

Python-Markdown/markdown#3 (comment)

Must be 4 spaces for indentation to be registered for python-markdown, while Github's website uses an internal processor that allows a few as 2 spaces to count as an indentation.

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

2 participants