diff --git a/org_mode_samples/affiliated_keyword/all_name.org b/org_mode_samples/affiliated_keyword/all_name.org new file mode 100644 index 0000000..1934c83 --- /dev/null +++ b/org_mode_samples/affiliated_keyword/all_name.org @@ -0,0 +1,17 @@ +#+name: foo +: bar + +#+source: foo +: bar + +#+tblname: foo +: bar + +#+resname: foo +: bar + +#+srcname: foo +: bar + +#+label: foo +: bar diff --git a/org_mode_samples/affiliated_keyword/tblname_on_non_table.org b/org_mode_samples/affiliated_keyword/tblname_on_non_table.org new file mode 100644 index 0000000..4c8a0e0 --- /dev/null +++ b/org_mode_samples/affiliated_keyword/tblname_on_non_table.org @@ -0,0 +1,2 @@ +#+tblname: foo +: bar diff --git a/org_mode_samples/greater_element/table/name.org b/org_mode_samples/greater_element/table/name.org new file mode 100644 index 0000000..b5d3a56 --- /dev/null +++ b/org_mode_samples/greater_element/table/name.org @@ -0,0 +1,2 @@ +#+NAME: foo +| foo | bar | diff --git a/src/parser/util.rs b/src/parser/util.rs index 02dcfc6..8d4ce02 100644 --- a/src/parser/util.rs +++ b/src/parser/util.rs @@ -280,7 +280,14 @@ pub(crate) fn indentation_level<'b, 'g, 'r, 's>( pub(crate) fn get_name<'s>(affiliated_keywords: &Vec>) -> Option<&'s str> { let name_keyword = affiliated_keywords .iter() - .filter(|kw| kw.key.eq_ignore_ascii_case("name")) + .filter(|kw| { + kw.key.eq_ignore_ascii_case("name") + || kw.key.eq_ignore_ascii_case("source") + || kw.key.eq_ignore_ascii_case("tblname") + || kw.key.eq_ignore_ascii_case("resname") + || kw.key.eq_ignore_ascii_case("srcname") + || kw.key.eq_ignore_ascii_case("label") + }) .last(); name_keyword.map(|kw| kw.value) }