hexojs / hexo-renderer-stylus

Stylus renderer for Hexo
MIT License
18 stars 19 forks source link

Cannot ignore single-line comments correctly #60

Open LucunJi opened 3 years ago

LucunJi commented 3 years ago

Environment

Gemini scheme in NexT theme is used.

Description

I was editing sources/_data/mixins.styl to prettify my site. The original values were copied from the source as a reference.

When I use single line comments, the page glitches. The white background of posts and sidebar disappears, but the exact glitch behavior may change depends on what is commented in which file. The comments do not appear in main.css after hexo clean && hexo build

//original values:
// desktop() {
//  @media (min-width: 992px) {
//    {block};
//  }
//}

But when I use block comments, the page is rendered correctly. After clean and build, the comments appear in the beginning of main.css.

/*original values:
 desktop() {
  @media (min-width: 992px) {
    {block};
  }
}
 */

I looked into documents of stylus and it says line comments is allowed, thus I think the renderer went into error.