Thread overview
[Issue 122] DDoc newline behaviour produces suboptimal results
Jun 15, 2006
d-bugmail
Mar 13, 2010
Don
Mar 15, 2010
Don
Mar 15, 2010
Don
Mar 15, 2010
Don
Apr 10, 2010
Don
June 15, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=122





------- Comment #1 from bugzilla@digitalmars.com  2006-06-14 23:03 -------
Can you please provide a small example?


-- 

March 13, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=122



--- Comment #2 from Don <clugdbug@yahoo.com.au> 2010-03-13 13:05:06 PST ---
I've worked out what this is. Trailing newlines don't get stripped from the Description section. Yes, action on an ancient bug!

Here's a test case:

/**
foo1

this has one BR*/
void foo1();
/**
foo2

this also has one BR
*/
void foo2();

/**
foo3

this still just has one BR

*/
void foo3();

/**
foo4

but this has two BRs!!


*/
void foo4();

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=122


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #3 from Don <clugdbug@yahoo.com.au> 2010-03-15 00:57:17 PDT ---
PATCH: Don't include trailing newlines.
doc.c line 1007.
Value of 'pend' shouldn't increase unless there's a non-\n
character.

+        pend = p;
        while (1)
        {
        if (!*p)
-        {   pend = p;
            goto L1;
-        }
        if (*p == '\n')
        {   p++;
            if (*p == '\n' && !summary && !namelen)
            {
            pend = p;
            p++;
            goto L1;
            }
            break;
        }
        p++;
+        pend = p;
        }
        p = skipwhitespace(p);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=122



--- Comment #4 from Don <clugdbug@yahoo.com.au> 2010-03-15 02:08:52 PDT ---
Sorry, that patch came out wrong. The first line belongs further up in the function.

Around line 965:
     {
     p = skipwhitespace(p);
     pstart = p;
+    pend = p;

     /* Find end of section, which is ended by one of:
      *    'identifier:' (but not inside a code section)


And around line 1007:
        while (1)
        {
        if (!*p)
-        {   pend = p;
            goto L1;
-        }
        if (*p == '\n')
        {   p++;
            if (*p == '\n' && !summary && !namelen)
            {
            pend = p;
            p++;
            goto L1;
            }
            break;
        }
        p++;
+        pend = p;
        }
        p = skipwhitespace(p);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=122



--- Comment #5 from Don <clugdbug@yahoo.com.au> 2010-03-15 12:58:16 PDT ---
See bug 1628 for a better patch.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 10, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=122


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #6 from Don <clugdbug@yahoo.com.au> 2010-04-09 19:07:34 PDT ---
Fixed DMD1.058 and DMD2.043.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------