feat: replace (--) with emdash (#6479)

This commit is contained in:
Savely Krasovsky
2024-02-03 02:23:17 +01:00
committed by GitHub
parent 69ecda387e
commit a3ccb33099

View File

@@ -2,6 +2,7 @@ import { ellipsis, smartQuotes, InputRule } from "prosemirror-inputrules";
import Extension from "@shared/editor/lib/Extension"; import Extension from "@shared/editor/lib/Extension";
const rightArrow = new InputRule(/->$/, "→"); const rightArrow = new InputRule(/->$/, "→");
const emdash = new InputRule(/--$/, "—");
const oneHalf = new InputRule(/1\/2$/, "½"); const oneHalf = new InputRule(/1\/2$/, "½");
const threeQuarters = new InputRule(/3\/4$/, "¾"); const threeQuarters = new InputRule(/3\/4$/, "¾");
const copyright = new InputRule(/\(c\)$/, "©️"); const copyright = new InputRule(/\(c\)$/, "©️");
@@ -16,6 +17,7 @@ export default class SmartText extends Extension {
inputRules() { inputRules() {
return [ return [
rightArrow, rightArrow,
emdash,
oneHalf, oneHalf,
threeQuarters, threeQuarters,
copyright, copyright,