From 876d33239e5d16b26a7b710b9c3b4bb4347b2fd1 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 14 Sep 2023 02:58:57 -0400 Subject: [PATCH] Allow any character to be escaped in the path for links. --- org_mode_samples/object/regular_link/elisp.org | 1 + src/compare/diff.rs | 2 ++ src/parser/regular_link.rs | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 org_mode_samples/object/regular_link/elisp.org diff --git a/org_mode_samples/object/regular_link/elisp.org b/org_mode_samples/object/regular_link/elisp.org new file mode 100644 index 0000000..1b41cd1 --- /dev/null +++ b/org_mode_samples/object/regular_link/elisp.org @@ -0,0 +1 @@ +[[elisp:(local-set-key "\M-\x" 'foo-bar-baz)]] diff --git a/src/compare/diff.rs b/src/compare/diff.rs index c21db5f..1dc4bd3 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1926,6 +1926,8 @@ fn compare_regular_link<'s>( Ok(_) => {} }; + // TODO: Compare :type :path :format :raw-link :application :search-option + Ok(DiffResult { status: this_status, name: emacs_name.to_owned(), diff --git a/src/parser/regular_link.rs b/src/parser/regular_link.rs index 847b915..19796ad 100644 --- a/src/parser/regular_link.rs +++ b/src/parser/regular_link.rs @@ -2,7 +2,7 @@ use nom::branch::alt; use nom::bytes::complete::escaped; use nom::bytes::complete::tag; use nom::bytes::complete::take_till1; -use nom::character::complete::one_of; +use nom::character::complete::anychar; use nom::combinator::verify; use nom::multi::many_till; @@ -82,7 +82,7 @@ fn pathreg<'b, 'g, 'r, 's>( _ => false, }), '\\', - one_of(r#"]"#), + anychar, )(input)?; Ok((remaining, path)) }