Skip to content

fix: return markdown lexicon errors - #139

Merged
jmeridth merged 1 commit into
gemaraproj:mainfrom
vansh-nagar:fix/markdown-lexicon-errors
Oct 5, 2026
Merged

jmeridth merged 1 commit into
gemaraproj:mainfrom
vansh-nagar:fix/markdown-lexicon-errors

Conversation

@vansh-nagar

Copy link
Copy Markdown
Contributor

Closes #45.

Replaces the unknown-term panic with an error and carries that error through the lexicon linker into Go templates, where rendering already returns execution errors. Adds a regression test for the unknown-term path and updates the linker tests for the error-returning signature.

Test: go test ./gemaraconv/markdown/...

Signed-off-by: vansh-nagar <vansh.nagar.dev@gmail.com>
@vansh-nagar
vansh-nagar requested a review from a team as a code owner October 3, 2026 10:01
@github-actions github-actions Bot added the fix label Oct 3, 2026

@jmeridth jmeridth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 (summary) Approving. Routing the error through the template FuncMap is a clean way to do this: text/template stops execution when a func returns a non-nil error, and render already wraps and returns it, so the panic is gone without changing output for valid inputs. The regression test for the unknown-term path is a good addition. Thanks for picking up #45. (AI review, model: claude-opus-5-5.)

@jmeridth
jmeridth merged commit 308f253 into gemaraproj:main Oct 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in markdown generation

2 participants