最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Magnific popup printing tags in sprint - Stack Overflow

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论