From 3d8ff29664e5177297f5ac4c7cd5427bff1e62b2 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Fri, 25 Aug 2023 13:08:02 -0600 Subject: [PATCH] defaultValue is implicitly code only with JSDoc compat --- CHANGELOG.md | 2 ++ src/lib/converter/comments/parser.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22dc23ef4..088b47238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Added `--disableGit` option to prevent TypeDoc from using Git to try to determine if sources can be linked, #2326. - Added support for tags `@showGroups`, `@hideGroups`, `@showCategories`, `@hideCategories` to configure the navigation pane on a per-reflection basis, #2329. +- With `--jsDocCompatibility.defaultTags` set, `@defaultValue` is now implicitly a code block if the text contains no code, #2370. ### Bug Fixes @@ -39,6 +40,7 @@ - @camc314 - @cprussin +- @roggervalf - @Th3S4mur41 ## v0.24.8 (2023-06-04) diff --git a/src/lib/converter/comments/parser.ts b/src/lib/converter/comments/parser.ts index 6fcf65fd3..c3de92e22 100644 --- a/src/lib/converter/comments/parser.ts +++ b/src/lib/converter/comments/parser.ts @@ -216,8 +216,8 @@ function blockTag( if (tagName === "@example" && config.jsDocCompatibility.exampleTag) { content = exampleBlockContent(comment, lexer, config, warning); } else if ( - (tagName === "@default" && config.jsDocCompatibility.defaultTag) || - tagName === "@defaultValue" + ["@default", "@defaultValue"].includes(tagName) && + config.jsDocCompatibility.defaultTag ) { content = defaultBlockContent(comment, lexer, config, warning); } else {