Closed rogueai closed 3 weeks ago
hello, I just published v0.10.0-alpha.10 to crates.io. This version adds control over sub/superscript parsing via the use_sub_superscript
field in ParseConfig
:
use orgize::{config::UseSubSuperscript, Org, ParseConfig};
let org = ParseConfig {
use_sub_superscript: UseSubSuperscript::Brace,
..Default::default()
}
.parse("a_b, a_{b}");
assert_eq!(
org.to_html(),
"<main><section><p>a_b, a<sub>b</sub></p></section></main>"
);
let org = ParseConfig {
use_sub_superscript: UseSubSuperscript::Nil,
..Default::default()
}
.parse("a_b, a_{b}");
assert_eq!(
org.to_html(),
"<main><section><p>a_b, a_{b}</p></section></main>"
);
Hi, first of all thanks for your library, it's definitely one of the most comprehensive parsers for org, and the ast traverser makes it extremely easy to write custom exporters!
I have a question about subscripts and superscripts: in my org config I've set the subscripts to only accept the
{}
notation with:that means only
a_{b}
will be exported as subscript and nota_b
, and the same applies for superscripts.Is there a way to configure orgize to do the same, or is it something that would need to be implemented on your side?
Thanks!