yorkie-team/yorkie

Enhance Tree.Edit to manage Merge and Split scenarios

hackerwins opened this issue · 0 comments

Description:

Enhance Tree.Edit to manage Merge and Split scenarios

In text-based editors employing tree models, editing extends beyond the XML data structure and encompasses the ability to merge and split paragraphs.

When a user selects content spanning two paragraphs and presses the delete key, the second paragraph is removed, and its content is merged into the first paragraph, resulting in a seamless combination:

  • Original: <p>a|b</p><p>c|d</p>
  • Result: <p>ad</p>

Likewise, when a user positions the cursor within a paragraph and hits the enter key, the paragraph divides into two separate paragraphs:

  • Original: <p>a|b</p>
  • Result: <p>a</p><p>b</p>

To accommodate these features, we need to extend Tree.Edit to handle the merge and split scenarios.

Why: