Skip to content

이미지 삽입 후 단락 생성 기능 추가#2

Open
mozzi34 wants to merge 1 commit intonononcrust:mainfrom
mozzi34:test/image-cursor-next-line
Open

이미지 삽입 후 단락 생성 기능 추가#2
mozzi34 wants to merge 1 commit intonononcrust:mainfrom
mozzi34:test/image-cursor-next-line

Conversation

@mozzi34
Copy link

@mozzi34 mozzi34 commented Jun 24, 2025

참고한 이슈

// createParagraphNear: https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/create-paragraph-near#page-title

editor.chain().focus().insertImage({ url: null, id }).createParagraphNear().run();

// editor.state.selection.$anchor.pos
const anchorPosition = editor.state.selection.$anchor.pos;

editor
  .chain()
  .focus()
  .insertImage({ url: null, id })
  .insertContentAt(anchorPosition, { type: "paragraph" })
  .run();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant