pax
pax

Reputation: 502

Selective strip tags in TextMate

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?

Upvotes: 1

Views: 1689

Answers (2)

amain
amain

Reputation: 1688

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.

Upvotes: 2

Scott
Scott

Reputation: 2793

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!

Upvotes: 2

Related Questions