Commit f1f1d13
authored
fix(markdown): remove empty links when text is deleted (#7702)
When a user deletes all text within a link in the visual markdown
editor, the empty link markup was being left behind (visible when
switching to raw markdown mode).
This adds a Slate normalizer that automatically removes link nodes
when they become empty (have no text content), ensuring the link
markup is properly cleaned up along with the text.
Fixes #76401 parent e795271 commit f1f1d13
File tree
1 file changed
+19
-1
lines changed- packages/decap-cms-widget-markdown/src/MarkdownControl/plugins/inlines
1 file changed
+19
-1
lines changedLines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | | - | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
12 | 30 | | |
13 | 31 | | |
14 | 32 | | |
| |||
0 commit comments