From 7b930fffc08ee848c1e5c681d80bec01e7a7fc6a Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Fri, 3 Mar 2023 10:42:32 -0500 Subject: [PATCH] Fixes #266 --- CHANGELOG.md | 1 + server/src/utils/functions.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be78bb5..6fd3fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [2.3.2] - 2023-XX-XX - Fix issue [#265](https://github.com/intersystems/language-server/issues/265): Support HTML spans in intellisense from class descriptions +- Fix issue [#266](https://github.com/intersystems/language-server/issues/266): Preserve empty HTML spans in intellisense from class descriptions ## [2.3.1] - 2023-03-02 - Fix issue [#77](https://github.com/intersystems/language-server/issues/77): Incorrect 'Class/Routine/Include file does not exist' Diagnostics after namespace switch diff --git a/server/src/utils/functions.ts b/server/src/utils/functions.ts index 25398dd..9d31739 100644 --- a/server/src/utils/functions.ts +++ b/server/src/utils/functions.ts @@ -15,7 +15,10 @@ import parameterTypes = require("../documentation/parameterTypes.json"); // Initialize turndown and tune it for Documatic HTML const TurndownService = require('turndown-ext').default; -const turndown = new TurndownService({codeBlockStyle: "fenced"}); +const turndown = new TurndownService({ + codeBlockStyle: "fenced", + blankReplacement: (content, node: HTMLElement) => node.nodeName == 'SPAN' ? node.outerHTML : '' +}); turndown.remove("style"); turndown.keep(["span", "table", "tr", "td"]); turndown.addRule("pre",{