pawamoy / mkdocs-spellcheck

A spell checker plugin for MkDocs.
https://pawamoy.github.io/mkdocs-spellcheck/
ISC License
15 stars 3 forks source link

Spellcheck doesn't work on any indented content #13

Closed Archmonger closed 1 year ago

Archmonger commented 1 year ago

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):

Additional context N/A

pawamoy commented 1 year ago

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 :thinking:

I'll take a look!

Archmonger commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Released in version 0.2.2 :slightly_smiling_face: