marijnh on master
Support an --edit arg to pm rel… (compare)
I'm trying to write a test that interacts with a prosemirror instance. It is using Ember's test helper e.g.
await fillIn('.ProseMirror', '<p><a href="#">test</a></p>');. (this is essentially the same as setting
With the goal of acceptance testing, a round-trip through
parseDOM to make sure the markup generated is as expected.
But this doesn't work - the result is just
<p>test</p>. Where did the mark go?
This is reproducible on the demo on the Prosemirror website if you use the dev tools to edit the HTML. Sometimes it works, others it doesn't, I can't seem to find a pattern.
What's going on here and what's the best way to achieve this?
I could of course use ProseMirror commands, but then that is not testing our application as if a user was interacting with it.
Hi all, I'm still battling with the kludge line breaks.
As I understand it, they are added to a node to make that node visible - so the cursor can land in it (otherwise it would collapse).
What I don't understand is why it is added when there is already content there, preventing such a collapse.
It seems (to me at least) to create more problems than it solves in this scenario.
Our prosemirror instance supports quite a broad range of HTML nodes and styles, and no matter how hard I try, whatever I paste into ProseMirror, it never looks like the source it was copied from.
Can anybody help?
Thanks for the response, but I still must be missing the point!
Here is a screencast example: https://share.getcloudapp.com/jku4WGzm
In it, I:
Notice how the kludge br means the pasted HTML does not visually match where it was copied from. (It creates a space underneath the icons)
How can I get it to render the same as the serialized HTML?
I've narrowed it down to something to do with:
<img class="ProseMirror-separator" /> <br>
...when inside a table:
Instructions for reproducing here: https://jsfiddle.net/amk221/L2mqevax/
Hi, I have what's likely a very silly question but haven't been able to find docs/similar recent Gitter posts. I'm trying to write tests for my inputrules by simulating user text input. I first tried @marijnh's suggestion here to no avail - I found using the
view.someProp(handleTextInput) with text that matches input rule regex triggers basic input rules, but using that same function with text that doesn't trigger any input rules doesn't update the view's state at all. I've also tried copying pieces of the tests from
prosemirror-view (and using the
compose function) and am able to edit the DOM, but it doesn't seem like those DOM edit events are being propagated to the view.
My question is: what's the recommended way to simulate users entering input for the purposes of integration testing?