Closed ngulden closed 2 years ago
The funniest part is that this bug can be seen on this project's own documentation: https://sphinxcontrib-spelling.readthedocs.io/en/latest/customize.html#word-filters
Boolean controlling whether words that follow the CamelCase conventions used for page names in :spelling:word:`wikis` should be treated as spelled properly. Defaults to
True
.
I guess no one checked if it work correctly? It has tests, but they seem to only check if the spell checker correctly ignores the words, not if the rendered output is correct.
This feature was added as part of 9cef7caf1a7c26e0f500f816f79f64af95274fa6 from PR #184, which seems to be the only change in v7.6.0.
The role is actually working though. I semi-confirmed this by editing https://github.com/sphinx-contrib/spelling/blob/f4a419ed6341ba929c0007e82eb1652d9ee60d38/sphinxcontrib/spelling/role.py#L10 to return immediately, and then the words are correctly marked as misspelled.
Turns out the cause is quite simple: the nodes.Text
object from docutils does not hold both the raw text and the "real" text, so it is being passed the raw text, which includes the role name as we see it. I was able to fix it, I'll try to open a PR for it if I can get some valid tests to cover this case.
The fix for this issue was released in version 7.6.1
Perfect. Thank you very much for the quick fix and the new release. I tested it and now it works as expected.
I have a document in English with German translation using gettext.
In my German translation I mark words as correct spelled in the PO file:
Unfortunately, the HTML output is the same:
I have the same behavior, when I use the role in the English originating language of the document.
To me, it looks broken. This behavior makes the role useless to me, because the rendered HTML prints the role definition completely instead just the word.
The spellcheck works though. The marked words are not considered as miss spelled.
I use Sphinx 4.5.0 and sphinxcontrib-spelling version 7.6.0.