hexojs/hexo-renderer-stylus

Cannot ignore single-line comments correctly

LucunJi opened this issue · 0 comments

Environment

  • Ubuntu Linux focal
  • hexo-renderer-stylus@2.0.1
  • hexo@5.4.0
  • hexo-theme-next@8.3.0

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.