From f2fe5ea3d66d8e74acf58fa6c395e932eb19315e Mon Sep 17 00:00:00 2001
From: Mathias Nater
Date: Tue, 28 May 2019 09:46:14 +0200
Subject: [PATCH] Release 3.1.0 (#81)
## Version 3.1.0 (2019-04-28)
### Fixed
* Correctly reject hyphenator promises (fix issue#77)
* performance: reduce file size of Hyphenopoly_Loader.js
* update devDependencies
### Added
* feature: get maindir and patterndir from currentScript
---
CHANGELOG.md | 9 +
Hyphenopoly.js | 19 +-
Hyphenopoly_Loader.js | 480 ++++++++++++++++++++--------------------
hyphenEngine.asm.js | 2 +-
hyphenopoly.module.js | 2 +-
package-lock.json | 399 ++++++++++++++++++++++-----------
package.json | 6 +-
testsuite/test1.html | 6 +-
testsuite/test10.html | 4 -
testsuite/test11.html | 4 -
testsuite/test12.html | 4 -
testsuite/test13.html | 4 -
testsuite/test14.html | 4 -
testsuite/test15.html | 4 -
testsuite/test16.html | 4 -
testsuite/test17.html | 4 -
testsuite/test18.html | 4 -
testsuite/test19.html | 4 -
testsuite/test2.html | 4 -
testsuite/test20.html | 4 -
testsuite/test21.html | 4 -
testsuite/test22.html | 4 -
testsuite/test23.html | 4 -
testsuite/test24.html | 6 +-
testsuite/test25.html | 4 -
testsuite/test26.html | 4 -
testsuite/test27.html | 4 -
testsuite/test28.html | 4 -
testsuite/test29.html | 8 +-
testsuite/test3.html | 4 -
testsuite/test30.html | 4 -
testsuite/test31.html | 4 -
testsuite/test32.html | 4 -
testsuite/test33.html | 6 +-
testsuite/test34.html | 6 +-
testsuite/test35.html | 4 -
testsuite/test36.html | 128 +++++++++++
testsuite/test37.html | 128 +++++++++++
testsuite/test38.html | 131 +++++++++++
testsuite/test4.html | 4 -
testsuite/test5.html | 8 +-
testsuite/test6.html | 4 -
testsuite/test7.html | 4 -
testsuite/test8.html | 4 -
testsuite/test9.html | 4 -
testsuite/testdriver.js | 5 +-
tools/compileWASM.sh | 4 +-
47 files changed, 929 insertions(+), 540 deletions(-)
create mode 100644 testsuite/test36.html
create mode 100644 testsuite/test37.html
create mode 100644 testsuite/test38.html
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c75e44f..296f83ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Version History
+## Version 3.1.0 (2019-04-28)
+### Fixed
+* Correctly reject hyphenator promises (issue#77)
+* performance: reduce file size of Hyphenopoly_Loader.js
+* update devDependencies
+
+### Added
+* feature: get maindir and patterndir from currentScript
+
## Version 3.0.2 (2019-04-28)
### Security
* refactor(Loader): don't use innerHTML
diff --git a/Hyphenopoly.js b/Hyphenopoly.js
index 323d555d..17038a75 100644
--- a/Hyphenopoly.js
+++ b/Hyphenopoly.js
@@ -1,5 +1,5 @@
/**
- * @license Hyphenopoly 3.0.2 - client side hyphenation for webbrowsers
+ * @license Hyphenopoly 3.1.0 - client side hyphenation for webbrowsers
* ©2019 Mathias Nater, Zürich (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
@@ -8,7 +8,6 @@
*/
/* globals asmHyphenEngine, Hyphenopoly */
-
(function mainWrapper(w) {
"use strict";
const SOFTHYPHEN = String.fromCharCode(173);
@@ -334,12 +333,12 @@
isChild = isChild || false;
const eLang = getElementLanguage(el, pLang);
/* eslint-disable security/detect-object-injection */
- if (H.clientFeat.langs[eLang] === "H9Y") {
+ if (H.cf.langs[eLang] === "H9Y") {
elements.add(el, eLang, sel);
if (!isChild && C.safeCopy) {
registerOnCopy(el);
}
- } else if (!H.clientFeat.langs[eLang]) {
+ } else if (!H.cf.langs[eLang]) {
H.events.dispatch("error", {
"lvl": "warn",
"msg": "Element with '" + eLang + "' found, but '" + eLang + ".hpb' not loaded. Check language tags!"
@@ -748,10 +747,10 @@
*/
function calculateHeapSize(targetSize) {
/* eslint-disable no-bitwise */
- if (H.clientFeat.wasm) {
+ if (H.cf.wasm) {
return Math.ceil(targetSize / 65536) * 65536;
}
- const exp = Math.ceil(Math.log2(targetSize));
+ const exp = Math.ceil(Math.log(targetSize) * Math.LOG2E);
if (exp <= 12) {
return 1 << 12;
}
@@ -896,7 +895,7 @@
*/
function encloseHyphenateFunction(baseData, hyphenateFunc) {
/* eslint-disable no-bitwise */
- const heapBuffer = H.clientFeat.wasm
+ const heapBuffer = H.cf.wasm
? baseData.wasmMemory.buffer
: baseData.heapBuffer;
const wordStore = (new Uint16Array(heapBuffer)).subarray(
@@ -940,7 +939,7 @@
* @returns {undefined}
*/
function instantiateWasmEngine(lang) {
- Promise.all([H.binaries.get(lang), H.binaries.get("hyphenEngine")]).then(
+ Promise.all([H.bins.get(lang), H.bins.get("hyphenEngine")]).then(
function onAll(binaries) {
const hpbBuf = binaries[0];
const baseData = calculateBaseData(hpbBuf);
@@ -995,7 +994,7 @@
* @returns {undefined}
*/
function instantiateAsmEngine(lang) {
- const hpbBuf = H.binaries.get(lang);
+ const hpbBuf = H.bins.get(lang);
const baseData = calculateBaseData(hpbBuf);
const specMem = H.specMems.get(lang);
const heapBuffer = (specMem.byteLength >= baseData.hs)
@@ -1095,7 +1094,7 @@
false
);
- H.events.define(
+ H.events.addListener(
"loadError",
function onLoadError(e) {
if (e.msg !== "wasm") {
diff --git a/Hyphenopoly_Loader.js b/Hyphenopoly_Loader.js
index 13a6fda6..ebed7641 100644
--- a/Hyphenopoly_Loader.js
+++ b/Hyphenopoly_Loader.js
@@ -1,5 +1,5 @@
/**
- * @license Hyphenopoly_Loader 3.0.2 - client side hyphenation
+ * @license Hyphenopoly_Loader 3.1.0 - client side hyphenation
* ©2019 Mathias Nater, Zürich (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
@@ -9,17 +9,28 @@
/* global Hyphenopoly */
-(function H9YL() {
+/**
+ * Wrap all code in an iife to keep a scope. Important objects are parameters
+ * of this iife to keep codesize low.
+ * @param {Object} w shorthand for window
+ * @param {Object} d shorthand for document
+ * @param {Object} H shorthand for Hyphenopoly
+ * @param {Object} o shorthand for object
+ */
+(function H9YL(w, d, H, o) {
"use strict";
- const d = document;
- const H = Hyphenopoly;
+
+ const store = sessionStorage;
+ const wa = w.WebAssembly;
+ const lcFallbacks = new Map();
+ const lcRequire = new Map();
/**
* Create Object without standard Object-prototype
* @returns {Object} empty object
*/
function empty() {
- return Object.create(null);
+ return o.create(null);
}
@@ -30,36 +41,50 @@
* @returns {undefined}
*/
function eachKey(obj, fn) {
- Object.keys(obj).forEach(fn);
+ o.keys(obj).forEach(fn);
}
+ /**
+ * Set H.cf (Hyphenopoly.clientFeatures) either by reading out previously
+ * computed settings from sessionStorage or creating an template object.
+ * This is in an iife to keep complexity low.
+ */
(function configFeat() {
- // Set H.clientFeat (either from sessionStorage or empty)
- if (H.cacheFeatureTests && sessionStorage.getItem("Hyphenopoly_Loader")) {
- H.clientFeat = JSON.parse(sessionStorage.getItem("Hyphenopoly_Loader"));
+ if (H.cacheFeatureTests && store.getItem("Hyphenopoly_Loader")) {
+ H.cf = JSON.parse(store.getItem("Hyphenopoly_Loader"));
} else {
- H.clientFeat = {
+ H.cf = {
"langs": empty(),
"polyfill": false,
"wasm": null
};
}
}());
+
+ /**
+ * Set H.paths defaults or overwrite with user settings.
+ * This is in an iife to keep complexity low.
+ */
(function configPaths() {
- // Set defaults for paths and setup
- H.dfltPaths = Object.create({
- "maindir": "../Hyphenopoly/",
- "patterndir": "../Hyphenopoly/patterns/"
- });
+ const maindir = (d.currentScript)
+ ? d.currentScript.src.replace(/Hyphenopoly_Loader.js/i, "")
+ : "../";
+ const patterndir = maindir + "patterns/";
if (H.paths) {
- if (H.paths.patterndir) {
- H.dfltPaths.patterndir = H.paths.patterndir;
- }
- if (H.paths.maindir) {
- H.dfltPaths.maindir = H.paths.maindir;
- }
+ H.paths.maindir = H.paths.maindir || maindir;
+ H.paths.patterndir = H.paths.patterndir || patterndir;
+ } else {
+ H.paths = o.create({
+ "maindir": maindir,
+ "patterndir": patterndir
+ });
}
}());
+
+ /**
+ * Set some H.setup fields to defaults or overwrite with user settings.
+ * This is in an iife to keep complexity low.
+ */
(function configSetup() {
if (H.setup) {
H.setup.selectors = H.setup.selectors || {".hyphenate": {}};
@@ -73,26 +98,36 @@
};
}
}());
+
+ /**
+ * Copy required languages to local lcRequire and
+ * eventually fallbacks to local lcFallbacks.
+ * This is in an iife to keep complexity low.
+ */
(function configRequire() {
- H.lcRequire = new Map();
eachKey(H.require, function copyRequire(k) {
- /* eslint-disable security/detect-object-injection */
- H.lcRequire.set(k.toLowerCase(), H.require[k]);
- /* eslint-enable security/detect-object-injection */
+ // eslint-disable-next-line security/detect-object-injection
+ lcRequire.set(k.toLowerCase(), H.require[k]);
});
if (H.fallbacks) {
- H.lcFallbacks = new Map();
eachKey(H.fallbacks, function copyFallbacks(k) {
- /* eslint-disable security/detect-object-injection */
- H.lcFallbacks.set(
+ lcFallbacks.set(
k.toLowerCase(),
+ // eslint-disable-next-line security/detect-object-injection
H.fallbacks[k].toLowerCase()
);
- /* eslint-enable security/detect-object-injection */
});
}
}());
+ /**
+ * Define function H.toggle.
+ * This function hides or unhides (depending of the parameter state)
+ * the whole document (H.setup.hide == "all") or
+ * each selected element (H.setup.hide == "element") or
+ * text of each selected element (H.setup.hide == "text")
+ * @param {string} state State: either on (visible) or off (hidden)
+ */
H.toggle = function toggle(state) {
if (state === "on") {
const stylesNode = d.getElementById("H9Y_Styles");
@@ -121,11 +156,16 @@
default:
myStyle = "";
}
- sc.appendChild(document.createTextNode(myStyle));
- d.getElementsByTagName("head")[0].appendChild(sc);
+ sc.appendChild(d.createTextNode(myStyle));
+ d.head.appendChild(sc);
}
};
+ /**
+ * Setup basic event system. Some events are defined but the definition of
+ * what happens when they are triggered is deferred to Hyphenopoly.js
+ * This is in an iife to keep complexity low.
+ */
(function setupEvents() {
// Events known to the system
const definedEvents = new Map();
@@ -157,7 +197,7 @@
"timeout",
function def(e) {
H.toggle("on");
- window.console.info(
+ w.console.info(
"Hyphenopolys 'FOUHC'-prevention timed out after %dms",
e.delay
);
@@ -170,13 +210,13 @@
function def(e) {
switch (e.lvl) {
case "info":
- window.console.info(e.msg);
+ w.console.info(e.msg);
break;
case "warn":
- window.console.warn(e.msg);
+ w.console.warn(e.msg);
break;
default:
- window.console.error(e.msg);
+ w.console.error(e.msg);
}
},
true
@@ -222,7 +262,8 @@
"data": e,
"name": "loadError"
});
- }
+ },
+ false
);
define(
@@ -301,60 +342,29 @@
}());
/**
- * Test if wasm is supported
- * @returns {undefined}
+ * Feature test for wasm.
+ * @returns {boolean} support
*/
- function featureTestWasm() {
- /* eslint-disable no-prototype-builtins */
- /**
- * Feature test for wasm
- * @returns {boolean} support
+ function runWasmTest() {
+ /*
+ * Wasm feature test with iOS bug detection
+ * (https://bugs.webkit.org/show_bug.cgi?id=181781)
*/
- function runWasmTest() {
- /*
- * This is the original test, without webkit workaround
- * if (typeof WebAssembly === "object" &&
- * typeof WebAssembly.instantiate === "function") {
- * const module = new WebAssembly.Module(Uint8Array.from(
- * [0, 97, 115, 109, 1, 0, 0, 0]
- * ));
- * if (WebAssembly.Module.prototype.isPrototypeOf(module)) {
- * return WebAssembly.Instance.prototype.isPrototypeOf(
- * new WebAssembly.Instance(module)
- * );
- * }
- * }
- * return false;
- */
-
- /*
- * Wasm feature test with iOS bug detection
- * (https://bugs.webkit.org/show_bug.cgi?id=181781)
- */
- if (
- typeof WebAssembly === "object" &&
- typeof WebAssembly.instantiate === "function"
- ) {
- /* eslint-disable array-element-newline */
- const module = new WebAssembly.Module(Uint8Array.from([
- 0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 127, 1, 127,
- 3, 2, 1, 0, 5, 3, 1, 0, 1, 7, 8, 1, 4, 116, 101, 115,
- 116, 0, 0, 10, 16, 1, 14, 0, 32, 0, 65, 1, 54, 2, 0, 32,
- 0, 40, 2, 0, 11
- ]));
- /* eslint-enable array-element-newline */
- if (WebAssembly.Module.prototype.isPrototypeOf(module)) {
- const inst = new WebAssembly.Instance(module);
- return WebAssembly.Instance.prototype.isPrototypeOf(inst) &&
- (inst.exports.test(4) !== 0);
- }
- }
- return false;
- }
- /* eslint-enable no-prototype-builtins */
- if (H.clientFeat.wasm === null) {
- H.clientFeat.wasm = runWasmTest();
+ if (
+ typeof wa === "object" &&
+ typeof wa.Instance === "function"
+ ) {
+ /* eslint-disable array-element-newline */
+ const module = new wa.Module(Uint8Array.from([
+ 0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 127, 1, 127,
+ 3, 2, 1, 0, 5, 3, 1, 0, 1, 7, 8, 1, 4, 116, 101, 115,
+ 116, 0, 0, 10, 16, 1, 14, 0, 32, 0, 65, 1, 54, 2, 0, 32,
+ 0, 40, 2, 0, 11
+ ]));
+ /* eslint-enable array-element-newline */
+ return (new wa.Instance(module).exports.test(4) !== 0);
}
+ return false;
}
/**
@@ -363,7 +373,7 @@
* @param {string} filename Filename of the script
* @returns {undefined}
*/
- function scriptLoader(path, filename) {
+ function loadScript(path, filename) {
const script = d.createElement("script");
script.src = path + filename;
if (filename === "hyphenEngine.asm.js") {
@@ -385,7 +395,7 @@
* @param {Object} msg Message
* @returns {undefined}
*/
- function binLoader(path, fne, name, msg) {
+ function loadBinary(path, fne, name, msg) {
/**
* Get bin file using fetch
* @param {string} p Where the script is stored
@@ -395,46 +405,41 @@
* @returns {undefined}
*/
function fetchBinary(p, f, n, m) {
- if (!loadedBins.has(f)) {
- loadedBins.set(f, [m]);
- window.fetch(p + f).then(
- function resolve(response) {
- if (response.ok) {
- if (n === "hyphenEngine") {
- H.binaries.set(n, response.arrayBuffer().then(
- function getModule(buf) {
- return new WebAssembly.Module(buf);
- }
- ));
- H.events.dispatch("engineLoaded", {"msg": m});
- } else {
- const files = loadedBins.get(f);
- files.forEach(function eachHpb(rn) {
- H.binaries.set(
- rn,
- (files.length > 1)
- ? response.clone().arrayBuffer()
- : response.arrayBuffer()
- );
- H.events.dispatch(
- "hpbLoaded",
- {"msg": rn}
- );
- });
- }
+ w.fetch(p + f).then(
+ function resolve(response) {
+ if (response.ok) {
+ if (n === "hyphenEngine") {
+ H.bins.set(n, response.arrayBuffer().then(
+ function getModule(buf) {
+ return new wa.Module(buf);
+ }
+ ));
+ H.events.dispatch("engineLoaded", {"msg": m});
} else {
- H.events.dispatch("loadError", {
- "file": f,
- "msg": m,
- "name": n,
- "path": p
+ const files = loadedBins.get(f);
+ files.forEach(function eachHpb(rn) {
+ H.bins.set(
+ rn,
+ (files.length > 1)
+ ? response.clone().arrayBuffer()
+ : response.arrayBuffer()
+ );
+ H.events.dispatch(
+ "hpbLoaded",
+ {"msg": rn}
+ );
});
}
+ } else {
+ H.events.dispatch("loadError", {
+ "file": f,
+ "msg": m,
+ "name": n,
+ "path": p
+ });
}
- );
- } else if (n !== "hyphenEngine") {
- loadedBins.get(f).push(m);
- }
+ }
+ );
}
/**
@@ -447,42 +452,42 @@
*/
function requestBinary(p, f, n, m) {
/* eslint-disable-next-line no-negated-condition */
- if (!loadedBins.has(f)) {
- loadedBins.set(f, [m]);
- const xhr = new XMLHttpRequest();
- xhr.onload = function onload() {
- if (xhr.statusText === "OK") {
- loadedBins.get(f).
- forEach(function eachHpb(rn) {
- H.binaries.set(
- rn,
- xhr.response
- );
- H.events.dispatch(
- "hpbLoaded",
- {"msg": rn}
- );
- });
- } else {
- H.events.dispatch("loadError", {
- "file": f,
- "msg": m,
- "name": n,
- "path": p
+ const xhr = new XMLHttpRequest();
+ xhr.onload = function onload() {
+ if (xhr.status === 200) {
+ loadedBins.get(f).
+ forEach(function eachHpb(rn) {
+ H.bins.set(
+ rn,
+ xhr.response
+ );
+ H.events.dispatch(
+ "hpbLoaded",
+ {"msg": rn}
+ );
});
- }
- };
- xhr.open("GET", p + f);
- xhr.responseType = "arraybuffer";
- xhr.send();
+ } else {
+ H.events.dispatch("loadError", {
+ "file": f,
+ "msg": m,
+ "name": n,
+ "path": p
+ });
+ }
+ };
+ xhr.open("GET", p + f);
+ xhr.responseType = "arraybuffer";
+ xhr.send();
+ }
+ if (!loadedBins.has(fne)) {
+ loadedBins.set(fne, [msg]);
+ if (H.cf.wasm) {
+ fetchBinary(path, fne, name, msg);
} else {
- loadedBins.get(f).push(m);
+ requestBinary(path, fne, name, msg);
}
- }
- if (H.clientFeat.wasm) {
- fetchBinary(path, fne, name, msg);
- } else {
- requestBinary(path, fne, name, msg);
+ } else if (name !== "hyphenEngine") {
+ loadedBins.get(fne).push(msg);
}
}
@@ -500,49 +505,39 @@
);
const wasmPages = specVal.get(lang) || 32;
H.specMems = H.specMems || new Map();
- if (H.clientFeat.wasm) {
- H.specMems.set(lang, new WebAssembly.Memory({
+ if (H.cf.wasm) {
+ H.specMems.set(lang, new wa.Memory({
"initial": wasmPages,
"maximum": 256
}));
} else {
- /**
- * Polyfill Math.log2
- * @param {number} x argument
- * @return {number} Log2(x)
- */
- Math.log2 = Math.log2 || function polyfillLog2(x) {
- return Math.log(x) * Math.LOG2E;
- };
/* eslint-disable no-bitwise */
- const asmPages = (2 << Math.floor(Math.log2(wasmPages))) * 65536;
+ const asmPages = (2 << Math.floor(
+ Math.log(wasmPages) * Math.LOG2E
+ )) << 16;
/* eslint-enable no-bitwise */
H.specMems.set(lang, new ArrayBuffer(asmPages));
}
}
- (function featureTestCSSHyphenation() {
+ (function testClientFeatures() {
const tester = (function tester() {
let fakeBody = null;
-
- const css = (function createCss() {
- /* eslint-disable array-element-newline */
- const props = [
- "visibility:hidden;",
- "-moz-hyphens:auto;",
- "-webkit-hyphens:auto;",
- "-ms-hyphens:auto;",
- "hyphens:auto;",
- "width:48px;",
- "font-size:12px;",
- "line-height:12px;",
- "border:none;",
- "padding:0;",
- "word-wrap:normal"
- ];
- /* eslint-enable array-element-newline */
- return props.join("");
- }());
+ /* eslint-disable array-element-newline */
+ const css = [
+ "visibility:hidden;",
+ "-moz-hyphens:auto;",
+ "-webkit-hyphens:auto;",
+ "-ms-hyphens:auto;",
+ "hyphens:auto;",
+ "width:48px;",
+ "font-size:12px;",
+ "line-height:12px;",
+ "border:none;",
+ "padding:0;",
+ "word-wrap:normal"
+ ].join("");
+ /* eslint-enable array-element-newline */
/**
* Create and append div with CSS-hyphenated word
@@ -551,16 +546,15 @@
*/
function create(lang) {
/* eslint-disable security/detect-object-injection */
- if (H.clientFeat.langs[lang]) {
+ if (H.cf.langs[lang]) {
return;
}
/* eslint-enable security/detect-object-injection */
fakeBody = fakeBody || d.createElement("body");
const testDiv = d.createElement("div");
testDiv.lang = lang;
- testDiv.id = lang;
testDiv.style.cssText = css;
- testDiv.appendChild(d.createTextNode(H.lcRequire.get(lang)));
+ testDiv.appendChild(d.createTextNode(lcRequire.get(lang)));
fakeBody.appendChild(testDiv);
}
@@ -623,18 +617,27 @@
/* eslint-disable security/detect-object-injection */
H.hyphenators = H.hyphenators || empty();
if (!H.hyphenators[lang]) {
- if (window.Promise) {
+ if (w.Promise) {
H.hyphenators[lang] = new Promise(function pro(rs, rj) {
H.events.addListener("engineReady", function handler(e) {
if (e.msg === lang) {
rs(H.createHyphenator(e.msg));
}
}, true);
- H.events.addListener("error", function handler(e) {
- if (e.key === lang || e.key === "hyphenEngine") {
- rj(e.msg);
+ H.events.addListener("loadError", function handler(e) {
+ if (e.name === lang || e.name === "hyphenEngine") {
+ rj(new Error("File " + e.file + " can't be loaded from " + e.path));
}
- }, true);
+ }, false);
+ });
+ H.hyphenators[lang].catch(function catchPromiseError(e) {
+ H.events.dispatch(
+ "error",
+ {
+ "lvl": "error",
+ "msg": e.message
+ }
+ );
});
} else {
H.hyphenators[lang] = {
@@ -646,7 +649,7 @@
"then": function () {
H.events.dispatch(
"error",
- {"msg": "Promises not supported in this engine. Use a polyfill (e.g. https://github.com/taylorhakes/promise-polyfill)!"}
+ {"msg": "Promises not supported in this engine. Use a polyfill."}
);
}
};
@@ -656,72 +659,67 @@
}
/**
- * Load all ressources for a required , check if wasm is supported
- * and expose the hyphenate function.
+ * Load .hpb files
* @param {string} lang The language
* @returns {undefined}
*/
function loadPattern(lang) {
let filename = lang + ".hpb";
let langFallback = lang;
- if (H.lcFallbacks && H.lcFallbacks.has(lang)) {
- langFallback = H.lcFallbacks.get(lang);
+ H.cf.polyfill = true;
+ // eslint-disable-next-line security/detect-object-injection
+ H.cf.langs[lang] = "H9Y";
+ if (lcFallbacks && lcFallbacks.has(lang)) {
+ langFallback = lcFallbacks.get(lang);
filename = langFallback + ".hpb";
}
- H.binaries = H.binaries || new Map();
- binLoader(H.dfltPaths.patterndir, filename, langFallback, lang);
+ H.bins = H.bins || new Map();
+ loadBinary(H.paths.patterndir, filename, langFallback, lang);
}
- featureTestWasm();
- H.lcRequire.forEach(function eachReq(value, lang) {
- /* eslint-disable security/detect-object-injection */
- if (value === "FORCEHYPHENOPOLY") {
- H.clientFeat.polyfill = true;
- H.clientFeat.langs[lang] = "H9Y";
- loadPattern(lang);
- } else if (
- H.clientFeat.langs[lang] &&
- H.clientFeat.langs[lang] === "H9Y"
+
+ if (H.cf.wasm === null) {
+ H.cf.wasm = runWasmTest();
+ }
+ lcRequire.forEach(function eachReq(value, lang) {
+ if (value === "FORCEHYPHENOPOLY" ||
+ // eslint-disable-next-line security/detect-object-injection
+ (H.cf.langs[lang] && H.cf.langs[lang] === "H9Y")
) {
loadPattern(lang);
} else {
tester.create(lang);
}
- /* eslint-enable security/detect-object-injection */
});
const testContainer = tester.append(d.documentElement);
if (testContainer !== null) {
- H.lcRequire.forEach(function eachReq(value, lang) {
- if (value !== "FORCEHYPHENOPOLY") {
- const el = d.getElementById(lang);
- /* eslint-disable security/detect-object-injection */
- if (checkCSSHyphensSupport(el) && el.offsetHeight > 12) {
- H.clientFeat.langs[lang] = "CSS";
- } else {
- H.clientFeat.polyfill = true;
- H.clientFeat.langs[lang] = "H9Y";
- loadPattern(lang);
- }
- /* eslint-enable security/detect-object-injection */
+ const nl = testContainer.getElementsByTagName("div");
+ eachKey(nl, function eachNode(n) {
+ /* eslint-disable security/detect-object-injection */
+ if (checkCSSHyphensSupport(nl[n]) && nl[n].offsetHeight > 12) {
+ H.cf.langs[nl[n].lang] = "CSS";
+ } else {
+ loadPattern(nl[n].lang);
}
+ /* eslint-enable security/detect-object-injection */
});
tester.clear();
}
- if (H.clientFeat.polyfill) {
- scriptLoader(H.dfltPaths.maindir, "Hyphenopoly.js");
- if (H.clientFeat.wasm) {
- binLoader(
- H.dfltPaths.maindir,
+ if (H.cf.polyfill) {
+ loadScript(H.paths.maindir, "Hyphenopoly.js");
+ if (H.cf.wasm) {
+ loadBinary(
+ H.paths.maindir,
"hyphenEngine.wasm",
"hyphenEngine",
"wasm"
);
} else {
- scriptLoader(H.dfltPaths.maindir, "hyphenEngine.asm.js");
+ loadScript(H.paths.maindir, "hyphenEngine.asm.js");
}
- eachKey(H.clientFeat.langs, function prepareEach(lang) {
+ eachKey(H.cf.langs, function prepareEach(lang) {
/* eslint-disable security/detect-object-injection */
- if (H.clientFeat.langs[lang] === "H9Y") {
+ if (H.cf.langs[lang] === "H9Y") {
allocateMemory(lang);
exposeHyphenateFunction(lang);
}
@@ -745,12 +743,12 @@
);
}
- if (H.clientFeat.polyfill) {
+ if (H.cf.polyfill) {
if (H.setup.hide === "all") {
H.toggle("off");
}
if (H.setup.hide !== "none") {
- H.setup.timeOutHandler = window.setTimeout(function timedOut() {
+ H.setup.timeOutHandler = w.setTimeout(function timedOut() {
H.toggle("on");
H.events.dispatch("timeout", {"delay": H.setup.timeout});
}, H.setup.timeout);
@@ -769,13 +767,13 @@
}
} else {
H.events.dispatch("tearDown", {});
- window.Hyphenopoly = null;
+ w.Hyphenopoly = null;
}
if (H.cacheFeatureTests) {
- sessionStorage.setItem(
+ store.setItem(
"Hyphenopoly_Loader",
- JSON.stringify(H.clientFeat)
+ JSON.stringify(H.cf)
);
}
-}());
+}(window, document, Hyphenopoly, Object));
diff --git a/hyphenEngine.asm.js b/hyphenEngine.asm.js
index faf8944b..6ec8c5cd 100644
--- a/hyphenEngine.asm.js
+++ b/hyphenEngine.asm.js
@@ -1,5 +1,5 @@
/**
- * @license hyphenEngine.asm.js 3.0.2 - client side hyphenation for webbrowsers
+ * @license hyphenEngine.asm.js 3.1.0 - client side hyphenation for webbrowsers
* ©2019 Mathias Nater, Zürich (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
diff --git a/hyphenopoly.module.js b/hyphenopoly.module.js
index 67f2bd5a..a680f55b 100644
--- a/hyphenopoly.module.js
+++ b/hyphenopoly.module.js
@@ -1,5 +1,5 @@
/**
- * @license Hyphenopoly.module.js 3.0.2 - hyphenation for node
+ * @license Hyphenopoly.module.js 3.1.0 - hyphenation for node
* ©2018 Mathias Nater, Zürich (mathiasnater at gmail dot com)
* https://github.com/mnater/Hyphenopoly
*
diff --git a/package-lock.json b/package-lock.json
index 23221ff5..0e362280 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "hyphenopoly",
- "version": "3.0.1",
+ "version": "3.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -75,15 +75,15 @@
}
},
"@babel/parser": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz",
- "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==",
+ "version": "7.4.5",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz",
+ "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==",
"dev": true
},
"@babel/runtime": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.4.tgz",
- "integrity": "sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==",
+ "version": "7.4.5",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz",
+ "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.2"
@@ -109,16 +109,16 @@
}
},
"@babel/traverse": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz",
- "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==",
+ "version": "7.4.5",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz",
+ "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@babel/generator": "^7.4.4",
"@babel/helper-function-name": "^7.1.0",
"@babel/helper-split-export-declaration": "^7.4.4",
- "@babel/parser": "^7.4.4",
+ "@babel/parser": "^7.4.5",
"@babel/types": "^7.4.4",
"debug": "^4.1.0",
"globals": "^11.1.0",
@@ -157,9 +157,9 @@
"dev": true
},
"@types/react": {
- "version": "16.8.14",
- "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.14.tgz",
- "integrity": "sha512-26tFVJ1omGmzIdFTFmnC5zhz1GTaqCjxgUxV4KzWvsybF42P7/j4RBn6UeO3KbHPXqKWZszMXMoI65xIWm954A==",
+ "version": "16.8.18",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.18.tgz",
+ "integrity": "sha512-lUXdKzRqWR4FebR5tGHkLCqnvQJS4fdXKCBrNGGbglqZg2gpU+J82pMONevQODUotATs9fc9k66bx3/St8vReg==",
"dev": true,
"requires": {
"@types/prop-types": "*",
@@ -870,6 +870,19 @@
"make-dir": "^2.0.0",
"package-hash": "^3.0.0",
"write-file-atomic": "^2.4.2"
+ },
+ "dependencies": {
+ "write-file-atomic": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
+ "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.11",
+ "imurmurhash": "^0.1.4",
+ "signal-exit": "^3.0.2"
+ }
+ }
}
},
"caller-callsite": {
@@ -1125,9 +1138,9 @@
"dev": true
},
"combined-stream": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
- "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"requires": {
"delayed-stream": "~1.0.0"
@@ -1185,9 +1198,9 @@
"dev": true
},
"core-js": {
- "version": "2.6.5",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
- "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==",
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz",
+ "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==",
"dev": true
},
"core-util-is": {
@@ -1245,9 +1258,9 @@
}
},
"csstype": {
- "version": "2.6.4",
- "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.4.tgz",
- "integrity": "sha512-lAJUJP3M6HxFXbqtGRc0iZrdyeN+WzOWeY0q/VnFzI+kqVrYIzC7bWlKqCW7oCIdzoPkvfp82EVvrTlQ8zsWQg==",
+ "version": "2.6.5",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.5.tgz",
+ "integrity": "sha512-JsTaiksRsel5n7XwqPAfB0l3TFKdpjW/kgAELf9vrb5adGA7UCPLajKK5s3nFrcFm3Rkyp/Qkgl73ENc1UY3cA==",
"dev": true
},
"dashdash": {
@@ -1500,9 +1513,9 @@
"dev": true
},
"esm": {
- "version": "3.2.22",
- "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.22.tgz",
- "integrity": "sha512-z8YG7U44L82j1XrdEJcqZOLUnjxco8pO453gKOlaMD1/md1n/5QrscAmYG+oKUspsmDLuBFZrpbxI6aQ67yRxA==",
+ "version": "3.2.25",
+ "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
+ "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
"dev": true
},
"espree": {
@@ -2773,9 +2786,9 @@
"dev": true
},
"ink": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ink/-/ink-2.1.1.tgz",
- "integrity": "sha512-vP1yE/uJoiY6uB9yHalczUA02I9fg7xDUbTEZitPK5y6dvnPo9a/6UWqIB2uCYkHOhEZMN+D/TsVr4v2sz8qYA==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/ink/-/ink-2.2.0.tgz",
+ "integrity": "sha512-BQl7jpmLxPqFGjdQdgXQS0+mAyn1BHkEW1YXur3dahNNwLB6MWsfAZ1GWVdj+Mbpmj+u33KaFOosw3067t3d9g==",
"dev": true,
"requires": {
"@types/react": "^16.8.6",
@@ -3196,9 +3209,9 @@
"dev": true
},
"istanbul-lib-coverage": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
- "integrity": "sha512-LXTBICkMARVgo579kWDm8SqfB6nvSDKNqIOBEjmJRnL04JvoMHCYGWaMddQnseJYtkEuEvO/sIcOxPLk9gERug==",
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
+ "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
"dev": true
},
"istanbul-lib-hook": {
@@ -3225,16 +3238,10 @@
"semver": "^6.0.0"
},
"dependencies": {
- "istanbul-lib-coverage": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
- "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
- "dev": true
- },
"semver": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz",
- "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.0.tgz",
+ "integrity": "sha512-kCqEOOHoBcFs/2Ccuk4Xarm/KiWRSLEX9CAZF8xkJ6ZPlIoTZ8V5f7J16vYLJqDbR7KrxTJpR2lqjIEm2Qx9cQ==",
"dev": true
}
}
@@ -3263,12 +3270,6 @@
"supports-color": "^6.1.0"
},
"dependencies": {
- "istanbul-lib-coverage": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
- "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
- "dev": true
- },
"supports-color": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
@@ -3293,12 +3294,6 @@
"source-map": "^0.6.1"
},
"dependencies": {
- "istanbul-lib-coverage": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
- "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
- "dev": true
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -3308,18 +3303,18 @@
}
},
"istanbul-reports": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.4.tgz",
- "integrity": "sha512-QCHGyZEK0bfi9GR215QSm+NJwFKEShbtc7tfbUdLAEzn3kKhLDDZqvljn8rPZM9v8CEOhzL1nlYoO4r1ryl67w==",
+ "version": "2.2.6",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz",
+ "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==",
"dev": true,
"requires": {
"handlebars": "^4.1.2"
}
},
"jackspeak": {
- "version": "1.3.7",
- "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-1.3.7.tgz",
- "integrity": "sha512-Z4iSFpaCV7Cocpcl5t9/UyPkisxenbmaqminyTgK6lDDMXcm9EvIZ9Bwr/uFbGOjfWlz1UZwKwFY5AvtgNlHuw==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-1.4.0.tgz",
+ "integrity": "sha512-VDcSunT+wcccoG46FtzuBAyQKlzhHjli4q31e1fIHGOsRspqNUFjVzGb+7eIFDlTvqLygxapDHPHS0ouT2o/tw==",
"dev": true,
"requires": {
"cliui": "^4.1.0"
@@ -3853,9 +3848,9 @@
"dev": true
},
"neo-async": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz",
- "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==",
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
+ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
"dev": true
},
"nested-error-stacks": {
@@ -3915,9 +3910,9 @@
"dev": true
},
"nyc": {
- "version": "14.1.0",
- "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.0.tgz",
- "integrity": "sha512-iy9fEV8Emevz3z/AanIZsoGa8F4U2p0JKevZ/F0sk+/B2r9E6Qn+EPs0bpxEhnAt6UPlTL8mQZIaSJy8sK0ZFw==",
+ "version": "14.1.1",
+ "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz",
+ "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==",
"dev": true,
"requires": {
"archy": "^1.0.0",
@@ -3945,14 +3940,6 @@
"uuid": "^3.3.2",
"yargs": "^13.2.2",
"yargs-parser": "^13.0.0"
- },
- "dependencies": {
- "istanbul-lib-coverage": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
- "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
- "dev": true
- }
}
},
"oauth-sign": {
@@ -4268,6 +4255,12 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true
},
+ "picomatch": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz",
+ "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==",
+ "dev": true
+ },
"pify": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
@@ -4340,9 +4333,9 @@
"dev": true
},
"psl": {
- "version": "1.1.31",
- "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
- "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==",
+ "version": "1.1.32",
+ "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
+ "integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g==",
"dev": true
},
"pump": {
@@ -4871,9 +4864,9 @@
"dev": true
},
"resolve": {
- "version": "1.10.1",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz",
- "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==",
+ "version": "1.11.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
+ "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
@@ -5450,33 +5443,33 @@
}
},
"tap": {
- "version": "13.1.0",
- "resolved": "https://registry.npmjs.org/tap/-/tap-13.1.0.tgz",
- "integrity": "sha512-EPCYlkEg4V0rk2fiG8A/WH4FrXEfoWkoiwuGidT3THhOpM4uzgyyrFnYjLj8h26LvmM7OtRh7N+5FIeRGoAJ/Q==",
+ "version": "14.1.11",
+ "resolved": "https://registry.npmjs.org/tap/-/tap-14.1.11.tgz",
+ "integrity": "sha512-lz/nGffbk4M7RfKfK14QrXBSy8cYNKTMZXAgPFSThyDDwsy46VGlp+sEX6jHydQa2xe1Q/Ea3IWCrMI04JM4+A==",
"dev": true,
"requires": {
"async-hook-domain": "^1.1.0",
"bind-obj-methods": "^2.0.0",
"browser-process-hrtime": "^1.0.0",
"capture-stack-trace": "^1.0.0",
- "chokidar": "^2.1.5",
+ "chokidar": "^3.0.0",
"color-support": "^1.1.0",
"coveralls": "^3.0.3",
"diff": "^4.0.1",
"domain-browser": "^1.2.0",
- "esm": "^3.2.22",
+ "esm": "^3.2.25",
"findit": "^2.0.0",
"foreground-child": "^1.3.3",
"fs-exists-cached": "^1.0.0",
"function-loop": "^1.0.2",
- "glob": "^7.1.3",
+ "glob": "^7.1.4",
"import-jsx": "^2.0.0",
"isexe": "^2.0.0",
"istanbul-lib-processinfo": "^1.0.0",
- "jackspeak": "^1.3.7",
+ "jackspeak": "^1.4.0",
"minipass": "^2.3.5",
"mkdirp": "^0.5.1",
- "nyc": "^14.1.0",
+ "nyc": "^14.1.1",
"opener": "^1.5.1",
"own-or": "^1.0.0",
"own-or-env": "^1.0.1",
@@ -5487,15 +5480,131 @@
"tap-mocha-reporter": "^4.0.1",
"tap-parser": "^9.3.2",
"tap-yaml": "^1.0.0",
- "tcompare": "^2.2.0",
- "treport": "^0.3.0",
+ "tcompare": "^2.3.0",
+ "treport": "^0.4.0",
"trivial-deferred": "^1.0.1",
"ts-node": "^8.1.0",
- "typescript": "^3.4.3",
+ "typescript": "^3.4.5",
"which": "^1.3.1",
- "write-file-atomic": "^2.4.2",
- "yaml": "^1.5.0",
+ "write-file-atomic": "^3.0.0",
+ "yaml": "^1.6.0",
"yapool": "^1.0.0"
+ },
+ "dependencies": {
+ "anymatch": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.0.2.tgz",
+ "integrity": "sha512-rUe9SxpRQlVg4EM8It7JMNWWYHAirTPpbTuvaSKybb5IejNgWB3PGBBX9rrPKDx2pM/p3Wh+7+ASaWRyyAbxmQ==",
+ "dev": true,
+ "requires": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ }
+ },
+ "binary-extensions": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz",
+ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==",
+ "dev": true
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "chokidar": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.0.tgz",
+ "integrity": "sha512-ebzWopcacB2J19Jsb5RPtMrzmjUZ5VAQnsL0Ztrix3lswozHbiDp+1Lg3AWSKHdwsps/W2vtshA/x3I827F78g==",
+ "dev": true,
+ "requires": {
+ "anymatch": "^3.0.1",
+ "async-each": "^1.0.3",
+ "braces": "^3.0.2",
+ "fsevents": "^2.0.6",
+ "glob-parent": "^5.0.0",
+ "is-binary-path": "^2.1.0",
+ "is-glob": "^4.0.1",
+ "normalize-path": "^3.0.0",
+ "readdirp": "^3.0.1"
+ }
+ },
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "fsevents": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz",
+ "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==",
+ "dev": true,
+ "optional": true
+ },
+ "glob": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
+ "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz",
+ "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
+ "is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^2.0.0"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "readdirp": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.0.1.tgz",
+ "integrity": "sha512-emMp13NEwWQQX1yeDgrzDNCSY7NHV6k9HTW0OhyQqOAzYacbqQhnmWiCYjxNPcqMTQ9k77oXQJp28jkytm3+jg==",
+ "dev": true,
+ "requires": {
+ "picomatch": "^2.0.4"
+ }
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^7.0.0"
+ }
+ }
}
},
"tap-mocha-reporter": {
@@ -5570,15 +5679,15 @@
}
},
"tcompare": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-2.2.0.tgz",
- "integrity": "sha512-+Mr0UBIE3ncNn0wJvKsw8ph61QoaDvR6Q8WkxWIHxWLcKf8SHGyTTkGLMX//4NKQ/Pe1Uu64oXYJsxLyAXXWdA==",
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-2.3.0.tgz",
+ "integrity": "sha512-fAfA73uFtFGybWGt4+IYT6UPLYVZQ4NfsP+IXEZGY0vh8e2IF7LVKafcQNMRBLqP0wzEA65LM9Tqj+FSmO8GLw==",
"dev": true
},
"terser": {
- "version": "3.17.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz",
- "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.0.tgz",
+ "integrity": "sha512-dOapGTU0hETFl1tCo4t56FN+2jffoKyER9qBGoUFyZ6y7WLoKT0bF+lAYi6B6YsILcGF3q1C2FBh8QcKSCgkgA==",
"dev": true,
"requires": {
"commander": "^2.19.0",
@@ -5710,9 +5819,9 @@
}
},
"treport": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/treport/-/treport-0.3.0.tgz",
- "integrity": "sha512-THr7NS5iLJewcAiaBkxAuCVoakw84hAVY9n2kFNZqlFKHrZeGw8sNR4VhmT23JB1/JnCmPcIOmooTdYYVTI5hA==",
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/treport/-/treport-0.4.0.tgz",
+ "integrity": "sha512-1/gjl3sCJAm60txV3uyz/bghxkzXidSvijM15dM+xgtBRXnZ/5Lwzb6SY1AvhRzTl+rOsukw9kDh2mjTtm6L9A==",
"dev": true,
"requires": {
"cardinal": "^2.1.1",
@@ -5784,24 +5893,16 @@
"dev": true
},
"ts-node": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.1.0.tgz",
- "integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==",
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.2.0.tgz",
+ "integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==",
"dev": true,
"requires": {
"arg": "^4.1.0",
- "diff": "^3.1.0",
+ "diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.6",
"yn": "^3.0.0"
- },
- "dependencies": {
- "diff": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
- "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
- "dev": true
- }
}
},
"tslib": {
@@ -5840,6 +5941,15 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
"dev": true
},
+ "typedarray-to-buffer": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
+ "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
+ "dev": true,
+ "requires": {
+ "is-typedarray": "^1.0.0"
+ }
+ },
"typescript": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
@@ -5847,9 +5957,9 @@
"dev": true
},
"uglify-js": {
- "version": "3.5.9",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.9.tgz",
- "integrity": "sha512-WpT0RqsDtAWPNJK955DEnb6xjymR8Fn0OlK4TT4pS0ASYsVPqr5ELhgwOwLCP5J5vHeJ4xmMmz3DEgdqC10JeQ==",
+ "version": "3.5.15",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz",
+ "integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==",
"dev": true,
"optional": true,
"requires": {
@@ -6373,14 +6483,15 @@
}
},
"write-file-atomic": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz",
- "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.0.tgz",
+ "integrity": "sha512-EIgkf60l2oWsffja2Sf2AL384dx328c0B+cIYPTQq5q2rOYuDV00/iPFBOUiDKKwKMOhkymH8AidPaRvzfxY+Q==",
"dev": true,
"requires": {
- "graceful-fs": "^4.1.11",
"imurmurhash": "^0.1.4",
- "signal-exit": "^3.0.2"
+ "is-typedarray": "^1.0.0",
+ "signal-exit": "^3.0.2",
+ "typedarray-to-buffer": "^3.1.5"
}
},
"x-is-string": {
@@ -6408,12 +6519,12 @@
"dev": true
},
"yaml": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.5.0.tgz",
- "integrity": "sha512-nKxSWOa7vxAP2pikrGxbkZsG/garQseRiLn9mIDjzwoQsyVy7ZWIpLoARejnINGGLA4fttuzRFFNxxbsztdJgw==",
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.6.0.tgz",
+ "integrity": "sha512-iZfse3lwrJRoSlfs/9KQ9iIXxs9++RvBFVzAqbbBiFT+giYtyanevreF9r61ZTbGMgWQBxAua3FzJiniiJXWWw==",
"dev": true,
"requires": {
- "@babel/runtime": "^7.4.3"
+ "@babel/runtime": "^7.4.5"
}
},
"yapool": {
@@ -6423,12 +6534,12 @@
"dev": true
},
"yargs": {
- "version": "13.2.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz",
- "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==",
+ "version": "13.2.4",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz",
+ "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==",
"dev": true,
"requires": {
- "cliui": "^4.0.0",
+ "cliui": "^5.0.0",
"find-up": "^3.0.0",
"get-caller-file": "^2.0.1",
"os-locale": "^3.1.0",
@@ -6438,7 +6549,7 @@
"string-width": "^3.0.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
- "yargs-parser": "^13.0.0"
+ "yargs-parser": "^13.1.0"
},
"dependencies": {
"ansi-regex": {
@@ -6447,6 +6558,17 @@
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
+ "cliui": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
+ "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
+ "dev": true,
+ "requires": {
+ "string-width": "^3.1.0",
+ "strip-ansi": "^5.2.0",
+ "wrap-ansi": "^5.1.0"
+ }
+ },
"string-width": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
@@ -6466,13 +6588,24 @@
"requires": {
"ansi-regex": "^4.1.0"
}
+ },
+ "wrap-ansi": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
+ "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.0",
+ "string-width": "^3.0.0",
+ "strip-ansi": "^5.0.0"
+ }
}
}
},
"yargs-parser": {
- "version": "13.0.0",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz",
- "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==",
+ "version": "13.1.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.0.tgz",
+ "integrity": "sha512-Yq+32PrijHRri0vVKQEm+ys8mbqWjLiwQkMFNXEENutzLPP0bE4Lcd4iA3OQY5HF+GD3xXxf0MEHb8E4/SA3AA==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
diff --git a/package.json b/package.json
index 032c9578..308ca66a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "hyphenopoly",
- "version": "3.0.2",
+ "version": "3.1.0",
"description": "Hyphenation for node and Polyfill for client-side hyphenation.",
"keywords": [
"hyphenation",
@@ -47,8 +47,8 @@
"eslint-plugin-security": "^1.4.0",
"remark-cli": "^6.0.1",
"remark-preset-lint-recommended": "^3.0.2",
- "tap": "^13.1.0",
- "terser": "^3.17.0"
+ "tap": "^14.1.11",
+ "terser": "^4.0.0"
},
"eslintConfig": {
"parserOptions": {
diff --git a/testsuite/test1.html b/testsuite/test1.html
index 270d0c81..76fa7777 100644
--- a/testsuite/test1.html
+++ b/testsuite/test1.html
@@ -9,10 +9,6 @@
"en-us": "FORCEHYPHENOPOLY",
"hy": "ձայնավորձայնավոր"
},
- paths: {
- "maindir": "../",
- "patterndir": "../patterns/"
- },
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
@@ -28,7 +24,7 @@
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
- if (Hyphenopoly.clientFeat.langs[lang] === "CSS") {
+ if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "" + i + " passed (CSS)
";
result = result && true;
} else {
diff --git a/testsuite/test10.html b/testsuite/test10.html
index d51b7123..67ec1832 100644
--- a/testsuite/test10.html
+++ b/testsuite/test10.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
hide: "element",
selectors: {
diff --git a/testsuite/test11.html b/testsuite/test11.html
index 431af426..01d0d0b5 100644
--- a/testsuite/test11.html
+++ b/testsuite/test11.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test12.html b/testsuite/test12.html
index d089afae..faeabb87 100644
--- a/testsuite/test12.html
+++ b/testsuite/test12.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
dontHyphenate: {
kbd: false,
diff --git a/testsuite/test13.html b/testsuite/test13.html
index e8833743..46246e29 100644
--- a/testsuite/test13.html
+++ b/testsuite/test13.html
@@ -9,10 +9,6 @@
"en-us": "FORCEHYPHENOPOLY",
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test14.html b/testsuite/test14.html
index 662942b7..5c8e0a40 100644
--- a/testsuite/test14.html
+++ b/testsuite/test14.html
@@ -9,10 +9,6 @@
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".class1": {
diff --git a/testsuite/test15.html b/testsuite/test15.html
index 9b1f0025..8666e9b1 100644
--- a/testsuite/test15.html
+++ b/testsuite/test15.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test16.html b/testsuite/test16.html
index 14624a06..63614e30 100644
--- a/testsuite/test16.html
+++ b/testsuite/test16.html
@@ -8,10 +8,6 @@
require: {
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test17.html b/testsuite/test17.html
index 3e25e905..fb6cee17 100644
--- a/testsuite/test17.html
+++ b/testsuite/test17.html
@@ -8,10 +8,6 @@
require: {
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {}
diff --git a/testsuite/test18.html b/testsuite/test18.html
index b41416b1..9462586e 100644
--- a/testsuite/test18.html
+++ b/testsuite/test18.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test19.html b/testsuite/test19.html
index efc1b968..5f7f3b26 100644
--- a/testsuite/test19.html
+++ b/testsuite/test19.html
@@ -8,10 +8,6 @@
require: {
"la": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test2.html b/testsuite/test2.html
index a61c5183..6bd222be 100644
--- a/testsuite/test2.html
+++ b/testsuite/test2.html
@@ -8,10 +8,6 @@
require: {
"hu": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test20.html b/testsuite/test20.html
index b9165de3..d5918302 100644
--- a/testsuite/test20.html
+++ b/testsuite/test20.html
@@ -9,10 +9,6 @@
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test21.html b/testsuite/test21.html
index de608d68..5d09322d 100644
--- a/testsuite/test21.html
+++ b/testsuite/test21.html
@@ -10,10 +10,6 @@
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test22.html b/testsuite/test22.html
index f452f876..b3b57998 100644
--- a/testsuite/test22.html
+++ b/testsuite/test22.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test23.html b/testsuite/test23.html
index 936c36c3..778e74a4 100644
--- a/testsuite/test23.html
+++ b/testsuite/test23.html
@@ -10,10 +10,6 @@
require: {
"fur": "probabilmentri"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test24.html b/testsuite/test24.html
index c398595d..50062c4f 100644
--- a/testsuite/test24.html
+++ b/testsuite/test24.html
@@ -13,10 +13,6 @@
"en-au": "en-gb",
"en": "en-us"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
safeCopy: false
},
@@ -35,7 +31,7 @@
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
- if (Hyphenopoly.clientFeat.langs[lang] === "CSS") {
+ if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "" + i + " passed (CSS)
";
result = result && true;
} else {
diff --git a/testsuite/test25.html b/testsuite/test25.html
index ca5fb3d3..0dc77912 100644
--- a/testsuite/test25.html
+++ b/testsuite/test25.html
@@ -8,10 +8,6 @@
require: {
"nl": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test26.html b/testsuite/test26.html
index 5bca61ea..48f0b58f 100644
--- a/testsuite/test26.html
+++ b/testsuite/test26.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test27.html b/testsuite/test27.html
index 0afddec3..50b5791e 100644
--- a/testsuite/test27.html
+++ b/testsuite/test27.html
@@ -8,10 +8,6 @@
require: {
"fur": "probabilmentri"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test28.html b/testsuite/test28.html
index fb2fd85a..5fb52472 100644
--- a/testsuite/test28.html
+++ b/testsuite/test28.html
@@ -11,10 +11,6 @@
require: {
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
hide: hide_mode,
selectors: {
diff --git a/testsuite/test29.html b/testsuite/test29.html
index 01ac8e6b..a5e8fa07 100644
--- a/testsuite/test29.html
+++ b/testsuite/test29.html
@@ -15,10 +15,6 @@
"en-au": "en-gb",
"de-ch": "de"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
hide: "all",
selectors: {
@@ -107,11 +103,11 @@ 4: en-AU (fallback to en-gb)
5: de
Die Worttrennung, auch Silbentrennung genannt, bezeichnet in der Orthographie die Art und Weise, wie die Wörter insbesondere am Zeilenende getrennt werden können.
- Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.
+ Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.
6: de-CH (fallback to de)
Die Worttrennung, auch Silbentrennung genannt, bezeichnet in der Orthographie die Art und Weise, wie die Wörter insbesondere am Zeilenende getrennt werden können.
- Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.
+ Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.
Test Ref
+
+
+ Test 036
+ Reject hyphenator-promise if pattern can't be loaded.
+
+
+ fur
+
+ Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl
+
+ Test Ref
+
diff --git a/testsuite/test3.html b/testsuite/test3.html
index a2b0cdd3..72c4452b 100644
--- a/testsuite/test3.html
+++ b/testsuite/test3.html
@@ -9,10 +9,6 @@
require: {
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
diff --git a/testsuite/test30.html b/testsuite/test30.html
index 2650e1cc..49997dc5 100644
--- a/testsuite/test30.html
+++ b/testsuite/test30.html
@@ -8,10 +8,6 @@
require: {
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
classnames: {
"hyphenopoly": {}
diff --git a/testsuite/test31.html b/testsuite/test31.html
index ee9dfd5f..2f55ee60 100644
--- a/testsuite/test31.html
+++ b/testsuite/test31.html
@@ -8,10 +8,6 @@
require: {
"de": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
dontHyphenateClass: "nohyphens",
selectors: {
diff --git a/testsuite/test32.html b/testsuite/test32.html
index ce85254a..0809549e 100644
--- a/testsuite/test32.html
+++ b/testsuite/test32.html
@@ -53,10 +53,6 @@
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test33.html b/testsuite/test33.html
index 7f6f0fa8..53c7b8e8 100644
--- a/testsuite/test33.html
+++ b/testsuite/test33.html
@@ -12,10 +12,6 @@
fallbacks: {
"en-au": "en-us"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
safeCopy: false
},
@@ -34,7 +30,7 @@
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
- if (Hyphenopoly.clientFeat.langs[lang] === "CSS") {
+ if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "
";
result = result && true;
} else {
diff --git a/testsuite/test34.html b/testsuite/test34.html
index dbf73e31..99cca5dd 100644
--- a/testsuite/test34.html
+++ b/testsuite/test34.html
@@ -9,10 +9,6 @@
"foobar": "garzabariktimalborsi",
"en-us": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
safeCopy: false,
checkRes: true
@@ -32,7 +28,7 @@
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
- if (Hyphenopoly.clientFeat.langs[lang] === "CSS") {
+ if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "
";
result = result && true;
} else {
diff --git a/testsuite/test35.html b/testsuite/test35.html
index a1713585..2556455f 100644
--- a/testsuite/test35.html
+++ b/testsuite/test35.html
@@ -8,10 +8,6 @@
require: {
"hu": "FORCEHYPHENOPOLY"
},
- paths: {
- maindir: "../",
- patterndir: "../patterns/"
- },
setup: {
selectors: {
".hyphenate": {
diff --git a/testsuite/test36.html b/testsuite/test36.html
new file mode 100644
index 00000000..18834639
--- /dev/null
+++ b/testsuite/test36.html
@@ -0,0 +1,128 @@
+
+
+