safari-regexp-fix

This commit is contained in:
Untone 2024-05-10 15:44:36 +03:00
parent 53d3e2d836
commit ab7dda6c14

View File

@ -59,7 +59,7 @@ export const PublishSettings = (props: Props) => {
const composeDescription = () => { const composeDescription = () => {
if (!props.form.description) { if (!props.form.description) {
const cleanFootnotes = props.form.body.replaceAll(/<footnote data-value=".*?">.*?<\/footnote>/g, '') const cleanFootnotes = props.form.body.replaceAll(/<footnote data-value=".*?">(.*?)<\/footnote>/g, '')
const leadText = cleanFootnotes.replaceAll(/<\/?[^>]+(>|$)/gi, ' ') const leadText = cleanFootnotes.replaceAll(/<\/?[^>]+(>|$)/gi, ' ')
return shorten(leadText, DESCRIPTION_MAX_LENGTH).trim() return shorten(leadText, DESCRIPTION_MAX_LENGTH).trim()
} }