krz/orgo

Lightning fast org-mode static site generator. fast go org-mode static-site-generator

Commit 2eac492d17

2eac492d17d6d5a1062e0cae8af31ad7c35dc76b

parent: f274b51656

Unregistered key

cmc <hello@cleberg.net> · 2026-08-23 05:13 UTC
committer: <noreply@github.com>

audit: entities are supported, not out of scope (#30)

`\alpha` renders as `&alpha;` in orgo exactly as in Emacs, from an entity table
generated out of org's own `org-entities`. The audit counted every use as
out-of-scope anyway, and `docs/guide/05-org-support.org` listed entities under
"Not supported, and what happens instead" as rendering to "Literal text" — while
the Supported section three tables above documented all 412 names, the
`\alphabet` boundary and `#+OPTIONS: e:nil`. The document contradicted itself.

`fixtures/audit-entities.org` joins the Emacs oracle, which reports 100%
agreement with 0 unexplained lines.

The out-of-scope fixture still reports 10 genuine gaps, so this narrows what the
audit calls a gap without blunting it.

Layout: unified · split

docs/guide/05-org-support.org −1
@@ -186,7 +186,6 @@ a build.
186186| Macros ={{{name}}}=, radio targets | Literal text. |
187187| Drawers other than =PROPERTIES= | Captured and dropped, including =LOGBOOK=. |
188188| Non-HTML export blocks | Dropped entirely. |
189| Entities =\alpha= | Literal text. |
190189| =#+TODO:= sequences | Not read; the default keyword set is used. |
191190| Planning lines, =: = fixed-width | Render as ordinary paragraphs. |
192191
src/audit.rs +3 −1
@@ -345,7 +345,9 @@ impl Audit {
345345 self.count(Scope::Out, "LaTeX fragment", at);
346346 }
347347 if entity_ref(line) {
348 self.count(Scope::Out, "entity (\\name)", at);
348 // Rendered, and rendered as org renders it: `\alpha` becomes `&alpha;` in
349 // both exporters. `fixtures/audit-entities.org` holds the oracle to that.
350 self.count(Scope::In, "entity (\\name)", at);
349351 }
350352 for (marker, name) in [
351353 ('*', "bold"),
tests/constructs.rs +10 −3
@@ -388,6 +388,7 @@ fn well_formed_fixtures_produce_no_diagnostics() {
388388 "timestamps.org",
389389 "images.org",
390390 "tblfm.org",
391 "audit-entities.org",
391392 ] {
392393 let document = parse_fixture(name);
393394 assert!(
@@ -792,13 +793,19 @@ fn audit_ignores_backslashes_that_are_not_entities() {
792793 );
793794}
794795
795/// A bare entity outside verbatim still counts.
796/// A bare entity outside verbatim still counts, and counts as supported: `\alpha`
797/// becomes `&alpha;` in orgo exactly as in Emacs, which the oracle checks on this same
798/// fixture. The 412 names come from org's own `org-entities`.
796799#[test]
797800fn audit_counts_real_entities() {
798801 let report = audit_fixture("audit-entities.org");
802 let line = report
803 .lines()
804 .find(|l| l.contains("entity (\\name)"))
805 .expect("a real entity is counted");
799806 assert!(
800 report.contains("entity (\\name)"),
801 "a real entity was not counted:\n{report}"
807 line.starts_with("IN "),
808 "an entity orgo renders exactly as Emacs does must not read as a gap:\n{line}"
802809 );
803810}
804811
tests/oracle.rs +1
@@ -629,6 +629,7 @@ fn every_divergence_from_emacs_is_deliberate() {
629629 "images.org",
630630 "elements.org",
631631 "tblfm.org",
632 "audit-entities.org",
632633 ];
633634 let mut offenders = Vec::new();
634635 for fixture in fixtures {