1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-08-18 08:19:38 +02:00

Replaced matchAll usage since it's not available on all browsers

This commit is contained in:
Taloth Saldono 2020-05-06 14:33:14 +02:00 committed by Qstick
parent cd50767273
commit c988151b5d

View File

@ -16,10 +16,11 @@ class InlineMarkdown extends Component {
// For now only replace links
const markdownBlocks = [];
if (data) {
const matches = data.matchAll(/\[(.+?)\]\((.+?)\)/g);
let endIndex = 0;
const regex = RegExp(/\[(.+?)\]\((.+?)\)/g);
for (const match of matches) {
let endIndex = 0;
let match = null;
while ((match = regex.exec(data)) !== null) {
if (match.index > endIndex) {
markdownBlocks.push(data.substr(endIndex, match.index - endIndex));
}