Coder Social home page Coder Social logo

Comments (3)

avaranovich avatar avaranovich commented on August 27, 2024

The issue appears once you have \n\n before http:// ...
Text fragment example: namespace:\nhttp://mediawiki.org\nAll

For now this regex works for me :

 url_check = Regexp.new( '(^|[\n]*)([\w]+?://[\w]+[^ \"\r\n\t<]*)', Regexp::MULTILINE | Regexp::IGNORECASE )

but it breaks other external link format witth "[...]"

Here is the original regex:

url_check = Regexp.new( '(^|[\n ])([\w]+?://[\w]+[^ \"\r\n\t<]*)', Regexp::MULTILINE | Regexp::IGNORECASE )

and it seems explicitly requires a whitespace before http://

from wikicloth.

avaranovich avatar avaranovich commented on August 27, 2024

@nricciar Seems to be a different issue,

 See a designated [https://github.com/repo/README.md README].

rendered as

<p>See a designated <a href="<a href="https://github.com/repo/README.md">https://github.com/repo/README.md</a>" target="_blank"><a href="https://github.com/repo/README.md">https://github.com/repo/README.md</a></a>.</p></body></html>

I think the previous fix breaks this use case.

I also asked the question here: http://stackoverflow.com/questions/16011555/ruby-regex-doesnt-recognize-beginning-of-string

so regex by itself seems to be OK, but it is not working in the parsing context. Perhaps I am missing something important.

here is my test wiki markup:

 == Usage ==

See a designated [https://github.com/repo/README.md README].

[https://github.com/repo/README.md]

This is entrance page for the service (using HTML):

http://foobar.org/resources?format=html

Let us pick the "contributions" namespace: http://foobar.org/

from wikicloth.

nricciar avatar nricciar commented on August 27, 2024

The previous update should fix that regression. Should also work a lot better than a regular expression.

from wikicloth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.