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

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

Projects

None yet

4 participants

@theolmue
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
Owner

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
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 May 8, 2014
@Klap-in
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
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.

@theolmue theolmue referenced this issue in arsava/dokuwiki-template-vector May 9, 2014
Open

lib/tpl/vector/user/screen.css ignored in Ponder Stibbons #27

@Klap-in Klap-in reopened this May 12, 2014
@Klap-in
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(/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(/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
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 from lib/tpl/vector/user/screen.css ignored in Ponder Stibbons to Compression breaks CSS when valid '//' are used May 12, 2014
@splitbrain
Owner

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 splitbrain referenced this issue May 14, 2014
@splitbrain don't treat double slashes as comments when used in string
This avoids treating double slashes as single line comments in CSS when
they are used in a filter or content string.

closes #638
918a446
@splitbrain splitbrain closed this May 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment