<a href> 标签内的换行符

Line break inside <a href> tag

有点情况。我正在使用 Wordpress Magnific 弹出插件,它从媒体库中获取图片。在图片上我有一个标题、alt 和一些标题,当我在我的页面上输入它时 在灯箱外,我在检查时得到了这段代码。问题是我无法使用任何 html 来处理它。我想这一定是因为它的内部标签。我想知道是否有可能让它在其中使用 html 因为我需要在其中使用换行符?

<figure> <a href="https://somepage.com/somepage/image.jpeg" data-rel="lightbox-gallery-1234" data-magnific_type="image" data-rl_title="Some Title" data-rl_caption="Caption for the picture and some more text" title="Some title"> <img src="https://somepage.com/somepage/image.jpeg" data-link="https://somepage.com/somepage/image.jpeg"> </a></figure>

检查这个问题:CSS data attribute new line character & pseudo-element content value

同样适用于您。

找到了我的问题的答案。添加 white-space:pre-wrap; 至 CSS 和 &#13; 用作断行符