Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Remove ~h~ Bold when a \n is done #6

Open
walliesdevelopments opened this issue Apr 2, 2022 · 2 comments
Open

Remove ~h~ Bold when a \n is done #6

walliesdevelopments opened this issue Apr 2, 2022 · 2 comments

Comments

@walliesdevelopments
Copy link

It would be good if when a new line was made bold text was reset to not be bold

@iSentrie
Copy link
Contributor

iSentrie commented Apr 29, 2022

bold ~h~ isn't removed even by another ~h~, not even ~s~

what could be wrong here 🤔

parseMessage(message) {
const regexColor = /~([^h])~([^~]+)/g;
const regexBold = /~([h])~([^~]+)/g;
const regexStop = /~s~/g;
const regexLine = /\n/g;
message = message.replace(regexColor, "<span class='$1'>$2</span>").replace(regexBold, "<span class='$1'>$2</span>").replace(regexStop, "").replace(regexLine, "<br />");
return message;
}

@toubill
Copy link

toubill commented Jul 15, 2022

Dont edit the JS
Try something like that :
~h~~o~Vous avez consommé : \n ~s~~w~- ~g~1~b~ Raisin Blanc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants