Stylus: Bug: when code is editing, `@preprocessor stylus` misinterprets 'url-prefix'

Created on 22 Oct 2020  路  13Comments  路  Source: openstyles/stylus

Bug just in @preprocessor stylus && url-prefix see at https://github.com/openstyles/stylus/issues/1073#issuecomment-714409630
when code is editing, Applies-to-widget will changed to Everything .

/* ==UserStyle==
@name           Bug demo
@version        1.0.0
@namespace      123
@preprocessor   stylus
==/UserStyle== */
@-moz-document url-prefix("http://bug.bug/"), domain("bug.bug") {

.test{font-size:22px} 

}


Chrome-DevTools Console log

2010_22180131

DevTools failed to load SourceMap: Could not load content for chrome-extension://clngdbkpkpeebahjckkjfobafhncgmne/vendor/usercss-meta/usercss-meta.min.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME


gif demo

The latest Commit version of Stylus repository.
CentBrowser 4.3.8.130 (Official Build) (64-bit) (Portable) (Chromium 85.0.4183.121 and tested on Chrome84)

Bug

done at: https://github.com/openstyles/stylus/issues/1073#issuecomment-714477472

bug external

Most helpful comment

We'll wait a bit for the next release of CodeMirror that includes the fix because our local workaround would be ugly.

All 13 comments

I can't reproduce the bug. Remove your gif and instead post the actual code.

instead post the actual code.

Thank you, I updated this issue. you reminded me that I have posted the prompt code information of \ Because I don't understand javascript, I rarely deal with \

I didn't ask to post the console log so remove it either.

Post the code of the userstyle. The CSS code. The contents of your style. So that I don't have to type it by hand.

Post the code of the userstyle. The CSS code. The contents of your style. So that I don't have to type it by hand.

Oh, so it is, but it has nothing to do with the code. I tested it, any UserCSS, and the preprocessor is @preprocessor stylus, I can reproduce this bug here, so If it is related to the code, I will post the code from the beginning.

The following is a random demo code/applied URL (as long as one requirement is @preprocessor stylus)

/* ==UserStyle==
@name           Bug demo
@version        1.0.0
@namespace      123
@preprocessor   stylus
==/UserStyle== */
@-moz-document url-prefix("http://bug.bug/"), domain("bug.bug") {

.test{font-size:22px} 

}

Thanks. Next time just post the CSS right away.

OK. Thanks !
Tips: when the code is not edited (i.e. body#stylus-edit), it is no problem. But when code is edited (i.e. body#stylus-edit.dirty) , will trigger this bug...

It's a bug in stylus-lang preprocessor: it misinterprets url-prefix for url. I'll write a workaround.

It's a bug in stylus-lang preprocessor: it misinterprets url-prefix for url. I'll write a workaround.

Thanks! I tested it again, and found that as you said, this bug only appear in the url-prefix, and the other three applies-to (URL or domain or RegExp) are no problems.

It just so happens that I don't understand other preprocessor, I only know a little stylus-lang preprocessor, so discovered this bug.

We'll wait a bit for the next release of CodeMirror that includes the fix because our local workaround would be ugly.

We'll wait a bit for the next release of CodeMirror that includes the fix

Well, Great!!, it doesn't matter. thank you very much!
I want to ask you, for now, this bug will not really affect the code editing of stylus-lang preprocessor (including url-prefix code)?
In other words, except the applies-to-widget cannot be used directly, everything else is not affected. right?

Right. Meanwhile I suggest disabling the widget so it doesn't confuse you.

OK! I see now. Thanks!

Fixed in 3a615e4e.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HoLLy-HaCKeR picture HoLLy-HaCKeR  路  74Comments

catcat520 picture catcat520  路  26Comments

eight04 picture eight04  路  30Comments

narcolepticinsomniac picture narcolepticinsomniac  路  27Comments

darkred picture darkred  路  58Comments