Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes urlize conserve any white space char #637

Merged
merged 1 commit into from Jan 19, 2016

Conversation

pbu88
Copy link
Contributor

@pbu88 pbu88 commented Jan 18, 2016

Addresses issue #596.

The fix was rather simpler, I took the same approach that jinja2 urlize uses and is relying on the feature of split with regular expressions: (from docs)

If separator is a regular expression that contains capturing parentheses, then each time separator is matched, the results (including any undefined results) of the capturing parentheses are spliced into the output array. However, not all browsers support this capability.

Hope this helps!

@carljm
Copy link
Contributor

carljm commented Jan 18, 2016

Thanks! Do you have any reference for which browser version(s) support this behavior of split()? I wasn't able to find one on a quick search.

@pbu88
Copy link
Contributor Author

pbu88 commented Jan 19, 2016

No I couldn't find any, it's so frustrating that it gives you that warning and let you clueless about which are the ones that don't support it, but my guess is that it should be supported by all modern browsers now a days because is a pretty standard way to use split() across different programming languages and 2nd, is described like that since the ECMAScript 3rd edition (1999) reference.

Do you maybe have a way to run the tests across multiple browsers?

@carljm
Copy link
Contributor

carljm commented Jan 19, 2016

We don't have anything nice and automated set up for cross-browser testing, unfortunately, but I can check a few of the older supported browsers to verify.

@pbu88
Copy link
Contributor Author

pbu88 commented Jan 19, 2016

Let me know how can I help you with that :)

@carljm
Copy link
Contributor

carljm commented Jan 19, 2016

If it's part of ES3, I'm pretty sure it's fine. I'll test using Browserstack after I get this merged.

@carljm carljm merged commit efdd638 into mozilla:master Jan 19, 2016
carljm added a commit that referenced this pull request Jan 19, 2016
Makes urlize conserve any white space char

* pbu88/urlize_keep_ws_chars:
  Makes urlize conserve any white space char
carljm added a commit that referenced this pull request Jan 19, 2016
Makes urlize conserve any white space char

* pbu88/urlize_keep_ws_chars:
  Makes urlize conserve any white space char
@pbu88
Copy link
Contributor Author

pbu88 commented Jan 19, 2016

Cool! Thanks :)

@pbu88 pbu88 deleted the urlize_keep_ws_chars branch January 19, 2016 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants