File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ export function referenceToHTML(
7777 renderOption : RenderOption ,
7878 renderEmbed ?: ( metadata : Metadata ) => EmbeddedItem | EntryNode ,
7979) : string {
80+ if ( node . attrs . type === 'entry' && node . attrs [ 'display-type' ] === 'link' ) {
81+ const entryText = node . children ? nodeChildrenToHTML ( node . children , renderOption , renderEmbed ) : '' ;
82+ if ( node . attrs . target ) {
83+ return `<a${ node . attrs . style ? ` style="${ node . attrs . style } "` : `` } ${ node . attrs . class ? ` class="${ node . attrs . class } "` : `` } ${ node . attrs . id ? ` id="${ node . attrs . id } "` : `` } href="${ node . attrs . href || node . attrs . url } " target="${ node . attrs . target } ">${ entryText } </a>`
84+ }
85+ return `<a${ node . attrs . style ? ` style="${ node . attrs . style } "` : `` } ${ node . attrs . class ? ` class="${ node . attrs . class } "` : `` } ${ node . attrs . id ? ` id="${ node . attrs . id } "` : `` } href="${ node . attrs . href || node . attrs . url } ">${ entryText } </a>` ;
86+ }
8087 function sendToRenderOption ( referenceNode : Node ) : string {
8188 return ( renderOption [ referenceNode . type ] as RenderNode ) ( referenceNode , undefined ) ;
8289 }
You can’t perform that action at this time.
0 commit comments