공개 본문 목록 편집 분리
This commit is contained in:
@@ -12,13 +12,13 @@ export const stripQuoteMarker = (value) => String(value ?? '').replace(/^(?:>\s*
|
||||
* @returns {string} 본문
|
||||
*/
|
||||
export const stripListMarker = (value, ordered = false) => {
|
||||
const raw = String(value ?? '').trim()
|
||||
const raw = String(value ?? '')
|
||||
|
||||
if (ordered) {
|
||||
return raw.replace(/^\d+\.\s*/, '').trim()
|
||||
return raw.replace(/^\s*\d+\.\s*/, '').trim()
|
||||
}
|
||||
|
||||
return raw.replace(/^[-*+]\s+/, '').trim()
|
||||
return raw.replace(/^\s*[-*+]\s*/, '').trim()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,13 +35,13 @@ export const hasQuoteMarker = (value) => /^\s*>/.test(String(value ?? ''))
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const hasListMarker = (value, ordered = false) => {
|
||||
const raw = String(value ?? '').trim()
|
||||
const raw = String(value ?? '')
|
||||
|
||||
if (ordered) {
|
||||
return /^\d+\.\s*/.test(raw)
|
||||
return /^\s*\d+\.(?:\s|$)/.test(raw)
|
||||
}
|
||||
|
||||
return /^[-*+]\s/.test(raw)
|
||||
return /^\s*[-*+](?:\s|$)/.test(raw)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user