관리자 미디어 페이지네이션과 라이브 렌더링 개선
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import {
|
||||
getEditableCaretOffset,
|
||||
markdownInlineToHtml,
|
||||
markdownMultilineInlineToHtml,
|
||||
readEditableTextFromElement,
|
||||
setEditableCaretOffset
|
||||
} from '../../lib/markdown-inline.js'
|
||||
@@ -160,6 +161,12 @@ const resolvedEnterMode = computed(() => {
|
||||
*/
|
||||
const toEditorHtml = () => markdownInlineToHtml(props.modelValue.replace(/\n/g, ' '))
|
||||
|
||||
/**
|
||||
* modelValue를 멀티라인 편집용 HTML로 변환한다.
|
||||
* @returns {string} HTML
|
||||
*/
|
||||
const toMultilineEditorHtml = () => markdownMultilineInlineToHtml(props.modelValue)
|
||||
|
||||
/**
|
||||
* plainText 모드용 편집 텍스트를 만든다.
|
||||
* @param {string} value - 본문
|
||||
@@ -189,7 +196,9 @@ const syncEditorHtml = (options = {}) => {
|
||||
return
|
||||
}
|
||||
|
||||
rootRef.value.innerHTML = toEditorHtml()
|
||||
rootRef.value.innerHTML = resolvedEnterMode.value === 'multiline'
|
||||
? toMultilineEditorHtml()
|
||||
: toEditorHtml()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user