summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-11-18 15:48:28 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2018-11-18 15:48:28 (GMT)
commit64764a854d8824bb3a9714a159f5ebbd226d3a88 (patch)
treef1049df119b9ff938cba5f766d5b8cc08dac5720 /src
parent632a8a62bd7209322eafb3ff9d781ab201ba0523 (diff)
parent1647d7f2e34ac6db04a9dbf69f998d41c66cc92c (diff)
downloadDoxygen-64764a854d8824bb3a9714a159f5ebbd226d3a88.zip
Doxygen-64764a854d8824bb3a9714a159f5ebbd226d3a88.tar.gz
Doxygen-64764a854d8824bb3a9714a159f5ebbd226d3a88.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src')
-rw-r--r--src/cite.cpp4
-rw-r--r--src/commentscan.l14
-rw-r--r--src/docparser.cpp9
-rw-r--r--src/doctokenizer.l65
-rw-r--r--src/latexdocvisitor.cpp2
-rw-r--r--src/markdown.cpp4
6 files changed, 71 insertions, 27 deletions
diff --git a/src/cite.cpp b/src/cite.cpp
index b17800f..4f88611 100644
--- a/src/cite.cpp
+++ b/src/cite.cpp
@@ -223,7 +223,6 @@ void CiteDict::generatePage() const
if (line.find("<!-- BEGIN BIBLIOGRAPHY")!=-1) insideBib=TRUE;
else if (line.find("<!-- END BIBLIOGRAPH")!=-1) insideBib=FALSE;
- else if (insideBib) doc+=line+"\n";
int i;
// determine text to use at the location of the @cite command
if (insideBib && (i=line.find("name=\"CITEREF_"))!=-1)
@@ -234,14 +233,17 @@ void CiteDict::generatePage() const
{
QCString label = line.mid(i+14,j-i-14);
QCString number = line.mid(j+2,k-j-1);
+ label = substitute(substitute(label,"&ndash;","--"),"&mdash;","---");
CiteInfo *ci = m_entries.find(label);
//printf("label='%s' number='%s' => %p\n",label.data(),number.data(),ci);
+ line = line.left(i+14) + label + line.right(line.length()-j);
if (ci)
{
ci->text = number;
}
}
}
+ if (insideBib) doc+=line+"\n";
}
//printf("doc=[%s]\n",doc.data());
diff --git a/src/commentscan.l b/src/commentscan.l
index e317a86..3be770f 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -696,7 +696,13 @@ static void addSection()
static void addCite()
{
- Doxygen::citeDict->insert(yytext);
+ QCString name=yytext;
+ if (yytext[0] =='"')
+ {
+ name=yytext+1;
+ name=name.left(yyleng-2);
+ }
+ Doxygen::citeDict->insert(name.data());
}
//-----------------------------------------------------------------------------
@@ -943,9 +949,9 @@ FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+@&#]
FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
-CITESCHAR [a-z_A-Z0-9\x80-\xFF]
-CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/]*
-CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*
+CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
+CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
+CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
TMPLSPEC "<"{BN}*[^>]+{BN}*">"
diff --git a/src/docparser.cpp b/src/docparser.cpp
index b414e8f..39978de 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -269,7 +269,7 @@ static void unescapeCRef(QCString &s)
* copies the image to the output directory (which depends on the \a type
* parameter).
*/
-static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool warn = true)
+static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool dowarn = true)
{
QCString result;
bool ambig;
@@ -337,7 +337,8 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
}
else
{
- printf("Source and Destination are the same!\n");
+ warn(g_fileName,doctokenizerYYlineno,
+ "Prevented to copy file %s onto itself!\n",qPrint(inputFile));
}
}
else
@@ -365,7 +366,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
return baseName;
}
}
- else if (ambig && warn)
+ else if (ambig && dowarn)
{
QCString text;
text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName));
@@ -376,7 +377,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
else
{
result=fileName;
- if (result.left(5)!="http:" && result.left(6)!="https:" && warn)
+ if (result.left(5)!="http:" && result.left(6)!="https:" && dowarn)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,
"image file %s is not found in IMAGE_PATH: "
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 0a3c0cf..f50b9ae 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -38,6 +38,7 @@
#include "definition.h"
#include "doxygen.h"
#include "portable.h"
+#include "cite.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -340,9 +341,9 @@ EMOJI (":"[a-z_A-Z0-9\x80-\xFF"'+()&\*\.!,#-]":"|":"[a-z_A-Z0-9\x80-\xFF"'+(
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+
-CITESCHAR [a-z_A-Z0-9\x80-\xFF]
-CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/]*
-CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*
+CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
+CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]
+CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
OPTSTARS ("//"{BLANK}*)?"*"*{BLANK}*
LISTITEM {BLANK}*[-]("#")?{WS}
@@ -395,9 +396,9 @@ CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."=']
ESCWORD ("%"{ID}(("::"|"."){ID})*)|("%'")
CHARWORDQ1 [^ \-+0-9\t\n\r\\@<>()\[\]:;\?{}&%$#,."=']
WORD1 {ESCWORD}|{CHARWORDQ1}{CHARWORDQ}*|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"")
-WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'"
+WORD2 "."|","|"("|")"|"["|"]"|"::"|":"|";"|"\?"|"="|"'"
WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}"
-WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'"
+WORD2NQ "."|","|"("|")"|"["|"]"|"::"|":"|";"|"\?"|"="|"'"
CAPTION [cC][aA][pP][tT][iI][oO][nN]
HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*{WS}*(("/")?)">"
HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"sup"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"|"strike"|"u"
@@ -682,8 +683,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
return TK_SYMBOL;
}
<St_Para,St_Text>{EMOJI} { /* emoji symbol */
- g_token->name = yytext;
- return TK_EMOJI;
+ if (g_fileName == CiteConsts::fileName)
+ {
+ REJECT;
+ }
+ else
+ {
+ g_token->name = yytext;
+ return TK_EMOJI;
+ }
}
/********* patterns for linkable words ******************/
@@ -932,8 +940,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
return TK_SYMBOL;
}
<St_TitleN>{EMOJI} { /* emoji */
- g_token->name = yytext;
- return TK_EMOJI;
+ if (g_fileName == CiteConsts::fileName)
+ {
+ REJECT;
+ }
+ else
+ {
+ g_token->name = yytext;
+ return TK_EMOJI;
+ }
}
<St_TitleN>{HTMLTAG} {
}
@@ -972,8 +987,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
return TK_SYMBOL;
}
<St_TitleQ>{EMOJI} { /* emoji */
- g_token->name = yytext;
- return TK_EMOJI;
+ if (g_fileName == CiteConsts::fileName)
+ {
+ REJECT;
+ }
+ else
+ {
+ g_token->name = yytext;
+ return TK_EMOJI;
+ }
}
<St_TitleQ>{SPCMD1} |
<St_TitleQ>{SPCMD2} { /* special command */
@@ -1025,7 +1047,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
return 0;
}
<St_Cite>{CITEID} { // label to cite
- g_token->name=yytext;
+ if (yytext[0] =='"')
+ {
+ g_token->name=yytext+1;
+ g_token->name=g_token->name.left(yyleng-2);
+ }
+ else
+ {
+ g_token->name=yytext;
+ }
return TK_WORD;
}
<St_Cite>{BLANK} { // white space
@@ -1107,8 +1137,15 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
return TK_SYMBOL;
}
<St_Ref2>{EMOJI} { /* emoji */
- g_token->name = yytext;
- return TK_EMOJI;
+ if (g_fileName == CiteConsts::fileName)
+ {
+ REJECT;
+ }
+ else
+ {
+ g_token->name = yytext;
+ return TK_EMOJI;
+ }
}
<St_Ref2>{SPCMD1} |
<St_Ref2>{SPCMD2} { /* special command */
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 7663572..77795ee 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -294,7 +294,6 @@ void LatexDocVisitor::visit(DocURL *u)
if (m_hide) return;
if (Config_getBool(PDF_HYPERLINKS))
{
- m_t << endl << "%% AME " << u->url() <<endl;
m_t << "\\href{";
if (u->isEmail()) m_t << "mailto:";
m_t << latexFilterURL(u->url()) << "}";
@@ -1331,7 +1330,6 @@ void LatexDocVisitor::visitPre(DocHRef *href)
if (m_hide) return;
if (Config_getBool(PDF_HYPERLINKS))
{
- m_t << endl << "%% AME " << href->url() <<endl;
m_t << "\\href{";
m_t << latexFilterURL(href->url());
m_t << "}";
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 36b9734..a3d8c03 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -1892,7 +1892,7 @@ void writeOneLineHeaderOrRuler(GrowBuf &out,const char *data,int size)
QCString id;
if (isHRuler(data,size))
{
- out.addStr("<hr>\n");
+ out.addStr("\n<hr>\n");
}
else if ((level=isAtxHeader(data,size,header,id)))
{
@@ -2327,7 +2327,7 @@ static QCString processBlocks(const QCString &s,int indent)
}
else
{
- out.addStr("<hr>\n");
+ out.addStr("\n<hr>\n");
}
pi=-1;
i=end;