Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Fix: special string.replace sequences in Markdown #153

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

eyelidlessness
Copy link
Contributor

Closes enketo/enketo#777. Also closes #110, as this incorporates the change I proposed there and adds a test for the fix.

Copy link
Contributor

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspected this had nothing to do with itext translations so I verified the same issue is reproducible with the text being a direct child of label:

<label>*$' is $` this $&amp; the $$ real $0 $&lt;life&gt;?*</label>

Indeed, it's reproducible. I modified the test to verify that's also getting fixed correctly and it is.

There is a loss of functionality here: someone might deliberately be including HTML entities in markdown. However, HTML entities are not supported outside of markdown so I think it's fair to call this accidental functionality.

(Side note: I do think we should consider supporting sanitized HTML at some point to match Collect.)

@lognaturel lognaturel merged commit 8de64b5 into enketo:master Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Special regex replacement sequences inside display text cause performance issues and transformation errors
2 participants