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

Comments inside Twig files are always using HTML syntax #456

Open
lukepass opened this issue Apr 19, 2024 · 0 comments
Open

Comments inside Twig files are always using HTML syntax #456

lukepass opened this issue Apr 19, 2024 · 0 comments

Comments

@lukepass
Copy link

Hello, I noticed than when inside a twig file:

<!DOCTYPE html>
<html lang="it">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link rel="icon" href="{{ asset("logo.ico") }}" type="image/x-icon">
        {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
        {% block stylesheets %}{{ encore_entry_link_tags("app") }}{% endblock %}

        {% block javascripts %}{{ encore_entry_script_tags("app") }}{% endblock %}
    </head>
    <body class="{% block body_class %}bg-yellow-400{% endblock %}">
        {% block header %}
            {{ include("shared/_header.html.twig") }}
        {% endblock %}

        {% block body %}{% endblock %}

        {% block footer %}
            {{ include("shared/_footer.html.twig") }}
        {% endblock %}
    </body>
</html>

Commenting is always using HTML <!-- -->, but I would like it to use {# #} syntax, how can I do it?

I tried to setup like this but it didn't work either:

{ -- "gc" to comment visual regions/lines
    'numToStr/Comment.nvim',
    config = function()
      require('Comment').setup {}

      local ft = require 'Comment.ft'

      -- Set only line comment or both
      ft.set('twig', '{#%s#}').set('html.twig', '{#%s#}').set('twig.html', '{#%s#}')
    end,
  },

Thanks.

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

1 participant