File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -523,6 +523,8 @@ export default class ObsidianAdmonition
523523 editor . getDoc ( ) . replaceSelection (
524524 `\`\`\`ad-${ admonition . type }
525525
526+ ${ editor . getDoc ( ) . getSelection ( ) }
527+
526528\`\`\`\n`
527529 ) ;
528530 const cursor = editor . getCursor ( ) ;
@@ -546,6 +548,8 @@ export default class ObsidianAdmonition
546548 `\`\`\`ad-${ admonition . type }
547549title:
548550
551+ ${ editor . getDoc ( ) . getSelection ( ) }
552+
549553\`\`\`\n`
550554 ) ;
551555 const cursor = editor . getCursor ( ) ;
@@ -570,11 +574,10 @@ title:
570574 ) ;
571575 if ( admonition . command ) {
572576 try {
573- editor
574- . getDoc ( )
575- . replaceSelection (
576- `!!! ad-${ admonition . type } \n\n--- admonition\n`
577- ) ;
577+ editor . getDoc ( ) . replaceSelection (
578+ `!!! ad-${ admonition . type } \n
579+ ${ editor . getDoc ( ) . getSelection ( ) } \n--- admonition\n`
580+ ) ;
578581 const cursor = editor . getCursor ( ) ;
579582 editor . setCursor ( cursor . line - 2 ) ;
580583 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments