Skip to content

Commit a387871

Browse files
committedFeb 17, 2025
fix(documentation): fix list rendering
Fixes #242 Fixes #199
1 parent b302fd2 commit a387871

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed
 

‎server/src/documentation/documentation.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,19 @@ export function extractCommentsDoc(node: Node): string {
275275
result += "\n"
276276
}
277277

278+
if (isList) {
279+
result += "\n"
280+
}
281+
278282
result += line
279283

280-
if (insideCodeBlock || isCodeBlock || isTable) {
284+
if (insideCodeBlock || isCodeBlock || isTable || isList) {
281285
result += "\n"
282286
}
283287

284-
if ((isEndOfSentence || isList || isHeader) && !insideCodeBlock) {
288+
if ((isEndOfSentence || isHeader) && !insideCodeBlock) {
285289
result += "\n\n"
286-
} else if (!insideCodeBlock && !isCodeBlock) {
290+
} else if (!insideCodeBlock && !isCodeBlock && !isList) {
287291
result += " "
288292
}
289293

‎server/src/e2e/suite/testcases/documentation/functions.test

+18
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,26 @@ fun example() {
158158
```
159159
See:
160160

161+
161162
* https://docs.tact-lang.org/ref/core-advanced#getoriginalfwdfee
162163

163164
* https://docs.tact-lang.org/ref/core-advanced#getforwardfee
164165

165166
* https://docs.tact-lang.org/ref/core-advanced#contextreadforwardfee
167+
168+
========================================================================
169+
Function documentation with list
170+
========================================================================
171+
/// Some interesting list
172+
/// - Point 1
173+
/// with other line
174+
/// - Point 2
175+
fun <caret>foo(): Int {}
176+
------------------------------------------------------------------------
177+
```tact
178+
fun foo(): Int
179+
```
180+
Some interesting list
181+
- Point 1
182+
with other line
183+
- Point 2

0 commit comments

Comments
 (0)