@@ -12,7 +12,10 @@ import { CachedMetadata, HeadingCache } from 'obsidian'
1212const double_regexp : RegExp = / (?: \r \n | \r | \n ) ( (?: \r \n | \r | \n ) (?: < ! - - ) ? I D : \d + ) / g
1313const card_regexp : RegExp = / (?: \r \n | \r | \n ) ( (?: \r \n | \r | \n ) [ C a r d ] ) / g
1414
15- function id_to_str ( identifier :number , inline :boolean = false , comment :boolean = false ) : string {
15+ function id_to_str ( identifier :number , inline :boolean = false , comment :boolean = false , blocklinkid :boolean ) : string {
16+ if ( blocklinkid ) {
17+ return "^ID-" + identifier . toString ( )
18+ }
1619 let result = "ID: " + identifier . toString ( )
1720 if ( comment ) {
1821 result = "<!--" + result + "-->"
@@ -470,7 +473,7 @@ export class AllFile extends AbstractFile {
470473 ( id_position : number , index : number ) => {
471474 const identifier : number | null = this . note_ids [ index ]
472475 if ( identifier ) {
473- normal_inserts . push ( [ id_position , id_to_str ( identifier , false , this . data . comment ) ] )
476+ normal_inserts . push ( [ id_position , id_to_str ( identifier , false , this . data . comment , this . data . add_card_link ) ] )
474477 }
475478 }
476479 )
@@ -479,7 +482,7 @@ export class AllFile extends AbstractFile {
479482 ( id_position : number , index : number ) => {
480483 const identifier : number | null = this . note_ids [ index + this . notes_to_add . length ] //Since regular then inline
481484 if ( identifier ) {
482- inline_inserts . push ( [ id_position , id_to_str ( identifier , true , this . data . comment ) ] )
485+ inline_inserts . push ( [ id_position , id_to_str ( identifier , true , this . data . comment , this . data . add_card_link ) ] )
483486 }
484487 }
485488 )
@@ -488,7 +491,7 @@ export class AllFile extends AbstractFile {
488491 ( id_position : number , index : number ) => {
489492 const identifier : number | null = this . note_ids [ index + this . notes_to_add . length + this . inline_notes_to_add . length ] // Since regular then inline then regex
490493 if ( identifier ) {
491- regex_inserts . push ( [ id_position , "\n" + id_to_str ( identifier , false , this . data . comment ) ] )
494+ regex_inserts . push ( [ id_position , "\n" + id_to_str ( identifier , false , this . data . comment , this . data . add_card_link ) ] )
492495 }
493496 }
494497 )
0 commit comments