Uncodin / bypass

Skip the HTML, Bypass takes markdown and renders it directly on Android and iOS.
http://uncodin.github.com/bypass/
Apache License 2.0
1.51k stars 193 forks source link

Some characters cause URLs to render incorrectly #135

Open laurencedawson opened 11 years ago

laurencedawson commented 11 years ago
peter-bonanni commented 11 years ago

Is this an iOS, Android or cross-platform issue?

laurencedawson commented 11 years ago

I've tested on Android but this should break both platforms.

laurencedawson commented 11 years ago

Looks like ampersands in URLs also render incorrectly.

dlew commented 10 years ago

I believe this issue only happens if you aren't explicitly defining the URL, e.g. [text](url). Officially markdown doesn't support "naked" urls and libsoldout definitely doesn't support it.

rleh commented 9 years ago

On Android "naked" urls are not rendered at all. Markdown syntax urls ([text](url)) containing underscores or ambersands are displayed broken, but the correct url is opened in browser.

insanj commented 9 years ago

This is a very common issue and, contrary to what @rleh mentioned, the URL will not be correctly opened, it will be stripped of the _ characters (which will break the link on most sites). I am using Bypass to render text for a Reddit client, and nearly every Reddit comment link has underscores in it (i.e. the form is reddit.com/r/subreddit/comments/identifier/name_with_underscores_instead_of_spaces). Because of this issue most links I see rendered look noticeably out of place (with italics strewn about) and don't launch the correct address.

@dlew is correct in the assessment that this only occurs when links are not explicitly defined. However, styling within hyperlinks is never a desirable outcome. Any platform which allows for clickable hyperlinks should prevent those hyperlinks from appearing incorrectly or inappropriately (which happens here: the formatting makes the displaying URL inaccurate by italicizing, and the link itself makes the text view look weird and inconsistent).

For these reasons I believe this is a significant issue for Bypass, and should be considered a bug rather than a feature.

dlew commented 9 years ago

I came up with a reasonable workaround for this problem, which is to scan the input for URIs before passing it to Bypass and put autolinks around them. For example, http://example.com/some_link becomes <http://example.com/some_link>.

lennart-bader commented 9 years ago

@insanj I can reproduce exactly the same behavior @rleh mentioned. The Markdown syntax url is displayed completely broken, parts of it are italic, the very beginning is rendered as url. When you click this part (displayed correctly till the first underscore) the full url is opened in the browser.

rleh commented 9 years ago

@insanj: I double-checked this again, URLs containing underscores _ are displayed broken, but open correctly.

I used bypass com.commit451:bypasses:1.0.0 (https://github.com/Commit451/bypasses/tree/1.0.0) to build the android app using gradle.