mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-18 13:11:20 +08:00
chore: format script code.
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
export function rehypeUrls(node) {
|
||||
if (node.type === 'element' && node.properties?.href && /.md/.test(node.properties.href) && !/^(https?:\/\/)/.test(node.properties.href)) {
|
||||
if (
|
||||
node.type === 'element' &&
|
||||
node.properties?.href &&
|
||||
/.md/.test(node.properties.href) &&
|
||||
!/^(https?:\/\/)/.test(node.properties.href)
|
||||
) {
|
||||
let href = node.properties.href;
|
||||
node.properties.href = href.replace(/([^\.\/\\]+)\.(md|markdown)/gi, '$1.html');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user