Skip to content

fix: escape quotes and backslashes in field descriptions - #197

Merged
apaleyes merged 2 commits into
pasteurlabs:mainfrom
singhharsh1708:fix/description-escaping
Nov 3, 2026
Merged

apaleyes merged 2 commits into
pasteurlabs:mainfrom
singhharsh1708:fix/description-escaping

Conversation

@singhharsh1708

Copy link
Copy Markdown
Contributor

Relevant issue or PR

Follows #128, which added multiline descriptions.

Description of changes

The multiline macro wraps each description line in "..." without escaping it, so a description with a double quote gives an app that does not compile (SyntaxError ... "The "a" coefficient",), and a backslash is mangled (\theta becomes a tab and "heta") or breaks it (\x). The macro now escapes backslashes and double quotes.

String defaults and titles with " break the same way; this PR only covers descriptions.

Testing done

  • A Tesseract with description='The "a" coefficient' and one with a backslash: the generated app fails to parse on main and compiles here, with the help text unchanged.
  • New test fails on main and passes here; tests/test_parse.py passes.

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.64%. Comparing base (4bc4581) to head (6b0db06).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #197   +/-   ##
=======================================
  Coverage   86.64%   86.64%           
=======================================
  Files           5        5           
  Lines         322      322           
  Branches       36       36           
=======================================
  Hits          279      279           
  Misses         39       39           
  Partials        4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@apaleyes apaleyes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks @singhharsh1708 ! one thing to clarify below

Comment thread tests/test_parse.py Resolved
@apaleyes
apaleyes enabled auto-merge (squash) November 3, 2026 18:55
@apaleyes
apaleyes merged commit b733a89 into pasteurlabs:main Nov 3, 2026
11 checks passed
@pasteurlabs pasteurlabs locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants