Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

SorellaLaBefana

(229 posts)
Sun May 12, 2024, 10:15 AM May 2024

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 code—which would not work for anything more complicated.

3 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
Is there a way to post raw HTML code on DU? (Original Post) SorellaLaBefana May 2024 OP
You cannot post raw HTML code on DU EarlG May 2024 #1
Thanks. Suspected that might be the case. SorellaLaBefana May 2024 #2
What would I do? usonian May 2024 #3

EarlG

(22,540 posts)
1. You cannot post raw HTML code on DU
Sun May 12, 2024, 10:41 AM
May 2024

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

(229 posts)
2. Thanks. Suspected that might be the case.
Sun May 12, 2024, 11:04 AM
May 2024

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

(13,782 posts)
3. What would I do?
Sun May 12, 2024, 11:53 AM
May 2024

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.


Latest Discussions»Help & Search»Computer Help and Support»Is there a way to post ra...