SpanElement current = createSpanElement();
for (MatchResult match = REGEXP_MARKUP.exec(text); match != null;
match = REGEXP_MARKUP.exec(text)) {
current.setTextContent(text.substring(index, match.getIndex()));
myParagraph.appendChild(current);
current = createSpanElement();
/*
* If our match is a \n we need to create a <br/> element to force a line break, otherwise we
* matched an http/www link so let's make an anchor tag out of it.