aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/encode.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-22 17:24:05 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-22 17:24:05 +0200
commit79c3275f91f1c0867a1bfba3085c0682aa5486ef (patch)
treebe30b9a8b755bc6bc01e3f9d59e7d69c60b80b24 /src/util/encode.rs
parentb0accb11f1aade55e9fc4dc0a1c1d1b8362ab5d9 (diff)
downloadmarkdown-rs-79c3275f91f1c0867a1bfba3085c0682aa5486ef.tar.gz
markdown-rs-79c3275f91f1c0867a1bfba3085c0682aa5486ef.tar.bz2
markdown-rs-79c3275f91f1c0867a1bfba3085c0682aa5486ef.zip
Add support for normalizing identifiers
Diffstat (limited to 'src/util/encode.rs')
-rw-r--r--src/util/encode.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util/encode.rs b/src/util/encode.rs
index f79c8ea..5762c22 100644
--- a/src/util/encode.rs
+++ b/src/util/encode.rs
@@ -21,6 +21,8 @@
///
/// * [`micromark-util-encode` in `micromark`](https://github.com/micromark/micromark/tree/main/packages/micromark-util-encode)
pub fn encode(value: &str) -> String {
+ // To do: replacing 4 times might just be slow.
+ // Perhaps we can walk the chars.
value
.replace('&', "&amp;")
.replace('"', "&quot;")