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.

(JSX) period after anchor tag is moved to newline before break

See original GitHub issue

Prettier 1.14.2 Playground link

--parser babylon

Input:

const comp = () => (
  <p>
    <a href="https://example.com" style={{ color: "inherit", fontWeight: 600 }}>
      link
    </a>.
    <br />
  </p>
);

Output:

const comp = () => (
  <p>
    <a href="https://example.com" style={{ color: "inherit", fontWeight: 600 }}>
      link
    </a>
    .<br />
  </p>
);

Expected behavior: For the output to match the input. (. after </a>, not before <br />)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
SimenBcommented, Sep 6, 2018

@duailibe I bisected, it’s from #4717, cc @karl

0reactions
karlcommented, Sep 10, 2018

Ah that could work!

I won’t have time to work on this for a few days, so if anyone else want to pick this up please go ahead. Otherwise I’ll look at picking it up when I can.

On Mon, Sep 10, 2018 at 12:26 PM Simen Bekkhus notifications@github.com wrote:

Maybe special-case a standalone period? It’s (always?) a trailing character and not a leading one

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/prettier/prettier/issues/5047#issuecomment-419880642, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAOYWvDSgUNJ7eMTANwTu73TV7EoBpJks5uZkx2gaJpZM4WXoF5 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

forced line break after span coming from react, next or ...
A possible solution would be replacing it with display: inline instead. .phone-msg { display: inline; white-space: nowrap; }.
Read more >
How to avoid a new line with tag? - GeeksforGeeks
By default, the browser applies a line break before and after the p tag to separate the paragraphs. We can achieve this by...
Read more >
When a Line Doesn't Break - CSS-Tricks
We expect a line to break when the text on that line reaches the parent box boundaries. We see this every time we...
Read more >
word-break - CSS: Cascading Style Sheets - MDN Web Docs
The word-break property is specified as a single keyword chosen from the list of values below. Values. normal. Use the default line break...
Read more >
How to add a forced line break inside a table cell - TeX
\begin{tabular}{|p{2cm}|p{2cm}|} \hline Test & foo \newline bar \\ ... Edit: Use the following commands instead of p if you want to specify the...
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