wordpress-mobile / wordpress-mobile/AztecEditor-iOS

Generated HTML for edited links containing multibyte characters is weird.

Open
#856 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Bug
Dominant language
Swift
Stars
669
Forks
153
Avg merge
11h 27m
Merged PRs (30d)
4

Description

This is another side-effect of the underlying bug behind #853. #854 improves how the editor behaves when tapping on the "link" button in the toolbar, but the output HTML stills isn't great.

Expected behavior

After creating a link containing multibyte characters and then editing it, there's only one <a> element in the HTML output:

<a href="https://example.com">❤️ test 👍</a>
Actual behavior

Multiple <a> elements are present in the output:

<p>
<a href="http://example.com">❤️</a><a href="http://example.com"> test </a><a href="http://example.com">👍</a>
</p>
Steps to reproduce the behavior
  1. Insert a link with any URL, consisting of multi-byte characters (two emojis is probably the easiest).
  2. Put a cursor between the two characters.
  3. Start typing something, I usually add test in between the two.
  4. Look at the resulting HTML.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in AztecEditor-iOS with the toolbar link button: create a link around multibyte characters, edit it between the characters, and inspect the generated HTML. The fix is complete when the edited text is contained in one element with the expected URL, rather than multiple elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.