wordpress-mobile / wordpress-mobile/AztecEditor-iOS

Support for HTML5.0 Entity Codes/Names

Open
#1,399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm currently having problems converting HTML5 entity names like ,, ., (, ), etc. to its corresponding character when loading an html string to the editor. As a result, I would like to have these new entity names and codes supported when loading HTML5 content to the editor.

An alternative would be to parse these entity codes on my end but this would be tedious considering there are numerous additions of these in HTML5.

This is a sample html string passed on to the editor:

<p style=\"text-align: left;\">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout&period; The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters&comma; as opposed to using &apos;Content here&comma; content here&apos;&comma; making it look like readable English&period; Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text&comma; and a search for &apos;lorem ipsum&apos; will uncover many web sites still in their infancy&period; Various versions have evolved over the years&comma; sometimes by accident&comma; sometimes on purpose &lpar;injected humour and the like&rpar;&period;</p>

This is the resulting text loaded in the editor:
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout&period; The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters&comma; as opposed to using \'Content here&comma; content here\'&comma; making it look like readable English&period; Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text&comma; and a search for \'lorem ipsum\' will uncover many web sites still in their infancy&period; Various versions have evolved over the years&comma; sometimes by accident&comma; sometimes on purpose &lpar;injected humour and the like&rpar;&period;

This is the expected result:
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy, Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

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 supplied HTML in the editor and tracing the HTML-loading path responsible for entity decoding. Verify support for the listed HTML5 entity names, including comma, period, apostrophe, and parentheses, and confirm that the resulting editor text matches the expected characters.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.