Is there a way to post raw HTML code on DU?
Just tried posting simple HTML to quickly extract a particular string, only to find that DU strips out all anglebracketed tags: [xmp] [html][body] all vanish (as would these if had used anglebrackets instead of []
Neither 'excerpt' nor 'blockquote' prevents this.
Ended up using an image file to show the codewhich would not work for anything more complicated.
EarlG
(22,632 posts)For security reasons. It is possible to fake it with HTML codes, for example:
<html>
<body>
<img src="mypic.jpg">
</body>
</html>
Above, I used HTML decimal codes to insert the angled brackets. But it's a pain to do that for lengthy code excerpts, because each time you preview, the HTML codes get stripped out and replaced.
You can do it by creating a text doc and then replacing any restricted characters with the appropriate HTML codes, but you have to keep re-pasting it every time you preview. So it can be done, but not in a user-friendly way.
SorellaLaBefana
(257 posts)Besides being not user friendly, text editing <> to, say [[]] can introduce errors if the code contains Booleans.
As you point out, using either HTML decimal codes or &mnemonics is frustrating for the poster, and potentially introduces too much complexity for the reader.
Guess will stick with SIMPLE code and screenshots.
Again, thanks!
usonian
(14,600 posts)Off the top,
Copy and paste it into pastebin.com and give a link here.
(That's what pastebin was designed to do, IIRC)
A screenshot might serve as a preview, just so the post doesn't look empty.