diff --git a/reader/src/ASTRv2/content/animtext.vue b/reader/src/ASTRv2/content/animtext.vue index 452d0a6..b3616b7 100644 --- a/reader/src/ASTRv2/content/animtext.vue +++ b/reader/src/ASTRv2/content/animtext.vue @@ -34,13 +34,11 @@ if(this.line.attributes.name == "group_location_stamp"){ var raw = this.line.attributes.content; // the raw string is in the format of " title content " - // we need to extract the title and content - // we can do this by splitting the string by the "" and "" tags - // and then removing the closing tags "" - let parts = raw.split(""); - this.title = parts[1].split("")[0]; - parts = parts[1].split(""); - this.content = parts[1].split("")[0]; + // the p=1 or 2 is optional, but the closing tag is required + var title = raw.match(/(.*?)<\/>/); + var content = raw.match(/(.*?)<\/>/); + this.title = title ? title[1] : ""; + this.content = content ? content[1] : ""; } } }