code-d icon indicating copy to clipboard operation
code-d copied to clipboard

Embedded Code preview incorrect - (` hyphens and /// blocks and comment openings)

Open HuskyNator opened this issue 3 years ago • 1 comments

The highlighting does not always work when tokens/characters are exchanged. Note: https://dlang.org/spec/ddoc.html#embedded_comments

  1. The example given by the page above, also given below, does not function when ``` is used instead of ---, even though ```` does.
  2. Additionally, using /// instead of /++,+,+/ breaks the spacing of the embeded coding preview. (https://dlang.org/spec/ddoc.html#lexical)
  3. Comment openings are not ignored when the documentation starts on the same line as the initial comment line.
/++
 + Our function.
 +
 + Example:
 + ---
 + import std.stdio;
 +
 + void foo()
 + {
 +     writeln("foo!");  /* print the string */
 + }
 + ---
 +/

Expected result: image

Modified results:

  1. replace --- with ``` image
  2. replace /++,+,+/ with /// image
  3. documentation starts on the same line as the initial comment line image

HuskyNator avatar Dec 12 '22 21:12 HuskyNator

1 is fixed in serve-d now, (nightly available in 24h) 2 and 3 need updates to DCD and will take a while longer to be released.

WebFreak001 avatar Dec 13 '22 08:12 WebFreak001