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

Jekyll document autoformat problem. #8

Closed
Serhioromano opened this issue Apr 10, 2017 · 9 comments
Closed

Jekyll document autoformat problem. #8

Serhioromano opened this issue Apr 10, 2017 · 9 comments
Assignees

Comments

@Serhioromano
Copy link

Please look here microsoft/vscode#24088

Is this an issue for this plugin?

@edheltzel
Copy link
Owner

edheltzel commented Apr 10, 2017

@Serhioromano I can confirm the formatting issues with "editor.formatOnSave": true for HTML files with Front-Matter. But, if I change the grammar of the file from plain HTML to Liquid HTML The formatting issues go away.

@Serhioromano
Copy link
Author

Serhioromano commented Apr 14, 2017

Yes the problem goes away but formatting also goes away. It no longer format this document. So I have to manually format it with is inconvenient.

May be you have to add formatting options for Liquid HTML documents.

@edheltzel
Copy link
Owner

@Serhioromano I'll have to dig into the docs of VS Code a little more to see how to get HTML formatting for the Liquid Languages Support - But that might need to be referenced in the repo.

@Serhioromano
Copy link
Author

Serhioromano commented Apr 20, 2017

I added new comment in VS Code topic because I think it should be general formatting issue.

Also there is a thread in Beautifier repository
beautifier/js-beautify#510

@jel111
Copy link

jel111 commented May 21, 2017

Is there some problem with Handlebars being the same syntax? I forgot the term for changing that so the syntax is different. Do you know what that is called? Thanks!

@edheltzel
Copy link
Owner

edheltzel commented May 21, 2017

@jel111 I believe it is really more of a front-matter issue vs the curly brackets
check out this: microsoft/vscode#24088 (comment)

As for the term, I think you might be saying grammar? (VSCode calls it “Language Mode”)

@edheltzel
Copy link
Owner

edheltzel commented May 21, 2017

@Serhioromano as I mentioned in microsoft/vscode#24088 (comment)


For anyone else having formatting issues:

consider installing VSCode prettydiff extension to format your liquid tags

@jel111
Copy link

jel111 commented May 21, 2017

Thanks.

@edheltzel edheltzel assigned edheltzel and unassigned edheltzel Jun 23, 2017
@michellecarrasco
Copy link

Thanks for the tip @ginfuru
However, this is not working for frontmatter tags.
You can try this example:

--- 
layout: default 
---

<div class="row">
    <div class="large-2 column">
        <ul class="menu vertical">
            {% assign sorted = site.docs | sort:"order" %} {% for post in sorted %}
            <li class="{% if page.url == post.url %}active{% endif %}"><a href={{ post.url }}>{{ post.menu }}</a></li>
            {% endfor %}
        </ul>
    </div>
    <div class="large-10 column">
        <header class="post-header">
            <h1 class="post-title">{{ page.title | escape }}</h1>
        </header>
        {{ content }}
    </div>
</div>

on the prettydiff demo site: http://prettydiff.com/
Note: You have to try with the beautify function that you can select with the top radio button.

Here is the (non-working with Jekyll 3.7.3) result:

--- layout: default ---

<div class="row">
...
</div>

Note: I also tried with the vscode plugin and I got the same result.
Note 2: The demo site doesn't seems to use the last build but it was built after the GH issues were fixed: https://github.com/prettydiff/prettydiff/issues?utf8=%E2%9C%93&q=liquid%20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants