trentm / trentm/python-markdown2

[shadow] Escape non-ascii chars in urls

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.8k
Forks
459
Avg merge
2d 19h
Merged PRs (30d)
4

Description

_This is a _shadow issue* for Issue 31 on Google Code (from which this project was moved).
Added 2009-10-08T09:52:12.000Z by atregoub...@gmail.com.
Labels: Type-Defect, Priority-High.
Please make updates to the bug there.*

Original description

<b>What steps will reproduce the problem?</b>
1. import markdown2
2. markdown2.markdown(u'[link](http://example.com/тест)')

<b>What is the expected output? What do you see instead?</b>
now this produces following output: 
>>> u'<p><a href=&quot;http://example.com/\xd1\x82\xd0\xb5\xd1\x81\xd1\x82&quot;>link</a></p>\n'
it would be nice to see more standards compliant
>>> u'<p><a href=&quot;http://example.com/%D1%82%D0%B5%D1%81%D1%82&quot;>link</a></p>\n'

<b>What version of the product are you using? On what operating system?</b>
1.0.1.15 on ubuntu

<b>Please provide any additional information below.</b>
this can be done quite easily with urllib2.quote 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by importing markdown2 and rendering a link whose URL contains non-ASCII characters, such as http://example.com/тест. Compare the generated href with the expected percent-encoded URL; the work is done when the output uses standards-compliant URL escaping. The issue directs updates to the linked Google Code issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.