1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #7647 closed

Level 1 headers inside code blocks should not be processed (BB-8822)

Kamil Slowikowski
created an issue

Expected behavior

The Creole <<toc / 1>> tag is supposed to show the level 1 headers from all other Wiki files in the same folder.

Observed behavior

Level 1 headers inside code blocks in markdown files are processed, but they should not be.


  • "Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it’s also easy to use Markdown to write about Markdown’s own syntax."

For example, if one of my wiki markdown files contains this text:

# myscript.sh

echo "Hi there :)"

then the table of contents in a second file produced by using the Creole tag <<toc / 1>> will contain a listing called "myscript.sh" when it should not.

I assume this problem arises because a simple regular expression is used to find all level 1 headers. A more sophisticated parsing approach should be used instead to avoid processing level 1 headers inside code blocks.

Comments (3)

  1. Log in to comment