@@ -1914,4 +1914,104 @@ public class Table {}
19141914 assertEquals ("Incorrect TagElement" , 1 , (fragments .get (3 ).getFlags () & ASTNode .MALFORMED )); //MALFOUND flag
19151915 }
19161916 }
1917+
1918+ public void testMarkdownURLs4531_01 () throws JavaModelException {
1919+ String source = """
1920+ /// @see [Ex Si](ex.com)
1921+ public class Markdown() {}
1922+ """ ;
1923+ this .workingCopies = new ICompilationUnit [1 ];
1924+ this .workingCopies [0 ] = getWorkingCopy ("/Converter_25/src/markdown/gh3761/Markdown.java" , source , null );
1925+ if (this .docCommentSupport .equals (JavaCore .ENABLED )) {
1926+ CompilationUnit compilUnit = (CompilationUnit ) runConversion (this .workingCopies [0 ], true );
1927+ TypeDeclaration typedeclaration = (TypeDeclaration ) compilUnit .types ().get (0 );
1928+ Javadoc javadoc = typedeclaration .getJavadoc ();
1929+ TagElement tags = (TagElement ) javadoc .tags ().get (0 );
1930+ assertEquals ("fragments count does not match" , 2 , tags .fragments ().size ());
1931+ TagElement tagElement = (TagElement ) tags .fragments ().get (1 );
1932+ List <?> tagFragments = tagElement .fragments ();
1933+ assertTrue (tagFragments .get (0 ) instanceof TextElement );
1934+ assertTrue (tagFragments .get (1 ) instanceof QualifiedName );
1935+ }
1936+ }
1937+
1938+ public void testMarkdownURLs4531_02 () throws JavaModelException {
1939+ String source = """
1940+ /// @see [Ex Si](http://ex.com)
1941+ public class Markdown() {}
1942+ """ ;
1943+ this .workingCopies = new ICompilationUnit [1 ];
1944+ this .workingCopies [0 ] = getWorkingCopy ("/Converter_25/src/markdown/gh3761/Markdown.java" , source , null );
1945+ if (this .docCommentSupport .equals (JavaCore .ENABLED )) {
1946+ CompilationUnit compilUnit = (CompilationUnit ) runConversion (this .workingCopies [0 ], true );
1947+ TypeDeclaration typedeclaration = (TypeDeclaration ) compilUnit .types ().get (0 );
1948+ Javadoc javadoc = typedeclaration .getJavadoc ();
1949+ TagElement tags = (TagElement ) javadoc .tags ().get (0 );
1950+ assertEquals ("fragments count does not match" , 2 , tags .fragments ().size ());
1951+ TagElement tagElement = (TagElement ) tags .fragments ().get (1 );
1952+ List <?> tagFragments = tagElement .fragments ();
1953+ assertTrue (tagFragments .get (0 ) instanceof TextElement );
1954+ assertTrue (tagFragments .get (1 ) instanceof SimpleName );
1955+ }
1956+ }
1957+
1958+ public void testMarkdownURLs4531_03 () throws JavaModelException {
1959+ String source = """
1960+ /// @see [Ex Si](https://ex.com/a)
1961+ public class Markdown() {}
1962+ """ ;
1963+ this .workingCopies = new ICompilationUnit [1 ];
1964+ this .workingCopies [0 ] = getWorkingCopy ("/Converter_25/src/markdown/gh3761/Markdown.java" , source , null );
1965+ if (this .docCommentSupport .equals (JavaCore .ENABLED )) {
1966+ CompilationUnit compilUnit = (CompilationUnit ) runConversion (this .workingCopies [0 ], true );
1967+ TypeDeclaration typedeclaration = (TypeDeclaration ) compilUnit .types ().get (0 );
1968+ Javadoc javadoc = typedeclaration .getJavadoc ();
1969+ TagElement tags = (TagElement ) javadoc .tags ().get (0 );
1970+ assertEquals ("fragments count does not match" , 2 , tags .fragments ().size ());
1971+ TagElement tagElement = (TagElement ) tags .fragments ().get (1 );
1972+ List <?> tagFragments = tagElement .fragments ();
1973+ assertTrue (tagFragments .get (0 ) instanceof TextElement );
1974+ assertTrue (tagFragments .get (1 ) instanceof SimpleName );
1975+ }
1976+ }
1977+
1978+ public void testMarkdownURLs4531_04 () throws JavaModelException {
1979+ String source = """
1980+ /// @see [Ex Si](https://www.ex.net/a)
1981+ public class Markdown() {}
1982+ """ ;
1983+ this .workingCopies = new ICompilationUnit [1 ];
1984+ this .workingCopies [0 ] = getWorkingCopy ("/Converter_25/src/markdown/gh3761/Markdown.java" , source , null );
1985+ if (this .docCommentSupport .equals (JavaCore .ENABLED )) {
1986+ CompilationUnit compilUnit = (CompilationUnit ) runConversion (this .workingCopies [0 ], true );
1987+ TypeDeclaration typedeclaration = (TypeDeclaration ) compilUnit .types ().get (0 );
1988+ Javadoc javadoc = typedeclaration .getJavadoc ();
1989+ TagElement tags = (TagElement ) javadoc .tags ().get (0 );
1990+ assertEquals ("fragments count does not match" , 2 , tags .fragments ().size ());
1991+ TagElement tagElement = (TagElement ) tags .fragments ().get (1 );
1992+ List <?> tagFragments = tagElement .fragments ();
1993+ assertTrue (tagFragments .get (0 ) instanceof TextElement );
1994+ assertTrue (tagFragments .get (1 ) instanceof SimpleName );
1995+ }
1996+ }
1997+
1998+ public void testMarkdownURLs4531_05 () throws JavaModelException {
1999+ String source = """
2000+ /// @see [Ex Si][http://ex.com]
2001+ public class Markdown() {}
2002+ """ ;
2003+ this .workingCopies = new ICompilationUnit [1 ];
2004+ this .workingCopies [0 ] = getWorkingCopy ("/Converter_25/src/markdown/gh3761/Markdown.java" , source , null );
2005+ if (this .docCommentSupport .equals (JavaCore .ENABLED )) {
2006+ CompilationUnit compilUnit = (CompilationUnit ) runConversion (this .workingCopies [0 ], true );
2007+ TypeDeclaration typedeclaration = (TypeDeclaration ) compilUnit .types ().get (0 );
2008+ Javadoc javadoc = typedeclaration .getJavadoc ();
2009+ TagElement tags = (TagElement ) javadoc .tags ().get (0 );
2010+ assertEquals ("fragments count does not match" , 2 , tags .fragments ().size ());
2011+ TagElement tagElement = (TagElement ) tags .fragments ().get (1 );
2012+ List <?> tagFragments = tagElement .fragments ();
2013+ assertTrue (tagFragments .get (0 ) instanceof TextElement );
2014+ assertTrue (tagFragments .get (1 ) instanceof SimpleName );
2015+ }
2016+ }
19172017}
0 commit comments