# Inlining a node for a comment plugin or best to use marks?

**URL:** <https://discuss.prosemirror.net/t/inlining-a-node-for-a-comment-plugin-or-best-to-use-marks/2391>\
**Category:** Uncategorized\
**Created:** [December 2, 2019, 11:51am UTC](https://discuss.prosemirror.net/t/inlining-a-node-for-a-comment-plugin-or-best-to-use-marks/2391 "2019-12-02T11:51:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MarkWilliams3141](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/markwilliams3141/32/1556_2.png) [@MarkWilliams3141](https://discuss.prosemirror.net/u/MarkWilliams3141)\
**Post date:** [December 3, 2019, 11:49am UTC](https://discuss.prosemirror.net/t/inlining-a-node-for-a-comment-plugin-or-best-to-use-marks/2391/3 "2019-12-03T11:49:55Z")

</div>

Thank you for the feedback marijn. I will try with references to ranges outside the document.

One downside is that it could be a bit trickier to preserving comments when users copy to clipboard (Although I don’t know if my organisation needs this functionality anyway).

I think I can use the transaction mapping to update the references as the document is modified.

```
state: {
      apply(transaction, currentValue, oldState, newState) {
        comments.forEach(comment => {
          comment.from = transaction.mapping.map(comment.from);
          comment.to = transaction.mapping.map(comment.to);
        })
      }
    }

```

Just a bit of background. We are building a text editor for highly structured pharmaceutical data. Hopefully can come back and show it off once it is done!

Thanks

---

_[View the full topic](https://discuss.prosemirror.net/t/inlining-a-node-for-a-comment-plugin-or-best-to-use-marks/2391)._
