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

Spellcheck doesn't work on any indented content #13

Closed
Archmonger opened this issue Nov 2, 2022 · 4 comments
Closed

Spellcheck doesn't work on any indented content #13

Archmonger opened this issue Nov 2, 2022 · 4 comments

Comments

@Archmonger
Copy link

Archmonger commented Nov 2, 2022

Describe the bug
Nothing that is indented will get spellchecked, such as mkdocs material admonitions.

mkdocs-spellcheck is assuming all indented content are always codeblocks.

Here are some potential fixes:

  1. Assume code blocks always fenced (using triple ticks ``` ). Indented code blocks have been fairly uncommon styling for a while now.
  2. Create two separate toggles for ignore_code and ignore_indents. Could alleviate this issue. I personally don't use indents for code blocks anymore, especially due to mkdocs-material's color formatted code blocks.
  3. Create some some heuristic matching to determine "what is a code block".

To Reproduce
Steps to reproduce the behavior:

  1. Install mkdocs-spellcheck
  2. Install mkdocs-material
  3. Create a admonition with a spelling error within the body

Expected behavior
Indented content should be spell checked

Screenshots
N/A

System (please complete the following information):

  • MkDocs SpellCheck version: 0.2.1
  • Python version: 3.10
  • OS: Windows

Additional context
N/A

@pawamoy
Copy link
Owner

pawamoy commented Nov 2, 2022

Hello, thanks for the report!

I don't think the cause is what you describe. This plugin operates on HTML, not Markdown, so indented blocks transformed into admonitions have no reason to be skipped 🤔

I'll take a look!

@Archmonger
Copy link
Author

One detail I forgot to mention is that ignore_code=no allows admonitions to be spelled checked. But obviously, all my actual code blocks end up spamming the console with warnings.

@pawamoy
Copy link
Owner

pawamoy commented Nov 2, 2022

Wow, there was a huge bug in the HTML stripper hahaha. For some reason I implemented a handle_stoptag method while it's actually called handle_endtag.

@pawamoy
Copy link
Owner

pawamoy commented Nov 2, 2022

Released in version 0.2.2 🙂

@pawamoy pawamoy closed this as completed Nov 2, 2022
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