Skip to content

Commit

Permalink
chore(docs): improve xmldoc inline code parsing (#5480)
Browse files Browse the repository at this point in the history
  • Loading branch information
avodovnik committed Feb 17, 2021
1 parent cc749fe commit 8f3a6c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/doclint/xmlDocumentation.js
Expand Up @@ -103,7 +103,12 @@ function _wrapAndEscape(node, maxColumns = 0) {
lines.push(text);
};

const text = node.text.replace(/[^\[]`([^\]]*[^\[])`[^\]]/g, (m, g1) => ` <c>${g1}</c> `);

let text = node.text;
text = text.replace(/`([^`]*)`/g, (match, code) => `<c>${code.replace('<', '&lt;').replace('>', '&gt;')}</c>`);
text = text.replace(/\[(.*?)\]\((.*?\))/g, (match, linkName, linkUrl) => {
return `<a href="${linkUrl}">${linkName}</a>`;
});
const words = text.split(' ');
let line = '';
for (let i = 0; i < words.length; i++) {
Expand Down

0 comments on commit 8f3a6c6

Please sign in to comment.