# Controlling inclusive left/right of MarkTypes

**URL:** https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267
**Category:** Uncategorized
**Created:** [March 30, 2016, 9:49am UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267 "2016-03-30T09:49:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![kiejo](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kiejo/32/64_2.png) [@kiejo](https://discuss.prosemirror.net/u/kiejo)
#### Post date: [March 30, 2016, 9:49am UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/1 "2016-03-30T09:49:48Z")

</div>

Is there a way to control the way `MarkType`s behave when typing at their edges? I know that the `MarkedRange` class allows setting `inclusiveLeft` and `inclusiveRight` options, but I couldn’t find anything on doing the same for `MarkType`s.

My use case would be to set `inclusiveRight` to `false` for link marks as the current behavior prevents you from writing normal text in a paragraph whose last item is a link (you can only expand the link when typing at the end). The workaround is to create a new paragraph with some text below the paragraph with the link and then join both paragraphs.

Would be great be able to define these options on a schema level.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [March 30, 2016, 1:16pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/2 "2016-03-30T13:16:00Z")

</div>

> [@kiejo](#):
>
> the current behavior prevents you from writing normal text in a paragraph whose last item is a link

Not really – you just have the disable the link style, just like you’d do for bold or emphasis.

But yeah, this might be a useful, straightforward feature to add. It will break the ‘enable and then type’ method of inserting links, but I guess I would disable it in the default schema.

---

<div class="post-metadata">

### Author: ![wes-r](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/wes-r/32/77_2.png) [@wes-r](https://discuss.prosemirror.net/u/wes-r)
#### Post date: [March 30, 2016, 1:38pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/3 "2016-03-30T13:38:55Z")

</div>

Agreed this would be awesome! My current work around has been to hack the `marksAt` node method to remove links when it detects you are at the end of a link.

---

<div class="post-metadata">

### Author: ![kiejo](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kiejo/32/64_2.png) [@kiejo](https://discuss.prosemirror.net/u/kiejo)
#### Post date: [March 30, 2016, 2:03pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/4 "2016-03-30T14:03:31Z")

</div>

> [@marijn](#):
>
> Not really – you just have the disable the link style, just like you’d do for bold or emphasis.

I hadn’t thought of that, but in our case we don’t want a menubar or hotkey for links and our setting is similar to the editor on the [ProseMirror landing page](http://prosemirror.net/), which has the same problem.

> [@marijn](#):
>
> It will break the ‘enable and then type’ method of inserting links

I think this shouldn’t be too big of a problem for links as enabling them before typing currently opens a modal dialog, which is different from the behavior of bold/emphasis where the ‘enable and then type’ functionality works really great. But either way it would definitely be awesome to have this feature!

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [March 30, 2016, 2:33pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/5 "2016-03-30T14:33:19Z")

</div>

Opened [#285](https://github.com/ProseMirror/prosemirror/issues/285)

---

<div class="post-metadata">

### Author: ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)
#### Post date: [August 8, 2024, 7:18pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/6 "2024-08-08T19:18:41Z")

</div>

I’d really like if `inclusiveLeft` were a thing. I was happy to see it was and followed the rabbit hole [here](https://github.com/ProseMirror/prosemirror/pull/287#issuecomment-206321835) to find it was removed, to great sadness.

`code` marks just don’t feel right when you can’t type into the start of them.

---

<div class="post-metadata">

### Author: ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)
#### Post date: [August 8, 2024, 7:24pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/7 "2024-08-08T19:24:52Z")

</div>

To add to this - we could use custom logic to reproduce it but the caret still appears outside of the `code` when the user starts typing instead of inside, so it feels janky at best. The caret discrepancy is noticeable because its size changes (it’s shorter inside code.)

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [August 9, 2024, 11:54am UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/8 "2024-08-09T11:54:17Z")

</div>

Caret style would be entirely unaffected by such a feature. The way the browser decides to draw the caret on an inline boundary is outside of the library’s control.

---

<div class="post-metadata">

### Author: ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)
#### Post date: [August 10, 2024, 11:47pm UTC](https://discuss.prosemirror.net/t/controlling-inclusive-left-right-of-marktypes/267/9 "2024-08-10T23:47:50Z")

</div>

@marijn sorry I opened a new discussion, I didn’t get notified of your reply here. I hadn’t realized that this was browser-controlled. Thank you for taking the time to reply.
