pro-editor-schema 1.1.1 → 1.1.2
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/dist/index.js +0 -41
- package/dist/index.mjs +0 -41
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2970,44 +2970,6 @@ var validateReferenceCited = (referenceElement, linkElements) => {
|
|
|
2970
2970
|
];
|
|
2971
2971
|
};
|
|
2972
2972
|
|
|
2973
|
-
// src/validation/validateUri.ts
|
|
2974
|
-
var WEB_URI_REGEX = /^(?:(?:https?):\/\/)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:\/[^\s]*)?$/i;
|
|
2975
|
-
var isValidUri = (uri) => {
|
|
2976
|
-
if (!uri || /\s/.test(uri)) {
|
|
2977
|
-
return false;
|
|
2978
|
-
}
|
|
2979
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(uri) && !/^https?:\/\//i.test(uri)) {
|
|
2980
|
-
return false;
|
|
2981
|
-
}
|
|
2982
|
-
return WEB_URI_REGEX.test(uri);
|
|
2983
|
-
};
|
|
2984
|
-
var validateUri = (uriElement) => {
|
|
2985
|
-
const url = uriElement.getAttribute(LINK_ATTRIBUTE);
|
|
2986
|
-
if (!url) {
|
|
2987
|
-
return [
|
|
2988
|
-
createValidationIssue({
|
|
2989
|
-
store: getStore(uriElement),
|
|
2990
|
-
title: "URL is required",
|
|
2991
|
-
kind: "missing",
|
|
2992
|
-
description: "URL is required. Please check and adjust.",
|
|
2993
|
-
level: "warning"
|
|
2994
|
-
})
|
|
2995
|
-
];
|
|
2996
|
-
}
|
|
2997
|
-
if (isValidUri(url)) {
|
|
2998
|
-
return [];
|
|
2999
|
-
}
|
|
3000
|
-
return [
|
|
3001
|
-
createValidationIssue({
|
|
3002
|
-
store: getStore(uriElement),
|
|
3003
|
-
title: "URL cannot be reached",
|
|
3004
|
-
kind: "unlinked",
|
|
3005
|
-
description: "URL cannot be reached. Please check and adjust.",
|
|
3006
|
-
level: "warning"
|
|
3007
|
-
})
|
|
3008
|
-
];
|
|
3009
|
-
};
|
|
3010
|
-
|
|
3011
2973
|
// src/validation/validateXml.ts
|
|
3012
2974
|
var validateElement = (element, root, elementsToLink, linkElements, schemasToValidateAgainst) => {
|
|
3013
2975
|
if (isIgnoredElement(element)) {
|
|
@@ -3028,9 +2990,6 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
3028
2990
|
if (schema.tag === FOOTNOTE_SCHEMA.tag) {
|
|
3029
2991
|
errors.push(...validateFootnoteCue(element, linkElements));
|
|
3030
2992
|
}
|
|
3031
|
-
if (schema.tag === URI_SCHEMA.tag) {
|
|
3032
|
-
errors.push(...validateUri(element));
|
|
3033
|
-
}
|
|
3034
2993
|
if (isIgnoredValidation(schema.code)) {
|
|
3035
2994
|
return errors;
|
|
3036
2995
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2902,44 +2902,6 @@ var validateReferenceCited = (referenceElement, linkElements) => {
|
|
|
2902
2902
|
];
|
|
2903
2903
|
};
|
|
2904
2904
|
|
|
2905
|
-
// src/validation/validateUri.ts
|
|
2906
|
-
var WEB_URI_REGEX = /^(?:(?:https?):\/\/)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:\/[^\s]*)?$/i;
|
|
2907
|
-
var isValidUri = (uri) => {
|
|
2908
|
-
if (!uri || /\s/.test(uri)) {
|
|
2909
|
-
return false;
|
|
2910
|
-
}
|
|
2911
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(uri) && !/^https?:\/\//i.test(uri)) {
|
|
2912
|
-
return false;
|
|
2913
|
-
}
|
|
2914
|
-
return WEB_URI_REGEX.test(uri);
|
|
2915
|
-
};
|
|
2916
|
-
var validateUri = (uriElement) => {
|
|
2917
|
-
const url = uriElement.getAttribute(LINK_ATTRIBUTE);
|
|
2918
|
-
if (!url) {
|
|
2919
|
-
return [
|
|
2920
|
-
createValidationIssue({
|
|
2921
|
-
store: getStore(uriElement),
|
|
2922
|
-
title: "URL is required",
|
|
2923
|
-
kind: "missing",
|
|
2924
|
-
description: "URL is required. Please check and adjust.",
|
|
2925
|
-
level: "warning"
|
|
2926
|
-
})
|
|
2927
|
-
];
|
|
2928
|
-
}
|
|
2929
|
-
if (isValidUri(url)) {
|
|
2930
|
-
return [];
|
|
2931
|
-
}
|
|
2932
|
-
return [
|
|
2933
|
-
createValidationIssue({
|
|
2934
|
-
store: getStore(uriElement),
|
|
2935
|
-
title: "URL cannot be reached",
|
|
2936
|
-
kind: "unlinked",
|
|
2937
|
-
description: "URL cannot be reached. Please check and adjust.",
|
|
2938
|
-
level: "warning"
|
|
2939
|
-
})
|
|
2940
|
-
];
|
|
2941
|
-
};
|
|
2942
|
-
|
|
2943
2905
|
// src/validation/validateXml.ts
|
|
2944
2906
|
var validateElement = (element, root, elementsToLink, linkElements, schemasToValidateAgainst) => {
|
|
2945
2907
|
if (isIgnoredElement(element)) {
|
|
@@ -2960,9 +2922,6 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
|
|
|
2960
2922
|
if (schema.tag === FOOTNOTE_SCHEMA.tag) {
|
|
2961
2923
|
errors.push(...validateFootnoteCue(element, linkElements));
|
|
2962
2924
|
}
|
|
2963
|
-
if (schema.tag === URI_SCHEMA.tag) {
|
|
2964
|
-
errors.push(...validateUri(element));
|
|
2965
|
-
}
|
|
2966
2925
|
if (isIgnoredValidation(schema.code)) {
|
|
2967
2926
|
return errors;
|
|
2968
2927
|
}
|