Skip to content

Compression breaks CSS when valid '//' are used #683

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

Closed
theolmue opened this issue May 8, 2014 · 7 comments
Closed

Compression breaks CSS when valid '//' are used #683

theolmue opened this issue May 8, 2014 · 7 comments
Assignees
Labels

Comments

@theolmue
Copy link

theolmue commented May 8, 2014

I did some changes in layout by using lib/tpl/vector/user/screen.css in Binky. This worked well. Today I upgraded to Ponder Stibbons. After that the configurations in lib/tpl/vector/user/screen.css are ignored. I checked, that the file is in place and unchanged. Any idea, whats wrong?

My screen.css:

/* en: Place for user defined CSS rules (screen media) - this file can safely be
   preserved when updating. See README for details.

   de: Ort für benutzerdefinierte CSS-Regeln (screen media) - Diese Datei kann
   beim Durchführen von Updates ohne Risiko beibehalten werden. Konsultieren Sie
   die README für Detailinformationen. */



/* Sidebar breiter machen (15em statt 10em) */
div#content,
#head-base,
div#footer,
div#panel,
#p-logo,
#p-logo a,
#left-navigation {
    margin-left: 15em !important;
}
@splitbrain
Copy link
Collaborator

Hmm. That location is not a standard location for user customization in DokuWiki. It might be handled by the template itself but I don't know how that would be affected by an upgrade.
@selfthinker any ideas?

@Klap-in
Copy link
Collaborator

Klap-in commented May 8, 2014

This is a feature of the vector template.
Please create a bug at https://github.com/arsava/dokuwiki-template-vector

(note: maybe it is cause by this change in the vector template: arsava/dokuwiki-template-vector@fede5d7 )

@Klap-in Klap-in closed this as completed May 8, 2014
@Klap-in
Copy link
Collaborator

Klap-in commented May 8, 2014

In my test wiki, i cannot reproduce it so far.

Did you expire the dokuwiki caches and cleaned the browser cache after the update?
That is:

  • Go to Config Manager and use the Save button to resave the config. This expires the caches.
  • Nextly, reload the wiki in the browser with Ctrl+F5. This cleans the cache of the browser.

@Klap-in
Copy link
Collaborator

Klap-in commented May 8, 2014

Vector includes currently the style files by https://github.com/arsava/dokuwiki-template-vector/blob/master/style.ini
So at the first sight there are no custom mechanisms that i would suspect to give troubles.

So when you are still affected after refreshing the cache, please report it the bug tracker of the Vector template.

@Klap-in
Copy link
Collaborator

Klap-in commented May 12, 2014

This issue seems caused by the url-rewriter in the DokuWiki's css-compressor.

A faulty snippet is from static/3rd/vector/main-ltr.css#L999 of the vector template:

div#content a.external,
div#content a[href ^="gopher://"] {
    background: url(static/3rd/vector/external-link-ltr-icon.png) center right no-repeat;
    padding: 0 13px 0 0;
}
div#content a[href ^="https://"],
.link-https {
    background: url(static/3rd/vector/lock-icon.png) center right no-repeat;
    padding: 0 13px 0 0;
}
div#content a[href ^="mailto:"],
.link-mailto {
    background: url(static/3rd/vector/mail-icon.png) center right no-repeat;
    padding: 0 13px 0 0;
}
div#content a[href ^="news://"] {
    background: url(static/3rd/vector/news-icon.png) center right no-repeat;
    padding: 0 13px 0 0;
}
div#content a[href ^="ftp://"],
.link-ftp {
    background: url(static/3rd/vector/file-icon.png) center right no-repeat;
    padding: 0 13px 0 0;
}
div#content a[href ^="irc://"],
div#content a.extiw[href ^="irc://"],
.link-irc {
    background: url(static/3rd/vector/talk-icon.png) center right no-repeat;
    padding: 0 13px 0 0;
}

This is compressed to:

div#content a.external,div#content a[href ^="gopher:background:url(https://github.com/wiki/lib/tpl/vector/static/3rd/vector/external-link-ltr-icon.png) center right no-repeat;padding:0 13px 0 0;}div#content a[href ^="https:.link-https{background:url(/wiki/lib/tpl/vector/static/3rd/vector/lock-icon.png) center right no-repeat;padding:0 13px 0 0;}div#content a[href ^="mailto:"],.link-mailto{background:url(/wiki/lib/tpl/vector/static/3rd/vector/mail-icon.png) center right no-repeat;padding:0 13px 0 0;}div#content a[href ^="news:background:url(https://github.com/wiki/lib/tpl/vector/static/3rd/vector/news-icon.png) center right no-repeat;padding:0 13px 0 0;}div#content a[href ^="ftp:.link-ftp{background:url(/wiki/lib/tpl/vector/static/3rd/vector/file-icon.png) center right no-repeat;padding:0 13px 0 0;}div#content a[href ^="irc:div#content a.extiw[href ^="irc:.link-irc{background:url(/wiki/lib/tpl/vector/static/3rd/vector/talk-icon.png) center right no-repeat;padding:0 13px 0 0;}

The original css was valid css, isn't?
In that case DokuWiki's compressor needs a fix.

@Klap-in Klap-in added the Bug label May 12, 2014
@selfthinker
Copy link
Collaborator

Yup, that is valid CSS. And the compression is broken. Therefore a simple "fix" would be to disable it [https://www.dokuwiki.org/config:compress]. I can imagine this was either introduced with fe5a50c or 98cb860.

I will change the title of the ticket to reflect what's broken.

@selfthinker selfthinker changed the title lib/tpl/vector/user/screen.css ignored in Ponder Stibbons Compression breaks CSS when valid '//' are used May 12, 2014
@splitbrain
Copy link
Collaborator

Yeah fe5a50c seems to be the problem. I guess that function needs to check for strings as well. I will have a look.

@splitbrain splitbrain self-assigned this May 13, 2014
splitbrain referenced this issue May 14, 2014
This avoids treating double slashes as single line comments in CSS when
they are used in a filter or content string.

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

No branches or pull requests

4 participants