ehynds / grunt-image-embed

A grunt task for converting images inside a stylesheet to base64-encoded data URI strings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails on URLs with hashes (#)

osmestad opened this issue · comments

A common way to work around an IE bug is to append a hash to the URL of the .eot file, this fails with a file not found error. In this case the query parameter could be ignored.

For embedding SVG fonts it seems a selector with the font id is appended, which also causes a file not found, not sure if/how that selector needs to be handled when base64 encoding?

Example CSS:

/* Generated by Font Squirrel (http://www.fontsquirrel.com) on October 3, 2012 */
@font-face {
    font-family: 'tar_bkregular';
    src: url('../font/tarbook-webfont.eot');
    src: url('../font/tarbook-webfont.eot?#iefix') format('embedded-opentype'),
         url('../font/tarbook-webfont.woff') format('woff'),
         url('../font/tarbook-webfont.ttf') format('truetype'),
         url('../font/tarbook-webfont.svg#tar_bkregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

Thanks!