问题
I apologize if this has been asked before, but I don't believe it's been clearly asked, causing a lot of confusion on stackoverflow....I'm using Notepad v6.6.9 and I am looking for way to automaticlaly change my closing element tags when I want to "later" change my opening element tags. For example if I have an XHTML page with the following content....
<p>hello world</p>
...and I save this page, and re-open it, and then click to change <p> to <h3>, I want notepad++ to automatically change my closing </p> element to </h3>
Another way to put it:
"As I am typing and changing the currently selected opening tag, I want the closing tag to automatically change during the same time."
Is this possible in Notepad++? If so, how?
Thanks
回答1:
I'm not sure I fully understood your question but I'll try to answer it.
you can replace all your inside tags with notepad++ using this way:
- click on CTRL+F to open the find pop up.
- navigate to replace tab
- for your example, Replace only the P inside the tags to make it h3.
- Click Replace All.

This will replace all the P into h3 and keep your starting / ending tags unharmed.
Hope that was helpful.
EDIT: Based on my comment, below is my trick:
- go to settings menu
- click on preferences
- select Auto-completion
- check the html/ xml close tags


As I said, this will auto close the tags but I did not test it for auto changing closed tags.
来源:https://stackoverflow.com/questions/26413686/how-to-change-xhtml-closing-tags-automatically-in-notepad
