0
votes

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?

2
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
Thanks, I tired adding the attribute to each level, but that doesn't cause the markdown to be processed either - Jahnertz

2 Answers

0
votes

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.

0
votes

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>