fix: Improve SmartText fraction regex pattern (#7141)

Modify fraction regex statements to not match if directly preceded by a character
This commit is contained in:
Jack Woodgate
2024-06-26 00:11:13 +12:00
committed by GitHub
parent 77d6797d85
commit beabd32e6a

View File

@@ -4,8 +4,8 @@ import { InputRule } from "@shared/editor/lib/InputRule";
const rightArrow = new InputRule(/->$/, "→");
const emdash = new InputRule(/--$/, "—");
const oneHalf = new InputRule(/1\/2$/, "½");
const threeQuarters = new InputRule(/3\/4$/, "¾");
const oneHalf = new InputRule(/(?:^|\s)1\/2$/, "½");
const threeQuarters = new InputRule(/(?:^|\s)3\/4$/, "¾");
const copyright = new InputRule(/\(c\)$/, "©️");
const registered = new InputRule(/\(r\)$/, "®️");
const trademarked = new InputRule(/\(tm\)$/, "™️");