From 8f3a6c6b45d2267434cbfb0b675799a73659703c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C5=BEe=20Vodovnik?= Date: Wed, 17 Feb 2021 19:45:15 +0100 Subject: [PATCH] chore(docs): improve xmldoc inline code parsing (#5480) --- utils/doclint/xmlDocumentation.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/doclint/xmlDocumentation.js b/utils/doclint/xmlDocumentation.js index f480b51449c05..37c1858fe04dc 100644 --- a/utils/doclint/xmlDocumentation.js +++ b/utils/doclint/xmlDocumentation.js @@ -103,7 +103,12 @@ function _wrapAndEscape(node, maxColumns = 0) { lines.push(text); }; - const text = node.text.replace(/[^\[]`([^\]]*[^\[])`[^\]]/g, (m, g1) => ` ${g1} `); + + let text = node.text; + text = text.replace(/`([^`]*)`/g, (match, code) => `${code.replace('<', '<').replace('>', '>')}`); + text = text.replace(/\[(.*?)\]\((.*?\))/g, (match, linkName, linkUrl) => { + return `${linkName}`; + }); const words = text.split(' '); let line = ''; for (let i = 0; i < words.length; i++) {