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 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. :)

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 23:16
Powered by Dreamwidth Studios