Closed hack3r3d closed 1 year ago
What is a "self-closing img tag" (<img />
?) and why do you want to change its behaviour?
I don't want it to <img /
> I want it to be <img></img>
Why is because it's better html.
Why is because it's better html.
Even though <img></img>
is valid XHTML, it actually is invalid HTML5:
Void elements only have a start tag; end tags must not be specified for void elements.
– Source: https://html.spec.whatwg.org/multipage/syntax.html#elements-2
Start tags must have the following format: …
- Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.
– Source: https://html.spec.whatwg.org/multipage/syntax.html#start-tags
Simply put: <img></img>
is invalid HTML5, it must either be <img>
(i.e. without a closing tag, but this is invalid XHTML), or <img />
(both valid XHTML and HTML5). So I'd recommend not to do stuff like that. <img />
is perfectly fine.
Anyway, you could extend Parsedown to transform your Markdown to whatever you like - or simply add the plain (X)HTML in your Markdown files.
I don't want to get into a debate about html, but the answer it to extend Parsedown? The result I'm going for is just <img>
Thanks.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1:
I don't know that this is the correct forum for this sort of question, but how to change pico so it doesn't self-close img tags?