All table th gets scope (#36555)
This commit is contained in:
@@ -29,9 +29,10 @@ import doctocatLinkIcon from './doctocat-link-icon.js'
|
||||
// see https://github.com/unifiedjs/unified/issues/79
|
||||
const wrapperForImages = () =>
|
||||
wrapInElement({ selector: 'ol > li img', wrapper: 'span.procedural-image-wrapper' })
|
||||
const wrapperForRowheadersThead = () =>
|
||||
|
||||
const wrapperForTheadThScope = () =>
|
||||
wrapInElement({
|
||||
selector: '.rowheaders thead th',
|
||||
selector: 'thead th',
|
||||
wrapper: 'th',
|
||||
// This moves what it finds in the selector inside the wrapper.
|
||||
rewrite: true,
|
||||
@@ -39,6 +40,18 @@ const wrapperForRowheadersThead = () =>
|
||||
scope: 'col',
|
||||
},
|
||||
})
|
||||
|
||||
const wrapperForTbodyThScope = () =>
|
||||
wrapInElement({
|
||||
selector: 'thead th',
|
||||
wrapper: 'th',
|
||||
// This moves what it finds in the selector inside the wrapper.
|
||||
rewrite: true,
|
||||
wrapperAdditionalAttributes: {
|
||||
scope: 'col',
|
||||
},
|
||||
})
|
||||
|
||||
const wrapperForRowheadersTbody = () =>
|
||||
wrapInElement({
|
||||
selector: '.rowheaders tbody tr td:first-child',
|
||||
@@ -70,7 +83,8 @@ export default function createProcessor(context) {
|
||||
})
|
||||
.use(raw)
|
||||
.use(wrapperForImages)
|
||||
.use(wrapperForRowheadersThead)
|
||||
.use(wrapperForTheadThScope)
|
||||
.use(wrapperForTbodyThScope)
|
||||
.use(wrapperForRowheadersTbody)
|
||||
.use(rewriteImgSources)
|
||||
.use(rewriteAssetImgTags)
|
||||
|
||||
Reference in New Issue
Block a user