getodk / web-forms

ODK Web Forms enables form filling and submission editing of ODK forms in a web browser. It's coming soon! ✨
https://getodk.org
Apache License 2.0
10 stars 9 forks source link

Apply Markdown and HTML styling #62

Open lognaturel opened 8 months ago

lognaturel commented 8 months ago

Collect's implementation: https://github.com/getodk/collect/blob/e49eae16657d6677abde44e4475c1f08d3ccf9ae/collect_app/src/main/java/org/odk/collect/android/utilities/HtmlUtils.java#L23

Documentation: https://docs.getodk.org/form-styling/#markdown

Enketo allows disabling style: https://github.com/enketo/enketo/blob/37a7af1886743c7e20ddcb9f3b0f8708d184cd88/packages/enketo-transformer/README.md?plain=1#L85

Possible subtleties around using dynamic values in links: https://github.com/enketo/enketo/issues/804

Consider using https://github.com/remarkjs/remark

eyelidlessness commented 8 months ago

Possibly of interest, re: approaches to achieving a subset of Markdown: https://github.com/remarkjs/remark/issues/552

Depending on what we want to do with Markdown syntax we don’t support, it may be as simple as disallowing certain AST node types (as in, parse known-but-unsupported syntax and strip Markdown semantics from it), which Remark and/or related tools support directly. Or it might be more complex if we want to prevent use of certain Markdown features, preserving the actual syntax characters for those features as if they’re plain text. (The latter is likely more consistent with the existing reference implementation, but we might find we want to tweak the particulars of that depending on how we address it in the spec.)

lognaturel commented 2 months ago

@eyelidlessness here's a form: style-example.xlsx