Skip to content

Commit 7cd52d2

Browse files
committed
add redactedOriginal rendering style
1 parent 766be13 commit 7cd52d2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/LaTeXSwiftUI/LaTeX.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public struct LaTeX: View {
9494

9595
/// The view displays the input text until its finished rendering.
9696
case original
97-
97+
98+
case redactedOriginal
99+
98100
/// The view displays a progress view until its finished rendering.
99101
case progress
100102

@@ -188,7 +190,7 @@ public struct LaTeX: View {
188190
else {
189191
// The view is not rendered nor cached
190192
switch renderingStyle {
191-
case .empty, .original, .progress:
193+
case .empty, .original, .redactedOriginal, .progress:
192194
// Render the components asynchronously
193195
loadingView().task {
194196
await renderAsync()
@@ -299,6 +301,12 @@ extension LaTeX {
299301
Text("")
300302
case .original:
301303
Text(latex)
304+
case .redactedOriginal:
305+
Text(latex)
306+
.foregroundStyle(Color.clear)
307+
.background {
308+
Text(latex).redacted(reason: .placeholder)
309+
}
302310
case .progress:
303311
ProgressView()
304312
default:

0 commit comments

Comments
 (0)