Franz skrev 11. okt. 2011 10:58:
> Hi,
> 
> as I extended the CKEditorPlugin for Trac, I found that Trac formats
> underlined text by this line of code:
> <span class="underline"> As far as I understand this is defined in
> http://trac.edgewall.org/browser//trunk/trac/wiki/formatter.py#L409
> 
> CKEditor uses the u-tag for underlined text, so there is a difference,
> which has to be handled.
> 
> But why are you using the span-tag, when there is a u-tag? Isn't the u-
> tag the official / nicer solution?

I can't answer for the decision by the trac-team to use the span tag --
but in general there are two approaches to html -- the "old" one and the
"new" semantic model.

In general tags like <b> (bold) and <u> (underline) have been phased out
in favour of semantic tags like <em> (emphasis) and <strong>. This is a
"write what you mean, not what it might look like" approach.

This separation between semantics and style is part of the design behind
css. One might argue that using a span is the worst of both worlds --
but at least the span tag is intended for adding among other thing
visual style to a document without complicating the document structure.

There are two reasons for this; a) making the html document more easily
machine readable, and b) because of a) makking the html document easier
to render "with it's intended meaning" by a user-agent for a user.

Eg: In Japanese, there is no meaningful "underline", and emphasis is
often made by using a different script (katakana) (Not that I know of
any browser that renders <em> as katakana -- but it would be possible in
theory).

Similarly a screen reader might try to emphasise a word verbally --
rather than reading "underline, word, underline stop" or something similar.

So, no. the "u"-tag isn't necessarily a better/more official approach.


Best regards,

-- 
 .---.  Eirik Schwenke <[email protected]>
( NSD ) Harald HÃ¥rfagresgate 29            Rom 150
 '---'  N-5007 Bergen            tlf: (555) 889 13

  GPG-key at pgp.mit.edu  Id 0x8AA3392C

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to