Skip to content

Commit

Permalink
Handle boolean sorthand for filters
Browse files Browse the repository at this point in the history
[closes #2966]
  • Loading branch information
ForbesLindesay committed Mar 7, 2018
1 parent 540cddd commit 23ae71a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pug-filters/lib/handle-filters.js
Expand Up @@ -94,7 +94,7 @@ function getAttributes(node, options) {
var attrs = {};
node.attrs.forEach(function (attr) {
try {
attrs[attr.name] = constantinople.toConstant(attr.val);
attrs[attr.name] = attr.val === true ? true : constantinople.toConstant(attr.val);
} catch (ex) {
if (/not constant/.test(ex.message)) {
throw error('FILTER_OPTION_NOT_CONSTANT', ex.message + ' All filters are rendered compile-time so filter options must be constants.', node);
Expand Down

0 comments on commit 23ae71a

Please sign in to comment.