How to change XHTML closing tags automatically in Notepad++

纵饮孤独 提交于 2020-06-27 19:02:08

问题


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:

  1. click on CTRL+F to open the find pop up.
  2. navigate to replace tab
  3. for your example, Replace only the P inside the tags to make it h3.
  4. Click Replace All.

enter image description here

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:

  1. go to settings menu
  2. click on preferences
  3. select Auto-completion
  4. check the html/ xml close tags enter image description here

enter image description here

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!