-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Replace <em> with <span> for desc_annotation semantic HTML #13689
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
base: master
Are you sure you want to change the base?
Conversation
Replace <em class="property"> with <span class="property"> in HTML5 writer's visit_desc_annotation and depart_desc_annotation methods to improve semantic HTML structure for Python attribute type annotations. Fixes sphinx-doc#13688 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
0288b94
to
bba4f3d
Compare
Hi @q2mark this commit has the author of "Claude". Please confirm that this PR is entirely comprised of your own work, and you posses the legal right to copyright. A |
@AA-Turner yes this is entirely my own work and I have the right to copyright. |
* #13688: HTML5: Replace ``<em class="property">`` with ``<span class="property">`` | ||
for Python attribute type annotations to improve semantic HTML structure. | ||
Patch by Mark O. |
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.
Do you have a suggested link / reference for "semantic HTML structure"?
* #13688: HTML5: Replace ``<em class="property">`` with ``<span class="property">`` | |
for Python attribute type annotations to improve semantic HTML structure. | |
Patch by Mark O. | |
* #13688: HTML builder: Replace ``<em class="property">`` with ``<span class="property">`` | |
for Python attribute type annotations to improve semantic HTML structure. | |
Patch by Mark Ostroth. |
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.
@AA-Turner this is the current reference for all HTML elements.
https://html.spec.whatwg.org/multipage/text-level-semantics.html
Or MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements
Turns out we might want to use "var" and "code" but that could break existing themes. For now I am suggesting removing <em>
because the intention is not to emphasize text but to denote the purpose of the code.
Oh, please also add yourself to AUTHORS. |
Done. |
Purpose
This PR replaces
<em class="property">
with<span class="property">
in the HTML5 writer'svisit_desc_annotation
anddepart_desc_annotation
methods to improve semantic HTML structure for Python attribute type annotations.Changes:
sphinx/writers/html5.py
to use<span>
instead of<em>
tags while maintaining the existingproperty
CSS classtests/test_domains/test_domain_py_pyobject.py
Benefits:
The change maintains all existing functionality and CSS styling while providing better semantic meaning.
References