🐛 Fix typography unlinking.

This commit is contained in:
Andrey Antukh 2021-04-14 08:32:06 +02:00
parent 14359d9acf
commit a8565dc2c2
4 changed files with 39 additions and 30 deletions

View file

@ -109,12 +109,18 @@ export function applyInlineStyle(state, styles) {
let content = null;
for (let style of styles) {
const [p, k, _] = style.split("$$$");
console.log("applyInlineStyle", style);
const [p, k, v] = style.split("$$$");
const prefix = [p, k, ""].join("$$$");
content = state.getCurrentContent();
content = removeInlineStylePrefix(content, selection, prefix);
content = Modifier.applyInlineStyle(content, selection, style);
if (v !== "z:null") {
content = Modifier.applyInlineStyle(content, selection, style);
}
state = EditorState.push(state, content, "change-inline-style");
}