wordpress-mobile / wordpress-mobile/AztecEditor-iOS
Generated HTML for edited links containing multibyte characters is weird.
Nobody has claimed this yet.
- 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
- Insert a link with any URL, consisting of multi-byte characters (two emojis is probably the easiest).
- Put a cursor between the two characters.
- Start typing something, I usually add
testin between the two. - Look at the resulting HTML.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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