/** * Returns the {@linkplain EndTagType#NORMAL normal} {@link EndTag} with the specified {@linkplain EndTag#getName() name} beginning at or immediately following the specified position in the source document. * <p> * See the {@link Tag} class documentation for more details about the behaviour of this method. * * @param pos the position in the source document from which to start the search, may be out of bounds. * @param name the {@linkplain EndTag#getName() name} of the end tag to search for, may be <code>null</code>. * @return the {@linkplain EndTagType#NORMAL normal} {@link EndTag} with the specified {@linkplain EndTag#getName() name} beginning at or immediately following the specified position in the source document, or <code>null</code> if none exists or the specified position is out of bounds. */ public EndTag getNextEndTag(final int pos, final String name) { return getNextEndTag(pos,name,EndTagType.NORMAL); }
protected Tag constructTagAt(final Source source, final int pos) { final Tag tag=super.constructTagAt(source,pos); if (tag==null) return null; // A mason named block does not have a '%' before its closing '>' delimiter and requires a matching end tag. if (source.charAt(tag.getEnd()-2)=='%') return null; // this is a common server tag, not a named block if (source.getNextEndTag(tag.getEnd(),tag.getName(),getCorrespondingEndTagType())==null) return null; return tag; } }
final EndTag nextEndTag=source.getNextEndTag(end,endTagType.getEndTagName(name),endTagType); if (nextEndTag!=null) { if (startTagType==StartTagType.NORMAL && HTMLElements.END_TAG_REQUIRED_NESTING_FORBIDDEN_SET.contains(name)) {
EndTag nextTag = elem.getSource().getNextEndTag(elem.getBegin()); while (nextTag != null && !nextTag.getName().equalsIgnoreCase(elem.getName())) { nextTag = elem.getSource().getNextEndTag(nextTag.getEnd());
EndTag nextTag = elem.getSource().getNextEndTag(elem.getBegin()); while (nextTag != null && !nextTag.getName().equalsIgnoreCase(elem.getName())) { nextTag = elem.getSource().getNextEndTag(nextTag.getEnd());
EndTag nextTag = elem.getSource().getNextEndTag(elem.getBegin()); while (nextTag != null && !nextTag.getName().equalsIgnoreCase(elem.getName())) { nextTag = elem.getSource().getNextEndTag(nextTag.getEnd());