fix(settings): override book text align of left (#2802)

This commit is contained in:
Huang Xin
2025-12-28 18:02:56 +01:00
committed by GitHub
parent f944ad9b9f
commit 988fbc8c85
+6
View File
@@ -284,6 +284,10 @@ const getLayoutStyles = (
dd.aligned-center, div.aligned-center {
text-align: center ${overrideLayout ? '!important' : ''};
}
p.aligned-left, blockquote.aligned-left,
dd.aligned-left, div.aligned-left {
${justify && overrideLayout ? 'text-align: justify !important;' : ''}
}
p.aligned-right, blockquote.aligned-right,
dd.aligned-right, div.aligned-right {
text-align: right ${overrideLayout ? '!important' : ''};
@@ -808,6 +812,8 @@ export const keepTextAlignment = (document: Document) => {
const computedStyle = window.getComputedStyle(el);
if (computedStyle.textAlign === 'center') {
el.classList.add('aligned-center');
} else if (computedStyle.textAlign === 'left') {
el.classList.add('aligned-left');
} else if (computedStyle.textAlign === 'right') {
el.classList.add('aligned-right');
} else if (computedStyle.textAlign === 'justify') {