Skip to content
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

Problems parsing HTML String with named html entities #4

Closed
amelzer opened this issue Nov 3, 2016 · 4 comments
Closed

Problems parsing HTML String with named html entities #4

amelzer opened this issue Nov 3, 2016 · 4 comments

Comments

@amelzer
Copy link

amelzer commented Nov 3, 2016

As the title says, I am having problems with named HTML entities.

Steps to reproduce:

import DOMParser from 'react-native-html-parser';

const html = `<p>Hello world <b>world</b> <i>foo</i> bar hahh&ouml;</p>`;    
const parser = new DOMParser.DOMParser();
const parsed = parser.parseFromString(html, 'text/html');

Expected behaviour:
HTML string gets parsed

Actual behaviour:

domerror kopie

@g6ling
Copy link
Owner

g6ling commented Nov 4, 2016

This library doesn't support &ouml; character set. If you want to use more character set, you can edit entity-map.js.
In this case, edit like

...
    'quot': '"',
    'apos': "'",
    'ouml': 'ö', // add this line
....

And If you cannot find entity-map.js file, change react-native-html-parser version to 0.0.4 in package.json.
If you send PR with the upgraded file, a lot of people will benefit from your work. :D

@g6ling g6ling closed this as completed Jan 13, 2018
@thuctl
Copy link

thuctl commented Feb 8, 2018

i'm having a same problem:
version used: 0.0.5
view-source:https://thethaovanhoa.vn/mu-498ct149/trang-1.htm

device-2018-02-08-101635

@Andrfas
Copy link
Contributor

Andrfas commented Jul 5, 2018

Created PR #11 with upgraded file

@Gibbz
Copy link

Gibbz commented Jan 1, 2019

Im getting this error with ° Which is the degree symbol.
Found here: http://www.bom.gov.au/vic/observations/vicall.shtml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants