Skip to content

Commit

Permalink
Update animtext.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
050644zf committed Oct 10, 2024
1 parent 68216d3 commit 371e785
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions reader/src/ASTRv2/content/animtext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<p=1> title </><p=2> content </>"
// we need to extract the title and content
// we can do this by splitting the string by the "<p=1>" and "<p=2>" tags
// and then removing the closing tags "</>"
let parts = raw.split("<p=1>");
this.title = parts[1].split("</>")[0];
parts = parts[1].split("<p=2>");
this.content = parts[1].split("</>")[0];
// the p=1 or 2 is optional, but the closing tag is required
var title = raw.match(/<p=1>(.*?)<\/>/);
var content = raw.match(/<p=2>(.*?)<\/>/);
this.title = title ? title[1] : "";
this.content = content ? content[1] : "";
}
}
}
Expand Down

0 comments on commit 371e785

Please sign in to comment.