aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 12:12:36 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 12:12:36 +0200
commit6e80e03bb6d6af47aba2b339f160e4895ab5afba (patch)
tree98ecdfd1d73065ae45846320ccf43e5eb8c8cced /src/lib.rs
parentb75d7976cfe8db43783b930c1f4774f2ad4936f5 (diff)
downloadmarkdown-rs-6e80e03bb6d6af47aba2b339f160e4895ab5afba.tar.gz
markdown-rs-6e80e03bb6d6af47aba2b339f160e4895ab5afba.tar.bz2
markdown-rs-6e80e03bb6d6af47aba2b339f160e4895ab5afba.zip
Refactor to share identifier methods
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f423b68..8eaa2bb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -36,7 +36,10 @@ use mdast::Node;
use parser::parse;
use to_html::compile as to_html;
use to_mdast::compile as to_mdast;
-use util::sanitize_uri::sanitize;
+use util::{
+ identifier::{id_cont, id_start},
+ sanitize_uri::sanitize,
+};
/// Type of line endings in markdown.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
@@ -1198,3 +1201,15 @@ pub fn micromark_to_mdast(value: &str, options: &Options) -> Result<Node, String
pub fn sanitize_(value: &str) -> String {
sanitize(value)
}
+
+/// Do not use: exported for quick prototyping, will be removed.
+#[must_use]
+pub fn id_start_(char: char) -> bool {
+ id_start(char)
+}
+
+/// Do not use: exported for quick prototyping, will be removed.
+#[must_use]
+pub fn id_cont_(char: char, jsx: bool) -> bool {
+ id_cont(char, jsx)
+}