open-learning-exchange / planet

🌍 Planet Learning - Angular application
https://hub.docker.com/r/treehouses/planet
GNU Affero General Public License v3.0
62 stars 39 forks source link

Markdown editor: Invalid link silently breaks text #5583

Open singharpita opened 4 years ago

singharpita commented 4 years ago

try to add any link and hit the submit button. but nothing is shown with console error Screenshot from 2020-01-21 09-05-01 Screenshot from 2020-01-21 09-05-08

paulbert commented 4 years ago

This is an invalid markdown link. The text is in the brackets and link is in parentheses.

Regardless, this error should be handled better with the markdown rejected in the form rather than submitted to the database.

I only see the error when (http://) is submitted, but there may be other invalid urls.

paulbert commented 4 years ago

It might be best to validate the markdown and throw an error that says "Please use valid link(s)".

The validation should match (http://) and any number of spaces between the parentheses and http://