File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,17 +19,15 @@ export default function removeMarkdownExtensions(): (tree: Node) => void {
1919 node . properties &&
2020 typeof node . properties . href === "string"
2121 ) {
22- const markdownExtensionRegex = / \. m d ( # .* ) ? $ / ;
23- if ( markdownExtensionRegex . test ( node . properties . href ) ) {
22+ const match = / (?: \/ i n d e x ) ? \. ( m d | m d x ) ( # .* ) ? $ / ;
23+ if ( match . test ( node . properties . href ) ) {
2424 let date = new Date ( ) . toLocaleTimeString ( "en-US" , { hour12 : false } ) ;
25+
2526 console . log (
26- `\x1b[90m${ date } \x1b[0m \x1b[95m[🔥 *.md]\x1b[0m ${ node . properties . href } ` ,
27+ `\x1b[90m${ date } \x1b[0m \x1b[95m[🔥 *.md(x) ]\x1b[0m ${ node . properties . href } ` ,
2728 ) ;
2829
29- node . properties . href = node . properties . href . replace (
30- markdownExtensionRegex ,
31- "$1" ,
32- ) ;
30+ node . properties . href = node . properties . href . replace ( match , "$2" ) ;
3331 }
3432 }
3533 } ) ;
You can’t perform that action at this time.
0 commit comments