Allow selectors on next line by dmitry-timofeev · Pull Request #10 · rnorth/mkdocs-codeinclude-plugin

Allows targeting expressions to be on the next line:

<!--codeinclude-->
<!-- On the same line -->
[Title](long/long/Path) targeting_expr1

<!-- On the next line -->
[Title2](long/long/Path)
targeting_expr2
<!--/codeinclude-->

I kept the usage of a regular expression to find the include definitions, but had to change the implementation to use re.findall and a multiline expression instead of re.match over a single line.

The processing is now separated into three stages:

  1. Code-include block extraction.
  2. Computing substitutes (patches) for each block.
  3. Application of patches to the original markdown.

Resolves #9