diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-21 22:24:33 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-21 22:24:33 -0400 |
commit | 3b7d7b0c8014e31ec8ae1d2b31fb8c6de54cbc21 (patch) | |
tree | 4dc6c81eaaee680575f354fc9500ac5b9cb9a214 | |
parent | cc95db359c8b935699173ec921ba9316c762aea5 (diff) |
scanner: Preserve paragraph breaks in input XML
If we have a blank line in the incoming XML documentation, keep that in
the emitted doxygen comments.
-rw-r--r-- | src/scanner.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/scanner.c b/src/scanner.c index 4a4e605..5793c20 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -177,7 +177,7 @@ desc_dump(char *desc, const char *fmt, ...) { va_list ap; char buf[128], hang; - int col, i, j, k, startcol; + int col, i, j, k, startcol, newlines; va_start(ap, fmt); vsnprintf(buf, sizeof buf, fmt, ap); @@ -206,8 +206,12 @@ desc_dump(char *desc, const char *fmt, ...) for (i = 0; desc[i]; ) { k = i; - while (desc[i] && isspace(desc[i])) + newlines = 0; + while (desc[i] && isspace(desc[i])) { + if (desc[i] == '\n') + newlines++; i++; + } if (!desc[i]) break; @@ -215,7 +219,9 @@ desc_dump(char *desc, const char *fmt, ...) while (desc[i] && !isspace(desc[i])) i++; - if (col + i - j > 72) { + if (newlines > 1) + printf("\n%s*", indent(startcol)); + if (newlines > 1 || col + i - j > 72) { printf("\n%s*%c", indent(startcol), hang); col = startcol; } |