How to turn off autoinsert of matching XML/HTML elements?
Hi all,
I have a small question: when I'm typing HTML, and I type the name of an HTML element (e.g. <ul>), the closing element </ul> is inserted automatically. This is kinda annoying when you're just refactoring some HTML page, since usually I don't want that </ul> after my opening <ul>, and my current workflow is: type element name, removing closing element, type next element name, remove closing element, etc.
So, my question is: how to turn it off?
Edited by: Erik Pragt on May 29, 2008 9:30 AM
Please sign in to leave a comment.
Hi,
This is not currectly possible, please, file JIRA request
Erik Pragt wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Btw, we have logic to identify if end tag is really necessary and it
seems not working in your case, it would be nice if you can provide
reproducible html snippet as well.
Erik Pragt wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Well, consider the following example:
I have this piece of HTML:
<ul>
<li>hello!</li>
<li>hello!</li>
</ul>
And I want to transform this into:
<ul>
<li><span>hello!</span></li>
<li><span>hello!</span></li>
</ul>
I do this by typing <span> before the first hello, but IntelliJ automatically puts a new closing element there. So I have to remove (cut/paste, whatever) it, and readd it after the hello word. I know how to type HTML, so I'd rather turn this off. This is just a very simple case, but every element I insert, is automatically followed up by a closing element, and when editing existing documents, I find this quite annoying.
I've created an issue for it here: http://www.jetbrains.net/jira/browse/IDEA-18250
Hello Erik,
Maybe it can help... With the provided example it's possible to use "Surround
with tag" live template. Select "hello!" fragment, CtrlAltJ, select "tag"
and type "span", enter.
Alexander.
Hi Alexander,
Thanks for the reply. The example is just an example, and shouldn't be taken to literally. It was just meant to illustrate the problem. Besides, it's not possible to do the thing you proposed: I'm using GSP's, and there are currently not templates defined.
Erik
This has been bothering me too in the past. I ended up typing an opening angular bracket, immediately followed by a closing one, then move the cursor one step to the left into the bracket pair and type the name of the element (and then move out again). Silly, but easy to get used to.
Regards,
Jens