Skip to content

Commit

Permalink
Improves formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs committed Mar 16, 2024
1 parent 315f390 commit d10471e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Runestone/StringSyntaxHighlighter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ public final class StringSyntaxHighlighter {

private extension StringSyntaxHighlighter {
private func applyLineHeightMultiplier(to attributedString: NSMutableAttributedString) {
let scaledLineHeight = theme.font.totalLineHeight * lineHeightMultiplier
let mutableParagraphStyle = getMutableParagraphStyle(from: attributedString)
mutableParagraphStyle.lineSpacing = (theme.font.totalLineHeight * lineHeightMultiplier) - theme.font.totalLineHeight
mutableParagraphStyle.lineSpacing = scaledLineHeight - theme.font.totalLineHeight
let range = NSRange(location: 0, length: attributedString.length)
attributedString.beginEditing()
attributedString.removeAttribute(.paragraphStyle, range: range)
Expand Down

0 comments on commit d10471e

Please sign in to comment.