Skip to content

fix(python,ruby): stop escaping the README getting started guide - #2100

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/readme-getting-started-escaping
Oct 17, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/readme-getting-started-escaping

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

The Python and Ruby README templates rendered the getting-started guide with {{ sdk.gettingStarted|raw|trim }}. trim runs after raw, so its output loses the safe marking and Twig HTML-escapes it. Every fenced example in those READMEs showed ', <REGION> and => instead of real code, so nothing could be copied (reported by Hansi on appwrite/sdk-for-python#165, appwrite/sdk-for-ruby#80 and appwrite/sdk-for-console-python#20). Every other template already uses |trim|raw; this switches the two templates to match.

Test Plan

  • New testReadmeRendersTheGuideVerbatim in the Generation suite renders a guide and examples containing quotes, angle brackets, & and => for every README-producing language and checks README.md (and example/README.md where generated) contains it verbatim. Without the fix it fails for ruby and python only; with it all 17 pass.
  • vendor/bin/phpunit --testsuite Generation, composer lint-twig, composer refactor:check, composer lint, max-line-length.sh . 1200 "*.twig"
  • Regenerated python and ruby server: no HTML entities left in either README

Related PRs and Issues

Closes #2102

@hansi-codes

hansi-codes Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The filter order fixes the escaping behavior and the new generation test covers verbatim guide rendering.

Python and Ruby README templates now trim getting-started Markdown before marking it raw, preserving Markdown syntax in generated READMEs. The generation suite adds coverage checking that guide content is rendered verbatim across README outputs.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
templates/python/README.md.twig Reorders the getting-started filters so the trimmed guide is marked raw.
templates/ruby/README.md.twig Reorders the getting-started filters so the trimmed guide is marked raw.
tests/generation/GenerationTest.php Adds a generation test asserting guide text is preserved in README outputs.

Reviewed 2d9b2ee · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 17, 2026
@ChiragAgg5k
ChiragAgg5k merged commit b84f1b8 into main Oct 17, 2026
61 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/readme-getting-started-escaping branch October 17, 2026 17:37
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.

Stop escaping the README getting started guide in Python and Ruby

1 participant