Commit 21fef4d
authored
feat(attributes): expose ccRegisterBlockElements (#14)
Etherpad core's import-side content collector keeps its own
`_blockElems` set (`{div, p, pre, li}` by default), separate from
the editor's. `aceRegisterBlockElements` registers tags on the
editor side only -- so plugins built on `lineAttribute` /
`tagAttribute` (`ep_headings2`, `ep_subscript_and_superscript`,
etc.) tell the editor that `h1..h4` / `code` / `sub` / `sup` are
block elements but DON'T tell the importer.
Symptom: round-tripping a pad with `<h1>` / `<h2>` / `<code>` lines
through any HTML import path collapses adjacent heading-style
blocks into a single pad line. This just bit native DOCX export+
import in ether/etherpad#7568.
Fix: have `createLineAttribute` and `createTagAttribute` return a
`ccRegisterBlockElements` function with the same tag set as
`aceRegisterBlockElements`. Plugins re-export this from their
`ep.json` under `"ccRegisterBlockElements"` to register the same
tags on the import side.
Tests added for both factories.
Closes #131 parent 5db3a16 commit 21fef4d
2 files changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
| |||
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
122 | 133 | | |
123 | 134 | | |
124 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
125 | 146 | | |
126 | 147 | | |
127 | 148 | | |
| |||
138 | 159 | | |
139 | 160 | | |
140 | 161 | | |
| 162 | + | |
141 | 163 | | |
142 | 164 | | |
143 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
198 | 209 | | |
199 | 210 | | |
200 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
201 | 218 | | |
202 | 219 | | |
203 | 220 | | |
| |||
0 commit comments