Skip to content

Commit 65a117a

Browse files
committed
chore: add white-space styling
1 parent 5f3fe53 commit 65a117a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/pluggableWidgets/rich-text-web/src/utils/customPluginRegisters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import QuillTableBetter from "./formats/quill-table-better/quill-table-better";
1717
import MxUploader from "./modules/uploader";
1818
import MxBlock from "./formats/block";
1919
import CustomClipboard from "./modules/clipboard";
20+
import { WhiteSpaceStyle } from "./formats/whiteSpace";
2021
class Empty {
2122
doSomething(): string {
2223
return "";
@@ -28,6 +29,7 @@ class Empty {
2829
Quill.debug("error");
2930
Quill.register({ "themes/snow": MendixTheme }, true);
3031
Quill.register(CustomListItem, true);
32+
Quill.register(WhiteSpaceStyle, true);
3133
Quill.register(CustomLink, true);
3234
Quill.register(CustomVideo, true);
3335
Quill.register(CustomImage, true);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Scope, StyleAttributor } from "parchment";
2+
3+
const config = {
4+
scope: Scope.INLINE,
5+
whitelist: [
6+
"normal",
7+
"pre",
8+
"pre-wrap",
9+
"pre-line",
10+
"nowrap",
11+
"wrap",
12+
"break-spaces",
13+
"collapse",
14+
"inherit",
15+
"initial",
16+
"revert",
17+
"unset"
18+
]
19+
};
20+
21+
export class WhiteSpaceStyleAttributor extends StyleAttributor {}
22+
export const WhiteSpaceStyle = new WhiteSpaceStyleAttributor("whitespace", "white-space", config);

0 commit comments

Comments
 (0)