@contrail/document-util 1.0.4 → 1.0.5
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.
|
@@ -14,7 +14,7 @@ class DocumentStyleUtil {
|
|
|
14
14
|
static getFirstInlineStyleValue(text, pattern) {
|
|
15
15
|
if (!text)
|
|
16
16
|
return null;
|
|
17
|
-
const regex = new RegExp('(?:\\b' + pattern + ':)\\s*([
|
|
17
|
+
const regex = new RegExp('(?:\\b' + pattern + ':)\\s*[\'"]*([^;\'"]*)[\'"]*[;"](?=[^>]*>)');
|
|
18
18
|
const found = text === null || text === void 0 ? void 0 : text.match(regex);
|
|
19
19
|
return (found === null || found === void 0 ? void 0 : found.length) > 1 ? found[1] : null;
|
|
20
20
|
}
|
|
@@ -34,7 +34,7 @@ class DocumentTextUtil {
|
|
|
34
34
|
const fixedWidth = settings.width ? (settings.width * 100) / fontSize : null;
|
|
35
35
|
words.forEach((word, index) => {
|
|
36
36
|
let wordWidth = 0;
|
|
37
|
-
word.split('').forEach(char => {
|
|
37
|
+
word.split('').forEach((char) => {
|
|
38
38
|
if (/[\x00-\x1F]/.test(char)) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|