Closed
Description
From: microsoft/vscode#26415
TypeScript Version: 2.3.2
Code
/**
* @example
* ```
* if (true) {
* foo()
* }
* ```
*/
function foo() {
return '2';
}
Expected behavior:
For the @example
tag, we should return content including any leading whitespace
Actual behavior:
In this case, whitespace is stripped:
[Trace - 3:32:54 PM] Response received: quickinfo (120). Request took 2 ms. Success: true
Result: {
"kind": "function",
"kindModifiers": "",
"start": {
"line": 9,
"offset": 10
},
"end": {
"line": 9,
"offset": 13
},
"displayString": "function foo(): string",
"documentation": "",
"tags": [
{
"name": "example",
"text": "```\nif (true) {\nfoo()\n}\n```"
}
]
}
This results in incorrect rendering of the code example: