masukomi / masukomi/vim-markdown-folding

Lines inside fenced code blocks that start with an octothorpe are interpreted as headers and break folding

Open
#35 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
257
Forks
44
PR merge metrics
No merged PRs in 30d

Description

This looks very much along the lines of #1. Possibly related to #6 also (but I kinda doubt it).

Using vim-markdown-folding with vim-plug, on 3f35acfb753cc9ea22182400b075c5b6e896ad71. I'm observing a problem when editing [this file](https://raw.githubusercontent.com/rpdelaney/iris-setup/a73f04ab1d0d0cc587d40893af2bf48c7eb81ba7/PRE_OS.md) I'm working on.

Looks like this:
```
# Pre-OS prep [17 lines]-----------------------------------------------------------------------------------
## Installation media [13 lines]-----------------------------------------------------------------------------------
## Create partitions [4 lines]------------------------------------------------------------------------------------
# gdisk /dev/nvme0n1 [7 lines]------------------------------------------------------------------------------------
## Create LUKS container [4 lines]------------------------------------------------------------------------------------
# cryptsetup luksFormat --type luks1 --use-random --hash whirlpool --iter-time 5000 /dev/nvme0n1p2 [4 lines]---------------------------
## O/S Filesystem [7 lines]------------------------------------------------------------------------------------
### Create and mount LVM volumes [6 lines]------------------------------------------------------------------------------------
# vgcreate volgroup0 /dev/mapper/cryptlvm
# lvcreate volgroup0 -L 32G -n lvswap
# lvcreate volgroup0 -l 100%FREE -n lvroot [5 lines]-----------------------------------------------------------------------------------
### Create btrfs filesystem [4 lines]------------------------------------------------------------------------------------
# mkfs.btrfs -L root /dev/volgroup0/lvroot
# mkswap -L swap /dev/volgroup0/lvswap
# swapon -L swap [56 lines]-----------------------------------------------------------------------------------
## O/S [4 lines]------------------------------------------------------------------------------------
```

I would expect something more like this (maybe with different counts of folded lines):
```
# Pre-OS prep [17 lines]-----------------------------------------------------------------------------------
## Installation media [13 lines]-----------------------------------------------------------------------------------
## Create partitions [4 lines]------------------------------------------------------------------------------------
## Create LUKS container [4 lines]------------------------------------------------------------------------------------
## O/S Filesystem [7 lines]------------------------------------------------------------------------------------
### Create and mount LVM volumes [6 lines]------------------------------------------------------------------------------------
### Create btrfs filesystem [4 lines]------------------------------------------------------------------------------------
## O/S [4 lines]------------------------------------------------------------------------------------
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the folding behavior with vim-markdown-folding using the linked PRE_OS.md example and the reported commit. Start by tracing how fenced code blocks and lines beginning with octothorpes are classified, then verify that command lines inside the fence no longer create folds while Markdown headings still fold as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.