fix: apply layout styles to div tag, closes #1130 (#1142)

This commit is contained in:
Huang Xin
2025-05-13 19:48:21 +08:00
committed by GitHub
parent 4779e2638f
commit d96fb32bcf
2 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -227,7 +227,7 @@ const getLayoutStyles = (
width: auto;
background-color: transparent !important;
}
p, li, blockquote, dd {
p, div, li, blockquote, dd {
line-height: ${lineSpacing} ${overrideLayout ? '!important' : ''};
word-spacing: ${wordSpacing}px ${overrideLayout ? '!important' : ''};
letter-spacing: ${letterSpacing}px ${overrideLayout ? '!important' : ''};
@@ -241,7 +241,7 @@ const getLayoutStyles = (
hanging-punctuation: allow-end last;
widows: 2;
}
p {
p, div {
${vertical ? `margin-left: ${paragraphMargin}em ${overrideLayout ? '!important' : ''};` : ''}
${vertical ? `margin-right: ${paragraphMargin}em ${overrideLayout ? '!important' : ''};` : ''}
${!vertical ? `margin-top: ${paragraphMargin}em ${overrideLayout ? '!important' : ''};` : ''}