strapdown icon indicating copy to clipboard operation
strapdown copied to clipboard

XMP tag has been deprecated since HTML3.2

Open jamesmortensen opened this issue 10 years ago • 10 comments

I found this library to be very useful, and one of my colleagues used it to help us build API documentation that didn't require us to replace all of the > and < with &gt; and &lt. In fact, I see it as a competitor to static-site generator tools like Jekyll, Octopress, and DocPad. In fact, that's exactly what we did with our API documentation. we used Strapdown.js to create a static page.

However, it recently came to my attention that <xmp has been deprecated since HTML3.2.

Should you consider using a non-deprecated tag in this library, such as <pre> or <code> as suggested by the Mozilla HTML documentation on XMP?

Note: Do not use this element.

  • It has been deprecated since HTML3.2 and was not implemented in a consistent way. It was completely removed from the language in HTML5.
  • Use the <pre> element or, if semantically adequate, the <code> element instead. Note that you will need to escape the '<' character as '&lt;' to make sure it is not interpreted as markup.
  • A monospaced font can also be obtained on any element, by applying an adequate CSS style using monospace as the generic-font value for the font-family property.

jamesmortensen avatar Jun 28 '14 18:06 jamesmortensen

I think the deprecation of the <xmp> tag makes the tag unique for Strapdown.js ... ∩(︶▽︶)∩

ghost avatar Nov 29 '14 08:11 ghost

http://stackoverflow.com/a/10830811

binarez avatar Nov 05 '15 06:11 binarez

Except it doesn't make it unique. It simply leaves the library open to undefined behavior as described in the Stack Overflow link. If everyone decided to go out and make up their own tags, then the Internet would be a mess. There is nothing I see special or unique about Strapdown.js that isn't special or unique about some other library or tool that does use semantically correct markup.

If there is a good reason for this, it would be interesting to hear. I'm not against the idea of making up tags in practice, as long as it's not just because of ignorance of how HTML works.

jamesmortensen avatar Nov 05 '15 09:11 jamesmortensen

For reference "undeprecating" the

tag for the benefit of strapdown and others was rejected by w3 (in 2013) as wont fix. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12235#c15 <p>Would a sensible way forward be to support a custom tag based on </p><pre> as an alternate syntax? </pre>

tortoise74 avatar Jan 06 '16 00:01 tortoise74

Wouldn't it just work to use a div? I'm no html expert but it seems like that is what most libs do, no? Le 5 janv. 2016 7:35 PM, "tortoise74" [email protected] a écrit :

For reference "undeprecating" the

tag for the benefit of strapdown and others was rejected by w3 (in 2013) as wont fix. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12235#c15 <p>Would a sensible way forward be to support a custom tag based on </p><pre> as an alternate syntax? <p>— Reply to this email directly or view it on GitHub https://github.com/arturadib/strapdown/issues/40#issuecomment-169178700.</p> </pre>

binarez avatar Jan 06 '16 01:01 binarez

It works with textarea right now

dotku avatar Jan 15 '16 22:01 dotku

I know I'm late to the party but I would suggest using <script type="text/markdown"> as the container tag. This won't encode HTML entities and you won't have to set display:none; styling on it as well.

jbenner-radham avatar Jun 16 '18 18:06 jbenner-radham

That is what other libraries do which involve using different language, but I generally see that with scripting languages like Coffeescript or Brython, not markup languages.

jamesmortensen avatar Jun 16 '18 18:06 jamesmortensen

That's a good point. Although it's not uncommon to see markup in text/x-template tags for various template systems like Handlebars, Vue, etc. it's not the most semantic implementation I agree. The only other thing I could think of would be something like <template class="markdown">.

jbenner-radham avatar Jun 22 '18 13:06 jbenner-radham

<template> is meant for HTML code that is not readily rendered by a client, but instead leaves it in the DOM for scripts to manipulate.

Since any content is allowed, it's an obvious candidate as an alternative to the deprecated <xmp> tag.

mookid8000 avatar Oct 31 '18 12:10 mookid8000