Skip to content

Commit

Permalink
Text Editor: Add support for parsing google docs text align (ie text-…
Browse files Browse the repository at this point in the history
…align style on <p> elements)
  • Loading branch information
ChiriVulpes committed Oct 26, 2024
1 parent a4e36c3 commit 7e4f208
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/component/core/TextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,13 @@ const schema = new Schema({
if (!textAlign)
return false

return { align: textAlign }
return {
align: textAlign === "justify" || textAlign === "start" ? "left"
: textAlign === "end" ? "right"
: textAlign,
}
},
priority: 51,
},
],
toDOM: (node: Node) => ["div", Objects.filterNullish({
Expand Down

0 comments on commit 7e4f208

Please sign in to comment.