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

6 comments
Comment actions Permalink

Hi,

This is not currectly possible, please, file JIRA request

Erik Pragt wrote:

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?



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

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:

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?



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Well, consider the following example:

I have this piece of HTML:
&lt;ul>
&lt;li>hello!&lt;/li>
&lt;li>hello!&lt;/li>
&lt;/ul>

And I want to transform this into:
&lt;ul>
&lt;li>&lt;span>hello!&lt;/span>&lt;/li>
&lt;li>&lt;span>hello!&lt;/span>&lt;/li>
&lt;/ul>

I do this by typing &lt;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

0
Comment actions Permalink

Hello Erik,

Well, consider the following example:

I have this piece of HTML:
&lt;ul>
&lt;li>hello!&lt;/li>
&lt;li>hello!&lt;/li>
&lt;/ul>
And I want to transform this into:
&lt;ul>
&lt;li>&lt;span>hello!&lt;/span>&lt;/li>
&lt;li>&lt;span>hello!&lt;/span>&lt;/li>
&lt;/ul>
I do this by typing &lt;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


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.


0
Comment actions Permalink

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

0
Comment actions Permalink

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

0

Please sign in to leave a comment.