diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 369bf1c06..a2e3f9625 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -5,8 +5,8 @@ {{ questionText }}
{{ alertHeadline }}
- - - {{ copy.split(':')[1].split(',')[1] }} - - - -
+ + + + {{ getRouterLinkDisplayTextFromCopy(copy) }} + + +
)|(?:<\/p>)/g).filter(paragraph => paragraph !== ""); + }, + }, + methods: { + doesCopyContainRouterLink(copy) { + return copy.includes('routerLink:'); + }, + splitCopyForRouterLink(copy){ + // splits copy on { ... } such as {routerlink: ...} + return copy.split(/{(.*?)}/g); + }, + 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]; + }, + 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]; } }, };