Skip to content

Commit d950cbc

Browse files
committed
Merge branch 'link-options' into non-editable-link-bug-fix
2 parents cb5a60f + 7ec964f commit d950cbc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

docs/content/docs/features/blocks/inline-content.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type Link = {
8484
You can customize how links are rendered and how they respond to clicks with the `links` editor option.
8585

8686
```ts
87-
const editor = new BlockNoteEditor({
87+
const editor = BlockNoteEditor.create({
8888
links: {
8989
HTMLAttributes: {
9090
class: "my-link-class",
@@ -102,7 +102,7 @@ const editor = new BlockNoteEditor({
102102
Additional HTML attributes that should be added to rendered link elements.
103103

104104
```ts
105-
const editor = new BlockNoteEditor({
105+
const editor = BlockNoteEditor.create({
106106
links: {
107107
HTMLAttributes: {
108108
class: "my-link-class",
@@ -117,7 +117,7 @@ const editor = new BlockNoteEditor({
117117
Custom handler invoked when a link is clicked. If left `undefined`, links are opened in a new window on click (the default behavior). If provided, that default behavior is disabled and this function is called instead.
118118

119119
```ts
120-
const editor = new BlockNoteEditor({
120+
const editor = BlockNoteEditor.create({
121121
links: {
122122
onClick: (event) => {
123123
// Do something when a link is clicked.

packages/core/src/editor/managers/ExtensionManager/extensions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export function getDefaultTiptapExtensions(
162162

163163
if (options.links?.onClick) {
164164
options.links.onClick(event);
165+
handled = true;
165166
} else {
166167
const attrs = getAttributes(view.state, markType.name);
167168
const href = link.href ?? attrs.href;

0 commit comments

Comments
 (0)