Warm tip: This article is reproduced from stackoverflow.com, please click
bootstrap-4 html jekyll Markdown kramdown

Markdown in nested divs not being processed

发布于 2020-03-27 15:46:20

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?

Questioner
Jahnertz
Viewed
54
Waylan 2020-02-03 04:17

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>