Skip to content

Commit 1cd05f8

Browse files
authored
Merge pull request #43 from justmakeapp/feature/add-redacted-original-render-style
feature / add redactedOriginal rendering style
2 parents c1e16cd + 7cd52d2 commit 1cd05f8

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

@@ -197,7 +199,7 @@ public struct LaTeX: View {
197199
else {
198200
// The view is not rendered nor cached
199201
switch renderingStyle {
200-
case .empty, .original, .progress:
202+
case .empty, .original, .redactedOriginal, .progress:
201203
// Render the components asynchronously
202204
loadingView().task {
203205
await renderAsync()
@@ -309,6 +311,12 @@ extension LaTeX {
309311
Text("")
310312
case .original:
311313
Text(latex)
314+
case .redactedOriginal:
315+
Text(latex)
316+
.foregroundStyle(Color.clear)
317+
.background {
318+
Text(latex).redacted(reason: .placeholder)
319+
}
312320
case .progress:
313321
ProgressView()
314322
default:

0 commit comments

Comments
 (0)