Skip to content

Whitespace stripped from HTML attributes sometimes... #2

@sean-

Description

@sean-

I haven't figured out exactly what the problem is, but I do have a reproducible test.

# in test_views/views.py
@test_views.route('/test_views/html_compress_bug1')
def html_compres_bug1():
    return render_template('test_views/html_compress_bug1.html', broken='other')
<!-- Stored in test_views/html_compress_bug1.html -->
<html>
  <head>
    <title>Test</title>
    <style type="text/css">
.alert-messageother {
background-color: #ff0000;
}
.other {
background-color: #00ff00;
}
</style>
  </head>
  <body>
    <div class="alert-message{{' '}}{{broken}}">
      <p>Forced a space, this works</p>
    </div>
    <div class="alert-message {{broken}}">
      <p>Space nuked</p>
    </div>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions