Hacker News new | ask | show | jobs
by Raphmedia 4086 days ago
I wish. But really, it mess up a lot of thing.

Styles may be wrongly applied, javascript may bind to the wrong dom elements, etc.

Most of the time, everything look really good in the wysiwyg box but breaks in the website. That empty tag might have a padding that adds extra whitespace on the website. Perhaps you added a <h1> or <h2> tag without noticing and this empty tag gets added to your navigation as an empty element.

I worked on a project where the user was using and modifying the same content page for the last 5 years. The page was glitchy as hell. Trust me, it didn't even look like HTML anymore. Hell, at first glance the whole HTML code looked like a big regex.

1 comments

I really have to wonder why wysiwyg is so difficult on the web when it's a solved problem on Desktop. I recommend looking at what markup iWorks Pages produces when you export to html - it's quite clean. Why not making a simple wysiwyg that

1) doesn't do any styles, it just operates using pure html tags. So no font for example.

2) cleans up empty tag as soon as possible (but at the latest when you hit save).

3) treats newlines as follows: single newline = <br>, double newline = new <p> tag. Regarding <p> tags there is exactly two states: Having one open and having none open.

Does it really have to be that hard?

This is pretty much what CKEditor does if you configure it to do that (simple toolbar, enter inserts <br>)

Thinking about it, the correct thing to do is to use <p> for each line, but allow the user to specify single or double spacing.

This is approximately what real word processors do, because often you will want one line to be left-aligned (e.g. to show English text) and the immediately next line to be right aligned (e.g. to show Hebrew text).