links.put(document.createRangeMarker(new TextRange(document.getTextLength() - linkText.length(), document.getTextLength())),
new NotificationHyperlinkInfo(notification, href));
content = content.substring(linkEnd + A_CLOSING.length());
+ continue;
}
}
- else {
- hasHtml = true;
- if ("<br>".equals(tagStart) ||
- "</br>".equals(tagStart) ||
- "</p>".equals(tagStart) ||
- "<p>".equals(tagStart) ||
- "<p/>".equals(tagStart)) {
- lineSeparators.add(document.createRangeMarker(TextRange.from(document.getTextLength(), 0)));
- }
- else if (!"<html>".equals(tagStart) && !"</html>".equals(tagStart) && !"<body>".equals(tagStart) && !"</body>".equals(tagStart)) {
- showMore.set(true);
- }
- content = content.substring(tagMatcher.end());
+
+ hasHtml = true;
+ if ("<br>".equals(tagStart) ||
+ "</br>".equals(tagStart) ||
+ "</p>".equals(tagStart) ||
+ "<p>".equals(tagStart) ||
+ "<p/>".equals(tagStart)) {
+ lineSeparators.add(document.createRangeMarker(TextRange.from(document.getTextLength(), 0)));
+ }
+ else if (!"<html>".equals(tagStart) && !"</html>".equals(tagStart) && !"<body>".equals(tagStart) && !"</body>".equals(tagStart)) {
+ showMore.set(true);
}
+ content = content.substring(tagMatcher.end());
}
return hasHtml;
}
assert entry.links.collect { it.first } == [new TextRange(0, 4)]
}
+ public void testMalformedLink() throws Exception {
+ def entry = EventLog.formatForLog(new Notification("xxx", '<a href="a">link<a/>', "content", NotificationType.ERROR))
+ assert entry.message == 'link: content (show balloon)'
+ }
+
}