Skip to content

Commit 8293fce

Browse files
committed
Problems with -- in \cite command name.
When having: ``` @Article{b--94 ... ``` or ``` @Article{do--93 ... ``` and a definition like: ``` ALIASES = "cgalCite{1}=<!-- -->\cite{shortauthor,nopar} \1 \cite \1" ``` this gave problems: - the option of the `\cite` command was not taken into account - the part before the `&ndash;` in the back substitution was not correct (in the perl file) as only 1 character was taken into account.
1 parent 7418470 commit 8293fce

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/commentscan.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ STopt [^\n@\\]*
11501150
<Comment>{CMD}"---" { // escaped mdash
11511151
addOutput(yyscanner,yytext);
11521152
}
1153-
<Comment>{CMD}"--" { // escaped mdash
1153+
<Comment>{CMD}"--" { // escaped ndash
11541154
addOutput(yyscanner,yytext);
11551155
}
11561156
<Comment>"---" { // mdash

src/markdown.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ size_t Markdown::Private::isSpecialCommand(std::string_view data,size_t offset)
624624
{ "b", endOfLabel },
625625
{ "c", endOfLabel },
626626
{ "category", endOfLine },
627-
{ "cite", endOfLabel },
627+
{ "cite", endOfLabelOpt },
628628
{ "class", endOfLine },
629629
{ "concept", endOfLine },
630630
{ "copybrief", endOfFunc },

templates/html/bib2xhtml.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ sub html_ent {
5858
s/\!\`/&iexcl;/g;
5959
s/\-\-\-/&mdash;/g;
6060
s/([^\!])\-\-([^\>])/$1&ndash;$2/g;
61-
s/(CITEREF_[^\!])&ndash;([^\>])/$1--$2/g;
62-
s/(CITEREF_[^\!])&mdash;([^\>])/$1---$2/g;
61+
s/(CITEREF_[^\!]+)&ndash;([^\>])/$1--$2/g;
62+
s/(CITEREF_[^\!]+)&mdash;([^\>])/$1---$2/g;
6363
s/\\([aA]lpha)\b/&$1;/g;
6464
s/\\([bB]eta)\b/&$1;/g;
6565
s/\\([gG]amma)\b/&$1;/g;

0 commit comments

Comments
 (0)