[Bug] Indented bullet lists lose indents when pasting into the source editor #1556
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck#1556
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
When pasting a indented bullet list from another text editor into the ocideck source editor the indentation levels are stripped and all bullets will now live on the same primary level.
To reproduce
Steps to reproduce the behaviour:
Expected behaviour
The indentation levels will remain in the pasted text.
Screenshots / sample deck
If applicable, add screenshots or attach a minimal
.md/.ocideckthattriggers the issue.
Environment
flutter --version): n/a install via BrewAdditional context
The text was copied from the text editor in a Microsoft Copilot Notebook. That behaves like a markdown text editor, sort off. I cannot reproduce the issue on Fedora linux copying and paste from a known proper markdown editor.
Thanks for the detailed report — including the note that it does not happen from a proper markdown editor on Fedora. That turned out to be the decisive clue.
We checked the source editor's paste path and cannot make the indentation disappear there. Pasting your example keeps the 4- and 8-space indentation exactly: the editor has no paste handling of its own, and the one input filter it does have only acts on single characters. Parsing and rewriting the source is character-stable as well.
What OciDeck receives is the plain-text flavour of the clipboard, and that is all a text field can read. Our reading is that the Copilot Notebook editor puts an already-flattened list in that flavour, so the levels are gone before OciDeck sees them. We cannot confirm that from here.
Could you help us check? Paste the same clipboard content into a plain text editor — TextEdit in plain-text mode, or
pbpaste | cat -Ain a terminal. If the indentation is missing there, it never reached us. If it is present (as spaces or as tabs), we have a bug and we would like to see that output.Two related defects did come out of checking this, both tracked separately: a tab-indented list pasted in document mode is mistaken for a table (#1557), and the visual bullet editor collapses the third level of a 4-space-indented list (#1558). Neither matches your steps, but if you were indenting with tabs rather than spaces, #1557 may be what you hit.
A correction to our previous answer, and an apology for the premature conclusion.
We tested the wrong editor. The two-panel
<source>view you reach from a new document is document mode, and that one does have its own paste handling — the deck source editor we checked does not. Re-testing the right path turned up several defects that can flatten a nested list:Your example with ordinary spaces still comes through intact, so we cannot yet say which of these you hit. The clipboard dump we asked for now answers a much sharper question:
pbpaste | hexdump -C | head -20would show us exactly which characters carry the indentation.Thanks for pushing on this — the report turned out to be worth considerably more than the one bug it described.
An update. Three of the four defects we found are now fixed on main (
36bec4a2):Each fix has a test that fails if the fix is removed, and the seven other kinds of space are covered as a counter-check so the repair does not overreach.
We are leaving this issue open, because we still cannot say whether any of these is what you actually hit — your example with ordinary spaces came through intact both before and after. If you can still reproduce it on the next release, the clipboard dump would settle it:
pbpaste | hexdump -C | head -20.Zeer waarschijnlijk opgelost in 0.4.6.
Even een test gedaan met 0.4.6. Probleem is er nog steeds wanneer ik plak vanuit een Copilot Notebook. Maar het lijkt de manier te zijn waarop Copilot Notebook de tekst aanbied aan de copy API van MacOS, of MacOS die opmaak niet herkent. Onderstaand voorbeeld begint met een H1 (#) op de eerste regel, screenshot van de origineel gekopieerde tekst onderaan bijgevoegd.
pbpaste | hexdump -C | head -20outputIn screenshot:

Dank voor de dump — die geeft uitsluitsel, en het antwoord is niet het antwoord
dat we hadden gehoopt te geven.
Wat er in je klembord zat. De 300 bytes die je stuurde bevatten geen enkele
inspringing: elke bullet begint op kolom 0 met
-, en er staat nergens eenspatie of tab vóór. De
#van je H1 ontbreekt ook — "Ocideck Bullet indenttest" staat er als kale tekst. Wat Copilot Notebook op de platte-tekstvariant
van het klembord zet is dus de gerenderde tekst van de pagina, niet de
Markdown-bron ervan. De niveaus zijn weg voordat OciDeck iets ziet.
En we hebben nagerekend dat wij ze niet kwijtmaken. We hebben jouw exacte
klembordinhoud — byte voor byte uit je hexdump gereconstrueerd, alle 300 —
door het plakpad van de documentbroneditor gehaald. Wat eruit komt is
identiek aan wat erin gaat, op de lege regel aan begin en eind na. Geen
inspringing erin, geen inspringing eruit.
Dat betekent dat de vier reparaties uit 0.4.6 jouw geval inderdaad niet konden
raken, en dat er in dit pad niets meer te repareren valt. Het spijt ons dat je
daarvoor twee keer hebt moeten testen.
Wat er wél zou helpen, en waarom het niet klein is. Een webtoepassing als
Copilot Notebook zet meestal méér dan één variant op het klembord: naast platte
tekst ook een HTML-variant, en dáár staat de nesting wel in (
<ul><li><ul>…).OciDeck leest vandaag alleen de platte-tekstvariant — dat is wat een tekstveld
kan. De HTML-variant lezen en naar Markdown omzetten zou jouw geval oplossen, en
meteen elk ander "geplakt vanuit een webeditor"-geval.
Klein is dat niet. Op macOS is die variant voor ons vandaag niet bereikbaar: het
klembordpakket dat we al gebruiken heeft hem alleen op Windows en Android
geïmplementeerd, dus er is platformwerk voor nodig. Daar bovenop komt een
HTML-naar-Markdown-omzetting, en klembord-HTML is invoer van buiten die we
zorgvuldig moeten behandelen.
We nemen dat op als een apart verzoek in plaats van het aan dit bugrapport te
blijven hangen, zodat het niet stil blijft liggen — maar we beloven er nog geen
termijn bij.
Tot die tijd houdt een echte Markdown-bron zijn niveaus wel: exporteren
vanuit Copilot als Markdown, of via een Markdown-editor plakken, komt intact
binnen (zoals je zelf al op Fedora zag).
We sluiten dit rapport als "niet in OciDeck te repareren", niet omdat het geen
echt probleem is. Het heeft ons vier defecten opgeleverd die wél van ons waren
(#1557, #1560, #1561) — dank daarvoor.
Ter opvolging: het onderliggende verzoek — de HTML-variant van het klembord lezen zodat structuur uit een webeditor bewaard blijft — staat nu apart als #1595, met de bevindingen uit dit rapport als onderbouwing. Dit rapport sluiten we; #1595 draagt het verder.