When I replace '<i>p</i>o'
text with a character, say 'm'
, it produces a quite convoluted ReplaceStep which, for some reason, defaults all marks's attributes to their default values.
- Go to https://teemukoivisto.github.io/prosemirror-weird-replace-step OR locally you can run
node serve.js
and go to http:https://localhost:4040/ - Follow the steps
Previous at https://github.com/TeemuKoivisto/prosemirror-weird-replace-step/tree/13c125a37430efcafce4dd6e8a304aa85df6a9c1
- Go to https://teemukoivisto.github.io/prosemirror-weird-replace-step
- Click 'Restore example'
- Select
po
, pressm
- The below JSON should be shown
{
"stepType": "replace",
"from": 5,
"to": 38,
"slice": {
"content": [
{
"type": "text",
"text": "m"
},
{
"type": "text",
"marks": [
{
"type": "italic",
"attrs": {
"color": null
}
}
],
"text": "l"
},
{
"type": "text",
"text": "oo"
},
{
"type": "text",
"marks": [
{
"type": "bold",
"attrs": {
"color": null
}
}
],
"text": "o"
},
{
"type": "text",
"text": "oooo"
},
{
"type": "text",
"marks": [
{
"type": "bold",
"attrs": {
"color": null
}
}
],
"text": "o"
},
{
"type": "text",
"marks": [
{
"type": "italic",
"attrs": {
"color": null
}
}
],
"text": "mm"
},
{
"type": "text",
"text": "oooo"
},
{
"type": "text",
"marks": [
{
"type": "bold",
"attrs": {
"color": null
}
}
],
"text": "ooo"
},
{
"type": "text",
"text": " ooo"
},
{
"type": "text",
"marks": [
{
"type": "bold",
"attrs": {
"color": null
}
}
],
"text": "o"
},
{
"type": "text",
"marks": [
{
"type": "italic",
"attrs": {
"color": null
}
}
],
"text": "cb"
},
{
"type": "text",
"text": "ooo"
},
{
"type": "text",
"marks": [
{
"type": "italic",
"attrs": {
"color": null
}
}
],
"text": "ocb"
}
]
}
}
git submodule update --init --recursive
yarn
yarn pm
yarn start