我有一些HTML输出代码,例如部分:更换标签和换行符在HTML标签,其开始在一些文字
<div class="header">
\n\t
<div class="header-inner">
\n\t\t
<div class="title">
Title\n\t\t
</div>
\n\t
</div>
\n
</div>
事业部.title伪有换行符和制表符前关闭。可以删除它(替换为JS模式)?文字随机,并不总是“标题”,和标签有相同的问题可以很多。
极品:
<div class="header">
\n\t
<div class="header-inner">
\n\t\t
<div class="title">
Title
</div>
\n\t
</div>
\n
</div>
要替换** **所有的制表符和换行符的div.title里面?可能的重复http://stackoverflow.com/questions/4562756/replacing-tab-characters-in-javascript – roemhildtg
是的,在div.title和所有以文本开头的标签中。 – werty1001
我需要regexp进行替换,但我不知道它是否可行,html代码返回gulp管道,我不能使用jQuery或原生js。 – werty1001