Skip to content

Commit 43de259

Browse files
authored
fix(xmldocs): over-greedy regex for md links and clean-up (#5798)
* fix(xmldocs): over-greedy regex for Markdown links * fix(dotnet): missing using and extra spaces
1 parent 6a8c8d9 commit 43de259

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

utils/doclint/generateDotnetApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ function generateEnumNameIfApplicable(member, name, type, parent) {
364364
function renderMethod(member, parent, output, name) {
365365
const typeResolve = (type) => translateType(type, parent, (t) => {
366366
let newName = `${parent.name}${translateMemberName(member.kind, member.name, null)}Result`;
367-
documentedResults.set(newName, `Result of calling <see cref="${translateMemberName("interface", parent.name)}.${translateMemberName(member.kind, member.name, member)}" />.`);
367+
documentedResults.set(newName, `Result of calling <see cref="${translateMemberName("interface", parent.name)}.${translateMemberName(member.kind, member.name, member)}"/>.`);
368368
return newName;
369369
});
370370

utils/doclint/templates/interface.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
using System.IO;
4040
using System.Runtime.Serialization;
4141
using System.Text.Json;
42+
using System.Text.Json.Serialization;
4243
using System.Text.RegularExpressions;
4344
using System.Threading;
4445
using System.Threading.Tasks;

utils/doclint/xmlDocumentation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ function _wrapAndEscape(node, maxColumns = 0) {
118118

119119

120120
let text = node.text;
121-
text = text.replace(/`([^`]*)`/g, (match, code) => `<c>${code.replace('<', '&lt;').replace('>', '&gt;')}</c>`);
122-
text = text.replace(/\[(.*?)\]\((.*?\))/g, (match, linkName, linkUrl) => {
121+
text = text.replace(/\[(.*?)\]\((.*?)\)/g, (match, linkName, linkUrl) => {
123122
return `<a href="${linkUrl}">${linkName}</a>`;
124123
});
125-
text = text.replace(/\[(.*?)\]/g, (match, link) => `<see cref="${link}" />`);
124+
text = text.replace(/(?<!`)\[(.*?)\]/g, (match, link) => `<see cref="${link}"/>`);
125+
text = text.replace(/`([^`]*)`/g, (match, code) => `<c>${code.replace('<', '&lt;').replace('>', '&gt;')}</c>`);
126126
const words = text.split(' ');
127127
let line = '';
128128
for (let i = 0; i < words.length; i++) {

0 commit comments

Comments
 (0)