Skip to content

Commit

Permalink
Merge pull request #4145 from thematters/fix/moment-editor-breaks
Browse files Browse the repository at this point in the history
feat(moment): allow max 1 hard break and 1 soft break for moment
  • Loading branch information
robertu7 authored Aug 20, 2024
2 parents 6df061d + 46df163 commit 2b0e15b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/connectors/momentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,18 @@ export class MomentService {
data: {
shortHash: shortHash(),
authorId: user.id,
content: normalizeMomentHTML(sanitizeHTML(data.content), {
truncate: {
maxLength: MAX_CONTENT_LINK_TEXT_LENGTH,
keepProtocol: false,
},
}),
content: normalizeMomentHTML(
sanitizeHTML(data.content, {
maxHardBreaks: 1,
maxSoftBreaks: 1,
}),
{
truncate: {
maxLength: MAX_CONTENT_LINK_TEXT_LENGTH,
keepProtocol: false,
},
}
),
state: MOMENT_STATE.active,
},
})
Expand Down

0 comments on commit 2b0e15b

Please sign in to comment.