Closed phryneas closed 4 years ago
So this seems to be a problem with the tokenizer removing all lines where only a single character is present. It seems possible to circumvent this by indenting with a *
So, this:
/**
a s d f g
*/
ends up as
but
/**
* ```
* a
* s
* d
* f
* g
* ```
*/
works.
With that info, I can work around that in my comments for now, but this seems like a serious bug.
This is the recommended standard way that it should be written:
/**
* ```
* a
* s
* d
* f
* g
* ```
*/
But you are right, this is definitely a bug in the handling of the /**
*/
framing.
Yeah, I wouldn't have noticed it if it weren't for the code block - but writing code blocks with leading *
is really distracting from the code itself :/
Yeah, I wouldn't have noticed it if it weren't for the code block - but writing code blocks with leading * is really distracting from the code itself :/
Makes sense. It does look like a pretty reasonable practice.
Here's a PR: https://github.com/microsoft/tsdoc/pull/259
That was fast :) Thanks a lot!
By the way, if you are interested where your libs are used, here's my use case:
This is going to make it into the @reduxjs/toolkit
docs. I'm writing a remark plugin that takes a link in the form of
[summary,remarks,params,examples](docblock://mapBuilders.ts?token=ActionReducerMapBuilder.addDefaultCase)
and renders the docblock into something like this (the TS code from the example is compiled down into JS for those tabs - in this case, TS and JS are identical though ^^)
That is pretty cool!
This fix was released with @microsoft/tsdoc
version 0.12.21
So I noticed that when calling
.toString()
on the_codeExcerpt._content
of aDocFencedCode
, some characters seem to go missing.See this example:
docNode._codeExcerpt.content.parserContext.sourceRange.toString()
When calling
docNode._codeExcerpt._content.toString()
, this is mangled to(Diff highlight by me)
Actually, the same seems to happen in the TSdoc playground.
Just copy& paste my initial docblock over there: https://microsoft.github.io/tsdoc/
I guess this is a bug, or am I writing completely wrong tsdoc?