v1.2.9: 라이브 에디터·홈 피드·메인 커버 개선
라이브 모드 코드/콜아웃/토글 편집, 슬래시 명령, 홈 Latest List·Compact·Cards 보기, 사이트 설정 메인 화면 커버(720px) 및 HomeHero 반영. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
16
lib/markdown-toggle.js
Normal file
16
lib/markdown-toggle.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 토글 블록 마크다운 줄 배열을 만든다.
|
||||
* @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,
|
||||
':::'
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user