# Transaction steps work very strange

**URL:** <https://discuss.prosemirror.net/t/transaction-steps-work-very-strange/6257>\
**Category:** Uncategorized\
**Created:** [March 5, 2024, 1:05pm UTC](https://discuss.prosemirror.net/t/transaction-steps-work-very-strange/6257 "2024-03-05T13:05:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seleckis](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/seleckis/32/3866_2.png) [@seleckis](https://discuss.prosemirror.net/u/seleckis)\
**Post date:** [March 5, 2024, 1:05pm UTC](https://discuss.prosemirror.net/t/transaction-steps-work-very-strange/6257/1 "2024-03-05T13:05:25Z")

</div>

Hi, I’m new to prosemirror, I want to understand the way it works, and sometimes it makes me mad. I’m trying to handle transactions and sometimes steps produced are very strange. Two examples:

Using backspace in editor to delete text in most cases produces step like this:

```auto
{
  from: 99,
  to: 100,
  slice: {
    size: 0,
    content: {
      content: [],
      size: 0,
    }
  }
}

```

but pressing Backspace when the caret is placed on the left position of a marked text with SPACE character at the beginning the step would be:

```auto
{
  from: 99,
  to: 112,
  slice: {
    size: 12,
    content: {
      content: [
        {
          "type": "text",
          "text": " marked text"
        }
      ],
      size: 12,
    }
  }
}

```

why? I just delete a character on the left of the marked.

Another example is more crazy. I have a mark at position: [50, 55], and a mark at position [100, 105]. When I select a text from 100 to 106 (should be a bit more than the range of a mark) and press a key to insert any character, for example “a”, I expect the text [100,106] to be deleted and “a” character to be inserted, it is ok. But the step has this:

```auto
{
  from: 50,
  to: 106,
  content: {
    content: [
      {
        marks: [Mark],
        text: "mark1"
      },
      {
        marks: [],
        text: "text between two marks"
      },
      {
        marks: [Mark, Mark], // two marks
        text: "a" // inserted text
      }
    ],
    size: 56,
  }
}

```

just why? I have selected only the second mark, why step has the first mark and the text between marks?
