TextMate 中的选择性条带标签
有没有办法在 TextMate 中选择性地去除 HTML 标签 - 您可以在 Dreamweaver 中轻松执行此操作。 TextMate 允许您删除所有 HTML 标签,但我只想删除所有 和
标签。
在类似的主题上,有没有办法摆脱所有内联CSS样式?
Is there a way to strip HTML tags selectively in TextMate - you can easily do this in Dreamweaver.
TextMate allows you to strip all HTML tags but I would like to get rid of only, let's say all the <span>
's and <font>
's.
On a similar topic, is there a way to get rid of all the inline css styles?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不使用正则表达式替换呢? 例如,要摆脱所有内联 css 样式,您只需替换
为任何内容(空字符串)即可。 注意前导空格。
Why not use replace with regular expressions? E.g. to get rid of all inline css styles you would just replace
with nothing (empty string). Note the leading space.
我不知道,但总是可以选择对
(显然还有
)进行查找/替换并离开“替换”字段为空。 当然,如果你的跨度具有不同的类/id 属性或你拥有的东西,那么这会变得有点问题,那么你就进入了 RegExp 领域。
不过,这至少应该给你一个开始。 不过,我很想听听其他人能提供什么。 Textmate 是如此可定制,我确信有比我提供的更好的解决方案!
Not that I'm aware of, but there's always the option of doing a Find/Replace for
<span>
(and</span>
, obviously) and leaving the "Replace" field empty. Of course, this becomes a little more problematic if you've got spans with varying class/id attributes or what-have-you, then you're getting into RegExp territory.That should at least give you a start, though. I'd be interested to hear what anyone else has to offer, though. Textmate is so customizable that I'm sure there's a better solution than what I've offered!