.*?)' + // Match & Capture all chracters (lazy), can be empty
+ '(?=' +
+ anyLogicOperatorNonCapture +
+ '|$)'; // Looks ahead but does not capture the next logic operator
+ // Combine all matching patterns, separated by 'or' pipes
+ return new RegExp(
+ matchStartOfString +
+ '|' +
+ matchIfOperator +
+ '|' +
+ matchElseOperator +
+ '|' +
+ matchEndOperator,
+ 'g'
+ );
}
//////////////////////////////////////////
// End of If Statement Processing Logic //
//////////////////////////////////////////
+export function doesCopyContainTextLink(copy) {
+ return copy.includes(dynamicStrings.TEXT_LINK);
+}
+
export function setupModalLinks(context) {
context.$nextTick(() => {
const elements = document.getElementsByClassName("modal-text")
@@ -430,23 +437,35 @@ export function doesCopyContainRouterLink(copy) {
return copy.includes(this.dynamicStrings.ROUTER_LINK);
}
+/**
+ * splits copy on { ... } such as {routerlink: ...}
+ * @returns array of strings
+ */
export function splitCopyOnCMSPlaceHolder(copy) {
// splits copy on { ... } such as {routerlink: ...}
return copy.split(/{(.*?)}/g);
}
+/**
+ * Returns string2 of input following this pattern: {string1:string2,string3}
+ * @returns string
+ */
export function getRouterLinkRouteFromCopy(copy) {
// sample input: {routerLink:estimate,provide your VIN}
// first split would return 'estimate,provide your VIN'
// second split would return 'estimate'
- return copy.split(":")[1].split(",")[0];
+ return copy.split(':')[1].split(',')[0];
}
+/**
+ * Returns string3 of input following this pattern: { string1: string2, string3 }
+ * @returns string
+ */
export function getRouterLinkDisplayTextFromCopy(copy) {
// sample input: {routerLink:estimate,provide your VIN}
// first split would return 'estimate,provide your VIN'
// second split would return 'provide your VIN'
- return copy.split(":")[1].split(",")[1];
+ return copy.split(':')[1].split(',')[1];
}
// Copy returned from the CMS that has newlines will return blocks wrapped in
@@ -455,5 +474,5 @@ export function getRouterLinkDisplayTextFromCopy(copy) {
// attributes present
export function splitCMSCopyOnParagraphTag(copy) {
// filter removes empty strings that are a result of string.split with regex
- return copy.split(/(?:)|(?:<\/p>)/g).filter((paragraph) => paragraph !== "");
+ return copy.split(/(?:
)|(?:<\/p>)/g).filter((paragraph) => paragraph !== '');
}
diff --git a/src/iss-components/site-footer/site-footer.vue b/src/iss-components/site-footer/site-footer.vue
index b2537703..2ce2c41c 100644
--- a/src/iss-components/site-footer/site-footer.vue
+++ b/src/iss-components/site-footer/site-footer.vue
@@ -3,7 +3,7 @@