@tryghost/helpers 1.1.69 → 1.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/helpers.js +5 -1
- package/es/helpers.js +2 -1
- package/es/helpers.js.map +1 -1
- package/lib/utils/count-words.js +5 -1
- package/package.json +5 -5
- package/umd/helpers.min.js +1 -1
- package/umd/helpers.min.js.map +1 -1
package/cjs/helpers.js
CHANGED
|
@@ -3554,7 +3554,11 @@ function countWords(text) {
|
|
|
3554
3554
|
text = text.replace(/<(.|\n)*?>/g, ' '); // strip any HTML tags
|
|
3555
3555
|
|
|
3556
3556
|
const pattern = /[a-zA-ZÀ-ÿ0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
|
|
3557
|
-
|
|
3557
|
+
|
|
3558
|
+
const RTLPattern = /([\u0600-\u06ff]+|[\u0591-\u05F4]+)/g;
|
|
3559
|
+
|
|
3560
|
+
const match = text.match(pattern) || text.match(RTLPattern);
|
|
3561
|
+
|
|
3558
3562
|
let count = 0;
|
|
3559
3563
|
|
|
3560
3564
|
if (match === null) {
|
package/es/helpers.js
CHANGED
|
@@ -3558,7 +3558,8 @@ function countWords(text) {
|
|
|
3558
3558
|
text = text.replace(/<(.|\n)*?>/g, ' '); // strip any HTML tags
|
|
3559
3559
|
|
|
3560
3560
|
var pattern = /[a-zA-ZÀ-ÿ0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
|
|
3561
|
-
var
|
|
3561
|
+
var RTLPattern = /([\u0600-\u06ff]+|[\u0591-\u05F4]+)/g;
|
|
3562
|
+
var match = text.match(pattern) || text.match(RTLPattern);
|
|
3562
3563
|
var count = 0;
|
|
3563
3564
|
|
|
3564
3565
|
if (match === null) {
|