Support different cases in radio links.

This commit is contained in:
Tom Alexander 2023-09-14 04:04:21 -04:00
parent 66d16d89ed
commit ca6fdf1924
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,3 @@
<<<Foo Bar Baz>>>
foo bar baz

View File

@ -0,0 +1,6 @@
<<<foo bar baz>>>
foo
bar
baz

View File

@ -1,6 +1,6 @@
use nom::branch::alt; use nom::branch::alt;
use nom::bytes::complete::is_not; use nom::bytes::complete::is_not;
use nom::bytes::complete::tag; use nom::bytes::complete::tag_no_case;
use nom::character::complete::anychar; use nom::character::complete::anychar;
use nom::character::complete::line_ending; use nom::character::complete::line_ending;
use nom::character::complete::one_of; use nom::character::complete::one_of;
@ -91,7 +91,7 @@ impl<'x> RematchObject<'x> for PlainText<'x> {
let is_not_whitespace = is_not::<&str, &str, CustomError<_>>(" \t\r\n")(goal); let is_not_whitespace = is_not::<&str, &str, CustomError<_>>(" \t\r\n")(goal);
match is_not_whitespace { match is_not_whitespace {
Ok((new_goal, payload)) => { Ok((new_goal, payload)) => {
let (new_remaining, _) = tag(payload)(remaining)?; let (new_remaining, _) = tag_no_case(payload)(remaining)?;
remaining = new_remaining; remaining = new_remaining;
goal = new_goal; goal = new_goal;
continue; continue;