Trilium-SyntaxHighlightWidget
Trilium-SyntaxHighlightWidget copied to clipboard
fix: highlight triggered while ime inputs are not committed
The highlighting is wrongly triggered while IME inputs are not committed, which is a normal situation for CJK inputs. The current version will give a result like this:
This PR maintains a new state inComposition
in HighlightCodeBlockWidget
by listening compositionstart
and compositionend
events, and ignores every changes fired between these events. The fix references facebook/react#3926 and ckeditor/ckeditor5#1342.