Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b627255

Browse files
committed
rename MAX_IMAGE_SIZE to MAX_URL_SIZE
1 parent 6bb9433 commit b627255

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

blocks/file-blocks/markdown-edit/extensions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function makeExtensions({
129129
EditorView.domEventHandlers({
130130
paste(e, view) {
131131
const value = e.clipboardData?.items[0];
132-
const MAX_IMAGE_SIZE = 5000000;
132+
const MAX_URL_SIZE = 5000000;
133133
// handle images pasted from the web
134134
if (value && value.type === "text/html") {
135135
value.getAsString((str) => {
@@ -142,7 +142,7 @@ export function makeExtensions({
142142
from: view.state.selection.main.from,
143143
to: view.state.selection.main.to,
144144
insert: images
145-
.filter((image) => image && image.length < MAX_IMAGE_SIZE)
145+
.filter((image) => image && image.length < MAX_URL_SIZE)
146146
.map((image) => `![${image}](${image})`)
147147
.join("\n"),
148148
},
@@ -158,7 +158,7 @@ export function makeExtensions({
158158
const reader = new FileReader();
159159
reader.onload = (e) => {
160160
const image = e.target?.result as string;
161-
if (image && image.length < MAX_IMAGE_SIZE) {
161+
if (image && image.length < MAX_URL_SIZE) {
162162
view.dispatch({
163163
changes: {
164164
from: view.state.selection.main.from,

0 commit comments

Comments
 (0)