votingworks / vxsuite

https://voting.works
30 stars 5 forks source link

VxMark: Support VxDesign rich text in propositions #4895

Open arsalansufi opened 3 months ago

arsalansufi commented 3 months ago

While VxDesign HMPB ballot generation knows how to handle VxDesign rich text in propositions, the VxMarkScan UI does not. So you'll end up with funky looking prompts, where

{
  "@type": "BallotDefinition.LanguageString",
  "Language": "en",
  "Content": "Retain <b>Robert Demergue</b> as Chief Justice of the Supreme Court?"
},

is rendered as:

Retain ,Robert Demergue, as Chief Justice of the Supreme Court?

Related issue: https://github.com/votingworks/vxsuite/issues/4896

jonahkagan commented 1 month ago

Noting that in v3, I don’t think we ever supported markdown, just a limited subset of HTML.

For v4, with the new ballot rendering stack, I haven't yet built any support for rich text (though it will be quite easy to do), so we can decide what kind of markup language we want.

I would lean towards sticking with a limited subset of HTML, since that will give us the most flexibility in the long term.

jonahkagan commented 1 month ago

Also noting that I do think we need to implement this (rather than just work around the markup by stripping it, for example), since many ballot measures use the formatting to convey their meaning (e.g. striking through text that is being removed from a law)