Skip to content

fix: strip embedded markup before text conversion - #6751

Open
ump45nose wants to merge 1 commit into
1Panel-dev:v2from
ump45nose:fix/strip-embedded-markup-before-html
Open

fix: strip embedded markup before text conversion#6751
ump45nose wants to merge 1 commit into
1Panel-dev:v2from
ump45nose:fix/strip-embedded-markup-before-html

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

markdown_to_plain_text currently applies generic Markdown and HTML cleanup before removing MaxKB's embedded media and form markup. This means:

  • the optional closing-tag branch can remove only an <audio> or <video> opening tag and leave fallback content behind;
  • Markdown underscore handling rewrites <form_rander> before its JSON payload can be removed.

Those leftovers can reach downstream text-to-speech output.

Summary of your change

  • Remove paired audio/video markup, image tags, and form_rander payloads before generic Markdown/HTML conversion.
  • Require audio/video closing tags to match their corresponding opening tags.
  • Add focused regression coverage for audio fallback text, video fallback text, and form-render JSON.

Validation

  • Focused current-source smoke: PASS (audio, video, form-render, and existing Markdown conversion cases)
  • ruff check apps/common/utils/common.py apps/common/tests.py
  • ruff format --check apps/common/tests.py
  • git diff --check

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follows the Conventional Commits specification.
  • Considered the docs impact; no documentation changes are needed for this bug fix.

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.

1 participant