File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { AssetModel } from '../Models/asset-model';
33import { RenderOption , RenderObject , RenderContentType } from '../options/index' ;
44import { EmbeddedAsset , EmbeddedEntry , EmbedTagModel } from '../Models/embeddec-object-model' ;
55import { defaultOptions } from '../options/default-options' ;
6+ import ASSET from '../embedded-types/asset' ;
67
78// This function will find Embedded object present in string
89export function findEmbeddedEntry (
@@ -51,10 +52,10 @@ export function findRenderString(
5152 return '' ;
5253 }
5354 let text = null
54- if ( ( object as EmbeddedEntry ) . a && ( object as EmbeddedEntry ) . a [ "#text" ] ) {
55- text = ( object as EmbeddedEntry ) . a [ "#text" ]
56- } else if ( ( object as EmbeddedEntry ) . img && ( object as EmbeddedEntry ) . img . alt ) {
57- text = ( object as EmbeddedEntry ) . img . alt
55+ if ( object [ "sys-style-type" ] !== ASSET . DISPLAYABLE && ( object as EmbeddedEntry ) [ "#text" ] ) {
56+ text = ( object as EmbeddedEntry ) [ "#text" ]
57+ } else if ( ( object as EmbeddedEntry ) . alt ) {
58+ text = ( object as EmbeddedEntry ) . alt
5859 }
5960 if ( renderOptions && renderOptions [ object [ 'sys-style-type' ] ] !== undefined ) {
6061 const renderFunction = renderOptions [ object [ 'sys-style-type' ] ] as RenderObject ;
Original file line number Diff line number Diff line change @@ -8,5 +8,8 @@ export const defaultOptions: RenderOption = {
88 [ ENTRY . INLINE ] : ( entry ) => `<span>${ entry . title || entry . uid } </span>` ,
99 [ ENTRY . LINK ] : ( entry , text ) => `<a href="${ entry . url } ">${ text || entry . title || entry . uid } </a>` , // Todo Check for link with Manish
1010 [ ASSET . DOWNLOADABLE ] : ( asset , text ) => `<a href="${ asset . url } ">${ text || asset . title || asset . filename || asset . uid } </a>` ,
11- [ ASSET . DISPLAYABLE ] : ( asset , text ) => `<img src="${ asset . url } " alt="${ text || asset . title || asset . filename || asset . uid } " />` ,
11+ [ ASSET . DISPLAYABLE ] : ( asset , text ) => {
12+ const displaycontent = `<img src="${ asset . url } " alt="${ text || asset . title || asset . filename || asset . uid } " />`
13+ return displaycontent
14+ } ,
1215} ;
You can’t perform that action at this time.
0 commit comments