Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tpl: Incorrect indentation for multiple <th> elements. #81

Open
jdufresne opened this issue Apr 4, 2014 · 3 comments
Open

Tpl: Incorrect indentation for multiple <th> elements. #81

jdufresne opened this issue Apr 4, 2014 · 3 comments

Comments

@jdufresne
Copy link
Contributor

When indenting the entire buffer at once, the following template does not indent correctly. It indents as seen below:

<table>
  <thead>
    <tr>
      {% for header in headers %}
        <th>{{ header.attr1 }}</th>
      <th>{{ header.attr2 }}</th>
    {% endfor %}
    </tr>
  </thead>
</table>

I would expect it to indent as follows:

<table>
  <thead>
    <tr>
      {% for header in headers %}
        <th>{{ header.attr1 }}</th>
        <th>{{ header.attr2 }}</th>
      {% endfor %}
    </tr>
  </thead>
</table>

Steps to reproduce:

  1. Open a new buffer
  2. Turn on pony-tpl-mode
  3. Enter text above
  4. Enter commands to indent entire buffer: C-x h <tab>
@jdufresne
Copy link
Contributor Author

I've looked through the code.

This may be a indent bug in smgl-mode.el. If you open up the "bad" indented file in html-mode (from sgml-mode.el) and try to indent line 6, the indentation will be the same. As this is just a series of HTML tags, pony-tpl-mode delegates to the html-mode.

@jdufresne
Copy link
Contributor Author

@davidmiller
Copy link
Owner

Nice work :)

I've not dug into how sgml-mode does it's indentation in quite some time -
will take a look when I get the chance though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants