0

I'm creating a theme using Bootstrap with jekyll and I'm running into a problem when creating content in markdown. Ideally I'd like to structure my posts with Bootstrap grids like so:

<div class="row">
  <div class="col col-md-6" markdown="1">
  # Hello World
  </div>
</div>

However, the markdown isn't being processed here. It doesn't seem to work in nested HTML blocks.

Single level blocks will work:

<div markdown="1">
# Hello World
</div>

I'm using Kramdown and I can't see any examples similar to this in the docs. I'm guessing maybe I need to create a plugin to do this?

Jahnertz
  • 3
  • 1
  • I suspect you need to add `markdown=1` to each level of your raw HTML. When kramdown sees the outer div without the attribute set, it ignores everything inside and never sees the inner div with the attribute. – Waylan Jan 31 '20 at 21:18
  • Thanks, I tired adding the attribute to each level, but that doesn't cause the markdown to be processed either – Jahnertz Feb 02 '20 at 03:07

2 Answers2

0

I wrote a small plugin to add liquid tags for the grid system here (Heavily based on this tutorial)

This doesn't really answer the question, but it does get the job done.

Jahnertz
  • 3
  • 1
0

Kramdown's documentation simply states regarding stx style headers

No spaces are allowed before the hash characters.

Therefore, you need to delete the indentation of your Markdown content within the div tag:

<div class="row">
  <div class="col col-md-6" markdown="1">
# Hello World
  </div>
</div>
Waylan
  • 37,164
  • 12
  • 83
  • 109