Comparing version 1.10.2 to 1.10.3
@@ -42,3 +42,3 @@ /** Text hyphenation in Javascript. | ||
); | ||
function createHTMLVerifier(skipHTML) { | ||
function createHTMLVerifier() { | ||
var skip = false; | ||
@@ -53,4 +53,3 @@ return function (accumulate, chars) { | ||
chars[0] === "<" && | ||
(!isNotLetter(chars[1]) || chars[1] === "/") && | ||
skipHTML | ||
(!isNotLetter(chars[1]) || chars[1] === "/") | ||
) { | ||
@@ -229,3 +228,5 @@ skip = true; | ||
createHyphenationVerifier( | ||
[createHTMLVerifier(skipHTML), createHyphenCharVerifier(hyphenChar)], | ||
(skipHTML ? [createHTMLVerifier()] : []).concat( | ||
createHyphenCharVerifier(hyphenChar) | ||
), | ||
minWordLength | ||
@@ -232,0 +233,0 @@ ) |
{ | ||
"name": "hyphen", | ||
"version": "1.10.2", | ||
"version": "1.10.3", | ||
"description": "Text hyphenation in Javascript.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -695,4 +695,4 @@ ![Franklin M. Liang's hyphenation algorithm](https://ytiurin.github.io/hyphen/01.png) | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/hyphen@1.10.2/patterns/en-us.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/hyphen@1.10.2/hyphen.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/hyphen@1.10.3/patterns/en-us.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/hyphen@1.10.3/hyphen.min.js"></script> | ||
``` | ||
@@ -738,14 +738,4 @@ | ||
Default exported `hyphenateHTML` function | ||
In cases when text parser should not skip HTML tags, apply the following code changes. | ||
```javascript | ||
// Code before 1.10.0 | ||
hyphenateHTML(text); | ||
``` | ||
```javascript | ||
// Code after 1.10.0 | ||
hyphenate(text); | ||
``` | ||
Default exported `hyphenate` function | ||
@@ -752,0 +742,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4807663
21885
806