snoopdave commented on code in PR #228:
URL: https://github.com/apache/roller/pull/228#discussion_r4394674495
##########
app/src/main/java/org/apache/roller/weblogger/util/Utilities.java:
##########
@@ -183,9 +183,12 @@ public static String removeHTML(String str, boolean
addSpace) {
start = endTag + 1;
beginTag = str.indexOf('<', start);
}
- // if no endTag found, get rest of str and break
+ // if no endTag found, the rest is text unless it starts a tag,
+ // which a browser would still parse as markup
else {
- ret.append(str.substring(beginTag));
+ if (!startsTag(str, beginTag)) {
Review Comment:
🤖Claude: fixed by keeping the scan going after a '<' that is text: it
appends the '<' and looks at the next one, so a later '<' that starts a tag is
still dropped. New test testRemoveHTMLUnclosedTagAfterLessThanText pins this
(99ec8bc67).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]