Skip to content

Commenting out the first line of CSS inside of an html file is broken #164

@s4my

Description

@s4my

Hi @numToStr, in the process of trying to comment out a block of css inside of an html file (inside of <style> tag), the html comment string is used <!-- %s --> instead of the css comment string /* %s */. this bug happens for both linewise and blockwise comments.

<!DOCTYPE html>
<html>
    <head>
        <title>Comment.nvim bug</title>
        <style>
            <!-- body { -->
                background: #f7f7f8;
                font-family: Inter,Roobert,Helvetica Neue,Helvetica,Arial,sans-serif;
            }
        </style>
    </head>
    <body>
</html>

if you start your selection from the second line after the <style> tag the plugin works perfectly.

<!DOCTYPE html>
<html>
    <head>
        <title>Comment.nvim bug</title>
        <style>
            body {
            /*     background: #f7f7f8; */
            /*     font-family: Inter,Roobert,Helvetica Neue,Helvetica,Arial,sans-serif; */
            /* } */
        </style>
    </head>
    <body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions