Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[23] DOM changes for markdown Javadoc comments #2738 #2807

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -496,7 +504,7 @@ protected boolean commentParse() {
}
refreshInlineTagPosition(textEndPosition);
setInlineTagStarted(false);
} else if (this.lineStarted && this.textStart != -1 && this.textStart <= textEndPosition && (this.textStart < this.starPosition || this.starPosition == lastStarPosition)) {
} else if (this.lineStarted && this.textStart != -1 && this.textStart <= textEndPosition && (this.textStart < this.starPosition || this.starPosition == lastStarPosition || this.markdown)) {
pushText(this.textStart, textEndPosition);
}
updateDocComment();
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
Loading