Coder Social home page Coder Social logo

Comments (7)

ndarville avatar ndarville commented on June 2, 2024

Same here; In[19] breaks. Maybe Gruber’s regex can be of help.

from bleach.

jsocol avatar jsocol commented on June 2, 2024

Whoops, had the wrong output for 19 somehow.

I started with Gruber's regex, and I couldn't get it to compile, let alone match anything. If someone wants to take another crack at it, and it still passes the current test suite + fixes this, that would be awesome.

from bleach.

ndarville avatar ndarville commented on June 2, 2024

If anything fails, I am sure that one of the guys at Stack Overflow will know what is wrong.

I tried Gruber’s regex in RegExr, and it works for the wonky example in our case—it doesn’t work with “cute” domains like del.icio.us, though. I’ll take a crack at it tomorrow, but with my meagre skills, I wouldn’t cross my fingers.

from bleach.

jsocol avatar jsocol commented on June 2, 2024

Note how the TLDs are formatted into the regex right now. That's all the known-valid TLDs as of maybe 8 months ago, so things like del.icio.us get linkified but not example.txt.

from bleach.

jsocol avatar jsocol commented on June 2, 2024

I don't think this is mathematically possible. We want http://en.wikipedia.org/wiki/X_(disambiguation) to match (e.g. the paren counts) and not http://this-is-the-end-of-a-parenthetical-comment.com/).. Frankly I'm impressed it works as well as it does. There are hacks in place for balanced parens around the link only, and those work great, but regex just can't do tag balancing. I think this errs on the right side.

from bleach.

jsocol avatar jsocol commented on June 2, 2024

...of course, the github parser managed to linkify my examples there correctly. Maybe there's a non-regex way?

from bleach.

jsocol avatar jsocol commented on June 2, 2024

As a test: example.com/).

Ah, no, this works for github/markdown because they only linkify links that start with https?:

from bleach.

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.