react-crossword icon indicating copy to clipboard operation
react-crossword copied to clipboard

Rich text formatting of clues

Open 0jg opened this issue 3 years ago • 2 comments

If I pass through JSON with HTML elements e.g., <em>...</em>, it automatically gets converted to HTML entities \u003cem\u003e ... \u003c/em\u003e.

Can support for rich text formatting be added to a future release?

0jg avatar Jun 16 '22 19:06 0jg

Great idea! I'll have to think about what the "most natural" way to embed formatting in a clue would be... raw HTML doesn't seem very React-y, and is potentially risky/insecure... for the use-cases you're imagining, would Markdown support be enough? That would get you bold and italic, and other common kinds of formatting. In fact, are bold and italic the only things you really need? (I can maybe see a use-case for links, for something like "a video clue"... but multi-paragraph text, lists, etc., seem really unlikely to be needed.)

JaredReisinger avatar Dec 12 '22 21:12 JaredReisinger

Markdown also seems like a sensible approach! Italics are nice for names of things (eg, “This actor starred in the film In Bruges.”)

0jg avatar Dec 12 '22 22:12 0jg