Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

fix: add logic for replace html escaped symbols in uri string. #2899

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Kiolk
Copy link

@Kiolk Kiolk commented Apr 19, 2020

Hi folks.
I investigated the problem with issue #2890
The problem happens when extract URL from Html node, where & present as &amp (by 'net.sourceforge.htmlcleaner:htmlcleaner:2.2'). It normal display in TextView. Uri.parse() not converted this escaped symbol and try open page with it.
I not sure, this solution is best, but it resolves the problem.

@chuyenvanduong2002
Copy link

how about oppo a91

@Kiolk
Copy link
Author

Kiolk commented Sep 23, 2020

how about oppo a91

I don't clear understand you. Can you explain you comment more details?

@KaustubhPatange
Copy link

Looks like a code smell to me! I would suggest editing LinkParseHelper file to include a static hashmap of all escape symbol & a helper function to remove them all.

A pseudo-code is given below.

public class LinkParserHelper {
    ...
    static final Map<String, String> escapeSymbols = ...

    public static String removeEscapeSymbols(String url) {
        for(Map.Entry<String, String> value : escapeSymbols.entrySet()) {
            url = url.replace(value.getKey(), value.getValue());
        }
        return url;
    }
}

The only problem is the LinkParseHelper class in written in java so the code must be in java. Anyway, you can then call the static function at the appropriate call site.

@cypher01-droid
Copy link

cypher01-droid commented Nov 14, 2020 via email

Repository owner deleted a comment from gina23 Nov 15, 2020
KaustubhPatange added a commit to KaustubhPatange/FastHub that referenced this pull request Dec 26, 2020
LightDestory pushed a commit to LightDestory/FastHub-RE that referenced this pull request Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants