Skip to content

fix: apply escape flag to a user-supplied HTML renderer - #471

Merged
lepture merged 1 commit into
lepture:mainfrom
Sanjays2402:fix/create-markdown-escape-custom-renderer
Jul 25, 2026
Merged

fix: apply escape flag to a user-supplied HTML renderer#471
lepture merged 1 commit into
lepture:mainfrom
Sanjays2402:fix/create-markdown-escape-custom-renderer

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Closes #420

create_markdown() only passed escape to the renderer it constructed itself, so create_markdown(renderer=MyRenderer(), escape=False) silently kept escaping HTML.

escape now defaults to None ("keep the renderer's own setting") and an explicit True/False is applied to a supplied HTMLRenderer instance too. Existing calls are unaffected: the default renderer still escapes by default.

create_markdown() only passed the escape flag to the renderer it built
itself, so passing escape=False together with a custom HTMLRenderer
subclass silently left HTML escaped.

escape now defaults to None, meaning 'keep the renderer's own setting',
and an explicit True/False is applied to a supplied HTMLRenderer
instance as well.

Closes lepture#420
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.18%. Comparing base (b5dd994) to head (1209f34).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #471   +/-   ##
=======================================
  Coverage   91.18%   91.18%           
=======================================
  Files          36       36           
  Lines        3629     3631    +2     
  Branches      676      677    +1     
=======================================
+ Hits         3309     3311    +2     
  Misses        193      193           
  Partials      127      127           

☔ 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.

@lepture
lepture merged commit 75cab78 into lepture:main Jul 25, 2026
10 checks 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.

escape flag in create_markdown is ignored when using a custom renderer – must be set manually

2 participants