Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting doesn't work always #9

Open
mhsdesign opened this issue Mar 7, 2024 · 2 comments
Open

Splitting doesn't work always #9

mhsdesign opened this issue Mar 7, 2024 · 2 comments

Comments

@mhsdesign
Copy link
Contributor

mhsdesign commented Mar 7, 2024

The text starting at the current cursor is not splitted.

This is a two step process of first getting the contents of the second part and creating a new node with it, and then removing the contents from the first node.
In between these nodes the new node can be placed:

Bildschirmaufnahme.2024-03-07.um.19.46.41-1-1-1.mov

The "after" part is empty, and the temporary splitmarker is placed at the end:

et justo duo dolores et ea reb.</p><p>###NEOS_SPLIT###</p>

Tested with Neos 8.3

@mhsdesign
Copy link
Contributor Author

mhsdesign commented Mar 7, 2024

Got it, the text will actually not be split at the cursor but at the next paragraph, thus one first has to separate it via enter:

writer.insertText('###NEOS_SPLIT###', marker, 'end');

Bildschirmaufnahme.2024-03-07.um.20.11.19-1.mov

@mhsdesign mhsdesign changed the title Splitting doesn't seem to work with Neos 8.3 Splitting doesn't work always Mar 7, 2024
@mhsdesign
Copy link
Contributor Author

And when not using autoparagraph: true the plugin will also not work but just append ###NEOS_SPLIT### to the text (in a span):

Bildschirmaufnahme.2024-03-07.um.20.16.49-1.mov

Two things go wrong here, first the plugin doesnt create the dummy element where to split at the correct position (its created at the end), second we split for <p>###NEOS_SPLIT###</p> but the html is duo dolores et ea reb.</span><span>###NEOS_SPLIT###</span>

const [contentBefore, contentAfter] = content.split('<p>###NEOS_SPLIT###</p>');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant