Skip to content

Commit

Permalink
Fixes giving breakWith option via a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubpawlowicz committed Aug 7, 2018
1 parent e14931a commit b7da0d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[4.2.1 / 2018-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v4.2.0...HEAD)
==================

* Fixes giving `breakWith` option via a string.

[4.2.0 / 2018-08-02](https://github.com/jakubpawlowicz/clean-css/compare/4.1...4.2.0)
==================

Expand Down
2 changes: 2 additions & 0 deletions lib/options/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ function toHash(string) {
accumulator[name] = parseInt(value);
} else if (name == 'indentWith') {
accumulator[name] = mapIndentWith(value);
} else if (name == 'breakWith') {
accumulator[name] = mapBreakWith(value);
}

return accumulator;
Expand Down
8 changes: 8 additions & 0 deletions test/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ vows.describe('integration tests')
]
}, { format: { breaks: { afterProperty: true }, breakWith: 'crlf' } })
)
.addBatch(
optimizerContext('CRLF line with format as string', {
'uses specified one': [
'.block{color:red;display:block}',
'.block{color:red;\r\ndisplay:block\r\n}'
]
}, { format: 'breaks:afterProperty=on;breakWith:crlf' })
)
.addBatch(
optimizerContext('LF line breaks', {
'uses specified one': [
Expand Down

0 comments on commit b7da0d1

Please sign in to comment.