aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-02-04 12:49:40 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-02-04 12:49:40 +0100
commit78c0ce81fd2f45e0c5ec237602cd1d4e530d3076 (patch)
tree5982a0075c497b09889871957b82dabac8f7dbaa /src
parentf5e5d595b58e0fd4c3035c58cf74605e587d949c (diff)
Replace HTML tags in HTML
Diffstat (limited to 'src')
-rw-r--r--src/html_renderer.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/html_renderer.rs b/src/html_renderer.rs
index 61d2d73..5251d0a 100644
--- a/src/html_renderer.rs
+++ b/src/html_renderer.rs
@@ -124,7 +124,10 @@ fn line_content(line: &GeminiLine) -> String {
format!("<pre aria-label=\"{alt_text}\">")
}
GeminiLine::PreformattedToggle(false, _) => "</pre>".to_string(),
- GeminiLine::Text(content, true) | GeminiLine::Quote(content) => content.to_string(),
+ GeminiLine::Text(content, true) | GeminiLine::Quote(content) => content
+ .replace('<', "&lt;")
+ .replace('>', "&gt;")
+ .to_string(),
}
}