You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no way to instruct mammoth to ignore classes when finding a parent element to nest within. This presents a problem when trying to nest elements within elements that have varying classes set using style maps.
This file would be expected to render like so (assuming the classes set the list-style-type with CSS):
<olclass="decimal"><li>
Test
<olclass="alpha"><li>
Test
<olclass="roman"><li>Test</li></ol></li></ol></li></ol><p>Test</p><p>Test</p><p>Test</p>
1. Test
a. Test
i. Test
Test
Test
Test
However, because the ol.alpha is not nested within an ol and our ol has a class applies to it, a new parent element is created. The document is actually rendered like so:
Issue
Currently, there is no way to instruct mammoth to ignore classes when finding a parent element to nest within. This presents a problem when trying to nest elements within elements that have varying classes set using style maps.
Example
With this style map:
This file would be expected to render like so (assuming the classes set the list-style-type with CSS):
However, because the
ol.alpha
is not nested within anol
and ourol
has a class applies to it, a new parent element is created. The document is actually rendered like so:The text was updated successfully, but these errors were encountered: