1
0
mirror of synced 2025-12-22 03:16:52 -05:00

Set correct scope attributes on rowheaders tables (#35999)

Co-authored-by: Rachael Sewell <rachmari@github.com>
This commit is contained in:
Peter Bengtsson
2023-03-30 07:41:33 -04:00
committed by GitHub
parent d53b5a2bb1
commit 8d13af951e
3 changed files with 42 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ export default (options) => {
const selector = options.selector || options.select || 'body'
const wrapper = options.wrapper || options.wrap
const rewrite = options.rewrite
const additionalAttributes = options.wrapperAdditionalAttributes
/*
* Transformer
@@ -25,6 +26,13 @@ export default (options) => {
for (const match of selectAll(selector, tree)) {
visit(tree, match, (node, i, parent) => {
const parsedWrapper = parseSelector(wrapper)
if (additionalAttributes) {
parsedWrapper.properties = Object.assign(
{},
parsedWrapper.properties || {},
additionalAttributes
)
}
if (rewrite) {
parsedWrapper.children = node.children
} else {