Skip to content

Make more kinds of blocks collapse-able in edit mode #384

@Kaiserouo

Description

@Kaiserouo

Is your feature request related to a problem? Please describe.
HackMD already has some support for folding/collapsing blocks in the edit section, specifically headers and style curly brackets. But there seems to be no support for folding blocks of text in:

  • Alert section (:::spoiler)
  • Code blocks (```)
  • Quote section (>)
  • Multi-layer bullet points (-)
  • Math blocks ($$)

They often contain a lot of text, and sometimes (especially :::spoiler and code blocks), their content takes up too much space and would be hard to navigate through all these contents before reaching the later part of the notes.

Describe the solution you'd like
I want the aforementioned blocks to be foldable, like how in the current version of HackMD, you can fold the whole header / paragraph by clicking the arrow on the left, next to the line numbers.

Describe alternatives you've considered
Maybe you can make the part you wanna collapse h6 (######), but that wouldn't make that much sense if there are more support for other kinds of blocks.

Additional context

I use Google Chrome 128.0.6613.86 (64-bit), Windows 11 Pro 23H2 (OS build 22631.4112)

a.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions