From 5ab0d527b28a41744b730170187fc11fdfb1e141 Mon Sep 17 00:00:00 2001
From: Scott Kiener {{ alertHeadline }}
-
-
-
+
+
+
+
This is just a long string.This is just a long string.This is just a long string.This is just a long string.This is just a long string.This is just a long string.This is just a long string.
"; }, - splitAlertCopyForLink(){ - // Splits content when brackets are found in text so that text can be looped through and router-link can be injected when needed - return this.alertCopy.split(/{(.*?)}/g); + splitAlertCopyForParagraphTag(){ + // splits the alertCopy on(with or without attributes) and
+ // filter removes empty strings that are a result of string.split with regex + return this.alertCopy.split(/(?:)|(?:<\/p>)/g).filter(paragraph => paragraph !== ""); + }, + }, + methods: { + splitParagraphForRouterLink(paragraph){ + // splits paragraph on { ... } such as {routerlink: ...} + return paragraph.split(/{(.*?)}/g); } }, };