Skip to content
This repository
Browse code

Merge branch 'master' of github.com:twitter/twitter-text-js

  • Loading branch information...
commit 39d5b1d5869625d0cebb710a596bda67e020b9bf 2 parents 5947248 + cdedeae
Keita Fujii keitaf authored

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 twitter-text.js
6 twitter-text.js
@@ -53,6 +53,8 @@ if (typeof twttr === "undefined" || twttr === null) {
53 53 }), flags);
54 54 }
55 55
  56 + twttr.txt.regexSupplant = regexSupplant;
  57 +
56 58 // simple string interpolation
57 59 function stringSupplant(str, values) {
58 60 return str.replace(/#\{(\w+)\}/g, function(match, name) {
@@ -60,6 +62,8 @@ if (typeof twttr === "undefined" || twttr === null) {
60 62 });
61 63 }
62 64
  65 + twttr.txt.stringSupplant = stringSupplant;
  66 +
63 67 function addCharsToCharClass(charClass, start, end) {
64 68 var s = String.fromCharCode(start);
65 69 if (end !== start) {
@@ -69,6 +73,8 @@ if (typeof twttr === "undefined" || twttr === null) {
69 73 return charClass;
70 74 }
71 75
  76 + twttr.txt.addCharsToCharClass = addCharsToCharClass;
  77 +
72 78 // Space is more than %20, U+3000 for example is the full-width space used with Kanji. Provide a short-hand
73 79 // to access both the list of characters and a pattern suitible for use with String#split
74 80 // Taken from: ActiveSupport::Multibyte::Handlers::UTF8Handler::UNICODE_WHITESPACE

0 comments on commit 39d5b1d

Please sign in to comment.
Something went wrong with that request. Please try again.