#9 Indentation: Pretty-print attributes on multiple lines

open
nobody
None
2
2003-09-09
2003-09-09
No

Low priority:

It would be reallynice to pretty-print attributes of tags
which take up multiple lines and have this work with tabs
or spaces. Basically, attributes on new lines should line
up with the first attribute after the tag name. I hope
this comes out, but since the default font is not
monospaced, I'm going to try entering html onto this
page. Let's see if it's legible...

This means to indent as follows (using periods for
spaces):

<code>
<some-tag attr1="val1"
..........attr2="val2"
..........attr3="val3" />
</code>

(using "tab" to represent tabs):
<code>
tab<some-tag attr1="val1"
tab..........attr2="val2"
tab..........attr3="val3" />
</code>

Discussion

  • Glen Peterson

    Glen Peterson - 2003-09-09

    Logged In: YES
    user_id=750563

    That went well. Let's try the examples again, shal we?

    If you don't count the number of periods, but consider them
    to be spaces, it would look like this:
    ...<some-tag attr1="val1"
    ..................attr2="val2"
    ..................attr3="val3" />

    Using "tab" to represent tabs and periods loosely to represent
    spaces (as above):

    tab<some-tag attr1="val1"
    tab...............attr2="val2"
    tab...............attr3="val3" />

     
  • Glen Peterson

    Glen Peterson - 2003-09-09

    Logged In: YES
    user_id=750563

    Great. The original post is in a variable width font, but replies
    are fixed. Third time's the charm:

    Using periods to represent spaces, it would look like this:
    ...<some-tag attr1="val1"
    .............attr2="val2"
    .............attr3="val3" />

    Using "tab" to represent tabs and periods to represent spaces
    (as above):

    tab<some-tag attr1="val1"
    tab..........attr2="val2"
    tab..........attr3="val3" />

     
  • Glen Peterson

    Glen Peterson - 2003-09-09
    • priority: 5 --> 2
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks