fix: profile routes

This commit is contained in:
Jannat Patel
2024-04-18 20:27:15 +05:30
parent 86713db75e
commit 44b36599c3
10 changed files with 2443 additions and 38 deletions

View File

@@ -7,6 +7,7 @@ import Header from '@editorjs/header'
import Paragraph from '@editorjs/paragraph'
import Embed from '@editorjs/embed'
import NestedList from '@editorjs/nested-list'
import InlineCode from '@editorjs/inline-code'
import { watch } from 'vue'
import dayjs from '@/utils/dayjs'
@@ -136,6 +137,10 @@ export function getEditorTools() {
defaultStyle: 'ordered',
},
},
inlineCode: {
class: InlineCode,
shortcut: 'CMD+SHIFT+M',
},
embed: {
class: Embed,
inlineToolbar: false,
@@ -336,3 +341,19 @@ export function getFormattedDateRange(
format
)}`
}
export function getLineStartPosition(string, position) {
const charLength = 1
let char = ''
while (char !== '\n' && position > 0) {
position = position - charLength
char = string.substr(position, charLength)
}
if (char === '\n') {
position += 1
}
return position
}