File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,50 @@ Callouts inline [great page](/hello-world).
458458 ) ;
459459} ) ;
460460
461+ test ( "internal link inside codeblock ignored" , async ( ) => {
462+ const targetPageId = "123" ;
463+ const targetPage : NotionPage = makeSamplePageObject ( {
464+ slug : "hello-world" ,
465+ name : "Hello World" ,
466+ id : targetPageId ,
467+ } ) ;
468+
469+ const results = await getMarkdown (
470+ {
471+ type : "code" ,
472+ code : {
473+ caption : [ ] ,
474+ rich_text : [
475+ {
476+ type : "text" ,
477+ text : {
478+ content :
479+ "this should not change [link](https://www.notion.so/native/metapages/mypage)" ,
480+ link : null ,
481+ } ,
482+ annotations : {
483+ bold : false ,
484+ italic : false ,
485+ strikethrough : false ,
486+ underline : false ,
487+ code : false ,
488+ color : "default" ,
489+ } ,
490+ plain_text :
491+ "this should not change [link](https://www.notion.so/native/metapages/mypage)" ,
492+ href : null ,
493+ } ,
494+ ] ,
495+ language : "javascript" , // notion assumed javascript in my test in which I didn't specify a language
496+ } ,
497+ } ,
498+ targetPage
499+ ) ;
500+ expect ( results . trim ( ) ) . toContain (
501+ "this should not change [link](https://www.notion.so/native/metapages/mypage)"
502+ ) ;
503+ } ) ;
504+
461505async function getMarkdown ( block : object , targetPage ?: NotionPage ) {
462506 const config = {
463507 plugins : [
You can’t perform that action at this time.
0 commit comments