pne: A picture of a plush toy, halfway between a duck and a platypus, with a green body and a yellow bill and feet. (Default)
[personal profile] pne

LiveJournal's HTML cleaner uses a parser which can parse HTML (but also understands XHTML).

This means, for example, that you can leave off quotes on attribute values if they consist only of letters, numbers, hyphens, dots, underscores, and colons. This is the reason why <lj user=exampleusername> and <lj user="exampleusername"> both work to produce [livejournal.com profile] exampleusername (though I'd prefer the latter)—the HTML cleaner doesn't see whether there are quotes or not and the output of the parser is the same in either case.

The fact that the cleaner uses an HTML parser also means that it does SGML-style attribute minimisation; if the value of an attribute in an HTML file is the same as its name, then you can leave off the value. For example, you can pre-check a checkbox in HTML with <input type=checkbox name=foo value=27 checked>, which would have to be <input type="checkbox" name="foo" value="27" checked="checked" /> in XHTML (which does not allow attribute minimisation).

And because the parser in the HTML cleaner does this, too, you can say <lj-cut text> (see it in action here: [this is cut]) and it'll be parsed the same as <lj-cut text="text"> :p Or even <lj user> which becomes [profile] user (i.e. <lj user="user">). Funny.

Date: Thursday, 15 January 2004 12:38 (UTC)
From: [identity profile] insel.livejournal.com
Was für einen HTML Dingens muss man benutzen, damit etwas als durchgestrichen erscheint?
Danke.

Date: Thursday, 15 January 2004 12:45 (UTC)
ext_78: A picture of a plush animal. It looks a bit like a cross between a duck and a platypus. (Default)
From: [identity profile] pne.livejournal.com
Im Allgemeinen? <strike> oder <s> (oder, wenn man's mit CSS machen möchte: <span style="text-decoration: line-through">).

Wenn du speziell <lj user> meinst (wie in [livejournal.com profile] deleted): das Durchstreichen passiert da automatisch, wenn der Benutzer sein Journal gelöscht hat.

Date: Thursday, 15 January 2004 12:53 (UTC)
asciident: (Default)
From: [personal profile] asciident
<del>!!

Date: Thursday, 15 January 2004 13:55 (UTC)
From: [identity profile] jordik.livejournal.com
Nicht immer, del wird am meisten durchgestricht im Browser gezeichnet, aber das muß nicht immer so sein: ich hab' ein Telephon mit Internet gesehen worauf del mit roter text gezeichnet wurde (in CSS: del {color: red;}).

Date: Thursday, 15 January 2004 13:57 (UTC)
asciident: (Default)
From: [personal profile] asciident
I don't know German, and what I could babelfish of your comment didn't make enough sense to me to reply. I'm not even sure you know English, alas. :)

Date: Thursday, 15 January 2004 14:35 (UTC)
From: [identity profile] jordik.livejournal.com
And here I was assuming you spoke only German!

Anyway, you cannot rely on del being rendered as strike-through. Not only can users override this in their user (or browser) stylesheets, page authors can also override it, and there are user agents which use a different rendering.

I've seen a phone with limited web browsing (not WAP!), where text was always black on white, but del was rendered as red text (CSS: del {color: red}). INS on that browser was blue.

Similarily you cannot rely on em being rendered in italics, or strong being rendered boldfaced.

Date: Thursday, 15 January 2004 14:40 (UTC)
asciident: (Default)
From: [personal profile] asciident
This is true of the strike, bold, and italic tags as well: this was struck out, this was bold, and this was italic. :)



<strike style="text-decoration: none;">this was struck out</strike>, <b style="font-weight: normal;">this was bold</b>, and <i style="font-style: normal;">this was italic</i>

Sorry for the double comment, I didn't close a tag!

Date: Thursday, 15 January 2004 16:27 (UTC)
From: [identity profile] jordik.livejournal.com
But those tags don't carry any semantic meaning, so it is not very likely they'll appear differently. They are cosmetic tags, and therefore don't belong in HTML but should be done with CSS.

EM, STRONG, DEL, INS etc. have a real meaning: even if they are all rendered the same as normal text their meaning is not lost.

Date: Friday, 16 January 2004 00:55 (UTC)
ext_78: A picture of a plush animal. It looks a bit like a cross between a duck and a platypus. (Default)
From: [identity profile] pne.livejournal.com
Ah, well.

In principle, yes—if you want to strike through text because you want to mark it as deleted.

Using <del> whenever you want struck-through text is like using <em> whenever you want italics and feeling you're "better" because you don't use the "evil" <i> tag. (For example, I tend to use <em> when talking, as with the "if" above, but <i> for things such as book titles or (sometimes) foreign words, which are conventionally italicised in English: the presentation [font-style] is the semantics in that case.)

But yeah, I suppose the most common case is indeed where you want to replace one word with another (in which case you really should follow it with <ins> as in this sentence example).

Date: Friday, 16 January 2004 12:12 (UTC)
asciident: (Default)
From: [personal profile] asciident
Which is precisely how I use the markup. (I continue to use the <i> tag for book titles, for example.) I admittedly couldn't read exactly what the first commenter asked. :)

Date: Friday, 16 January 2004 22:05 (UTC)
ext_78: A picture of a plush animal. It looks a bit like a cross between a duck and a platypus. (Default)
From: [identity profile] pne.livejournal.com
She asked, "What sort of HTML thingy do you have to use so that something looks struck-through? Thanks."

Date: Thursday, 15 January 2004 14:20 (UTC)
From: [identity profile] nik-w.livejournal.com
You should post this in [livejournal.com profile] lj_nifty - you'll be the hero of hundreds of bored teenagers and people with the IQ of a small cabbage going "omfg that's like sooooo kewl" and then get flamed by another few dozen because they don't know what you're talking about. Also, it'll probably be the first and the last time that the words "SGML", "attribute", and "parser" ever appear in an lj_nifty post;)

Date: Thursday, 15 January 2004 16:02 (UTC)
From: [identity profile] denial-land.livejournal.com
ditto on the [livejournal.com profile] lj_nifty thing ^^

Date: Friday, 16 January 2004 00:57 (UTC)
ext_78: A picture of a plush animal. It looks a bit like a cross between a duck and a platypus. (Default)
From: [identity profile] pne.livejournal.com
Well, people already know about leaving off quotes on the <lj user> tags since I've seen that pretty often.

And being able to say [profile] user and [personal profile] comm is of very limited use since the username is fixed. So I'm not sure whether it's particularly nifty.

Date: Friday, 16 January 2004 01:51 (UTC)
From: [identity profile] nik-w.livejournal.com
Ahh, but it doesn't have to be nifty to get into [livejournal.com profile] lj_nifty - people post all manner of stuff - e.g. the astounding fact that /userinfo.bml?user= leads to your own journal or that /todo.bml is not your personal ToDo list - in fact, the closer you come to stating the astoundingly obvious, the more people will love you!:p

Date: Friday, 16 January 2004 12:13 (UTC)
asciident: (Default)
From: [personal profile] asciident
Nifty is subjective. Not everyone who watches it knows all the intricacies of how LJ works. :)

Date: Thursday, 15 January 2004 20:36 (UTC)
From: [identity profile] sovereigna.livejournal.com
That's great and all, but I'm picky about my code.
That just allowing people to get sloppy and cheat...

Profile

pne: A picture of a plush toy, halfway between a duck and a platypus, with a green body and a yellow bill and feet. (Default)
Philip Newton

June 2015

S M T W T F S
 12 3456
78910111213
14151617181920
2122232425 2627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Friday, 30 January 2026 15:17
Powered by Dreamwidth Studios