-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-139257: escape enumerator-like letters to support docutils 0.22 #140031
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
Conversation
Escape things that look like Roman numerals. Docutils 0.22 includes a new roman-numeral interpreter that falls over some of our content. Escape anything that causes trouble. Python itself isn't using docutils 0.22 yet for its doc generation, but some Linux distributions have updated to it.
8920f8f to
799e7bb
Compare
picnixz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if this change is actually sufficient it's good. But that means that we need to be careful when adding roman-like text. What I find annoying is the Q/A modifications, but I don't know how we could do otherwise.
|
This feels like a Docutils bug if it requires this much escaping? A |
That's because we have no way of disabling roman numeral handling in docutils >= 0.22, unless we specify compatible enumerator-like objects (that are implementation details in docutils and only in >= 0.22). See the issue for the commit that changed this. |
|
Note: what would be ideal is for docutils to check first the return value of a converter, and if it is None, then assume that the conversion is disabled. That would be the cleanest way to do it (and our monkey patch would be compatible with older docutils versions) |
Presumably that's what @birkenfeld thought when implementing the monkey-patch in #48813. The alternative here is to re-instate #139258 and update the monkey-patch. |
|
I added a second commit to remove the monkey-patch entirely. But instead of doing that, we could make it raise an explicit exception, to avoid accidentally introducing Roman-numbered lists. |
Other FAQs use headings for the questions, which also makes them linkable: |
That would indeed be better. I think we have two distinct issues:
|
We don't have a single clean method to disable roman lists across docutils versions, but we can blow up the bulid cleanly...
Docutils 0.22 does not allow referencing a link that was implicitly named earlier in the document, it complains: ERROR: Duplicate target name, cannot be used as a unique reference: "basic authentication".
Docutils 0.22 doesn't allow the contents directive to be used within an only directive, it complains: ERROR: The "contents" directive may not be used within topics or body elements.
feb1cfd to
8e6c0cc
Compare
Changed to that. Also, added a couple of additional commits for other docutils 0.22 issues. |
|
See PR #142056 for an alternative. |
Escape things that look like Roman numerals. Docutils 0.22 includes a new roman-numeral interpreter that falls over some of our content. Escape anything that causes trouble.
Python itself isn't using docutils 0.22 yet for its doc generation, but some Linux distributions have updated to it.
An alternative to GH-139258
📚 Documentation preview 📚: https://cpython-previews--140031.org.readthedocs.build/