News for hackers. Stuff that matters.
Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by mattmanser on Monday August 13, 2012 @10:25AM (#4376006)
I do like it, one question though, anyone can speculate as to why he says use an xmp tag, but then himself uses a textarea on the page? And will google index it?
Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by arturadib on Monday August 13, 2012 @10:40AM (#4376078)
Good question. I used <textarea> since I have the unusual circumstance of having to write down "</xmp>" in my Markdown, which would close the opening <xmp> if I had one :)

Most users won't have to do this.

Google does index <xmp>, see e.g. the search result for "devo site:www.the-pope.com". The word "devo" is inside <xmp>.

Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by taylorfausak on Monday August 13, 2012 @10:37AM (#4376062)
I hadn't heard of the <xmp> tag before now. His reasoning ("so that users don't have to escape special HTML characters") seems to be correct, except that it's a deprecated tag (http://stackoverflow.com/q/4545). Perhaps he used a <textarea> on this page so he could have the literal "</xmp>" in it?
Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by arturadib on Monday August 13, 2012 @10:42AM (#4376093)
That's correct. Although the tag is deprecated, I've tried it with all modern browsers (IE and mobile Safari included), and it seems to work just fine.

I'd think it would take a long time to phase this tag out as it was apparently popular among HTML spec writers, which means there's probably a ton of them still in the wild:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=12235

Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by RyanMcGreal on Monday August 13, 2012 @01:54PM (#4377097)
Couldn't you just escape it, i.e.

    <\/xmp>
inside the text?
Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by taylorfausak on Monday August 13, 2012 @02:27PM (#4377273)
There's no provision for escaping things inside an <xmp> tag. From the HTML 2.0 spec: "no markup except the end-tag […] is recognized" http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.5.2...
Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by __chrismc on Monday August 13, 2012 @10:36AM (#4376055)
The .js seems to allow for either.

I would speculate (after no more than a cursory glance) that using the xmp tag is the Google-indexable method of writing your page? Google should see it as plain text on a web page.

Textarea support could be to provide interactive/editable pages?

Re:Show HN: Strapdown.js - Instant and elegant Markdown docu... by Alexandervn on Monday August 13, 2012 @10:34AM (#4376050)
And if Google can index this, it probably values all text the same; it's just plain text.