aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_utils
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 14:06:50 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 14:06:54 +0200
commit1d8e2b373b5e347a89f05e36c73b04487e04bead (patch)
tree0fc27c9c2adafa3ee841d68ec1334e306babd7b1 /tests/test_utils
parent43edc8fc9d204da962c92b9f9fef45ac8b6b03da (diff)
downloadmarkdown-rs-1d8e2b373b5e347a89f05e36c73b04487e04bead.tar.gz
markdown-rs-1d8e2b373b5e347a89f05e36c73b04487e04bead.tar.bz2
markdown-rs-1d8e2b373b5e347a89f05e36c73b04487e04bead.zip
Refactor some hidden internals
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/jsx_rewrite.rs2
-rw-r--r--tests/test_utils/to_hast.rs14
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_utils/jsx_rewrite.rs b/tests/test_utils/jsx_rewrite.rs
index 9dd2605..33879b0 100644
--- a/tests/test_utils/jsx_rewrite.rs
+++ b/tests/test_utils/jsx_rewrite.rs
@@ -7,7 +7,7 @@ use crate::test_utils::{
},
to_swc::Program,
};
-use micromark::{id_cont_ as id_cont, id_start_ as id_start, unist::Position, Location};
+use micromark::{id_cont, id_start, unist::Position, Location};
use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith};
/// Configuration.
diff --git a/tests/test_utils/to_hast.rs b/tests/test_utils/to_hast.rs
index 4907e23..1ba8d35 100644
--- a/tests/test_utils/to_hast.rs
+++ b/tests/test_utils/to_hast.rs
@@ -1,5 +1,5 @@
use crate::test_utils::hast;
-use micromark::{mdast, sanitize_, unist::Position};
+use micromark::{mdast, sanitize, unist::Position};
// To do: support these compile options:
// ```
@@ -92,7 +92,7 @@ pub fn to_hast(mdast: &mdast::Node) -> hast::Node {
let mut index = 0;
while index < state.footnote_calls.len() {
let (id, count) = &state.footnote_calls[index];
- let safe_id = sanitize_(&id.to_lowercase());
+ let safe_id = sanitize(&id.to_lowercase());
// Find definition: we’ll always find it.
let mut definition_index = 0;
@@ -412,7 +412,7 @@ fn transform_footnote_reference(
_node: &mdast::Node,
footnote_reference: &mdast::FootnoteReference,
) -> Result {
- let safe_id = sanitize_(&footnote_reference.identifier.to_lowercase());
+ let safe_id = sanitize(&footnote_reference.identifier.to_lowercase());
let mut call_index = 0;
// See if this has been called before.
@@ -489,7 +489,7 @@ fn transform_image(_state: &mut State, _node: &mdast::Node, image: &mdast::Image
properties.push((
"src".into(),
- hast::PropertyValue::String(sanitize_(&image.url)),
+ hast::PropertyValue::String(sanitize(&image.url)),
));
properties.push(("alt".into(), hast::PropertyValue::String(image.alt.clone())));
@@ -522,7 +522,7 @@ fn transform_image_reference(
let (_, url, title) =
definition.expect("expected reference to have a corresponding definition");
- properties.push(("src".into(), hast::PropertyValue::String(sanitize_(url))));
+ properties.push(("src".into(), hast::PropertyValue::String(sanitize(url))));
properties.push((
"alt".into(),
@@ -584,7 +584,7 @@ fn transform_link(state: &mut State, node: &mdast::Node, link: &mdast::Link) ->
properties.push((
"href".into(),
- hast::PropertyValue::String(sanitize_(&link.url)),
+ hast::PropertyValue::String(sanitize(&link.url)),
));
if let Some(value) = link.title.as_ref() {
@@ -615,7 +615,7 @@ fn transform_link_reference(
let (_, url, title) =
definition.expect("expected reference to have a corresponding definition");
- properties.push(("href".into(), hast::PropertyValue::String(sanitize_(url))));
+ properties.push(("href".into(), hast::PropertyValue::String(sanitize(url))));
if let Some(value) = title {
properties.push(("title".into(), hast::PropertyValue::String(value.into())));