FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove self-closing tags by hugovk · Pull Request #226 · python/python-docs-theme · GitHub

Repository navigation

Remove self-closing tags - #226

Merged
AA-Turner merged 1 commit into
python:mainfrom
hugovk:deslash
Apr 7, 2025
Merged

AA-Turner merged 1 commit into
python:mainfrom
hugovk:deslash

Conversation

hugovk commented Apr 7, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

Self-closing tags (<tag />) do not exist in HTML.

If a trailing / (slash) character is present in the start tag of an HTML element, HTML parsers ignore that slash character. This is especially important to remember for elements such as <script> or <ul> that do require a closing tag. In these cases, adding a trailing slash in the start tag does not close the element. Instead, the trailing slash is ignored, and the element is treated as open until an explicit closing tag is encountered or until the parser implicitly closes the element based on the HTML structure and parsing rules. For example, in the case of <div/>Some text, browsers interpret this as <div>Some text</div>, treating the slash as ignored and considering the div element to encapsulate the text that follows.

https://developer.mozilla.org/en-US/docs/Glossary/Void_element#self-closing_tags

Let's omit them: they're ignored, could be misleading (give the false impression they do something when they do not) and are ugly (IMO).


📚 Documentation preview 📚: https://python-docs-theme-previews--226.org.readthedocs.build/

AA-Turner merged commit e0b4a33 into python:main Apr 7, 2025
hugovk deleted the deslash branch April 7, 2025 18:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL