@@ -124,8 +124,8 @@ export const tableWikilinkRegex = new RegExp(/(!?\[\[[^\]]*?\]\])/, "g")
124
124
const highlightRegex = new RegExp ( / = = ( [ ^ = ] + ) = = / , "g" )
125
125
const commentRegex = new RegExp ( / % % [ \s \S ] * ?% % / , "g" )
126
126
// from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts
127
- const calloutRegex = new RegExp ( / ^ \[ \! ( \w + ) \] ( [ + - ] ? ) / )
128
- const calloutLineRegex = new RegExp ( / ^ > * \[ \! \w + \] [ + - ] ? .* $ / , "gm" )
127
+ const calloutRegex = new RegExp ( / ^ \[ \! ( \w + ) \| ? ( . + ? ) ? \ ]( [ + - ] ? ) / )
128
+ const calloutLineRegex = new RegExp ( / ^ > * \[ \! \w + \| ? . * ? \ ][ + - ] ? .* $ / , "gm" )
129
129
// (?:^| ) -> non-capturing group, tag should start be separated by a space or be the start of the line
130
130
// #(...) -> capturing group, tag itself must start with #
131
131
// (?:[-_\p{L}\d\p{Z}])+ -> non-capturing group, non-empty string of (Unicode-aware) alpha-numeric characters and symbols, hyphens and/or underscores
@@ -428,7 +428,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
428
428
429
429
const match = firstLine . match ( calloutRegex )
430
430
if ( match && match . input ) {
431
- const [ calloutDirective , typeString , collapseChar ] = match
431
+ const [ calloutDirective , typeString , calloutMetaData , collapseChar ] = match
432
432
const calloutType = canonicalizeCallout ( typeString . toLowerCase ( ) )
433
433
const collapse = collapseChar === "+" || collapseChar === "-"
434
434
const defaultState = collapseChar === "-" ? "collapsed" : "expanded"
@@ -490,6 +490,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
490
490
className : classNames . join ( " " ) ,
491
491
"data-callout" : calloutType ,
492
492
"data-callout-fold" : collapse ,
493
+ "data-callout-metadata" : calloutMetaData ,
493
494
} ,
494
495
}
495
496
}
0 commit comments