Skip to content

Commit

Permalink
WIP - DOM parser changes for markdown comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jarthana committed Aug 14, 2024
1 parent a295222 commit 5fd4464
Show file tree
Hide file tree
Showing 134 changed files with 5,436 additions and 123 deletions.
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>eclipse.jdt.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
protected int firstTagPosition;
protected int index, lineEnd;
protected int tokenPreviousPosition, lastIdentifierEndPosition, starPosition;
protected int textStart, memberStart;
protected int textStart;
protected int memberStart;
protected int tagSourceStart, tagSourceEnd;
protected int inlineTagStart;
protected int[] lineEnds;
Expand Down Expand Up @@ -451,8 +452,15 @@ protected boolean commentParse() {
// $FALL-THROUGH$ - fall through default case
default :
if (this.markdown && nextCharacter == '[') {
if (parseMarkdownLinks())
if (this.textStart != -1) {
if (this.textStart < textEndPosition) {
pushText(this.textStart, textEndPosition);
}
}
if (parseMarkdownLinks(previousPosition)) {
this.textStart = this.index;
break;
}
}
if (isFormatterParser && nextCharacter == '<') {
// html tags are meaningful for formatter parser
Expand Down Expand Up @@ -2977,7 +2985,7 @@ private boolean containsNewLine(String str) {
/*
* Parse markdown links that are replacing @link and @linkplain
*/
protected abstract boolean parseMarkdownLinks() throws InvalidInputException;
protected abstract boolean parseMarkdownLinks(int previousPosition) throws InvalidInputException;
/*
* Parse tag declaration
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ protected void parseSimpleTag() {
}
}
@Override
protected boolean parseMarkdownLinks() throws InvalidInputException {
protected boolean parseMarkdownLinks(int previousPosition) throws InvalidInputException {
boolean valid = false;
// The markdown links can come in single [] or pair of [] with no space between them
// We are here after we have seen [
Expand Down
Loading

0 comments on commit 5fd4464

Please sign in to comment.