본문 빈 줄 간격 보존

This commit is contained in:
2026-05-14 16:24:40 +09:00
parent 941355cae9
commit f5bfb560e2
8 changed files with 27 additions and 6 deletions

View File

@@ -225,12 +225,13 @@ const parseMarkdownBlocks = (markdown) => {
const trimmedLine = line.trim()
if (trimmedLine === BLANK_PARAGRAPH_MARKER) {
blocks.push(createBlock('paragraph', '', null, `block-${blocks.length}`))
blocks.push(createBlock('spacer', '', null, `block-${blocks.length}`))
index += 1
continue
}
if (!trimmedLine) {
blocks.push(createBlock('spacer', '', null, `block-${blocks.length}`))
index += 1
continue
}
@@ -488,7 +489,8 @@ const showNextImage = () => {
<template>
<div class="content-markdown-renderer">
<template v-for="block in blocks" :key="block.id">
<ProseHeading v-if="block.type === 'heading'" :level="block.level">
<div v-if="block.type === 'spacer'" class="content-markdown-renderer__spacer h-6" aria-hidden="true" />
<ProseHeading v-else-if="block.type === 'heading'" :level="block.level">
<template v-for="(segment, segmentIndex) in parseInlineSegments(block.text)" :key="`${block.id}-heading-${segmentIndex}`">
<strong v-if="segment.type === 'strong'">{{ segment.text }}</strong>
<em v-else-if="segment.type === 'em'">{{ segment.text }}</em>

View File

@@ -1,5 +1,9 @@
# 업데이트 요약
## v1.0.15
- 본문 중간의 빈 줄이 공개 화면과 관리자 미리보기에서 사라지지 않도록 간격 보존을 보강.
## v1.0.14
- Markdown-first 전환 후 레거시 블록 본문이나 기존 자동 저장본 때문에 게시물 발행이 막히는 문제를 보강.

View File

@@ -1,5 +1,11 @@
# 의사결정 이력
## 2026-05-14 v1.0.15
### 마크다운 빈 줄 간격 보존
Markdown-first 에디터에서는 작성자가 빈 줄을 넣어 문단 사이 호흡을 직접 조절할 수 있어야 한다. 기존 `ContentMarkdownRenderer`는 빈 줄을 파싱 단계에서 건너뛰어 1줄과 2줄의 차이가 모두 사라졌다. 빈 줄과 레거시 빈 문단 마커를 `spacer` 블록으로 렌더링해 공개 본문과 관리자 미리보기에서 작성자가 넣은 세로 간격을 보존한다. 세부 높이는 이후 본문 스타일 QA에서 조정하되, 우선 줄 수 정보가 사라지지 않는 것을 기준으로 한다.
## 2026-05-14 v1.0.14
### Markdown-first 전환 후 레거시 본문 정규화

View File

@@ -83,7 +83,7 @@
| 파일 | 화면 위치 |
|------|-----------|
| components/content/ContentRenderer.vue | 게시물/페이지 본문 |
| components/content/ContentMarkdownRenderer.vue | 마크다운 문자열 기반 본문 렌더링, 확장 블록 파싱 |
| components/content/ContentMarkdownRenderer.vue | 마크다운 문자열 기반 본문 렌더링, 빈 줄 spacer 보존, 확장 블록 파싱 |
| components/content/ProseHeading.vue | h1~h6 제목 |
| components/content/ProseImage.vue | 본문 내 이미지 |
| components/content/ProseList.vue | 목록 |

View File

@@ -180,6 +180,9 @@ components/content/
- 이미지 갤러리
- `:::gallery` ~ `:::` fenced block 내부에 이미지 마크다운 행을 여러 개 작성
- 렌더링: `ContentMarkdownRenderer.vue` (그리드 + 라이트박스)
- 빈 줄
- 본문 중간의 내용 없는 줄은 줄 수만큼 spacer 블록으로 렌더링해 작성자가 의도한 세로 간격을 보존
- 레거시 빈 문단 마커(`<!--sori:blank-paragraph-->`)도 같은 spacer로 렌더링
- 카드류
- Callout: `:::callout` ~ `:::` (왼쪽 강조선은 `var(--site-accent)`)
- Toggle: `:::toggle 제목` ~ `:::`

View File

@@ -1,5 +1,11 @@
# 업데이트 이력
## v1.0.15
- 공개 본문/관리자 미리보기 공통 `ContentMarkdownRenderer`가 빈 줄을 버리지 않고 spacer 블록으로 렌더링하도록 수정.
- 레거시 빈 문단 마커(`<!--sori:blank-paragraph-->`)도 동일한 spacer 블록으로 표시하도록 정리.
- 패키지 버전 `1.0.15`로 갱신.
## v1.0.14
- 관리자 게시물/페이지 입력 스키마에서 레거시 블록 배열·객체 본문 값을 저장용 마크다운 문자열로 정규화하도록 보강.

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "sori.studio",
"version": "1.0.14",
"version": "1.0.15",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sori.studio",
"version": "1.0.14",
"version": "1.0.15",
"hasInstallScript": true,
"dependencies": {
"@nuxtjs/tailwindcss": "^6.14.0",

View File

@@ -1,6 +1,6 @@
{
"name": "sori.studio",
"version": "1.0.14",
"version": "1.0.15",
"private": true,
"type": "module",
"imports": {