feat/bug(commonmark] Block elements (including indented code blocks) under list items

Offen
#181 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

Reproduziere die beiden Beispiele im Editor und wechsle zwischen Rich-Text- und Markdown-Modus, um zu beobachten, wie Blockelemente innerhalb von Listeneinträgen verschoben werden. Die Arbeit ist abgeschlossen, wenn Codeblöcke und andere Blockelemente innerhalb von Listeneinträgen verbleiben können und Round-Tripping ihre Platzierung nicht mehr verändert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

commonmark enhancement

Is your feature request related to a problem? Please describe.
Cannot make block elements under list items (works in old editor)

Example scenarios that aren't working:

(1) (from https://meta.stackexchange.com/a/380355/51) Put in this text

You can solve this in the following ways:

1.     println("Hello, world!")

2.     System.out.println("Hello, world!")

switch to RT and it shows code blocks on new lines after the list items. Switch back and it stays that way in markdown.

screenshot of issue

We could say that if you want a code block inside a list item, you need to use backticks (the commonmark spec does not require indented code blocks in list items, though it is ambiguous). Or we could allow it (preferred, to be same as old editor). But either way, round-trip shouldn't change anything.

(2) From https://meta.stackexchange.com/a/380344/51, notes that the old editor allowed block elements (code block / heading / blockquote / table) inside list items, and the new one pushes them to new lines (as seen in the previous issue). Indeed, the menu items for block elements are turned of in RT mode when the cursor is inside a list item. Would be good if we can add this capability back, for parity. See that post for screenshots.

Vorherrschende Sprache
TypeScript
Sterne
442
Forks
60
Ø Merge
4 Std. 5 Min.
Gemergte PRs (30 T.)
11

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus StackExchange/Stacks-Editor

Alle Issues in StackExchange/Stacks-Editor

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.