Created
March 13, 2021 15:19
-
-
Save foeken/e08cb2211c2d75b027efdfe166842bc3 to your computer and use it in GitHub Desktop.
Fix Chinese page creation in Roam Research
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fix broken page creation for Chinese | |
document.addEventListener('input', function(e){ | |
var elem = e.target; | |
var pos = elem.selectionStart; | |
if (elem.nodeName != 'TEXTAREA' || e.data != '【') return; | |
elem.value = elem.value.replace('【','[]'); | |
elem.setSelectionRange(pos, pos); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment