This commit is contained in:
Texas Toland 2025-03-18 16:52:58 +08:00 committed by GitHub
parent 4366eebfb6
commit 4cbdff68d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,7 +36,15 @@ class InlineTagWidget extends WidgetType {
}
}
export const matchRegexp = /(?<!]\()https:\/\/github\.com\/[^\s]+(?<!['".?,:;]+)/g;
// (?<! # skip if
// ]\( # Markdown link
// )
// https:\/\/github\.com\/ # literal github.com/
// [ # valid characters:
// \w # alphanumeric or underscore
// $-.~!*'();:@&=+$,\/?%#[\] # valid special characters
// ]+ # repeating and required
export const matchRegexp = /(?<!]\()https:\/\/github\.com\/[\w$-.~!*'();:@&=+$,\/?%#[\]]+/g;
export function createInlineViewPlugin(_plugin: GithubLinkPlugin) {
class InlineViewPluginValue implements PluginValue {