question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug : carriage router is breaking the tokenizer

See original GitHub issue

Our solution minifies CSS from various websites and some CSS have carriage return (\r) without the new line character (\n). This character breaks the tokenizer. The only patch I found is removing all (\r) with a replace statement before applying clean-css.

Environment

  • clean-css version - npm ls clean-css: clean-css@4.1.9
  • node.js version - node -v: v8.9.4
  • operating system: Mac OS

Configuration options

var CleanCSS = require('clean-css');
new CleanCSS({
level: { 1: {all:false}}
})

Input CSS

\r@media only screen and (max-width: 1250px) {#aspot-standard {width: 100%;}}

Please note the ‘\r’ before the ‘@’.

Actual output CSS

@media only screen and (max-width: 1250px){}

Expected output CSS

@media only screen and (max-width: 1250px){#aspot-standard{width:100%}}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jakubpawlowiczcommented, Aug 1, 2018

To be released with 4.2.0 tomorrow.

0reactions
jakubpawlowiczcommented, Mar 5, 2018

So we should handle it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug : carriage router is breaking the tokenizer · Issue #1000 · clean ...
Our solution minifies CSS from various websites and some CSS have carriage return (\r) without the new line character (\n). This character breaks...
Read more >
Issues for all projects | Drupal.org
Issues for all projects ; Decoupled Router · Fatal error when updating or deleting nodes with an alias, Needs review, Critical, Bug report...
Read more >
Split - Apache Camel
Use a Splitter to break out the composite message into a series of individual messages, each containing data related to one item. The...
Read more >
c++ - BadPtr with vector<std::string> iterator in template function ...
I have a function that parses a .csv file and tokenizes each line using a "," as the delimiter. I tokenize it into...
Read more >
uncaught (in promise) error cannot find module, uncaught (in ...
A module to find REPP tokenizer binary and its repp.set config file. generate_repp_command ( inputfilename ) [source] ¶ This module generates the REPP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found