Skip to content

Commit

Permalink
fix: remove console logs from replaceMarkdownTag method in EditorStor…
Browse files Browse the repository at this point in the history
…e to clean up code #290
  • Loading branch information
blinko-space committed Dec 12, 2024
1 parent dba9469 commit f63667a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Common/Editor/editorStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export class EditorStore {
}

replaceMarkdownTag = (text: string, forceFocus = false) => {
console.log('replaceMarkdownTag', this.mdxEditorRef)
// console.log('replaceMarkdownTag', this.mdxEditorRef)
if (this.mdxEditorRef?.current) {
if (this.lastRange) {
console.log('replaceMarkdownTag', JSON.parse(JSON.stringify(this.lastRange)))
// console.log('replaceMarkdownTag', JSON.parse(JSON.stringify(this.lastRange)))
const currentTextBeforeRange = this.lastRangeText.replace(/ /g, " ") ?? ''
console.log('currentTextBeforeRange', currentTextBeforeRange)
// console.log('currentTextBeforeRange', currentTextBeforeRange)
const currentText = this.mdxEditorRef?.current!.getMarkdown().replace(/\\/g, '').replace(/ /g, " ")
console.log('currentText', currentText)
// console.log('currentText', currentText)
const tag = currentTextBeforeRange.replace(helper.regex.isEndsWithHashTag, "#" + text + ' ')
const MyContent = currentText.replace(currentTextBeforeRange, tag)
this.mdxEditorRef?.current.setMarkdown(MyContent)
Expand Down

0 comments on commit f63667a

Please sign in to comment.