Corrupted documentation is generated by ddoc for code examples having attributes with colons: /** Example: --- private: int i = 0; --- */ void main() { } Generated html: <html><head> <META http-equiv="content-type" content="text/html; charset=utf-8"> <title>hello</title> </head><body> <h1>hello</h1> <!-- Generated by Ddoc from hello.d --> <br><br> $(DDOC_MODULE_MEMBERS <dt><big>void <u>main</u>(); </big></dt> $(DDOC_DECL_DD <b>Example:</b><br> <pre class="d_code"></pre> <b>private:</b><br> int i = 0; <pre class="d_code"></pre> <br><br> <br><br> <hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> </body></html>
Created attachment 186 [details] Ddoc output Attached for testing convenience.
CAUSE: when splitting into sections, identifiers inside code sections should be ignored. (In the code below, note that "--foo:" is not a section). This patch also fixes bug 195. PATCH: doc.c, parseSections() line 965 (DMD2.035) /* Find end of section, which is ended by one of: - * 'identifier:' + * 'identifier:' (but not inside a code section) * '\0' */ idlen = 0; + bool inCode = false; while (1) { + if (*p=='-') { // check for start/end of a code section + int numdash=0; + while(*p=='-') { + ++numdash; + p++; + } + if (!*p || *p=='\r' || *p=='\n' && numdash>=3) + inCode = !inCode; + } - if (isalpha(*p) || *p == '_') + else if (!inCode && (isalpha(*p) || *p == '_')) { q = p + 1; while (isalnum(*q) || *q == '_')
Related SVN revision: http://www.dsource.org/projects/dmd/changeset/227
Fixed dmd 1.051 and 2.036
*** Issue 1652 has been marked as a duplicate of this issue. ***
dlang/dub pull request #1946 "Make the testsuite re-runnable on OSX" was merged into master: - ad164ef26ce226e269352fe828727632c4f4b40e by Geod24: testsuite: Make issue1117 test re-runnable It's the little things in life, like being able to re-run your test-suite on your own machine, that makes the greatest joy. https://github.com/dlang/dub/pull/1946