sartography / spiff-arena

SpiffWorkflow is a software development platform for building, running, and monitoring executable diagrams
https://www.spiffworkflow.org/
GNU Lesser General Public License v2.1
61 stars 41 forks source link

URL with dashes when sanitized #1751

Open madhurrya opened 2 months ago

madhurrya commented 2 months ago

When a url contains dashes, it shows like this in the markdown and the url doesn't work anymore. https://www.aihr.com/blog/learning-and-development/ >> https://www.aihr.com/blog/learning\-and\-development/

You can check with this model https://dev.app.spiff.status.im/process-models/misc:qa:test-how-greater-than-and-less-than-signs-display

Image

jasquat commented 2 months ago

We could remove hyphens from the sanitization. It looks like they are only used in table context for columns https://www.markdownguide.org/extended-syntax/#tables. We could only escape 3 or more hyphens.

dinithihj commented 2 months ago

Also noticed URLs with = and + are also not working as expected

https://www.google.com/search?q=special+characters >> https://www.google.com/search?q\=special\+characters image

jasquat commented 2 months ago

So = only matters when on a line by itself. We could leave it out or escape \n=\n. Some processors may allow for == string == to highlight strings but ours does not appear to allow that so we may be able to ignore it for now.

+ are used for bulleted lists so we may be able to remove them from the list for now.

https://www.markdownguide.org/basic-syntax/

madhurrya commented 2 months ago

Noticed the same with the underscore also. image

jasquat commented 2 months ago

That's really annoying. It seems like you don't need to escape it when in a url however, we have no way of knowing context. maybe s/(https?:[^ ]+)\\_/\1_/g after the initial search and replace?

Or maybe [^\w]_+. That may do it. It seems like underscores for formatting have to start with underscore without preceding non-whitespace / non-special characters.