Title
Allow style="" attribute and inline CSS in comments
Short, concise description of the idea
I would like to see the style="" attribute allowed in HTML tags in LJ comments. This tag is used for a variety of things, from color formatting to background images such as sparkletext.
Full description of the ideaThe style="" attribut is being stripped
(
Read more... )
Comments 15
(The comment has been removed)
Reply
Just testing…
[Edit: even worse, the style shows up on the preview but not when it's posted.]
Reply
(The comment has been removed)
Reply
Reply
Reply
Reply
CSS is useful. Blocking style attributes entirely is throwing the baby out with the bathwater. Which is silly, because who throws out bathwater? There's a drain in the tub for a reason! (And Perl modules for parsing CSS.)
To quote Evan from an e-mail way back in 2003 that discussed some of the issues with a CSS cleaner:
So, the situation is this:
- We can't strip CSS completely, because the users will bitch.
...
Ha!
Given the implementation of frivolities like Facebook and Twitter logins, I don't think there's any excuse for playing the "but it'd be hard and require developer time" card to avoid cleaning CSS properly. Integrating a proper CSS parser shouldn't take more than a couple of days. Figuring out what CSS to whitelist might take a little longer, but properly implemented shouldn't be any harder to change than the HTML tags are. And Mart's list from back then is still pretty good:
In fact, I'd go so far to say that we could just define a subset of CSS that we allow and deny everything else. Off the top of my head, the ( ... )
Reply
(The comment has been removed)
Wow, 2006. Which shows you just how long it's been since I've looked at LJ's code--last time I was in there, that wasn't. :) (Ah, the days when the bugtracker was public.)
CSS::SAC has undergone some updates since then (probably all of them have), so it's likely to have improved. Though I'm not sure CSS::SAC's selector parsing is even relevant in this case: you can't put selectors in style attributes anyway. (And if there's a bug, surely it'd be easier to, ya know, fix the bug rather than start from scratch.)
Reply
Please do!
Reply
Reply
Leave a comment