Skip to content

Add conversion support for <q> tags - #217

Merged
chrispy-snps merged 2 commits into
matthewwithanm:developfrom
colinrobinsonuib:patch-1
Apr 28, 2025
Merged

chrispy-snps merged 2 commits into
matthewwithanm:developfrom
colinrobinsonuib:patch-1

Conversation

@colinrobinsonuib

Copy link
Copy Markdown
Contributor

From this issue: #216

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/q

HTML that looks like this:

Here is <q>A Quote</q> from someone.

should be rendered as:

Here is “A Quote“ from someone.

Technically, the quotes rendered from <q> are dependent on the browser lang attribute

https://developer.mozilla.org/en-US/docs/Web/CSS/quotes#specifications

<ul>
  <li lang="fr">
    <q>Ceci est une citation française.</q>
  </li>
  <li lang="de">
    <q>Dies ist ein deutsches Zitat</q>
  </li>
  <li lang="en">
    <q>This is an English quote.</q>
  </li>
</ul>
- «Ceci est une citation française.»
- „Dies ist ein deutsches Zitat“
- “This is an English quote.”

But this PR uses simple straight quotes

@chrispy-snps

Copy link
Copy Markdown
Collaborator

Thank you @colinrobinsonuib! Can you please also add a unit test in tests/test_conversions.py?

@chrispy-snps chrispy-snps changed the title Add converter for q elements Add conversion support for <q> tags Apr 28, 2025
@chrispy-snps
chrispy-snps merged commit 0e1a849 into matthewwithanm:develop Apr 28, 2025
@chrispy-snps

Copy link
Copy Markdown
Collaborator

Thank you for your contribution @colinrobinsonuib!

Wuhall pushed a commit to Wuhall/python-markdownify that referenced this pull request May 21, 2025
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