I forked Formatting toolbar to add some very custom formatting stuff.
My code looks like this:
function replaceTitle(text) {
while (
text !==
(text = text.replace(/\[title\](.+?)\[\/title\]/gi, function (match, p) {
return `<div class="job-title">${p}</div>`;
}))
);
return text;
}
But eslint
complains:
9:3 error Expected { after 'while' condition curly
I tried moving that while
and stuff after it onto a single line (the formatting here is applied by vscode and usually works with the other plugins I manage), but that didn’t help either.
Can someone provide me with a clue?
EDIT: Well, it turns out that I don’t actually need that function, but I would still like to know what the problem is.