Let's say the WYSIWYG editor's value is:
my text and my bold and my italic text.
And the WYSIWYG's INTERNAL value (the value that it keeps on a variable) is:
my text and my bold and my italic text.
Now, when you click the BOLD icon on the WYSIWYG, the value of the editor could be changed to:
my text and my <b>bold</b> and my italic text.
BUT at the same time, the WYSIWYG's INTERNAL value would be:
my text and my <strong>bold</strong> and my italic text.
Do you see where I'm getting at? The browser could create its own markup to display the code on WYSIWYG, but the WYSIWYG itself would have an internal value, where it would edit the HTML, keeping it valid and compliant, without it being altered by the browser.
Now, the big problem is to like the editor's <b> with the internal <strong>. I'd say something with IDs there could work. For example:
my <b id="strong_1">bold</b> text
AND
my <strong id="strong_1">bold</strong> text
Now when the WYSIWYG edited the B, it would also KNOW that it had to edit the STRONG.
Am I being clear enough? :S Because I feel that I might sound a bit confusing
And then, when submitting, the WYSIWYG would remove all internal ID information, and the end result would be
my <strong>bold</strong> text.
Clean, and without the browser inconsistency (using B instead of STRONG, just an example, I know it probably wouldn't be like that, but this is just an example of a way in which a browser could be producing undesired code).
What do you think? Couldn't it be done?