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

HTML: Preserve YAML front matter block #4752

Closed
MarcelWoerner opened this issue Jun 26, 2018 · 3 comments
Closed

HTML: Preserve YAML front matter block #4752

MarcelWoerner opened this issue Jun 26, 2018 · 3 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@MarcelWoerner
Copy link

Prettier is smart enough to preserve YAML front matter blocks in Markdown files, but currently strips them from HTML files, which breaks HTML sites.

The same logic that allows Prettier to ignore YAML headers in Markdown files should be applied to HTML.

Prettier pr-4392
Playground link

Input:

---
testvar: my var
anothervar: my other var
---
  
 <section>
    <div class="grid-container">
        <div class="grid-x grid-margin-x align-center">
            <div class="cell shrink text-center">
                <h5>Headline</h5>
            </div>
        </div>
    </div>
</section>

Output:

SyntaxError: Invalid left-hand side in prefix operation (1:3)
> 1 | ---
    |   ^
  2 | testvar: my var
  3 | anothervar: my other var
  4 | ---

Expected behavior:

@alexander-akait
Copy link
Member

@MarcelWoerner we don't support HTML right now #1882

@phifa
Copy link

phifa commented Jun 26, 2018

@evilebottnawi i was just running into the same issue. is #1882 the official issue? any plans to make this work? thanks!

@lydell
Copy link
Member

lydell commented Jun 26, 2018

That's the official issue.

@lydell lydell closed this as completed Jun 26, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Sep 24, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

4 participants