Repository: matthewwithanm/python-markdownify

Issue:
Inline Quotation element ignored
Html that looks like this:

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

should be rendered as:

```
Here is “A Quote“ from someone.
```

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

Solution:

```python
def convert_q(self, el, text, parent_tags):
    return '“' + text + '“'
```

Hints from issue comments:
@chrispy-snps: @colinrobinsonuib - good catch! We should probably use straight ASCII quotes for wider compatibility with downstream flows.

Are you interested in opening a pull request and officially becoming a contributor?@colinrobinsonuib: Sure https://github.com/matthewwithanm/python-markdownify/pull/217

Solution patch:
diff --git a/markdownify/__init__.py b/markdownify/__init__.py
index 780761c..a43f3a7 100644
--- a/markdownify/__init__.py
+++ b/markdownify/__init__.py
@@ -650,6 +650,9 @@ def convert_pre(self, el, text, parent_tags):
 
         return '\n\n```%s\n%s\n```\n\n' % (code_language, text)
 
+    def convert_q(self, el, text, parent_tags):
+        return '"' + text + '"'
+
     def convert_script(self, el, text, parent_tags):
         return ''
 


Test patch:
diff --git a/tests/test_conversions.py b/tests/test_conversions.py
index 27951ee..6145411 100644
--- a/tests/test_conversions.py
+++ b/tests/test_conversions.py
@@ -305,6 +305,11 @@ def test_pre():
     assert md("<p>foo</p>\n<pre>bar</pre>\n</p>baz</p>", sub_symbol="^") == "\n\nfoo\n\n```\nbar\n```\n\nbaz"
 
 
+def test_q():
+    assert md('foo <q>quote</q> bar') == 'foo "quote" bar'
+    assert md('foo <q cite="https://example.com">quote</q> bar') == 'foo "quote" bar'
+
+
 def test_script():
     assert md('foo <script>var foo=42;</script> bar') == 'foo  bar'