question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular parser should not treat table data cells like block elements.

See original GitHub issue

Prettier 1.15.2 Playground link

--parser angular

Input:

<table>
  <tr>
    <td class="somethingReallyReallyLong" data-test="somethingElse">{{ someValue }}</td>
  </tr>
</table>

Output:

<table>
  <tr>
    <td class="somethingReallyReallyLong" data-test="somethingElse">
      {{ someValue }}
    </td>
  </tr>
</table>

Expected behavior: Something more like this :

<table>
  <tr>
    <td class="somethingReallyReallyLong" data-test="somethingElse">{{ 
      someValue
    }}</td>
  </tr>
</table>

The td tag should be treated the same way as span tags because white space is sensitive within a td.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
ikatyangcommented, Nov 13, 2018

I tried it on Chrome and it seems the whitespaces are insensitive there, could you share more info? or did you change their display?

image

<table>
  <tr>
    <td class="somethingReallyReallyLong" data-test="somethingElse">111</td>
    <td class="somethingReallyReallyLong" data-test="somethingElse">222</td>
  </tr>
</table>
<table>
  <tr>
    <td class="somethingReallyReallyLong" data-test="somethingElse">
      333
    </td>
    <td class="somethingReallyReallyLong" data-test="somethingElse">
      444
    </td>
  </tr>
</table>
2reactions
thorn0commented, Nov 13, 2018

Seems to be a duplicate of #5463: inserting white spaces around an interpolation breaks tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular formatter line breaks in double-curly braces cause ...
Angular formatter line breaks in double-curly braces cause ... Angular parser should not treat table data cells like block elements. #5452.
Read more >
How whitespace is handled by HTML, CSS, and in the DOM
This is so that whitespace characters don't impact the layout of your page. Creating space around and inside elements is the job of...
Read more >
How to remove unwanted space between rows and columns ...
I've tried changing the margin, padding, and various border properties on the table and tr and td. I want the pictures to all...
Read more >
CSS Syntax Module Level 3 - W3C
This module defines the abstract syntax and parsing of CSS stylesheets and other things which use CSS syntax (such as the HTML style ......
Read more >
&nbsp and HTML Space Challenges and Tricks | Mailtrap Blog
You've got to admit, the code above is not very readable. At the same time, creating multiple spaces with the use of &nbsp...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found