Magnific popup printing tags in sprint - Stack Overflow

I am using Magnific Popup for an image gallery. However, the counter is displaying the HTML tags as pla

I am using Magnific Popup for an image gallery. However, the counter is displaying the HTML tags as plain text on the frontend.

Here is my configuration:

$(".open-popup").magnificPopup({
    type: "image",
    fixedContentPos: true,
    gallery: {
        enabled: true,
        tCounter: '<span class="mfp-counter">%curr% of %total%</span>',
    },
});

With the above configuration, the counter is showing the tag as plain text instead of rendering it properly.

Here is the CodePen link for reference:

I am using Magnific Popup for an image gallery. However, the counter is displaying the HTML tags as plain text on the frontend.

Here is my configuration:

$(".open-popup").magnificPopup({
    type: "image",
    fixedContentPos: true,
    gallery: {
        enabled: true,
        tCounter: '<span class="mfp-counter">%curr% of %total%</span>',
    },
});

With the above configuration, the counter is showing the tag as plain text instead of rendering it properly.

Here is the CodePen link for reference: https://codepen.io/swaranan/pen/PwYwoXK

Share Improve this question asked Nov 28, 2024 at 10:13 Swaranan Singha BarmanSwaranan Singha Barman 3471 silver badge15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You need to set the allowHTMLInTemplate option to true.

allowHTMLInTemplate
false

Available since 1.2.0. Allows HTML content in the source template (such as text under image). If you enable this - make sure your HTML attributes are sanitized if they can be created by a non-admin user.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745516125a4631007.html

相关推荐

  • Magnific popup printing tags in sprint - Stack Overflow

    I am using Magnific Popup for an image gallery. However, the counter is displaying the HTML tags as pla

    1天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信