From d6801c4c5eaeebc5e14f5d1cd7c312ad82c1dbbd Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 9 Sep 2017 15:21:23 +0200 Subject: Physical newlines in ALIASES configuration tags. 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 --- doc/custcmd.doc | 4 +++- src/config.xml | 5 ++++- src/doxygen.cpp | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/custcmd.doc b/doc/custcmd.doc index 8ac2a65..de9a30d 100644 --- a/doc/custcmd.doc +++ b/doc/custcmd.doc @@ -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 Side Effects:. -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. diff --git a/src/config.xml b/src/config.xml index 6cd7997..960b392 100644 --- a/src/config.xml +++ b/src/config.xml @@ -532,7 +532,10 @@ Go to the next 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. ]]> diff --git a/src/doxygen.cpp b/src/doxygen.cpp index d3554cf..6867ce9 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -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()); } } -- cgit v0.12