Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Aikakakah authored Dec 15, 2024
1 parent 13f5f0b commit d5ec679
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function parseBBCode(text) {
let parsedText = text;

// Newlines
//parsedText = parsedText.replace(/\n/g, '<br>');
//parsedText = parsedText.replace(/\[\/heading]<br>/g, '[/heading]');
parsedText = parsedText.replace(/\n/g, '<br>');
parsedText = parsedText.replace(/\[\/head]<br>/g, '[/head]');

// Bold
parsedText = parsedText.replace(/\[bold](.*?)\[\/bold]/gis, '<strong>$1</strong>');
Expand All @@ -84,6 +84,8 @@ function parseBBCode(text) {

// Bullet
parsedText = parsedText.replace(/\[\/bullet](.*?)/gis, '• $1');
parsedText = parsedText.replace(/\[\/bullet1](.*?)\/n/gis, '• $1');
parsedText = parsedText.replace(/\[\/bullet2](.*?\/n)/gis, '• $1');

// Color
parsedText = parsedText.replace(/\[color=(.*?)](.*?)\[\/color]/gis, '<span style="color:$1;">$2</span>');
Expand Down

0 comments on commit d5ec679

Please sign in to comment.