Skip to content
This repository has been archived by the owner on Nov 21, 2021. It is now read-only.

In 0.2.9 and 0.2.10, removes all HTML #25

Closed
Sawtaytoes opened this issue Sep 24, 2014 · 5 comments
Closed

In 0.2.9 and 0.2.10, removes all HTML #25

Sawtaytoes opened this issue Sep 24, 2014 · 5 comments
Assignees
Labels

Comments

@Sawtaytoes
Copy link
Contributor

My HTML gets completely replaced w/ only this DOCTYPE declaration when using 0.2.9 and 0.2.10.
I could not test 0.2.8 as npm threw errors. 0.2.7 works for me and is what I've reverted to.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

premailer.coffee:

module.exports =


    ########################################
    ## Premailer
    ########################################

    html:
        options:
            mode: 'html'
            preserveStyles: false
            removeClasses: true
            removeScripts: false
            verbose: false

        files: '<%= locations.html.files %>'

    txt:
        options:
            mode: 'txt'
            verbose: false

        files: '<%= locations.txt.files %>'

A piece of location-vars.coffee where the files reference is found:

    html:
        src: '<%= locations.pages.dest %>'
        dest: '<%= locations.pages.dest %>'
        files: [
            expand: true
            cwd: '<%= locations.html.src %>'
            src: '**/*.html'
            dest: '<%= locations.html.dest %>'
            filter: 'isFile'
        ]
@toby1kenobi
Copy link

I get the same thing, with 0.2.10 at least. Reverting to 0.2.7 also fixes it for me.

@dwightjack
Copy link
Owner

Hi will look into it asap.

Thanks for the contribution.

@dwightjack dwightjack added the bug label Oct 2, 2014
@dwightjack dwightjack self-assigned this Oct 2, 2014
@kris-ellery
Copy link

It looks like this is still an issue. Tested 2.7 and 2.11, both failed. Reverting to 2.5 fixes it, but then it messes up some styling.

EDIT:
2.11 works if the dest file is different than source.

@marocas
Copy link

marocas commented Feb 25, 2015

@dwightjack
@KrisOlszewski Is right, i had to make a workaround on my workflow, the dest now is on the root of my project, then i delete my dist html files and copy the html from the root to my dist folder and delete them after. 2 more steps to get the work done.

@dwightjack
Copy link
Owner

Ok,

i think figured out the problem: since premailer was giving random error when destination file didn't existed, i was creating it before running premailer.

In a src === dest scenario this ended up parsing an empty file. :S

I just released 0.2.12 which should fix the issue. Tested with Ruby 1.9.3 + hpricot and Ruby 2.0.x with nokogiri.

Sorry for the delay in solving this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants