Skip to content

Commit aaf4872

Browse files
committed
chore: update
1 parent 45aa48c commit aaf4872

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

server/utils/docs/text.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
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
*/
7071
export function parseJsDocLinks(text: string, symbolLookup: SymbolLookup): string {
7172
let result = escapeHtml(text)
72-
73-
result = result.replace(/\{@link\s+([^\s}]+)(?:\s+([^\s}]*))?\}/g, (_, target, label) => {
73+
result = result.replace(/\{@link\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() })

0 commit comments

Comments
 (0)