Giter Site home page Giter Site logo

Comments (3)

pocketjoso avatar pocketjoso commented on May 18, 2024

Just some further info, although I'm still lost as to how to fix this problem:

On Windows

When running the penthouse.js standalone, if I just let the output be printed in the console, then it works (no extra line breaks). (same in Cygwin and Window's CMD).
./phantomjs js/penthouse.js http://192.168.1.249/criticalpathcssgenerator/ test.css

If I redirect the output to a new file however, then additional line breaks appear (as shown in last post).
./phantomjs js/penthouse.js http://192.168.1.249/criticalpathcssgenerator/ test.css > extra-linebreaks.css
This is also what happens when running via f.e. Grunt.

from penthouse.

pocketjoso avatar pocketjoso commented on May 18, 2024

I'll come back to this later, but for now I'm sure the problem has to do with newline encoding; something in the penthouse.js scripts (most likely fs) converting Windows style newlines (\r\n) to Nix style (\n), and then whenever the content gets rewritten to a Windows file the conversion goes wrong (becomes \r\r\n)?.

http://stackoverflow.com/questions/6891252/c-newline-character-under-windows-command-line-redirection

I don't know much about this topic... Perhaps the answer to this problem is obvious to someone, - @kopseng?

from penthouse.

pocketjoso avatar pocketjoso commented on May 18, 2024

Current fix for this now is simply replacing any existing \r\n initially with \n - this solves the problem. There might be more elegant solutions out there though..

Fixed in: a1dc313

from penthouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.