jotform / css.js

A lightweight, battle tested, fast, CSS parser in JavaScript
https://medium.com/jotform-form-builder/writing-a-css-parser-in-javascript-3ecaa1719a43
MIT License
426 stars 63 forks source link

Bug with base64 hack #14

Open ts1690 opened 8 years ago

ts1690 commented 8 years ago

Hi, tested 3 css parsing libraries before this one. Brilliant and thanks!

Found small bug regarding css parse removing a semicolon..

This css: "background-image: url('data:image/jpeg;base64,/9j/4AAQSkZ.."

Becomes: "background-image: url('data:image/jpegbase64,/9j/4AAQSkZ.."

The fix:

Line 181 was: ret[ret.length - 1].value += line.trim();

Should be: (note line is trimmed already above) ret[ret.length - 1].value += ';'+line;//.trim();