mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 20:34:44 +01:00
Follow-up (#1361)
This commit is contained in:
parent
2feae100ba
commit
6fa1194bd3
@ -40,6 +40,7 @@ const TEXT_FORMAT_BY_TAG_NAME: Record<string, keyof ISelectedTextFormats> = {
|
|||||||
DEL: 'strikethrough',
|
DEL: 'strikethrough',
|
||||||
CODE: 'monospace',
|
CODE: 'monospace',
|
||||||
};
|
};
|
||||||
|
const fragmentEl = document.createElement('div');
|
||||||
|
|
||||||
const TextFormatter: FC<OwnProps> = ({
|
const TextFormatter: FC<OwnProps> = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
@ -117,8 +118,9 @@ const TextFormatter: FC<OwnProps> = ({
|
|||||||
if (!selectedRange) {
|
if (!selectedRange) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
fragmentEl.innerText = selectedRange.toString();
|
||||||
|
|
||||||
return selectedRange.toString();
|
return fragmentEl.innerHTML;
|
||||||
}, [selectedRange]);
|
}, [selectedRange]);
|
||||||
|
|
||||||
const getSelectedElement = useCallback(() => {
|
const getSelectedElement = useCallback(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user