Skip to main content
Source Link

Getting Error in Sitecore Experience editor 10.2

We are getting an error for a component in experience editor.

Error: - XHTML markup is incorrect near field "fld_87182B393C1C4512A1FF76DB6D12EBC0_7B48C6C831FA4C20898328CB063FF744_en_1_6ecd25c3b5a04cde8cb248b6620e78fa_1082_edit".

enter image description here

Below is my code -

{{- linkDetails = (sc_link_info i_item 'Link') -}}
{{if linkDetails.linktype == "external"}}
    <a target='_blank' href="{{ linkDetails.url}}">{{sc_custom i_item "Image" }}</a> 
{{else if linkDetails.linktype == "media"}}
<a target='_blank' href="{{ i_item.Link.media_url }}">{{sc_custom i_item "Image" }}</a> 
{{else}}
<a data-promo='{{-sc_promo i_item-}}' href='{{-i_item.Link.url-}}' data-itemid='{{-i_item.id-}}' data-title='{{-sc_custom i_item "Title"-}}' data-category="{{-i_item.parent.Title-}}">
    {{-sc_custom i_item "Image"-}}
</a> 
{{ end }}

Please guide me to fix this!