Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@long-description for CSS files #39

Open
aminomancer opened this issue Aug 27, 2023 · 3 comments
Open

@long-description for CSS files #39

aminomancer opened this issue Aug 27, 2023 · 3 comments

Comments

@aminomancer
Copy link
Contributor

I think because the whole metadata block needs to be wrapped in a block comment for CSS, the @long-description tag won't work since it requires a block comment of its own. So the end comment token for the inner description block ends the outer comment, and everything after it gets parsed as CSS.

/* ==UserScript==
// @long-description
// @description
/*
long description here
*/
// ==/UserScript==
*/

Not sure what a good solution would be though. Maybe match for some other start/end token for long descriptions when it's a CSS file?

/* ==UserScript==
// @long-description
// @description
<!--
long description here
-->
// ==/UserScript==
*/
@MrOtherGuy
Copy link
Owner

For now it should be enough to just open another block comment immediately after ending @long-description - but yeah it's a bit unfortunate that the style header needs to be different in the first place.

@aminomancer
Copy link
Contributor Author

Ah I see what you mean. For some reason I thought the regex was looking for these block comment tokens, but I see now it's just the JS line comment tokens. So this only really matters for linting I suppose, but your solution works for that.

This way seems decent as far as aesthetics go:

/* ==UserScript==
// @long-description
// @description
*//*
long description here
*//* 
// ==/UserScript==
*/

@MrOtherGuy
Copy link
Owner

Right, unfortunately I don't think we can really do much about this since the script header is semi-standard across all loader - except we extend it a bit. So even if we came up with some better header format it would then mean that scripts written for other loaders would not work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants