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