New Markdown editor replaces certain characters with HTML-safe entities

Issue #18623 new
K created an issue

The Markup/Markdown text of an issue-description placed in Bitbucket's built-in issue tracker (including this very one, that’s used for Bitbucket’s site itself) will load back for editing in a corrupted form if text contains characters such as greater-thans, less-thans, ampersands, single quotes, or double quotes. Submitting without making any changes in the text-box (for instance, just changing the issue-title) actually causes changes in the description because the reverse conversions do not occur, and the entity-codes are taken as literals. This causes further corruption on later edits because the new ‘&’s are then converted into &which is then (on next edit) converted to &, etc.

Browsers used:

  • Firefox 60.6.1esr
  • Chrome 73.0.3683.103
  • Firefox 67.0 (Quantum)
  • Chrome 64.0.3282.167

Operating systems used:

  • Windows 7 Enterprise
  • Windows 10 Enterprise

To reproduce:

  1. Using one of the above browsers, create a new issue using Bitbucket’s internal issue-tracker.
  2. Into the description, paste the contents of the attached markdown file.
  3. Save the issue.
  4. Return to the issue you just created and select “Edit”.
  5. Note that occurrences of the above-listed characters will appear in the editor itself as their HTML-entity representations e.g. '.
  6. (optional) Saving the document will result in these entities being saved literally, even if the user took no actions to change the description, but instead changed the issue-status, title, or other.

Comments (3)

  1. K reporter

    Note this may only affect issue-descriptions created with the old editor, (so step 1. may need to be “Choose to edit an issue in a Bitbucket repo which predates the recently-added WYSIWYG”) but regardless, I’m seeing this behavior consistently today within a private repo of mine and it’s already killing me.

  2. K reporter

    Here's a screencap from my end of what the editor shows when I go to alter one issue that's giving me problems.

    Yuck, right?

  3. K reporter

    Updated description with expanded list of affected browsers and operating systems. I suspected this was maybe just a weird legacy thing but apparently not.

    Also changed issue-category, since this is more about the Markdown editor than anything that happens specifically in the tracker.

    Fun fact: the problem described above actually affected my edit, and I had to manually revert a number of characters back to their non-munged versions before submitting, to avoid parts of it becoming less legible.

  4. Log in to comment