[whatwg] contenteditable, <em> and <strong>

mail at jorgenhorstink.nl mail at jorgenhorstink.nl
Wed Jan 10 04:14:27 PST 2007


I've been reading this discussion and I do not get the point. It looks
like we are discussing about the traditional bold button, but to my mind
we should discuss about the logic behind that button.
First of all I want to state that to my mind Alexey Feldgendler was
absolutely right when he said: "WYSIWYG is always presentational because
its goal is to produce a document which is as close as possible to the
“original” that exists in the author's imagination.".

So, the regular joe who uses a WYSIWYG tool does not care about semantics.
He actually thinks in presentation and just want to make the selection
bold. This is how Word it does, how OpenOffice it does and how whatever
typewriter it does.

The question is, what logic lies beneath the typical bold button? I've
been developing a lot of wysiwyg tools and analyzed a lot of them. Almost
every tool I have seen just uses the bold execCommand;

execCommand('bold', false, null);

So the question is, what should this command return? As the name of the
command states, a request is made to make the selection bold. So use a <b>
element! I suggest to extend the Command Identifier List to also allow
'important' and 'emphasis'. The latter should use a <em> element and the
former the <strong> element.

execCommand('important', false, null);
execCommand('emphasis', false, null);

Now we have defined the right purpose of the specific command identifiers,
it is up to the author of the WYSIWYG tool to decide which command to use.
An author who knows about semantics and has read this discussion would use
the bold command for the bold button and the italic command for the italic
button.

To emphasize text of to make text important, extra buttons or menu items
should be used. The way the traditional bold and italic buttons are being
used should not be altered. That would be inconsistent.

--cheers




More information about the whatwg mailing list