mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
fix table rows parsing in case row count is more than 2
#WEB-2414 fixed
This commit is contained in:
@@ -248,11 +248,15 @@ public class HtmlParsing {
|
||||
if (isOptionalTagEnd) {
|
||||
boolean foundMatch = childTerminatesParentInStack(childName, true);
|
||||
if (foundMatch) {
|
||||
myTagMarkersStack.pop();
|
||||
myTagNamesStack.pop();
|
||||
// allow only one promotion per tag, otherwise last row in table
|
||||
// will make it up to the first one moving all tags in between under first node
|
||||
if (!canTerminate(childName, tagName)) {
|
||||
myTagMarkersStack.pop();
|
||||
myTagNamesStack.pop();
|
||||
|
||||
myTagMarkersStack.push(childMarker);
|
||||
myTagNamesStack.push(childName);
|
||||
myTagMarkersStack.push(childMarker);
|
||||
myTagNamesStack.push(childName);
|
||||
}
|
||||
|
||||
tag.doneBefore(XmlElementType.HTML_TAG, childMarker);
|
||||
return true;
|
||||
@@ -378,7 +382,7 @@ public class HtmlParsing {
|
||||
}
|
||||
|
||||
private static boolean canTerminate(final String childTagName,final String tagName) {
|
||||
return HtmlUtil.canTerminate(childTagName, tagName);
|
||||
return childTagName.equals(tagName) || HtmlUtil.canTerminate(childTagName, tagName);
|
||||
}
|
||||
|
||||
private boolean childTerminatesParentInStack(final String childName, final boolean terminateOnNonOptionalTag) {
|
||||
@@ -393,7 +397,7 @@ public class HtmlParsing {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (childName.equals(parentName) || canTerminate(childName, parentName)) {
|
||||
if (canTerminate(childName, parentName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user