Skip to content

Commit

Permalink
Add support for handling content in CDATA sections by extensions
Browse files Browse the repository at this point in the history
Fix #1694

Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
  • Loading branch information
laeubi committed Nov 7, 2024
1 parent 88a4e55 commit da9134d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public CompletionList doComplete(DOMDocument xmlDocument, Position position, Sha
Scanner scanner = XMLScanner.createScanner(text, node.getStart(), isInsideDTDContent(node, xmlDocument));
String currentTag = "";
TokenType token = scanner.scan();
TokenType lastToken = null;
while (token != TokenType.EOS && scanner.getTokenOffset() <= offset) {
cancelChecker.checkCanceled();
switch (token) {
Expand Down Expand Up @@ -249,6 +250,13 @@ public CompletionList doComplete(DOMDocument xmlDocument, Position position, Sha
}
}
break;
case CDATATagOpen:
break;
case CDATATagClose:
if (lastToken != TokenType.CDATATagOpen) {
break;
}
case CDATAContent:
case Content:
if (completionRequest.getXMLDocument().isDTD()
|| completionRequest.getXMLDocument().isWithinInternalDTD(offset)) {
Expand Down Expand Up @@ -284,6 +292,7 @@ public CompletionList doComplete(DOMDocument xmlDocument, Position position, Sha
}
break;
}
lastToken = token;
token = scanner.scan();
}
return completionResponse;
Expand Down

0 comments on commit da9134d

Please sign in to comment.