diff options
Diffstat (limited to 'Sources/NorgUI/Views/Blocks')
| -rw-r--r-- | Sources/NorgUI/Views/Blocks/ListItemView.swift | 2 | ||||
| -rw-r--r-- | Sources/NorgUI/Views/Blocks/ParagraphView.swift | 4 | ||||
| -rw-r--r-- | Sources/NorgUI/Views/Blocks/QuoteView.swift | 2 | ||||
| -rw-r--r-- | Sources/NorgUI/Views/Blocks/RangedTagView.swift | 8 |
4 files changed, 10 insertions, 6 deletions
diff --git a/Sources/NorgUI/Views/Blocks/ListItemView.swift b/Sources/NorgUI/Views/Blocks/ListItemView.swift index 581974b..ffff2eb 100644 --- a/Sources/NorgUI/Views/Blocks/ListItemView.swift +++ b/Sources/NorgUI/Views/Blocks/ListItemView.swift @@ -20,7 +20,7 @@ struct ListItemView: View { Text(marker) .foregroundStyle(.secondary) .monospacedDigit() - Text(AttributedString(norg: content, theme: theme)) + NorgInlineText(spans: content) } } } diff --git a/Sources/NorgUI/Views/Blocks/ParagraphView.swift b/Sources/NorgUI/Views/Blocks/ParagraphView.swift index 2ad0dd5..d117ccc 100644 --- a/Sources/NorgUI/Views/Blocks/ParagraphView.swift +++ b/Sources/NorgUI/Views/Blocks/ParagraphView.swift @@ -2,11 +2,9 @@ import NorgKit import SwiftUI struct ParagraphView: View { - @Environment(\.norgTheme) private var theme - let content: [InlineSpan] var body: some View { - Text(AttributedString(norg: content, theme: theme)) + NorgInlineText(spans: content) } } diff --git a/Sources/NorgUI/Views/Blocks/QuoteView.swift b/Sources/NorgUI/Views/Blocks/QuoteView.swift index 0347d78..f5a6ec8 100644 --- a/Sources/NorgUI/Views/Blocks/QuoteView.swift +++ b/Sources/NorgUI/Views/Blocks/QuoteView.swift @@ -19,7 +19,7 @@ struct QuoteView: View { status: status, content: content, font: theme.body, line: line, onSetStatus: onSetStatus ) } else { - Text(AttributedString(norg: content, theme: theme)) + NorgInlineText(spans: content) .foregroundStyle(theme.quoteColor) .italic() } diff --git a/Sources/NorgUI/Views/Blocks/RangedTagView.swift b/Sources/NorgUI/Views/Blocks/RangedTagView.swift index 1cdf1d9..04ec4d1 100644 --- a/Sources/NorgUI/Views/Blocks/RangedTagView.swift +++ b/Sources/NorgUI/Views/Blocks/RangedTagView.swift @@ -1,10 +1,16 @@ import SwiftUI struct RangedTagView: View { + @Environment(\.norgTheme) private var theme + let name: [String] let content: String var body: some View { - VerbatimBlock(label: name.joined(separator: "."), content: content) + if name == ["math"], theme.mathRenderer != nil { + MathBlockView(latex: content) + } else { + VerbatimBlock(label: name.joined(separator: "."), content: content) + } } } |