Skip to content

fix: keep an inline <q> quotation in its sentence - #997

Merged
adbar merged 2 commits into
adbar:masterfrom
RavSinghChandan:inline-q-quotes
Oct 23, 2026
Merged

adbar merged 2 commits into
adbar:masterfrom
RavSinghChandan:inline-q-quotes

Conversation

@RavSinghChandan

@RavSinghChandan RavSinghChandan commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

<q> was converted like <blockquote>, to a block-level quote, so an inline quotation split its paragraph: <p>He said <q>hello there</q> loudly.</p> came out as He said hello there and loudly. in two paragraphs, and the quotation marks that browsers show were lost.

<q> is now unwrapped in convert_tags(), so the sentence stays in one piece in all output formats. <blockquote> and <pre> are unchanged, and the evaluation gate scores are the same. Added tests for a plain, a formatted and a nested quotation, and for marks the site already puts around the <q>.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (80e5340) to head (12223e8).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #997   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          21       21           
  Lines        4207     4261   +54     
=======================================
+ Hits         4205     4259   +54     
  Misses          2        2           

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

@adbar

adbar commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Keeping the quotation inline is right, the added marks don't work well though: many sites already put marks around <q>, so the output gets „“...”“ or "“...”". Also, the marks are English-only.

Could you drop them and just unwrap the element: strip_tags(tree, "q") ?
The tests would then check that the sentence stays in one paragraph.

@RavSinghChandan

Copy link
Copy Markdown
Contributor Author

Thanks, good point about the double marks and the language. Done: is now only unwrapped with strip_tags(tree, "q"), and the tests check that the sentence stays in one paragraph, including when the site already puts its own marks around the .

@adbar
adbar merged commit 3a4c80d into adbar:master Oct 23, 2026
15 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.

2 participants