Skip to content

Commit

Permalink
issue #6796 Bad link to section, subsection if pointing at item past …
Browse files Browse the repository at this point in the history
…suspicious text

To escape `\` and `@` not only `\\` and `@@` should be possible  but also `\@` and  `@\`
  • Loading branch information
albert-github committed Jan 26, 2019
1 parent afc7721 commit e41ae81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commentscan.l
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput(yytext);
}
}
<Comment>{B}*("\\\\"|"@@")"f"[$\[{] { // escaped formula command
<Comment>{B}*({CMD}{CMD})"f"[$\[{] { // escaped formula command
addOutput(yytext);
}
<Comment>{B}*{CMD}"~"[a-z_A-Z-]* { // language switch command
Expand Down Expand Up @@ -1805,7 +1805,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
g_sectionTitle+=yytext;
addOutput(yytext);
}
<SectionTitle>("\\\\"|"@@"){ID} { // unescape escaped command
<SectionTitle>({CMD}{CMD}){ID} { // unescape escaped command
g_sectionTitle+=&yytext[1];
addOutput(yytext);
}
Expand Down
2 changes: 1 addition & 1 deletion src/doctokenizer.l
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
/* State for the pass used to find the anchors and sections */

<St_Sections>[^\n@\\<]+
<St_Sections>"@@"|"\\\\"|"@<"|"\\<"
<St_Sections>{CMD}("<"|{CMD})
<St_Sections>"<"{CAPTION}({WS}+{ATTRIB})*">" {
QCString tag=yytext;
int s=tag.find("id=");
Expand Down
2 changes: 1 addition & 1 deletion src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -6542,7 +6542,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
// middle of a comment block
docBlock+=yytext;
}
<DocBlock>("@@"|"\\\\"){ID}/[^a-z_A-Z0-9] { // escaped command
<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
docBlock+=yytext;
}
<DocBlock>{CMD}("f$"|"f["|"f{") {
Expand Down

0 comments on commit e41ae81

Please sign in to comment.