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

fix(html): correct column for error code frame #5553

Merged
merged 1 commit into from Nov 27, 2018

Conversation

@ikatyang
Copy link
Member

commented Nov 26, 2018

Found in #5552

  • before
    [error] test.html: SyntaxError: Unexpected character "/" (1:26)
    [error] > 1 | <div>footer content here<//>
    [error]     |                          ^
  • after
    [error] test.html: SyntaxError: Unexpected character "/" (1:27)
    [error] > 1 | <div>footer content here<//>
    [error]     |                           ^

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • I’ve read the contributing guidelines.

Try the playground for this PR

@ikatyang ikatyang added this to the 1.15.3 milestone Nov 26, 2018

@lydell

This comment has been minimized.

Copy link
Collaborator

commented Nov 26, 2018

More cases: – all fixed by this PR!

Prettier 1.15.2
Playground link

--parser html

Input:

<link></link>

Output:

SyntaxError: Void elements do not have end tags "link" (1:6)
> 1 | <link></link>
    |      ^

Prettier 1.15.2
Playground link

--parser html

Input:

  <p>
    <p>
    </p>
  </p>

Output:

SyntaxError: Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (4:2)
  2 |     <p>
  3 |     </p>
> 4 |   </p>
    |  ^
  5 | 

Prettier 1.15.2
Playground link

--parser html

Input:

<p>
  <p>
  </p>
</p>

Output:

SyntaxError: Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (4:0)
  2 |   <p>
  3 |   </p>
> 4 | </p>
  5 | 
@lydell
lydell approved these changes Nov 26, 2018

@ikatyang ikatyang merged commit 4dd7c79 into prettier:master Nov 27, 2018

8 of 10 checks passed

Header rules No header rules processed
Details
Pages changed 2 new files uploaded
Details
Mixed content No mixed content detected
Details
Redirect rules 3 redirect rules processed
Details
codecov/patch 100% of diff hit (target 80%)
Details
codecov/project 97.07% (+0%) compared to 4af3dd4
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
prettier.prettier Build #20181126.2 succeeded
Details
prod Workflow: prod
Details

@ikatyang ikatyang deleted the ikatyang:fix/html/error-code-frame-column branch Nov 27, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Feb 25, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.