# Don't wrap certain inline nodes in another marks

**URL:** <https://discuss.prosemirror.net/t/dont-wrap-certain-inline-nodes-in-another-marks/2784>\
**Category:** Uncategorized\
**Created:** [May 22, 2020, 7:26am UTC](https://discuss.prosemirror.net/t/dont-wrap-certain-inline-nodes-in-another-marks/2784 "2020-05-22T07:26:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfirba](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kfirba/32/1453_2.png) [@kfirba](https://discuss.prosemirror.net/u/kfirba)\
**Post date:** [May 22, 2020, 7:26am UTC](https://discuss.prosemirror.net/t/dont-wrap-certain-inline-nodes-in-another-marks/2784/1 "2020-05-22T07:26:19Z")

</div>

Hey,

I’m trying to develop an image inline node with smart uploading. Everything seems to work just fine, however, I’ve stumbled upon 2 issues I can’t solve:

1. I want to disallow the image marks to be wrapped in some other marks (bold, italic, underline, strike, etc.). As for now, given I have the following DOM:

```auto
<p>Some text some text <img ..> some text some text</p>

```

and I try select everything and applies **BOLD** to it, the entire paragraph’s content will be wrapped in a `<strong>` tag:

```auto
<p><strong>Some text some text <img ..> some text some text</strong></p>

```

Ideally, I would like it to be:

```auto
<p><strong>Some text some text </strong><img ..><strong> some text some text</strong></p>

```

1. For some reason, Prosemirror adds a `<br>` to the end of my paragraph even tho it contains an image. Why is that?

```auto
<p><img ...><br></p> <!-- See the <br> at the end of the paragraph. Why? -->

```

Thanks!

---

<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:** [May 22, 2020, 5:39pm UTC](https://discuss.prosemirror.net/t/dont-wrap-certain-inline-nodes-in-another-marks/2784/2 "2020-05-22T17:39:53Z")

</div>

Disallowing marks on some nodes isn’t supported (the parent node determines what marks are allowed, and that is used for all its children).

> [@kfirba](#):
>
> For some reason, Prosemirror adds a `<br>` to the end of my paragraph even tho it contains an image. Why is that?

Works around bugs in the way browsers display the cursor. This isn’t part of the actual document, just rendered in the editable representation.

---

<div class="post-metadata">

**Author:** ![kfirba](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kfirba/32/1453_2.png) [@kfirba](https://discuss.prosemirror.net/u/kfirba)\
**Post date:** [May 24, 2020, 8:24am UTC](https://discuss.prosemirror.net/t/dont-wrap-certain-inline-nodes-in-another-marks/2784/3 "2020-05-24T08:24:49Z")

</div>

I see.

About the `<br>`, it seems to add unnecessary height to the document when the white-space is set to `pre-wrap`:

```css
white-space: pre-wrap;

```

Is it needed?

---

<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:** [May 24, 2020, 1:25pm UTC](https://discuss.prosemirror.net/t/dont-wrap-certain-inline-nodes-in-another-marks/2784/4 "2020-05-24T13:25:49Z")

</div>

> [@kfirba](#):
>
> About the `<br>` , it seems to add unnecessary height to the document when the white-space is set to `pre-wrap` :

That’s the default, and I don’t see any changes in height caused by the `<br>` (as I understand it, browsers will more or less not render anything for a `<br>` at the end of a block node).
