maryvilledev / codesplainUI

Web app for breaking down and annotating Python 3 source code.
https://www.codesplain.io
GNU General Public License v3.0
2 stars 2 forks source link

Apostrophes in snippet title cause URL routing to fail #422

Closed thebho closed 7 years ago

thebho commented 7 years ago

Expected Behavior

I should be able to add a snippet with a title Brian's Python Example and the backend should covert the title to a URL friendly key. This was happening in previous releases, the title Brian's Python Examples is saved as https://dev.codesplain.io/thebho/brian's_python_examples.

Current Behavior

In dev we now get https://dev.codesplain.io/thebho/brian%27s_python_copycat when using the title: Brian's Python Copycat and that URL redirects back to the homepage. There is a snippet saved with that key.

Steps to Reproduce (for bugs)

  1. Create a new snippet with a title containing an apostrophe
  2. Save that snippet
  3. Reload the page

Possible Solution

Trim the apostrophe before doing the url_lib.quote conversion in the lambda Do a find and replace with a - Add a UI workaround