# Editing link targets

**URL:** https://discuss.prosemirror.net/t/editing-link-targets/1203
**Category:** Uncategorized
**Created:** [February 26, 2018, 4:14pm UTC](https://discuss.prosemirror.net/t/editing-link-targets/1203 "2018-02-26T16:14:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jjmurre](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/jjmurre/32/459_2.png) [@jjmurre](https://discuss.prosemirror.net/u/jjmurre)
#### Post date: [February 26, 2018, 4:14pm UTC](https://discuss.prosemirror.net/t/editing-link-targets/1203/1 "2018-02-26T16:14:23Z")

</div>

The current implementation of hyperlinks in the example-setup is adding/removing (and not updating) links. I want to make it possible to edit the properties of the link. I have been looking at the way image nodes are implemented.

But, link properties are part of a mark. So, I was thinking of using something like `state.doc.rangeHasMark()` (e.g. `rangeGetMark()`) to find the actual mark that contains the link properties, and use these properties to pre-fill the fields in `openPrompt()`. Is this a sensible approach, or am I missing some convenient API call?

---

<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: [February 26, 2018, 4:36pm UTC](https://discuss.prosemirror.net/t/editing-link-targets/1203/2 "2018-02-26T16:36:35Z")

</div>

Yes, that sounds like a reasonable approach. The example setup does something like that for images—if you have an image node selected and do ‘insert image’, it’ll pre-fill the prompt with the image’s attributes.

---

<div class="post-metadata">

### Author: ![Dev1an](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/dev1an/32/1179_2.png) [@Dev1an](https://discuss.prosemirror.net/u/Dev1an)
#### Post date: [October 22, 2019, 2:47pm UTC](https://discuss.prosemirror.net/t/editing-link-targets/1203/3 "2019-10-22T14:47:58Z")

</div>

I think the question here is more like “how to find the Mark in the given range” than “How to fill the prompt”. And since images are nodes and not marks, I don’t see how this gives an answer to the question.

This post however is related to getting a mark in the current selection: [Expanding the selection to the active mark?](https://discuss.prosemirror.net/t/expanding-the-selection-to-the-active-mark/478/7)

---

<div class="post-metadata">

### Author: ![sweety-chaudhary](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/s/eb8c5e/32.png) [@sweety-chaudhary](https://discuss.prosemirror.net/u/sweety-chaudhary)
#### Post date: [May 15, 2020, 12:08pm UTC](https://discuss.prosemirror.net/t/editing-link-targets/1203/4 "2020-05-15T12:08:33Z")

</div>

Using state.doc.rangeHasMark() I am not able to find the mark.

Is there any other way of finding the mark that contains the link properties

---

<div class="post-metadata">

### Author: ![clibu](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/clibu/32/1817_2.png) [@clibu](https://discuss.prosemirror.net/u/clibu)
#### Post date: [November 24, 2020, 3:07am UTC](https://discuss.prosemirror.net/t/editing-link-targets/1203/5 "2020-11-24T03:07:57Z")

</div>

I realize this is an old post however my code may be of help to someone with this issue. Note that I am very new to Prosemirror, so there may well be better ways to accomplish this.

See my post: [How to get the determined attributes from a mark](https://discuss.prosemirror.net/t/how-to-get-the-determined-attributes-from-a-mark/853/3)
