Skip to content

Commit fdc2435

Browse files
committed
Make sure extra space from export statements is allowed in regex
1 parent 134ca32 commit fdc2435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/utils/code-highlight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function linkifyModuleSpecifiers(html: string, options?: LinkifyOptions): string
196196
// Match: from keyword span followed by string span containing module specifier
197197
// Pattern: <span style="...">from</span><span style="..."> 'module'</span>
198198
let result = html.replace(
199-
/(<span[^>]*>from<\/span>)(<span[^>]*>) (['"][^'"]+['"])<\/span>/g,
199+
/(<span[^>]*> ?from<\/span>)(<span[^>]*>) (['"][^'"]+['"])<\/span>/g,
200200
(match, fromSpan, stringSpanOpen, moduleSpecifier) => {
201201
const href = getHref(moduleSpecifier)
202202
if (!href) return match

0 commit comments

Comments
 (0)