mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Allow only a single line break before embedded note
This commit is contained in:
parent
47a38df7e0
commit
f61df308ea
@ -326,6 +326,18 @@ const ParsedNote: Component<{
|
||||
}
|
||||
|
||||
if (isNoteMention(token)) {
|
||||
if (lastSignificantContent === 'LB') {
|
||||
const lastIndex = content.length - 1;
|
||||
const lastGroup = content[lastIndex];
|
||||
|
||||
|
||||
setContent(lastIndex, () => ({
|
||||
type: lastGroup.type,
|
||||
tokens: lastGroup.tokens.slice(0, Math.min(1, lastGroup.tokens.length)),
|
||||
meta: lastGroup.meta,
|
||||
}));
|
||||
|
||||
}
|
||||
lastSignificantContent = 'notemention';
|
||||
updateContent(content, 'notemention', token);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user