mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-25 23:50:51 +08:00
feat: mobile Profile page
This commit is contained in:
@@ -16,3 +16,12 @@ export function stripMarkdown(text) {
|
||||
el.innerHTML = html
|
||||
return el.textContent || el.innerText || ''
|
||||
}
|
||||
|
||||
export function stripMarkdownLength(text, length) {
|
||||
const plain = stripMarkdown(text)
|
||||
if (!length || plain.length <= length) {
|
||||
return plain
|
||||
}
|
||||
// 截断并加省略号
|
||||
return plain.slice(0, length) + '...'
|
||||
}
|
||||
Reference in New Issue
Block a user