mirror of https://github.com/lidarr/Lidarr
Replaced matchAll usage since it's not available on all browsers
This commit is contained in:
parent
14e13217ba
commit
3f3dd20371
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue