Sublime Forum

Command to remove a specific tag from a selection?

#1

I was wondering if I was missing there being a command or plugin that would remove a specific tag from a document or selection (if there was one).

For example, remove all SPAN tags, regardless of whether they had any attributes, or with specific attributes (span class=“foo”).

I have been doing something like this every time:

Find: <span.*?>(.*?)</span>
Replace: \1

And would like to make that into a simple command, if one does not already exist. If it doesn’t already exist, how does one make a command out of a set of find/replace parameters?

0 Likes

Selecting the same tag all at once
#2

You can try the RegReplace plugin by Facelessuser to set a command to a specific find/replace.

Or you can use the tag plugin to remove a selected tag…

0 Likes

#3

github.com/SublimeText/Tag

“Edit -> Tag -> Remove…”

0 Likes

#4

[quote=“tito”]https://github.com/SublimeText/Tag

“Edit -> Tag -> Remove…”[/quote]

Thanks, remove picked tag, I hadn’t realized that’s what that meant.

0 Likes