Empty list elements in Kupu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Silva |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Not sure if this some 'solvable', anyway a report from WU Wien:
I think that this small problem has its roots in how browsers handle empty
list elements. there also seems to be one small Kupu issue.
Actually when you press tab twice, Kupu inserts an element in the "missed
out" level automatically after saving.
[IN KUPU]
o Level 1
* Level 2
- Level 3
o Level 1
- Level 3
gets changed to:
o Level 1
* Level 2
- Level 3
o Level 1
*
- Level 3
after saving. Unfortunately one cannot edit the missing Level 2 item (in
this example).
[IN LAYOUT]
the above example looks like:
o Level 1
* Level 2
- Level 3
o Level 1
* - Level 3
I quickly browsed through the source code and my (quick and dirty)
approach was to insert a " " after the empty list element and the
result was OK. So this might be a work-around. Of course I can hardly
estimate if its possible to check wheather a list element is empty and
insert a if that's the case...
Changed in silva: | |
assignee: | guido-infrae → aaltepet |
Changed in silva: | |
milestone: | none → 2.1 |
Changed in silva: | |
assignee: | aaltepet → nobody |
Changed in silva: | |
status: | Fix Committed → Fix Released |
It looks using a KupuContentFilters to catch this before the content is sent to Silva (on save) is the best way to go. I thought about adjusting the transformations (coming from kupu) but that's very difficult. Also, I tried implementing JW's suggestion of inserting an before the nested list, but that led to extra spacing/artifact. It would be nice if there was a way to leverage sarissa's xpath capabilities in order to quickly locate relevant list items.