Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
glushchenko committed Sep 25, 2024
1 parent 45f7f54 commit 3d853c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FSNotes/Helpers/NotesTextProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ public class NotesTextProcessor {
NotesTextProcessor.italicRegex.matches(string, range: paragraphRange) { (result) -> Void in
guard let range = result?.range else { return }
attributedString.addAttribute(.font, value: italicFont, range: range)
attributedString.fixAttributes(in: range)

let preRange = NSMakeRange(range.location, 1)
attributedString.addAttribute(.foregroundColor, value: NotesTextProcessor.syntaxColor, range: preRange)
Expand All @@ -906,6 +907,7 @@ public class NotesTextProcessor {
NotesTextProcessor.boldRegex.matches(string, range: paragraphRange) { (result) -> Void in
guard let range = result?.range else { return }
attributedString.addAttribute(.font, value: boldFont, range: range)
attributedString.fixAttributes(in: range)

let preRange = NSMakeRange(range.location, 2)
attributedString.addAttribute(.foregroundColor, value: NotesTextProcessor.syntaxColor, range: preRange)
Expand Down

0 comments on commit 3d853c0

Please sign in to comment.