amyreese / markdown-pp

Preprocessor for Markdown files to generate a table of contents and other documentation needs
MIT License
309 stars 68 forks source link

Fix a missed shift in INCLUDE command #55

Closed pkorpine closed 6 years ago

pkorpine commented 6 years ago

This fixes an issue where a shift is not performed on a heading on the first line of a recursively INCLUDEd file.

Example:

FileA.mdpp:

# FileA-1
# FileA-2
!INCLUDE "FileB.mdpp",1

FileB.mdpp

# FileB-1
# FileB-2
!INCLUDE "FileC.mdpp",1

FileC.mdpp

# FileC-1
# FileC-2

Before this patch markdown-pp FileA.mdpp produces:

# FileA-1
# FileA-2

## FileB-1
## FileB-2

## FileC-1
### FileC-2

After this patch:

# FileA-1
# FileA-2

## FileB-1
## FileB-2

### FileC-1
### FileC-2
amyreese commented 6 years ago

Cheers!