# How to get the whole text content of a link

**URL:** https://discuss.prosemirror.net/t/how-to-get-the-whole-text-content-of-a-link/4486
**Category:** Uncategorized
**Created:** [March 15, 2022, 9:50am UTC](https://discuss.prosemirror.net/t/how-to-get-the-whole-text-content-of-a-link/4486 "2022-03-15T09:50:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![onewkl](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/onewkl/32/2691_2.png) [@onewkl](https://discuss.prosemirror.net/u/onewkl)
#### Post date: [March 15, 2022, 9:50am UTC](https://discuss.prosemirror.net/t/how-to-get-the-whole-text-content-of-a-link/4486/1 "2022-03-15T09:50:37Z")

</div>

For example, some text has a link mark and strong mark, the strong mark will cause the link mark split into several marks, although there is only one ‘a’ dom node. so how to get the whole text content of this link

---

<div class="post-metadata">

### Author: ![tslocke](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/tslocke/32/2218_2.png) [@tslocke](https://discuss.prosemirror.net/u/tslocke)
#### Post date: [March 16, 2022, 11:16am UTC](https://discuss.prosemirror.net/t/how-to-get-the-whole-text-content-of-a-link/4486/2 "2022-03-16T11:16:23Z")

</div>

Marks are not like nodes. They can’t be ‘split’.

Have a careful read of the document model: [ProseMirror Guide](https://prosemirror.net/docs/guide/#doc)

You probably want to use the Node API to iterate the children of the parent node, collecting the adjacent nodes that have the same link mark on them.

---

<div class="post-metadata">

### Author: ![jpobley](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/jpobley/32/2471_2.png) [@jpobley](https://discuss.prosemirror.net/u/jpobley)
#### Post date: [March 17, 2022, 6:58pm UTC](https://discuss.prosemirror.net/t/how-to-get-the-whole-text-content-of-a-link/4486/3 "2022-03-17T18:58:39Z")

</div>

This thread is related and would be a good starting point: [Expanding the selection to the active mark? - #2 by marijn](https://discuss.prosemirror.net/t/expanding-the-selection-to-the-active-mark/478/2)

---

<div class="post-metadata">

### Author: ![onewkl](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/onewkl/32/2691_2.png) [@onewkl](https://discuss.prosemirror.net/u/onewkl)
#### Post date: [March 22, 2022, 2:10am UTC](https://discuss.prosemirror.net/t/how-to-get-the-whole-text-content-of-a-link/4486/4 "2022-03-22T02:10:29Z")

</div>

Thank you! This looks like what I need.
