fix: markdown parser link issue

This commit is contained in:
Jannat Patel
2024-12-17 16:35:30 +05:30
parent 1ea47a008c
commit d3f7baae4c
3 changed files with 9 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
export class MarkdownParser {
export class Markdown {
constructor({ data, api, readOnly, config }) {
this.api = api
this.data = data || {}
@@ -65,6 +65,8 @@ export class MarkdownParser {
} else if (previousLine && this.hasLink(previousLine)) {
const { text, url } = this.extractLink(previousLine)
const anchorTag = `<a href="${url}" target="_blank">${text}</a>`
console.log(previousLine.replace(/\[.+?\]\(.+?\)/, anchorTag))
debugger
this.convertBlock('paragraph', {
text: previousLine.replace(/\[.+?\]\(.+?\)/, anchorTag),
})
@@ -149,4 +151,4 @@ export class MarkdownParser {
}
}
export default MarkdownParser
export default Markdown