diff --git a/lib/inline.js b/lib/inline.js index 4ffaa05..475a62e 100644 --- a/lib/inline.js +++ b/lib/inline.js @@ -124,6 +124,12 @@ function inlineDocument($, css, options) { return; } + if (!el.counterProps) { + el.counterProps = el.parent && el.parent.counterProps + ? Object.create(el.parent.counterProps) + : {}; + } + if (pseudoElementType) { var pseudoElPropName = 'pseudo' + pseudoElementType; var pseudoEl = el[pseudoElPropName]; @@ -150,12 +156,6 @@ function inlineDocument($, css, options) { editedElements.push(el); } - if (!el.counterProps) { - el.counterProps = el.parent && el.parent.counterProps - ? Object.create(el.parent.counterProps) - : {}; - } - function resetCounter(el, value) { var tokens = value.split(/\s+/); diff --git a/test/cases/juice-content/counter-reset.css b/test/cases/juice-content/counter-reset.css new file mode 100644 index 0000000..e69de29 diff --git a/test/cases/juice-content/counter-reset.html b/test/cases/juice-content/counter-reset.html new file mode 100644 index 0000000..863d222 --- /dev/null +++ b/test/cases/juice-content/counter-reset.html @@ -0,0 +1,12 @@ + +
+ + + +Cool!
+ + diff --git a/test/cases/juice-content/counter-reset.json b/test/cases/juice-content/counter-reset.json new file mode 100644 index 0000000..a2c47aa --- /dev/null +++ b/test/cases/juice-content/counter-reset.json @@ -0,0 +1,4 @@ +{ + "removeStyleTags": true, + "inlinePseudoElements": true +} diff --git a/test/cases/juice-content/counter-reset.out b/test/cases/juice-content/counter-reset.out new file mode 100644 index 0000000..5783920 --- /dev/null +++ b/test/cases/juice-content/counter-reset.out @@ -0,0 +1,8 @@ + + + + + +Cool!
+ +