D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9155 - Ddoc: code section should strip leading spaces
Summary: Ddoc: code section should strip leading spaces
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: ddoc, pull
Depends on:
Blocks:
 
Reported: 2012-12-13 23:52 UTC by Kenji Hara
Modified: 2013-03-04 19:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-12-13 23:52:28 UTC
In current, ddoc does not strip leading spaces in code section.

This code:
===============
/**
 *  Example:
 *  ---
 *  import std.stdio;
 *  writeln("Hello world!");
 *  if (test) {  
 *    writefln("D programming language");
 *  }
 *  ---
 */
void foo(){}
===============

Outputs:
===============
void foo();
Example:
  import std.stdio;
  writeln("Hello world!");
  if (test) {
    writefln("D programming language");
  }
===============

Should be:
===============
void foo();
Example:
import std.stdio;
writeln("Hello world!");
if (test) {
  writefln("D programming language");
}
===============
Comment 2 github-bugzilla 2013-03-04 19:30:24 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c47ef9ed4cc5c7f50df878643f22fc1601040b0c
fix Issue 9155 - Ddoc: code section should strip leading spaces

https://github.com/D-Programming-Language/dmd/commit/0c2d8a9f7f82c122174d595ccfb5847bbf162aaf
Merge pull request #1377 from 9rnsr/fix9155

Issue 9155 - Ddoc: code section should strip leading spaces