@@ -3,22 +3,22 @@ export function renderMarkdown(markdownText = '') {
3
3
. replace ( / ` v s c o d e : : ( \S + ?) ` / g, '<a class="api-link scope-vscode" target="_blank" href=\'https://code.visualstudio.com/api/references/vscode-api#$1\'>$1</a>' )
4
4
// eslint-disable-next-line node/prefer-global/process
5
5
. replace ( / ` r e a c t i v e : : ( \S + ?) ` / g, `<a class="api-link scope-reactive" target="_blank" href='${ globalThis . process ? globalThis . process . env . BASE_URL : import . meta. env . BASE_URL } core/$1'>$1</a>` )
6
- . replace ( / ` v u e : : ( \S + ? ) \( ( \S + ?) \) ` / g, `<a class="api-link scope-vue" target="_blank" href='$2'>$1</a>` )
7
- . replace ( / ^ # # # ( .* $ ) / gim , '<h3>$1</h3>' )
8
- . replace ( / ^ # # ( .* $ ) / gim , '<h2>$1</h2>' )
9
- . replace ( / ^ # ( .* $ ) / gim , '<h1>$1</h1>' )
10
- . replace ( / ^ \ > ( .* $ ) / gim , '<blockquote>$1</blockquote>' )
11
- . replace ( / \* \* ( .* ) \* \* / gim , '<b>$1</b>' )
12
- . replace ( / \* ( .* ) \* / gim , '<i>$1</i>' )
13
- . replace ( / ! \[ ( .* ?) \] \( ( .* ?) \) / gim , '<img alt=\'$1\' src=\'$2\' />' )
14
- . replace ( / \[ ( .* ?) \] \( ( .* ?) \) / gim , '<a href=\'$2\'>$1</a>' )
15
- . replace ( / ` ( .* ?) ` / gim , '<code>$1</code>' )
16
- . replace ( / \n $ / gim , '<br />' )
6
+ . replace ( / ` v u e : : ( [ ^ ( ` ] + ) \( ( \S + ?) \) ` / g, `<a class="api-link scope-vue" target="_blank" href='$2'>$1</a>` )
7
+ . replace ( / ^ # # # ( .* $ ) / gm , '<h3>$1</h3>' )
8
+ . replace ( / ^ # # ( .* $ ) / gm , '<h2>$1</h2>' )
9
+ . replace ( / ^ # ( .* $ ) / gm , '<h1>$1</h1>' )
10
+ . replace ( / ^ > ( .* $ ) / gm , '<blockquote>$1</blockquote>' )
11
+ . replace ( / \* \* ( .* ) \* \* / g , '<b>$1</b>' )
12
+ . replace ( / \* ( .* ) \* / g , '<i>$1</i>' )
13
+ . replace ( / ! \[ ( .* ?) \] \( ( .* ?) \) / g , '<img alt=\'$1\' src=\'$2\' />' )
14
+ . replace ( / \[ ( .* ?) \] \( ( .* ?) \) / g , '<a href=\'$2\'>$1</a>' )
15
+ . replace ( / ` ( .* ?) ` / g , '<code>$1</code>' )
16
+ . replace ( / \n $ / gm , '<br />' )
17
17
18
18
return htmlText . trim ( )
19
19
}
20
20
21
21
export function renderCommitMessage ( msg : string ) {
22
22
return renderMarkdown ( msg )
23
- . replace ( / \# ( [ 0 - 9 ] + ) / g, '<a href=\'https://github.com/vueuse/vueuse/issues/$1\'>#$1</a>' )
23
+ . replace ( / # ( \d + ) / g, '<a href=\'https://github.com/vueuse/vueuse/issues/$1\'>#$1</a>' )
24
24
}
0 commit comments