cgross / grunt-dom-munger

Grunt task to read and manipulate HTML with CSS selectors.
MIT License
93 stars 40 forks source link

File changed/formatted after only reading attributes #26

Closed bostrom closed 10 years ago

bostrom commented 10 years ago

I'm using grunt-dom-munger for extracting each value for a certain html attribute throughout my templates. I'm doing this using a callback function which only uses jQuery to read the attribute and writes to a grunt configuration attribute (almost what options.read does, but not exactly).

I'm expecting the files to remain untouched since I'm only reading from them, but it looks like grunt-dom-munger modifies the files as it parses the file? Notably, all newlines added for readability and code formatting are normalised and removed. After running the task, my working directory shows up as modified for all html templates I have, which is not desirable.

Would it be possible to somehow disable this formatting/modification of files when only reading from them?

cgross commented 10 years ago

Merged 27.