aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 15:30:33 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 15:30:33 +0200
commitafe75b0508cedba1df5c9701a22e5732c7d0d00e (patch)
tree69b40ae77082d5e300e7320ba0ab08a2fb522380 /src/construct
parent645fb2b02b1563bd98c07515bdc2d6d8478ba74e (diff)
downloadmarkdown-rs-afe75b0508cedba1df5c9701a22e5732c7d0d00e.tar.gz
markdown-rs-afe75b0508cedba1df5c9701a22e5732c7d0d00e.tar.bz2
markdown-rs-afe75b0508cedba1df5c9701a22e5732c7d0d00e.zip
Add more tests for whitespace in jsx tags
Diffstat (limited to '')
-rw-r--r--src/construct/partial_mdx_jsx.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/construct/partial_mdx_jsx.rs b/src/construct/partial_mdx_jsx.rs
index 1bf6fc2..e654416 100644
--- a/src/construct/partial_mdx_jsx.rs
+++ b/src/construct/partial_mdx_jsx.rs
@@ -1104,20 +1104,12 @@ pub fn es_whitespace_eol_after(tokenizer: &mut Tokenizer) -> State {
/// Check if a character can start a JSX identifier.
fn id_start_opt(code: Option<char>) -> bool {
- if let Some(char) = code {
- id_start(char)
- } else {
- false
- }
+ code.map_or(false, id_start)
}
/// Check if a character can continue a JSX identifier.
fn id_cont_opt(code: Option<char>) -> bool {
- if let Some(char) = code {
- id_cont(char, true)
- } else {
- false
- }
+ code.map_or(false, |c| id_cont(c, true))
}
/// Crash because something happened `at`, with info on what was `expect`ed