The <TR> is similar to <BR> for the Plain text, thus when reading it
add the new line, if needed.
The WebKit returns correct `\n` in the node's innerText, but using it
as a plain text hides it for the user, thus split the lines and add
them as separate paragraphs.
When traversing the HTML structure the to-be-removed nodes in the middle
of the text could prevent correct move between nodes, by traversing into
them and immediately removing the node.
* Unlinkify mailto: anchors, which causes trouble on wrapping inside quoted text.
* Merge consecutive text nodes before wrapping to simplify the algorithm
While the BLOCKQUOTE node is considered a clock node, it's not a real
block node for paragraph quoting, thus special-case it and requote
its content instead.
This could exhibit in certain occasions when deleting content inside
quoted part using Backspace or Delete keys.
As the split (after Enter key press) splits the BLOCKQUOTE up to
the BODY, it's necessary to backup all of that. Otherwise, when
splitting in the second or higher BLOCKQUOTE level, the undo does
not have correct information and misbehaves.
This allows to save JavaScript plugins, files with .js extension,
into `$PREFIX/share/evolution/webkit/preview-plugins/` or into
`~/.local/share/evolution/preview-plugins/` for the message preview
and into `$PREFIX/share/evolution/webkit/webkit-editor-plugins/` or
into `~/.local/share/evolution/webkit-editor-plugins/` for
the WebKit composer.
The plugin is an object, which contains two members:
* `name` - a string with a name of the plugin
* `setup(doc)` - a setup function
The argument of the `setup` function is a `document`, which can
be either the main document or an iframe document. The function
can be called multiple times for the same document.
The preview plugin registers itself by calling `Evo.RegisterPlugin(plugin_instance)`.
The WebKit editor plugin registers itself by calling `EvoEditor.RegisterPlugin(plugin_instance)`.
Quoted lines with spaces only also added an extra <BR> when converting
from plain text, which leads to doubled quotation marks and misbehavior
when splitting the blockquote with the Enter key.
In the Plain Text mode, when changing paragraph format to UL/OL, its width
was not properly set, which drew the long lines unwrapped. Switching to HTML
mode and back did set the expected wrap width.
Similarly, when converting HTML into plain text (on send), the wrap width did
not count width of the UL/OL prefix, making the line longer than it should be.
Insignificant new lines in the text are those in regular <div> and such,
where the white-space style doesn't mean to keep them. Those could cause
trouble when switching from HTML to the Plain Text mode, like to have doubled
new lines. WebKit doesn't remove them on its own, unfortunately, thus this
special processing is needed.