OpenWaterFoundation / owf-app-viz-demo-ng

Open Water Foundation application to test different visualizations in Angular
0 stars 0 forks source link

Showdown is not handling some characters nicely #25

Open smalers opened 3 years ago

smalers commented 3 years ago

The Poudre Basin Information website has been updated to have a License file. However, the Markdown containing < and > characters at the end is not being converted properly. Maybe there are other characters that it is also not handling.

Need to figure this out because anything in a tick section should pass through literally.

Need to make Josh aware of the solution so that he can incorporate into the InfoMapper.

gsofia23 commented 3 years ago

Angle brackets within code blocks in particular get escaped. Therefore < becomes $lt and > becomes &gt when rendering markdown with ShowdownJS. The solution for this is to wrap code blocks with a <pre></pre> tag otherwise code segments may not be generated as expected.

See this issue below: https://github.com/showdownjs/showdown/issues/400

Helpful link to display behavior: https://johnmacfarlane.net/babelmark2/?text=%60%60%60%0A%3Chtml%3E%3C%2Fhtml%3E%0A%60%60%60

A demonstration of this behavior has been added to the cleaned up showdown demo's in app1.