在我們的一些文章中,我們發現圖像錯誤地將硬鏈接硬編碼到圖像標籤的標題/ alt屬性中,導致圖像顯示中斷。例如: <img src="/imgs/my-image.jpg" title="This is a picture of a <a href="/blob.html">blob</a>." />
我使用preg_replace_callback函數試過了,但它是難以企及的,因爲從鏈接重複報
我想找到NUMBER,但跳過H1,H2,H3等..(所有可能的HTML標題變種) 例1: <div>Today is good day. I got<h3>3<span> lotto tickets</span></h3></div>
例2: I want to buy lotto tickets. <h1>Maybe 10 is enough</h1>
實施例3: I want to b
鏈接研究之: How do you apply htmlentities selectively? 和 PHP function to strip tags, except a list of whitelisted tags and attributes 他們接近,但並不如預期。 我試過了什麼? <?php
define('CHARSET', 'UTF-8');
define('REPLAC