You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to mention a few edge cases I found involving headlines that don't have a space after the stars. Per the spec, none of these are headlines.
The first two are treated as headlines by org-element, but not org-agenda tags, org mode font lock, or orgize.
The second two are treated as headlines by org-element and orgize, but not org mode font lock.
It's fine if you want to just close this -- I'm not even entirely sure what the correct behavior should be. I just wanted to mention it since I found it when testing something. I could also send a PR for adding a errata/quirks documentation if you like.
fn main() {
// Org mode: Treats it as not a headline (both font lock and agenda tag view)
// Orgize 0.8.3: Not a headline
// (with-temp-buffer (insert "*a\n")(org-element-parse-buffer (point-max))) --> title "a", level 1
let org = orgize::Org::parse("*a :foo:\n");
assert_eq!(0, org.headlines().count());
// Org mode: Treats it as not a headline (both font lock and agenda tag view)
// Orgize 0.8.3: Not a headline
// (with-temp-buffer (insert "*a")(org-element-parse-buffer (point-max))) --> title "a", level 1
let org = orgize::Org::parse("*a :foo:");
assert_eq!(0, org.headlines().count());
// Org mode: Treats it as not a headline (font lock)
// Orgize 0.8.3: Headline with level 3 and title ""
// (with-temp-buffer (insert "***")(org-element-parse-buffer (point-max))) --> title "", level 3
let org = orgize::Org::parse("***");
assert_eq!(1, org.headlines().count());
assert_eq!(3, org.headlines().next().unwrap().level());
assert_eq!("", org.headlines().next().unwrap().title(&org).raw);
// Org mode: Treats it as not a headline (font lock)
// Orgize 0.8.3: Headline with level 1 and title ""
// (with-temp-buffer (insert "*\n")(org-element-parse-buffer (point-max))) --> title "", level 1
let org = orgize::Org::parse("*\n");
assert_eq!(1, org.headlines().count());
assert_eq!(1, org.headlines().next().unwrap().level());
assert_eq!("", org.headlines().next().unwrap().title(&org).raw);
}
The text was updated successfully, but these errors were encountered:
I wanted to mention a few edge cases I found involving headlines that don't have a space after the stars. Per the spec, none of these are headlines.
The first two are treated as headlines by org-element, but not org-agenda tags, org mode font lock, or orgize.
The second two are treated as headlines by org-element and orgize, but not org mode font lock.
It's fine if you want to just close this -- I'm not even entirely sure what the correct behavior should be. I just wanted to mention it since I found it when testing something. I could also send a PR for adding a errata/quirks documentation if you like.
The text was updated successfully, but these errors were encountered: