On Wed, May 12, 2010 at 2:24 AM, Alex Brollo alex.brollo@gmail.com wrote:
This question gives me the opportunity for a question to experts about server load. Is really so harder for the server to manage html tags like <b>, </b>, <i>,</i> instead of usual wiki markup ''', ''?
No, it's much easier. <b> and <i> are handled in one pass with all the other HTML elements, ''' and '' require their own horrible hacky unpredictable pass in the parser. ''' and '' are intended to be more user-friendly, not more robot-friendly. If we could kill them now, I'd be all in favor, but it's way too late for that.
The former have a great advantage since they are "well-formed tags"
They don't have to be well-formed. <b><i>Hi there!</b></i> is "valid" wiki markup, in that it will do what you want and nothing complains about it. You can also omit closing tags.
(even if they are "deprecated html tags"),
<b> and <i> are not deprecated in any standard we care about.
while wiki markup is not at all; this would make much simpler to manage them by some bot scripts. Sometimes I found almost impossible to select markup aposthophes from text apostophes in Italian texts by a script.
Yes, it's pretty terrible. Your only reliable bet is to reverse-engineer doQuotes() from includes/parser/Parser.php. Although of course that's run after various other passes are already done, particularly preprocessing, so even then it won't be totally reliable.
On Wed, May 12, 2010 at 7:39 AM, Svip svippy@gmail.com wrote:
Which reminds me, why doesn't it translates into <strong> and <em>
This is completely wrong. <b>/<i> originally meant "make this bold/italic, for no particular reason". This is what people actually mean when they type '' and ''', so pretending they necessarily want emphasis is wrong. Wordpress does this -- they have buttons that look like the bold/italic buttons from Word or whatnot, but actually create <strong> and <em>. That defeats the entire point of using <strong>/<em> instead of <b>/<i>. It's standards cargo-culting.
or better yet, <span style="font-weight: bold"> and <span style="font-style: italic;"> ?
These have the exact same semantics as <b> and <i>, but are much longer, so there's no point in any practical sense. We should try to follow standards even if they don't make much sense (as long as they're not too harmful), just to be supportive and pro-standards and whatever. But we don't need to do stupid things that *aren't* actually required by standards, and this isn't.
On Wed, May 12, 2010 at 9:19 AM, Svip svippy@gmail.com wrote:
Okay, correct, but it is 'discouraged'. They even removed them in XHTML 2.0, not that anyone uses that. Though, I don't think it is going out of HTML5.
<b> and <i> are not deprecated or removed or discouraged in HTML5, or in XHTML 1.0 Transitional, which are the standards we use. You can read the HTML5 definitions at http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-i-element. They're cleverly defined to be semantic elements whose semantics are "whatever people use bold or italics for":
"The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized."
"The b element represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened."
See, it's semantic! :P The examples there (for both elements) do highlight a lot of cases where you really do need bold or italics but it's not for emphasis or anything else we have an actual tag for. Using <span style="whatever"> in all those cases would be silly.
According to the HTML5 spec, authors SHOULD use (or are encouraged to consider using) <b>/<i> only when there's no more suitable replacement like <strong> or <em>. They MUST not use <strong> or <em> for anything other than emphasis (see http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#semantics-0). But we can't enforce either of those at the software level, so it's up to users to comply themselves. If they don't, we should at least have them violate the SHOULD/"encouraged to consider" instead of the MUST, if you want to do standards-lawyering.