A more advanced pattern that tries to take quotes into account. In case
this pattern does not work, this commit can be reverted and instead a
simpler pattern is used that relies on html tags being opened and closed
with < and > brackets. It assumes that < and > are always part of HTML
tags so any textual (content) occurrence should be replaced with html
entities (escaping).
This modification fixes issues w.r.t. message caused by loss of styling
due to opening/closing <plaintext> tags. Additionally it simplifies
html / plain text message handling and text replacement.
Implemented a different approach to ChatMessage processing. This new
implementation strictly watches for the moment when a chat message
(possibly HTML already, but might also be plain text) is definitely
converted into HTML. This happens when certain processing steps are
taken.
As soon as these processing steps are taken, the approach changes into
HTML by default and every piece of text that still is plain text will be
HTML-escaped. Just before appending the new text message to the (HTML)
chat document, we always have HTML "text" and as soon as a processing
step is used of which we know that it definitely converts to HTML, we
start using the HTML content type. This also means that on a number of
occasions we have removed the contentType parameter, since we already
know or have this information.
Since we now know for sure that from a certain moment on, we are
strictly dealing with HTML "text" and we also know that everything plain
text will be HTML-escaped, we can adopt a different plain text search
pattern (TEXT_TO_REPLACE_PATTERN). This search approach searches for all
text in between lesser than (<) and greater than (>) signs, since we can
be sure that that is normal (escaped) text. We unescape these pieces of
text before running through the replacement services such that they can
behave as they always have. This shouldn't break (much of) the
Replacement Services implementations.
Also check and tag hyperlinks for HTML messages.
Added dependency to Apache Commons Lang to swing-ui.
Removed option skipSmiley. It is not needed anymore, now that hyperlink
hrefs aren't found anymore.
In the "Add chat room" dialog there's no default operation when you
press ENTER in one of the input fields. From now on pressing ENTER
will default to the "Join" button if it is enabled.