Indent span tag

Answered

I can't find a way to indent the span tags in a HTML document. All other tags are indented correctly except span.
For example, after reformat i get this portion of the HTML:

<table height="100%" width="100%">
  <tr>
    <td height="100%" width="100%">
      <div >
<span jwcid="$content$">
<span jwcid="@shell/PortalShell">
<div >
  <span >Desenvolvimento</span>
</div>

How can i make IntelliJ indent this code correctly ?

8 comments
Comment actions Permalink

I tried some code style settings on this. If you remove the 'span' from the list of 'keep white space inside' then it will correctly format upon CtrlAltL. (I guess you have to make sure that this is what you want)

If it is only about indenting, then in my trials the CtrlAltI worked correctly (even without the change in the settings).

3
Comment actions Permalink

Seems to be http://www.jetbrains.net/jira/browse/IDEADEV-17269

Hugo Palma wrote:

I can't find a way to indent the span tags in a HTML document. All other tags are indented correctly except span.
For example, after reformat i get this portion of the HTML:

<table height="100%" width="100%">
  <tr>
    <td height="100%" width="100%">
      <div >
<span jwcid="$content$">
<span jwcid="@shell/PortalShell">
<div >
  <span >Desenvolvimento</span>
</div>

How can i make IntelliJ indent this code correctly ?



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

0
Comment actions Permalink

For me "it is only about indenting", but Ruben's CtrlAltI doesn't work.

The link above doesn't work. I still have this problem.

0
Comment actions Permalink

we have Jetbrains 2018.3 and this bug is still active today... <span> tags are taken into account when ctrl-alt-L'ing an html file...

I remember this bug when I was still using IDEA 12 back in 2012... and since then I have to manually indent my <span> tags manually...

0
Comment actions Permalink

Did you try this setting?

3
Comment actions Permalink

That setting doesn't help. Here's an example:

Before using "Code"> "Reformat Code":

 

After using "Code"> "Reformat Code":

Settings:

0
Comment actions Permalink

The comment above suggests that you need to remove span from the Keep white space inside.

0
Comment actions Permalink

Oh! That's what I had originally. But you are correct -- I just removed it and it now behaves the way I want.

Thank you!

0

Please sign in to leave a comment.