diff --git a/src/EditorView.swift b/src/EditorView.swift index e6c55aa..ca41746 100644 --- a/src/EditorView.swift +++ b/src/EditorView.swift @@ -580,19 +580,22 @@ private func highlightMarkdownLine(_ trimmed: String, line: String, lineRange: N return true } - if trimmed.hasPrefix("> ") { + if trimmed.hasPrefix("> ") || trimmed == ">" { textStorage.addAttribute(.foregroundColor, value: palette.overlay2, range: lineRange) let indent = NSMutableParagraphStyle() - indent.headIndent = 20 - indent.firstLineHeadIndent = 20 + indent.headIndent = 24 + indent.firstLineHeadIndent = 24 textStorage.addAttribute(.paragraphStyle, value: indent, range: lineRange) + let gtRange = (textStorage.string as NSString).range(of: ">", options: [], range: lineRange) + if gtRange.location != NSNotFound { + textStorage.addAttribute(.foregroundColor, value: palette.overlay0, range: gtRange) + } return true } - // Horizontal rule + // Horizontal rule — layout manager draws the line; mute the source text if isHorizontalRule(trimmed) { - textStorage.addAttribute(.foregroundColor, value: palette.overlay0, range: lineRange) - textStorage.addAttribute(.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: lineRange) + textStorage.addAttribute(.foregroundColor, value: palette.surface0, range: lineRange) return true }