cmacmackin / markdown-include

Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.
GNU General Public License v3.0
104 stars 41 forks source link

inheritHeadingDepth should refer to the original including file's depth #28

Open sepulzera opened 3 years ago

sepulzera commented 3 years ago

With inheritHeadingDepth being true.

Let a top-level file be:

# Some first level heading

{!sub/Subsection_1.md!}

{!task/Subsection_2.md!}

{!task/Subsection_3.md!}

And let each task/Subection_X.md be:

# Some heading <X>

Some text.

Then, I would expect the result to be:

# Some first level heading

## Some heading 1

Some text.

## Some heading 2

Some text.

## Some heading 3

Some text.

But, the actual result is:

# Some first level heading

## Some heading 1

Some text.

### Some heading 2

Some text.

#### Some heading 3

Some text.

With the current implementation of inheritHeadingDepth, it is impossible to include several sections on the same level.

Current workaround probably is to move the heading from the sections into the parent file.