Skip to content

Commit

Permalink
Physical newlines in ALIASES configuration tags.
Browse files Browse the repository at this point in the history
Some commands read input till the end of the physical line. In case these commands are used in an alias the rest of the line is lost / gives not the required results.
This patch creates the possibility to have physical newlines in ALIASES.
See also: https://stackoverflow.com/questions/46050789/doxygen-alias-with-multiple-commands
  • Loading branch information
albert-github committed Sep 9, 2017
1 parent ddae919 commit d6801c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doc/custcmd.doc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ The simplest form of an alias is a simple substitution of the form
put the command `\sideeffect` (or `@sideeffect`) in the documentation, which
will result in a user-defined paragraph with heading <b>Side Effects:</b>.

Note that you can put `\n`'s in the value part of an alias to insert newlines.
Note that you can put `\n`'s in the value part of an alias to insert newlines
(in the resulting output). You can put `^^` in the value part of an alias to
insert a newline as if a physical newline was in the original file.

Also note that you can redefine existing special commands if you wish.

Expand Down
5 changes: 4 additions & 1 deletion src/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,10 @@ Go to the <a href="commands.html">next</a> section or return to the
will allow you to
put the command \c \\sideeffect (or \c \@sideeffect) in the documentation, which
will result in a user-defined paragraph with heading "Side Effects:".
You can put \ref cmdn "\\n"'s in the value part of an alias to insert newlines.
You can put \ref cmdn "\\n"'s in the value part of an alias to insert newlines
(in the resulting output).
You can put `^^` in the value part of an alias to insert a newline as if
a physical newline was in the original file.
]]>
</docs>
</option>
Expand Down
10 changes: 10 additions & 0 deletions src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9826,6 +9826,16 @@ static void escapeAliases()
}
newValue+=value.mid(p,value.length()-p);
*s=newValue;
p = 0;
newValue = "";
while ((in=value.find("^^",p))!=-1)
{
newValue+=value.mid(p,in-p);
newValue+="\n";
p=in+2;
}
newValue+=value.mid(p,value.length()-p);
*s=newValue;
//printf("Alias %s has value %s\n",adi.currentKey().data(),s->data());
}
}
Expand Down

0 comments on commit d6801c4

Please sign in to comment.