Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
rztime committed Nov 22, 2024
1 parent dee33c0 commit 5344627
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions RZRichTextView/Classes/RZCss.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ public extension NSParagraphStyle {
/// 将paragraph转换为css对应的样式
func rz2cssStyle(font: UIFont?) -> String {
var styles: [String] = []
if !self.isol && !self.isul {
if self.paragraphSpacingBefore != 0 || self.paragraphSpacing != 0 || self.headIndent != 0 {
styles.append("margin:\(self.paragraphSpacingBefore)px 0.0px \(self.paragraphSpacing)px \(self.headIndent)px;")
}
}
if !self.isol && !self.isul || !self.isblockquote {
styles.append("margin:\(self.paragraphSpacingBefore)px 0.0px \(self.paragraphSpacing)px \(self.headIndent)px;")
}
switch self.alignment {
case .left, .justified, .natural: break
case .center: styles.append("text-align:center;")
Expand Down Expand Up @@ -209,7 +207,7 @@ public extension [NSAttributedString.Key: Any] {
styletexts.append("font-style:italic;")
case .normal:
break
}
}
}
case .foregroundColor:
if let color = value as? UIColor { styletexts.append("color:#\(color.qhexString);") }
Expand Down

0 comments on commit 5344627

Please sign in to comment.