File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* oxlint-disable regexp/no-super-linear-backtracking */
12/**
23 * Text Processing Utilities
34 *
@@ -69,8 +70,7 @@ export function createSymbolId(kind: string, name: string): string {
6970 */
7071export function parseJsDocLinks ( text : string , symbolLookup : SymbolLookup ) : string {
7172 let result = escapeHtml ( text )
72-
73- result = result . replace ( / \{ @ l i n k \s + ( [ ^ \s } ] + ) (?: \s + ( [ ^ \s } ] * ) ) ? \} / g, ( _ , target , label ) => {
73+ result = result . replace ( / \{ @ l i n k \s + ( [ ^ \s } ] + ) (?: \s + ( [ ^ } ] + ) ) ? \} / g, ( _ , target , label ) => {
7474 const displayText = label || target
7575
7676 // External URL
@@ -105,7 +105,7 @@ export async function renderMarkdown(text: string, symbolLookup: SymbolLookup):
105105 // - \r\n, \n, or \r line endings
106106 const codeBlockData : Array < { lang : string ; code : string } > = [ ]
107107 let result = text . replace (
108- / ` ` ` [ \t ] * ( \w * ) (?: \r \n | \r | \n ) ( [ \s \S ] * ?) (?: \r \n | \r | \n ) ? ` ` ` / g,
108+ / ` ` ` [ \t ] * ( \w * ) [ \t ] * (?: \r \n | \r | \n ) ( [ \s \S ] * ?) (?: \r \n | \r | \n ) ? ` ` ` / g,
109109 ( _ , lang , code ) => {
110110 const index = codeBlockData . length
111111 codeBlockData . push ( { lang : lang || 'text' , code : code . trim ( ) } )
You can’t perform that action at this time.
0 commit comments