String hrefPattern = "href=\"";
int hrefStart = text.indexOf(hrefPattern, from);
if (hrefStart != -1 && hrefStart < tagEnd) {
// href attribute found behind wgakey-attribute
int hrefEnd = text.indexOf("\"", hrefStart + hrefPattern.length());
text = text.substring(0, hrefStart + hrefPattern.length()) + targetContext.contenturl(null, null) + text.substring(hrefEnd);
} else {
hrefStart = text.lastIndexOf(hrefPattern, from);
if (hrefStart != -1 && hrefStart > tagStart) {
// href attribute found before wgakey-attribute
int hrefEnd = text.indexOf("\"", hrefStart + hrefPattern.length());