You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/docs/editor-basics/setup.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ The hook takes two optional parameters:
45
45
46
46
`collaboration`: Options for enabling real-time collaboration. See [Real-time Collaboration](/docs/advanced/real-time-collaboration) for more info.
47
47
48
-
`dictionary`: Provide strings for localization. See the [Localization / i18n example](/examples/basic/localization).
48
+
`dictionary`: Provide strings for localization. See the [Localization / i18n example](/examples/basic/localization) and [Custom Placeholders](/examples/basic/custom-placeholder).
49
49
50
50
`schema` (_advanced_): The editor schema if you want to extend your editor with custom blocks, styles, or inline content [Custom Schemas](/docs/custom-schemas).
`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,
`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,
79
+
e
80
+
);
77
81
}
78
82
79
83
return{
@@ -87,7 +91,6 @@ export class PlaceholderPlugin {
87
91
};
88
92
},
89
93
props: {
90
-
// TODO: maybe also add placeholder for empty document ("e.g.: start writing..")
91
94
decorations: (state)=>{
92
95
const{ doc, selection }=state;
93
96
@@ -104,20 +107,32 @@ export class PlaceholderPlugin {
104
107
return;
105
108
}
106
109
107
-
const$pos=selection.$anchor;
108
-
constnode=$pos.parent;
110
+
constdecs=[];
109
111
110
-
if(node.content.size>0){
111
-
returnnull;
112
+
// decoration for when there's only one empty block
0 commit comments