TextMate 中的选择性条带标签

发布于 2024-07-19 06:05:02 字数 247 浏览 0 评论 0原文

有没有办法在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怎樣才叫好 2024-07-26 06:05:02

为什么不使用正则表达式替换呢? 例如,要摆脱所有内联 css 样式,您只需替换

 style=".*"

为任何内容(空字符串)即可。 注意前导空格。

Why not use replace with regular expressions? E.g. to get rid of all inline css styles you would just replace

 style=".*"

with nothing (empty string). Note the leading space.

各空 2024-07-26 06:05:02

我不知道,但总是可以选择对 (显然还有 )进行查找/替换并离开“替换”字段为空。 当然,如果你的跨度具有不同的类/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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文