Skip to content

Escape parentheses in URLs#270

Closed
oxygen-dioxide wants to merge 1 commit into
matthewwithanm:developfrom
oxygen-dioxide:urlparentheses
Closed

Escape parentheses in URLs#270
oxygen-dioxide wants to merge 1 commit into
matthewwithanm:developfrom
oxygen-dioxide:urlparentheses

Conversation

@oxygen-dioxide

Copy link
Copy Markdown

Problem: Links containing ( or ) characters in the URL produce broken Markdown.

Example

<a href="http://en.wiktionary.org/wiki/)">) on wiktionary</a><br/><a href="http://en.wiktionary.org/wiki/(">( on wiktionary</a>

How to test

from markdownify import markdownify as md
print(md('<a href="http://en.wiktionary.org/wiki/)">")" on wiktionary</a><br/><a href="http://en.wiktionary.org/wiki/(">"(" on wiktionary</a>'))

Old behaviour (incorrect):

[")" on wiktionary](http://en.wiktionary.org/wiki/))
["(" on wiktionary](http://en.wiktionary.org/wiki/()

New behaviour (correct):

[")" on wiktionary](http://en.wiktionary.org/wiki/%29)
["(" on wiktionary](http://en.wiktionary.org/wiki/%28)

@oxygen-dioxide

Copy link
Copy Markdown
Author

Already done in #262

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