From a1782b9f8e76e73980177ddf674ad6eb2e7dacab Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Wed, 31 Jan 2024 14:25:17 -0800 Subject: [PATCH 1/3] Make `NodeMultilineBlockQuote` public --- src/nodes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nodes.rs b/src/nodes.rs index f3993c46..9895a6d6 100644 --- a/src/nodes.rs +++ b/src/nodes.rs @@ -7,7 +7,7 @@ use std::convert::TryFrom; #[cfg(feature = "shortcodes")] use crate::parser::shortcodes::NodeShortCode; -use crate::parser::multiline_block_quote::NodeMultilineBlockQuote; +pub use crate::parser::multiline_block_quote::NodeMultilineBlockQuote; /// The core AST node enum. #[derive(Debug, Clone, PartialEq, Eq)] From d7b9118989c0566b816bba232190259b138c7bf8 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Wed, 31 Jan 2024 14:31:11 -0800 Subject: [PATCH 2/3] Make `NodeShortCode` public --- src/nodes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nodes.rs b/src/nodes.rs index 9895a6d6..ad73fbc0 100644 --- a/src/nodes.rs +++ b/src/nodes.rs @@ -5,7 +5,7 @@ use std::cell::RefCell; use std::convert::TryFrom; #[cfg(feature = "shortcodes")] -use crate::parser::shortcodes::NodeShortCode; +pub use crate::parser::shortcodes::NodeShortCode; pub use crate::parser::multiline_block_quote::NodeMultilineBlockQuote; From 42e7b2bafb4fd924a2dc3fc30b7e590e1371c28b Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Fri, 2 Feb 2024 09:17:34 -0800 Subject: [PATCH 3/3] Add missing docs to `NodeShortCode`. --- src/parser/shortcodes.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/parser/shortcodes.rs b/src/parser/shortcodes.rs index 0c46edce..1f3bb361 100644 --- a/src/parser/shortcodes.rs +++ b/src/parser/shortcodes.rs @@ -8,14 +8,17 @@ pub struct NodeShortCode( ); impl NodeShortCode { + /// Checks whether the input is a valid short code. pub fn is_valid(value: &str) -> bool { emojis::get_by_shortcode(value).is_some() } + /// Get the underlying shortcode. pub fn shortcode(&self) -> &str { &self.0 } + /// Get the emoji for this short code. pub fn emoji(&self) -> &'static str { emojis::get_by_shortcode(&self.0).unwrap().as_str() }