Compare commits

..

4 Commits

Author SHA1 Message Date
Tom Alexander
ba15999534
Add a test showing we are not handling parenthesis in links properly.
Some checks failed
rust-test Build rust-test has failed
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
2023-09-21 14:31:13 -04:00
Tom Alexander
61c3e6c10e
Require table formulas have a value. 2023-09-21 14:12:18 -04:00
Tom Alexander
a7e130838d
Add a test showing that table formulas with no value do not get associated with the table. 2023-09-21 14:10:20 -04:00
Tom Alexander
853adadf91
Do not allow unescaped opening bracket in path for link. 2023-09-21 13:41:48 -04:00
7 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,4 @@
| Name | Value |
|------+-------|
| foo | bar |
#+tblfm:

View File

@ -0,0 +1 @@
https://en.wikipedia.org/wiki/Shebang_(Unix)

View File

@ -0,0 +1,7 @@
# Even though *exporting* honors the setting to require braces for subscript/superscript, the official org-mode parser still parses subscripts and superscripts.
#+OPTIONS: ^:{}
foo_this isn't a subscript when exported due to lack of braces (but its still a subscript during parsing)
bar_{this is a subscript}

View File

@ -2477,6 +2477,8 @@ fn compare_subscript<'s>(
Ok(_) => {} Ok(_) => {}
}; };
// TODO compare :use-brackets-p
Ok(DiffResult { Ok(DiffResult {
status: this_status, status: this_status,
name: emacs_name.to_owned(), name: emacs_name.to_owned(),
@ -2508,6 +2510,8 @@ fn compare_superscript<'s>(
Ok(_) => {} Ok(_) => {}
}; };
// TODO compare :use-brackets-p
Ok(DiffResult { Ok(DiffResult {
status: this_status, status: this_status,
name: emacs_name.to_owned(), name: emacs_name.to_owned(),

View File

@ -12,6 +12,7 @@ use nom::combinator::eof;
use nom::combinator::not; use nom::combinator::not;
use nom::combinator::peek; use nom::combinator::peek;
use nom::combinator::recognize; use nom::combinator::recognize;
use nom::combinator::verify;
use nom::multi::many_till; use nom::multi::many_till;
use nom::sequence::tuple; use nom::sequence::tuple;
@ -116,7 +117,9 @@ pub(crate) fn table_formula_keyword<'b, 'g, 'r, 's>(
_context: RefContext<'b, 'g, 'r, 's>, _context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>, input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Keyword<'s>> { ) -> Res<OrgSource<'s>, Keyword<'s>> {
filtered_keyword(table_formula_key)(input) verify(filtered_keyword(table_formula_key), |kw| {
!kw.value.is_empty()
})(input)
} }
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]

View File

@ -78,7 +78,7 @@ fn pathreg<'b, 'g, 'r, 's>(
) -> Res<OrgSource<'s>, OrgSource<'s>> { ) -> Res<OrgSource<'s>, OrgSource<'s>> {
let (remaining, path) = escaped( let (remaining, path) = escaped(
take_till1(|c| match c { take_till1(|c| match c {
'\\' | ']' => true, '\\' | '[' | ']' => true,
_ => false, _ => false,
}), }),
'\\', '\\',