vitaly-t / decomment

:hammer: Removes comments from JSON, JavaScript, CSS, HTML, etc.
75 stars 21 forks source link

decomment had an error handling pure css code #25

Closed ctrlkk closed 9 months ago

ctrlkk commented 9 months ago

I love you, but decomment has problems handling pure css code, i.e., css code that is not wrapped in the style tag.

For example:

const decomment = require('decomment');
decomment(`
.page {
    width: 100%;
    min-height: 100vh;
    background-color: $uni-bg-color-grey;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}
`);
vitaly-t commented 9 months ago

The main page explains it, you need to use decomment.text method for CSS, to process it as plain text.

vitaly-t commented 9 months ago

Closing, due to non-response (I don't feel love at all).