https://bugzilla.wikimedia.org/show_bug.cgi?id=24662

--- Comment #3 from Thana <m8r-cyc...@mailinator.com> 2010-08-15 19:37:00 UTC 
---
the mw parser already replaces consecutive spaces by a single space:
> <span style="font-size:        larger;">HELLO       1</span>
outputs cleanly as:
> <span style="font-size: larger;">HELLO 1</span>

however it does not remove single undesired interior spaces, including
those before the colon and semi-colon in the following:
> <span style=" border : 1px solid red ; ">HELLO 2</span>

either of which cause the parser to reject the above as a malformed css
property, rather than attempting to clean it up. the outputted html is
in fact:
> <span style="">HELLO 2</span>

no use of the php trim feature or of a tautological parser function as in
your example would prevent this invalidation if the spaces are not at the
beginning or end of user input.

i suppose you could have the parser do some tidying like this inside the
aggregate style attribute (carefully to avoid removing needful spaces as
within "1px solid red"):
> $style = preg_replace('/\s*(^|[\:\;]|$)\s*/g', '\\1', $style);

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to