@@ -49,25 +49,25 @@ class Html2Text
4949 protected $ search = array (
5050 "/ \r/ " , // Non-legal carriage return
5151 "/[ \n\t]+/ " , // Newlines and tabs
52- '/<head[^>]*>.*?<\/head>/i ' , // <head>
53- '/<script[^>]*>.*?<\/script>/i ' , // <script>s -- which strip_tags supposedly has problems with
54- '/<style[^>]*>.*?<\/style>/i ' , // <style>s -- which strip_tags supposedly has problems with
55- '/<i[^>]*>(.*?)<\/i>/i ' , // <i>
56- '/<em[^>]*>(.*?)<\/em>/i ' , // <em>
57- '/(<ul[^>]*>|<\/ul>)/i ' , // <ul> and </ul>
58- '/(<ol[^>]*>|<\/ol>)/i ' , // <ol> and </ol>
59- '/(<dl[^>]*>|<\/dl>)/i ' , // <dl> and </dl>
60- '/<li[^>]*>(.*?)<\/li>/i ' , // <li> and </li>
61- '/<dd[^>]*>(.*?)<\/dd>/i ' , // <dd> and </dd>
62- '/<dt[^>]*>(.*?)<\/dt>/i ' , // <dt> and </dt>
63- '/<li[^>]*>/i ' , // <li>
64- '/<hr[^>]*>/i ' , // <hr>
65- '/<div[^>]*>/i ' , // <div>
66- '/(<table[^>]*>|<\/table>)/i ' , // <table> and </table>
67- '/(<tr[^>]*>|<\/tr>)/i ' , // <tr> and </tr>
68- '/<td[^>]*>(.*?)<\/td>/i ' , // <td> and </td>
52+ '/<head\b [^>]*>.*?<\/head>/i ' , // <head>
53+ '/<script\b [^>]*>.*?<\/script>/i ' , // <script>s -- which strip_tags supposedly has problems with
54+ '/<style\b [^>]*>.*?<\/style>/i ' , // <style>s -- which strip_tags supposedly has problems with
55+ '/<i\b [^>]*>(.*?)<\/i>/i ' , // <i>
56+ '/<em\b [^>]*>(.*?)<\/em>/i ' , // <em>
57+ '/(<ul\b [^>]*>|<\/ul>)/i ' , // <ul> and </ul>
58+ '/(<ol\b [^>]*>|<\/ol>)/i ' , // <ol> and </ol>
59+ '/(<dl\b [^>]*>|<\/dl>)/i ' , // <dl> and </dl>
60+ '/<li\b [^>]*>(.*?)<\/li>/i ' , // <li> and </li>
61+ '/<dd\b [^>]*>(.*?)<\/dd>/i ' , // <dd> and </dd>
62+ '/<dt\b [^>]*>(.*?)<\/dt>/i ' , // <dt> and </dt>
63+ '/<li\b [^>]*>/i ' , // <li>
64+ '/<hr\b [^>]*>/i ' , // <hr>
65+ '/<div\b [^>]*>/i ' , // <div>
66+ '/(<table\b [^>]*>|<\/table>)/i ' , // <table> and </table>
67+ '/(<tr\b [^>]*>|<\/tr>)/i ' , // <tr> and </tr>
68+ '/<td\b [^>]*>(.*?)<\/td>/i ' , // <td> and </td>
6969 '/<span class="_html2text_ignore">.+?<\/span>/i ' , // <span class="_html2text_ignore">...</span>
70- '/<(img)[^>]*alt=\"([^>"]+)\"[^>]*>/i ' , // <img> with alt tag
70+ '/<(img)\b [^>]*alt=\"([^>"]+)\"[^>]*>/i ' , // <img> with alt tag
7171 );
7272
7373 /**
0 commit comments