This commit is contained in:
parent
14a241e900
commit
ee0119f503
|
|
@ -119,6 +119,9 @@ function _wrapAndEscape(node, maxColumns = 0) {
|
|||
|
||||
let text = node.text;
|
||||
text = text.replace(/\[([^\]]*)\]\((.*?)\)/g, (match, linkName, linkUrl) => {
|
||||
const isInternal = !linkUrl.startsWith('http://') && !linkUrl.startsWith('https://');
|
||||
if (isInternal)
|
||||
linkUrl = new URL(linkUrl.replace('.md', ''), 'https://playwright.dev/dotnet/docs/api/').toString();
|
||||
return `<a href="${linkUrl}">${linkName}</a>`;
|
||||
});
|
||||
text = text.replace(/(?<!`)\[(.*?)\]/g, (match, link) => `<see cref="${link}"/>`);
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
const path = require('path');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const Documentation = require('./documentation');
|
||||
const XmlDoc = require('./xmlDocumentation');
|
||||
const XmlDoc = require('./dotnetXmlDocumentation');
|
||||
const PROJECT_DIR = path.join(__dirname, '..', '..');
|
||||
const fs = require('fs');
|
||||
const { parseApi } = require('./api_parser');
|
||||
|
|
|
|||
Loading…
Reference in a new issue