Prettier adds extra closing bracket when a pre tag contains elements with angular template reference variables
See original GitHub issuePrettier 1.15.2 Playground link
--parser angular
Input:
<pre><code #foo></code></pre>
Output:
<pre><code #foo></code>></pre>
Expected behavior:
Prettier should not add an extra closing angle bracket after </code>
EDIT: changed example to use <code>
instead of <p>
. This is how I originally found the bug, not sure why I thought it would be better to replace <code>
with <p>
…
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Options - Prettier
Bracket Line. Put the > of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of...
Read more >Unexpected character "EOF" (Do you have an unescaped ...
I am upgrading my angular 2 app from beta 9 to RC5 and i get this error in my form template.
Read more >next js blog starter github - UT Physicians Group
I have made the blog available as a starter template so feel free to fork and modify ... slash / then the element...
Read more >WebStorm 182.2371.25 Release Notes | Knowledge Base
Bug, WEB-32412, template stringx jsx closing bracket expected ... Bug, WEB-31883, "Copy Reference" for JSON items does not include arrays indices.
Read more >Prism
Dead simple Include prism.css and prism.js, use proper HTML5 code tags ( code.language-xxxx ), done ... Languages add 0.3-0.5KB each, themes are around...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We use snapshot testing to verify the result, see CONTRIBUTING.md for more info.
In short, you could create a temporary test file just like what @mister-walter said, and run
bin/prettier.js foo.html
to see if it works. If it works, put it in thetests
folder and runAST_COMPARE=1 yarn test -u
, it should be good to send the PR if everything worked as expected.As a workaround you can span the
code
block to a new line.