hey-red / Markdown

Open source C# implementation of Markdown processor, as featured on Stack Overflow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URL encoding

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Add a hyperlink to 
'http://docs.jquery.com/Tutorials:Introducing_$(document).ready()'

What is the expected output? What do you see instead?
A link to be produced, but it's not parsed.

The link isn't URL encoded which is the issue.

Original issue reported on code.google.com by mrshrink...@gmail.com on 17 Jan 2010 at 9:33

When you say add link can you clarify what you mean in markup? There are about 5
different ways.. 

here's one example:

----------------------------------------------------
Here's a [link to JQuery docs][1].

[1]: http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
----------------------------------------------------

resulting markup seems OK to me--

http://is.gd/6uc9G

Original comment by wump...@gmail.com on 18 Jan 2010 at 3:37

Here's the original markdown I was using stackoverflow.com:
<pre>

    $(function(){

    }); 



is [jQuery][1] (a Javascript library) shorthand for:

    $(document).ready(function(){

    });


It is what you use to do with `<body onload="xxx">` but more sophisticated. You 
can 
get a fuller explanation [here][2].


  [1]: http://www.jquery.com
  [2]: http://docs.jquery.com/Tutorials:Introducing_$(document).ready()

</pre>

Original comment by mrshrink...@gmail.com on 18 Jan 2010 at 10:17

(Not including the pre tags)

Original comment by mrshrink...@gmail.com on 18 Jan 2010 at 10:18

Sorry - I should've tested this with the solution not just on 
stackoverflow.com. It 
links correctly with the latest release so it's an SO related issue. Another 
one to 
close

Original comment by mrshrink...@gmail.com on 18 Jan 2010 at 10:38

I don't think the URL sanitizer allows $ in the URLs, and will strip them out.

But yes it would be helpful if you TESTED the bug reports before making them.

Original comment by wump...@gmail.com on 18 Jan 2010 at 3:45

  • Changed state: Invalid
Note that I did modify the list of encoded characters if 
EncodeProblemUrlCharacters
(optional) is set -- I added $ and "

This is set on SO..

Original comment by wump...@gmail.com on 19 Jan 2010 at 2:24