我目前正在使用从 mustache/handlebars 模板构建的 HTML。
目标是在车把生成文本后获取文本,并通过删除不必要的空白字符来减小其大小,但保持标签的属性值和内容不变。
考虑以下示例:
</p> </td> </tr> <tr> <td>
应该变成:
</a></td></tr><tr><td>
和:
<p align="left"> Untouchable text </p> </td> </tr>
应该变成:
<p align="left"> Untouchable text </p></td></tr>