diff options
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r-- | src/commentcnv.l | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l index 1ae07c0..b031265 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -82,21 +82,22 @@ static void replaceCommentMarker(const char *s,int len) { const char *p=s; char c; - // copy blanks + // copy leading blanks while ((c=*p) && (c==' ' || c=='\t' || c=='\n')) { ADDCHAR(c); g_lineNr += c=='\n'; p++; } - // replace start of comment marker by spaces + // replace start of comment marker by blanks and the last character by a * + int blanks=0; while ((c=*p) && (c=='/' || c=='!' || c=='#')) { - ADDCHAR(' '); + blanks++; p++; if (*p=='<') // comment-after-item marker { - ADDCHAR(' '); + blanks++; p++; } if (c=='!') // end after first ! @@ -104,6 +105,15 @@ static void replaceCommentMarker(const char *s,int len) break; } } + if (blanks>0) + { + while (blanks>1) + { + ADDCHAR(' '); + blanks--; + } + ADDCHAR('*'); + } // copy comment line to output ADDARRAY(p,len-(p-s)); } |