indent p + p
This commit is contained in:
parent
3b91983491
commit
299ffe6c4b
6 changed files with 53 additions and 3 deletions
|
|
@ -30,6 +30,19 @@ export default class thesis extends Handler {
|
|||
wrapper.appendChild(num);
|
||||
siblings.forEach(s => wrapper.appendChild(s));
|
||||
});
|
||||
|
||||
// Si le dernier enfant d'un wrapper est un p et que le suivant est aussi un wrapper → .wrapper-indent
|
||||
const wrappers = content.querySelectorAll('.wrapper-ol');
|
||||
wrappers.forEach((wrapper) => {
|
||||
const last = wrapper.lastElementChild;
|
||||
const next = wrapper.nextElementSibling;
|
||||
if (last && last.nodeName === 'P' && next && next.classList.contains('wrapper-ol')) {
|
||||
const firstP = next.querySelector('p');
|
||||
if (!firstP || !firstP.classList.contains('p-these')) {
|
||||
next.classList.add('wrapper-indent');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
20
js/snapToBaseline.js
Normal file
20
js/snapToBaseline.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { Handler } from '/csspageweaver/lib/paged.esm.js';
|
||||
|
||||
export default class snapToBaseline extends Handler {
|
||||
constructor(chunker, polisher, caller) {
|
||||
super(chunker, polisher, caller);
|
||||
}
|
||||
|
||||
renderNode(node, sourceNode){
|
||||
if (node.nodeName === 'P') {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue