I would like a macro which deletes tags based at current position of the caret, no matter where is the text cursor:
Here is an example HTML file.
Here is a macro which I have so far. It works only on the opening tag. If the caret is at opening tag, then the two tags are deleted together.
- at the beginning of an opening tag;
- inside an opening tag;
- between opening and closing tag;
- at the beginning of a closing tag;
- inside a closing tag.
Here is an example HTML file.
Code: Select all
<html>
<head>
<title>EXAMPLE</title>
</head>
<body>
<p class="indent">EXAMPLE FILE</p>
<p>===Unnecessary tags==</p>
<p>These are useless tags. Opening and closing tags should be deleted together.</p>
<p><b>Aaa</b>
should be just
Aaa</p>
<p><i>Bbb</i>
should be just
Bbb</p>
<p><u>Ccc</u>
should be just
Ccc</p>
<p class="indent">Example <a id="rref6" href="#ref6">6</a>
should be just
Example 6</p>
</body>
</html>
Code: Select all
InsertMode
ColumnModeOff
HexOff
PerlReOn
Find RegExp Up "(?<=<)\w+"
Copy
UltraEditReOn
Find RegExp "</^c>"
Key DEL
UltraEditReOn
Find RegExp Up "<^c*>"
Key DEL