mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-30 08:50:48 +00:00
Fix apostrophe after mention
This commit is contained in:
parent
7953f03cbd
commit
b42ee44fa9
@ -41,6 +41,7 @@ import NoteImage from '../NoteImage/NoteImage';
|
|||||||
import { createStore } from 'solid-js/store';
|
import { createStore } from 'solid-js/store';
|
||||||
import { linebreakRegex } from '../../constants';
|
import { linebreakRegex } from '../../constants';
|
||||||
|
|
||||||
|
const specialChars = [",", "?", ";", "!", "'"];
|
||||||
|
|
||||||
const ParsedNote: Component<{
|
const ParsedNote: Component<{
|
||||||
note: PrimalNote,
|
note: PrimalNote,
|
||||||
@ -351,12 +352,18 @@ const ParsedNote: Component<{
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
let end = id[id.length - 1];
|
let end = '';
|
||||||
|
|
||||||
if ([',', '?', ';', '!'].some(x => end === x)) {
|
for (let i=0; i<specialChars.length; i++) {
|
||||||
id = id.slice(0, -1);
|
const char = specialChars[i];
|
||||||
} else {
|
|
||||||
end = '';
|
const index = id.indexOf(char);
|
||||||
|
|
||||||
|
if (index >= 0) {
|
||||||
|
end = id.slice(index);
|
||||||
|
id = id.slice(0, index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user