aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralyx <alyx@aleteoryx.me>2023-11-17 16:41:00 -0500
committeralyx <alyx@aleteoryx.me>2023-11-17 16:45:15 -0500
commite5b8bfaba2360a9a701f6db0830798a09e13bee0 (patch)
tree9ebe1f1a9641a17870dead9919f3c9d993198845
parent754e4be335fc250f00742f6c0503e05468792a73 (diff)
downloadlfm_embed-e5b8bfaba2360a9a701f6db0830798a09e13bee0.tar.gz
lfm_embed-e5b8bfaba2360a9a701f6db0830798a09e13bee0.tar.bz2
lfm_embed-e5b8bfaba2360a9a701f6db0830798a09e13bee0.zip
Remove redundant HTML escaping helpers.
-rw-r--r--Cargo.toml1
-rw-r--r--README.md4
-rw-r--r--src/config.rs6
3 files changed, 1 insertions, 10 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 31c0a95..ca94e86 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,6 @@ dotenv = "0.15.0"
duration-str = "0.5.1"
env_logger = "0.10.0"
handlebars = { version = "4.3.7", features = ["dir_source"] }
-htmlize = "1.0.3"
log = "0.4.19"
reqwest = { version = "0.11.18", features = ["gzip", "deflate", "brotli", "json"] }
serde = { version = "1.0.183", features = ["derive", "rc", "alloc"] }
diff --git a/README.md b/README.md
index 8095b5a..739b94a 100644
--- a/README.md
+++ b/README.md
@@ -256,10 +256,6 @@ In addition, the following [helpers](https://handlebarsjs.com/guide/expressions.
- `(not Boolean) => Boolean`: Boolean NOT gate.
-- `(html_escape String) => String`: Escape HTML special characters from the input string, replacing them with HTML entities in the output. For use in standard markdown.
-
-- `(html_attr_escape String) => String`: Escape HTML special characters, as well as quotation marks, in the input, replacing them with HTML entities and escaped quotes in the output. For use in HTML tag attributes.
-
- `(uri_encode String) => String`: URI-encode input text, making the output suitable to be included as part of a link or other URL.
# Contributing
diff --git a/src/config.rs b/src/config.rs
index ab92108..3b36ad2 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -85,13 +85,9 @@ impl State {
handlebars: {
let mut hb = Handlebars::new();
- handlebars_helper!(html_escape: |s: String| htmlize::escape_text(s));
- handlebars_helper!(html_attr_escape: |s: String| htmlize::escape_attribute(s));
handlebars_helper!(url_encode: |s: String| urlencoding::encode(&s));
- hb.register_helper("html-escape", Box::new(html_escape));
- hb.register_helper("html-attr-escape", Box::new(html_attr_escape));
- hb.register_helper("url-encode", Box::new(html_attr_escape));
+ hb.register_helper("url-encode", Box::new(url_encode));
for (key, fulltext) in INTERNAL_THEMES {
log::info!(target: "lfm::config::theme", "Registering internal theme `{key}`");