python-mapswipe-workers icon indicating copy to clipboard operation
python-mapswipe-workers copied to clipboard

Prevent input of HTML tags in project description

Open laurentS opened this issue 2 years ago • 2 comments

image

It's possible to input HTML tags in a project description, which leads to buggy looking text in the app. The input field in the managers dashboard could filter for those, and show a little cheatsheet under the field with common markdown equivalents to help managers correct the invalid values. For instance:

Instead of HTML tags, use markdown like this:
<b>bold text</b>  => **bold text**
etc...

As a super basic mockup:

image

laurentS avatar Jan 05 '23 09:01 laurentS

What are the options for reworking how styling works? It's not always super apparent. Right now I think you can add \n\n for a new line but it's not possible to get it to render a blank line? Being able to use some basic html tags could be helpful. For example, in ODK you can change the color and font family of text using the style attribute on a span tag. Also, rather than filtering out certain string like html tags, maybe some sort of preview box would be more helpful.

danbjoseph avatar Jan 05 '23 20:01 danbjoseph

That sounds like a reasonable approach to me. The app currently uses this package to render markdown, which hasn't been updated in 5 years. We actually use our own fork of the repo, maybe it's time to re-evaluate what options are available.

About your comment regarding \n\n, it looks like the examples suggest {'\n\n'}, maybe worth trying it out?

And I like the preview box, the only constraint being that it should use the same rendering logic as the app, otherwise it will be misleading more often than not.

laurentS avatar Jan 06 '23 14:01 laurentS