php - Regex. How to process all HTML tags in one line? -
i written php script transform inline css in html tags classes https://gist.github.com/ibars/aa52c6119e53908c91ac553aeba229e0
but correctly process tags, 1 on line.
[ok] <div style="width: 50%;">123</div>
[broken result] <div style="width: 50%;">123 <span style="font-size: 24px;">456</span> 789</div>
how make script process multiple tags in line?
solved using regex below while replace in notepad++
from: >([^\r])
to: >\r\n$1
this code force html opened tags move on new line. running script, getting result , use online html-formatter/-beautifier tool on removing uglification regex above
Comments
Post a Comment