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

Support for default inline-links without Markdown syntax #124

Closed myell0w closed 10 years ago

myell0w commented 11 years ago

I don't know if I'm missing something, but it seems that normal URLs in the markdown text without markdown syntax (text)[url] aren't marked with "BPLinkStyleAttributeName". I think this would be a nice addition, especially since it's part of the Markdown specs.

laurencedawson commented 11 years ago

I was checking through the source and it seems there is already support for autolink but it's not connected up. Was there a reason for this? Cheers

heydamianc commented 11 years ago

No, not that I know of. Care to have a hand at hooking it up?

myell0w commented 11 years ago

I took a look at the autolink handling and from my understanding the problem is that "autolinks" in Soldouts sense are links contained within < > - brackets. The corresponding line in markdown.c (1702):

rndr.active_char['<'] = char_langle_tag;

So the autlink-handling is only triggered, if the links starts with "<", which isn't particularly helpful. any ideas on how to improve this? The problem is that an additional pass to parse standard autolinks will take up more time, I'd love to have this handled within the markdown parser.

laurencedawson commented 11 years ago

In /bypass/src/parser.cpp autolink is set to NULL where as link is set to rndr_link:

NULL,                 // autolink
rndr_link,            // link
laurencedawson commented 11 years ago

It's worth noting inline links get garbled at the moment too, a simple example is:

http:\\www.google.com

Becomes:

http:www.google.com
myell0w commented 11 years ago

I've started to hook up the autolink callback, but it doesn't work yet. Anyone care to help? You can find the discussion over at https://github.com/Uncodin/bypass-core/pull/5