Files
sori.studio/lib/markdown-toggle.js
zenn 3fb8a40031 v1.2.9: 라이브 에디터·홈 피드·메인 커버 개선
라이브 모드 코드/콜아웃/토글 편집, 슬래시 명령, 홈 Latest List·Compact·Cards 보기,
사이트 설정 메인 화면 커버(720px) 및 HomeHero 반영.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 16:57:30 +09:00

17 lines
481 B
JavaScript

/**
* 토글 블록 마크다운 줄 배열을 만든다.
* @param {{ title?: string, body?: string }} options - 옵션
* @returns {string[]} 마크다운 줄
*/
export const buildToggleBlockLines = (options = {}) => {
const title = String(options.title ?? '').trim() || '더 보기'
const body = String(options.body ?? '').replace(/\r/g, '')
const bodyLines = body.length ? body.split('\n') : ['']
return [
`:::toggle ${title}`,
...bodyLines,
':::'
]
}