-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
pyspelling markdown filter is not processing <details> & <summary> tag blocks in GitHub markdown files. #192
Comments
It is unclear to me how you've configured pyspelling or its related filters. Please provide a minimal, reproducible example. |
Here's the Pyspelling config on our repo: |
Here's a minimal sample Markdown that will cause pyspelling to flag errors where there shouldn't be: If you want to set up the developer environment on your local workstation, expand the section below and follow the requirements listed.
<details markdown=1>
<summary markdown="span"><strong>Click to expand/collapse Hidable Section</strong></summary>
Some content
`code snippet foobar`
[link](https://url.notarealword.com)
More content
</details> In the sample MD snippet above, "notarealword" from the URL, and "foobar" from the codesnippet are flagged by pyspelling. I assume it's because the pyspelling markdown filter is not rendering content after the details tag to HTML, and thus the pre, code, and a (href) tags are not being rendered in the HTML output that is being sent to the spell checker, so the spell checker treats them like any other text. |
So, the current Markdown filter is using Python Markdown. Python Markdown will not process "Markdown content" in a block HTMl tag unless |
Thank YOU! That was the fix! I guess I was only looking at your extensions (https://facelessuser.github.io/pymdown-extensions/extensions/), not the extensions for Python Markdown themselves. I'm happy to close the issue, but not sure if it's worth calling this out for others who may stumble upon the same scenario? |
It wouldn't hurt to mention in the filter documentation that people can use the built-in markdown extensions or others. |
I recently started adding collapsible sections to the Markdown files in my repo to hide certain sections as per the GitHub docs: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections
Markdown sample from the GitHub docs link above:
This led to an issue where GitHub pages was not rendering the HTML properly. Everything in the Markdown file beyond the first details tag was rendered as the original Markdown in plain unformatted text. I was able to correct this and fix it based on this answer deep in another repo's issue: gettalong/kramdown#155 (comment)
At the same time GH Pages weren't rendering, I observed that pyspelling appeared to be evaluating all text beyond the first details tag in the Markdown file for spelling issues. While the fix above resolved the rendering issue for GitHub Pages, it has not resolved it for pyspelling.
I understand that "pyspelling.filters.markdown" converts Markdown to HTML, then passes the HTML content off to pyspelling. I suspect the "pyspelling.filters.markdown" filter is also not processing the Markdown content after the first details tag in a Markdown file.
Here is a specific example from my repo where PySpelling is not working properly: https://github.com/microsoft/WhatTheHack/blob/master/015-Serverless/Student/Challenge-01.md#setup-local-workstation
Any suggestions on how to resolve this issue?
The text was updated successfully, but these errors were encountered: