New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

team description visibly corrupts write-up with "<" and ">" characters upon re-edit #778

Closed
DreadPirateShawn opened this Issue Oct 17, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@DreadPirateShawn
Copy link

DreadPirateShawn commented Oct 17, 2015

Unfortunately caused by the fix for #700 ... same repro steps, but now attempting to write "less than 50% hp" as <50% hp will change to &lt;50% hp when attempting to re-edit the description after the first save.

This continues indefinitely -- eg, &lt;50% hp (corrupted by the first save) changes to &amp;lt;50% hp upon the next edit, and so on. Same with &, it'll change to &amp; then &amp;amp; then &amp;amp;amp; etc on each edit/save sequence.

(For what it's worth, this doesn't really seem like an "arbitrary HTML into team descriptions" issue -- these are symbols used in general English. Well, & is -- the > and < are admittedly less common, but definitely topically relevant to PAD teams, when discussing things like hp thresholds.)

Seems like the description might just need to be unescaped upon entering edit mode? Or perhaps disallow using those characters entirely (eg popup on save or some such) -- the feature is hardly vital, but text corruption seems a lot more frustrating than text restrictions (which can be worked around if known).

@madcowfred madcowfred closed this Jan 1, 2016

@madcowfred

This comment has been minimized.

Copy link
Owner

madcowfred commented Jan 1, 2016

Should be fixed properly now - I can make teams with < and > in names/descriptions and things work.

@DreadPirateShawn

This comment has been minimized.

Copy link

DreadPirateShawn commented Jan 1, 2016

Confirmed, many thanks!! I can now mention "I&I" in my description, edit and save and re-edit without corruption.

(Note for posterity -- this may require minor user cleanup, possibly tied to any such special characters that were used between the fix for #700 and the fix for this ticket. That is, for my OLD descriptions that include >, the very first edit now shows them uncorrupted, but for my semi-recent descriptions that include >, the very first edit shows &gt; but after fixing them once, then they remain uncorrupted. Probably not worth tinkering with the logic further, since it looks stable going forward, but keep that angle in mind if any other tickets are filed.)

@madcowfred

This comment has been minimized.

Copy link
Owner

madcowfred commented Jan 2, 2016

I maybe made this a bit worse by managing to replace > with < just now :( There's now 233 teams with the wrong sign instead of >, ugh.

@DreadPirateShawn

This comment has been minimized.

Copy link

DreadPirateShawn commented Jan 2, 2016

Ooof. :-/ Done stuff like that before myself.

One option is to make it clear that the sign needs to be audited now -- like replace < with <>, something that is obviously "weird".

For descriptions which used it as a "A then B" indicator, there's no real harm -- eg "pop Urd <> Shiva = OKHO" is odd but fine. But for descriptions which use > as a threshold indicator -- "don't leave boss >20%" -- an obviously bogus sign is much better than a quietly unreliable sign.

Sure, there'll be some splash damage -- presumably such an approach would also affect > symbols that were never problematic to begin with -- but the worst-case severity is lessened this way, no users encounter a sign that completely lies.

@madcowfred

This comment has been minimized.

Copy link
Owner

madcowfred commented Jan 2, 2016

Replaced < with ?<>?, that'll confuse people enough to fix it. Probably. Thanks for the idea :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment