Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
385b87e0
Commit
385b87e0
authored
Apr 13, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for \-- and \--- to prevent interpretation as ndash and mdash
parent
4ccfb9ef
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
4 deletions
+70
-4
commands.doc
doc/commands.doc
+16
-0
cmdmapper.cpp
src/cmdmapper.cpp
+2
-0
cmdmapper.h
src/cmdmapper.h
+3
-1
commentscan.l
src/commentscan.l
+6
-0
docparser.cpp
src/docparser.cpp
+29
-0
docparser.h
src/docparser.h
+1
-1
doctokenizer.l
src/doctokenizer.l
+1
-1
htmlentity.cpp
src/htmlentity.cpp
+2
-1
markdown.cpp
src/markdown.cpp
+10
-0
No files found.
doc/commands.doc
View file @
385b87e0
...
...
@@ -209,6 +209,8 @@ documentation:
\refitem cmdchardot \\\.
\refitem cmddcolon \::
\refitem cmdpipe \\|
\refitem cmdndash \\\--
\refitem cmdmdash \\\---
\endsecreflist
The following subsections provide a list of all commands that are recognized by
...
...
@@ -3076,6 +3078,20 @@ class Receiver
character has to be escaped in some cases, because it is used
for Markdown tables.
<hr>
\section cmdndash \\--
\addindex \\\--
This command writes two dashes (\--) to the output. This allows
writing two consecutive dashes to the output instead of one n-dash character (--).
<hr>
\section cmdmdash \\---
\addindex \\\---
This command writes three dashes (\---) to the output. This allows
writing three consecutuve dashes to the output instead of one m-dash character (---).
<hr>
\htmlonly <center> \endhtmlonly
<h2>
...
...
src/cmdmapper.cpp
View file @
385b87e0
...
...
@@ -136,6 +136,8 @@ CommandMap cmdMap[] =
{
"parblock"
,
CMD_PARBLOCK
},
{
"endparblock"
,
CMD_ENDPARBLOCK
},
{
"diafile"
,
CMD_DIAFILE
},
{
"--"
,
CMD_NDASH
},
{
"---"
,
CMD_MDASH
},
{
0
,
0
},
};
...
...
src/cmdmapper.h
View file @
385b87e0
...
...
@@ -125,7 +125,9 @@ enum CommandType
CMD_PARBLOCK
=
95
,
CMD_ENDPARBLOCK
=
96
,
CMD_DIAFILE
=
97
,
CMD_LATEXINCLUDE
=
98
CMD_LATEXINCLUDE
=
98
,
CMD_NDASH
=
99
,
CMD_MDASH
=
100
};
enum
HtmlTagType
...
...
src/commentscan.l
View file @
385b87e0
...
...
@@ -1200,6 +1200,12 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{B}*/\n { // horizontal line (dashed)
addOutput(yytext);
}
<Comment>{CMD}"---" { // escaped mdash
addOutput(yytext);
}
<Comment>{CMD}"--" { // escaped mdash
addOutput(yytext);
}
<Comment>"---" { // mdash
addOutput(insidePre || Doxygen::markdownSupport ? yytext : "—");
}
...
...
src/docparser.cpp
View file @
385b87e0
...
...
@@ -1271,6 +1271,15 @@ reparsetoken:
case
CMD_PERCENT
:
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Percent
));
break
;
case
CMD_NDASH
:
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Minus
));
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Minus
));
break
;
case
CMD_MDASH
:
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Minus
));
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Minus
));
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Minus
));
break
;
case
CMD_QUOTE
:
children
.
append
(
new
DocSymbol
(
parent
,
DocSymbol
::
Sym_Quot
));
break
;
...
...
@@ -3281,6 +3290,8 @@ int DocIndexEntry::parse()
case
CMD_HASH
:
m_entry
+=
'#'
;
break
;
case
CMD_DCOLON
:
m_entry
+=
"::"
;
break
;
case
CMD_PERCENT
:
m_entry
+=
'%'
;
break
;
case
CMD_NDASH
:
m_entry
+=
"--"
;
break
;
case
CMD_MDASH
:
m_entry
+=
"---"
;
break
;
case
CMD_QUOTE
:
m_entry
+=
'"'
;
break
;
default
:
warn_doc_error
(
g_fileName
,
doctokenizerYYlineno
,
"Unexpected command %s found as argument of
\\
addindex"
,
...
...
@@ -5373,6 +5384,15 @@ int DocPara::handleCommand(const QCString &cmdName)
case
CMD_PERCENT
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Percent
));
break
;
case
CMD_NDASH
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
break
;
case
CMD_MDASH
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
break
;
case
CMD_QUOTE
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Quot
));
break
;
...
...
@@ -6828,6 +6848,15 @@ void DocText::parse()
case
CMD_PERCENT
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Percent
));
break
;
case
CMD_NDASH
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
break
;
case
CMD_MDASH
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Minus
));
break
;
case
CMD_QUOTE
:
m_children
.
append
(
new
DocSymbol
(
this
,
DocSymbol
::
Sym_Quot
));
break
;
...
...
src/docparser.h
View file @
385b87e0
...
...
@@ -395,7 +395,7 @@ class DocSymbol : public DocNode
/* doxygen commands mapped */
Sym_BSlash
,
Sym_At
,
Sym_Less
,
Sym_Greater
,
Sym_Amp
,
Sym_Dollar
,
Sym_Hash
,
Sym_DoubleColon
,
Sym_Percent
,
Sym_Pipe
,
Sym_Quot
Sym_Quot
,
Sym_Minus
};
enum
PerlType
{
Perl_unknown
=
0
,
Perl_string
,
Perl_char
,
Perl_symbol
,
Perl_umlaut
,
Perl_acute
,
Perl_grave
,
Perl_circ
,
Perl_slash
,
Perl_tilde
,
...
...
src/doctokenizer.l
View file @
385b87e0
...
...
@@ -350,7 +350,7 @@ HFILEMASK ("."{FILESCHAR}*{FILEECHAR}+)*
FILEMASK ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|{HFILEMASK}
LINKMASK [^ \t\n\r\\@<&${}]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"){BLANK}+)?
VERBATIM "verbatim"{BLANK}*
SPCMD1 {CMD}([a-z_A-Z][a-z_A-Z0-9]*|{VERBATIM})
SPCMD1 {CMD}([a-z_A-Z][a-z_A-Z0-9]*|{VERBATIM}
|"--"|"---"
)
SPCMD2 {CMD}[\\@<>&$#%~".|]
SPCMD3 {CMD}form#[0-9]+
SPCMD4 {CMD}"::"
...
...
src/htmlentity.cpp
View file @
385b87e0
...
...
@@ -311,7 +311,8 @@ static struct htmlEntityInfo
{
SYM
(
DoubleColon
),
"::"
,
"::"
,
"::"
,
"::"
,
"::"
,
"::"
,
"::"
,
{
"::"
,
DocSymbol
::
Perl_string
}},
{
SYM
(
Percent
),
"%"
,
"%"
,
"%"
,
"%"
,
"
\\
%"
,
"%"
,
"%"
,
{
"%"
,
DocSymbol
::
Perl_char
}},
{
SYM
(
Pipe
),
"|"
,
"|"
,
"|"
,
"|"
,
"$|$"
,
"|"
,
"|"
,
{
"|"
,
DocSymbol
::
Perl_char
}},
{
SYM
(
Quot
),
"
\"
"
,
"
\"
"
,
"
\"
"
,
"""
,
"
\"
"
,
"
\"
"
,
"
\"
"
,
{
"
\"
"
,
DocSymbol
::
Perl_char
}}
{
SYM
(
Quot
),
"
\"
"
,
"
\"
"
,
"
\"
"
,
"""
,
"
\"
"
,
"
\"
"
,
"
\"
"
,
{
"
\"
"
,
DocSymbol
::
Perl_char
}},
{
SYM
(
Minus
),
"-"
,
"-"
,
"-"
,
"-"
,
"-
\\
/"
,
"-"
,
"-"
,
{
"-"
,
DocSymbol
::
Perl_char
}}
};
static
const
int
g_numHtmlEntities
=
(
int
)(
sizeof
(
g_htmlEntities
)
/
sizeof
(
*
g_htmlEntities
));
...
...
src/markdown.cpp
View file @
385b87e0
...
...
@@ -1004,6 +1004,16 @@ static int processSpecialCommand(GrowBuf &out, const char *data, int offset, int
if
(
c
==
'['
||
c
==
']'
||
c
==
'*'
||
c
==
'+'
||
c
==
'-'
||
c
==
'!'
||
c
==
'('
||
c
==
')'
||
c
==
'.'
||
c
==
'`'
||
c
==
'_'
)
{
if
(
c
==
'-'
&&
size
>
3
&&
data
[
2
]
==
'-'
&&
data
[
3
]
==
'-'
)
// \---
{
out
.
addStr
(
&
data
[
1
],
3
);
return
4
;
}
else
if
(
c
==
'-'
&&
size
>
2
&&
data
[
2
]
==
'-'
)
// \--
{
out
.
addStr
(
&
data
[
1
],
2
);
return
3
;
}
out
.
addStr
(
&
data
[
1
],
1
);
return
2
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment