mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix "no-empty" lint (#24588)
This commit is contained in:
parent
70dc6bcfd3
commit
e9356c2ec9
@ -6,14 +6,17 @@ function insertSpoiler(_, spoiler) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function replaceSpoilers(text) {
|
function replaceSpoilers(text) {
|
||||||
text = text || "";
|
text ||= "";
|
||||||
while (
|
let previousText;
|
||||||
text !==
|
|
||||||
(text = text.replace(
|
do {
|
||||||
|
previousText = text;
|
||||||
|
text = text.replace(
|
||||||
/\[spoiler\]((?:(?!\[spoiler\]|\[\/spoiler\])[\S\s])*)\[\/spoiler\]/gi,
|
/\[spoiler\]((?:(?!\[spoiler\]|\[\/spoiler\])[\S\s])*)\[\/spoiler\]/gi,
|
||||||
insertSpoiler
|
insertSpoiler
|
||||||
))
|
);
|
||||||
) {}
|
} while (text !== previousText);
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user