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');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue