Skip to content

Parse conditions before substituting values - #88

Merged
Gubarz merged 1 commit into
cheatmd-dev:mainfrom
echo8134:fix/condition-parsing
Oct 13, 2026
Merged

Gubarz merged 1 commit into
cheatmd-dev:mainfrom
echo8134:fix/condition-parsing

Conversation

@echo8134

Copy link
Copy Markdown
Contributor

Summary

Nested conditions produced conjunctions that the evaluator did not parse. Substituted operator text could also change the comparison. Split conjunctions and identify comparison operators in the template before substituting operands. Preserve existing whitespace rules.

Related issues

No linked issue.

Verification

Regression tests cover conjunctions and values containing operators. Three branch cases also pass through the built headless CLI.

Local checks passed on Go 1.27.1. The CI workflow uses Go 1.26.3.

Checklist

  • go build ./... and go test ./... pass
  • gofmt -l . and go vet ./... are clean
  • Added regression tests for the changed behavior
  • cheatmd --lint examples/ passes
  • Docs/wiki changes are not needed for this fix

@Gubarz
Gubarz marked this pull request as ready for review October 13, 2026 04:16
@Gubarz
Gubarz merged commit 61c39a4 into cheatmd-dev:main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants