Comments (7)
Same here; In[19]
breaks. Maybe Gruber’s regex can be of help.
from bleach.
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.
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.
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.
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.
...of course, the github parser managed to linkify my examples there correctly. Maybe there's a non-regex way?
from bleach.
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)
- bug: bleach truncates Katex style attributes HOT 7
- Solo quiero decir que Bleach vuelve en octubre ❤️💪😎🍷💕
- bug: hardcoded dev dependency versions breaks mypy usage HOT 5
- fork html5lib-python or find alternative HOT 1
- bug: bleach.clean is not handling & symbol very well HOT 1
- Possible to only allow target="_blank" but no other values? HOT 3
- tox utility environments are constrainted to only run on Linux HOT 1
- bleach is deprecated; statement on project going forward (2023-01-23) HOT 11
- RFE: please provide update for latest `tinycss2` 1.2.1 HOT 2
- RFE: lease drop use `six` module HOT 1
- bug: linkify with entities inside anchor strings are incorrectly escaped HOT 1
- Open angle bracket '<' with few words after cleaned up if there's no closing bracket HOT 1
- bug: using OpenSUSE and Fedora packages which change the Bleach code, parse_shim tests fail with Python 3.10.12 HOT 6
- bug: Cleaner removes href valid tag "tg://user?id=124124124" HOT 1
- bug: drop support for Python 3.7 which is EOL
- feature: add support for Python 3.12
- Style attributes are getting stripped off HOT 13
- Open bracket '<' still cleaned up without closing bracket
- RFE: move away from deprecated `html5lib` HOT 1
- feature: please provide update for latest `tinycss2==1.3`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bleach.