15

I can't get Jekyll's markdown processor to listen to me. These all display as is:

1.  ~Call Mom today.~

1.  ~~Call Mom today.~~

This just makes the internal text disappear:

1.  <s> Call Mom today.</s>

I'm using Jekyll Bootstrap pretty much out of the box.

djechlin
  • 59,258
  • 35
  • 162
  • 290

2 Answers2

21

Perhaps this

markdown: redcarpet
redcarpet:
  extensions: ["strikethrough"]

Github flavored Markdown and pygments highlighting in Jekyll

Or

echo '1. <s>Call Mom today.</s>' | kramdown

Result

<ol>
  <li>
    <s>Call Mom today.</s>
  </li>
</ol>

Note if you are using jekyll --watch this config change will not be picked up; you will need to restart Jekyll.

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
  • Looks like I have a more general problem. http://stackoverflow.com/questions/17004586/jekyll-markdown-deletes-any-html-in-list-item – djechlin Jun 08 '13 at 22:40
  • 1
    +1 for the jekyll --watch note. That was tripping me up. – jpolete Apr 11 '14 at 01:05
  • 1
    The `jekyll --watch` was key, especially since I had a separate watcher instance running in a different terminal and that was overwriting my output. – Anthony Panozzo Aug 04 '15 at 00:29
  • *“Note: Starting May 1st, 2016, GitHub Pages will only support kramdown.”* https://help.github.com/articles/updating-your-markdown-processor-to-kramdown/ – Denilson Sá Maia Feb 07 '16 at 03:27
  • Seems like Jekyll drops support for redcarpet and is kramdown only: https://jekyllrb.com/news/2019/08/20/jekyll-4-0-0-released/ – tartaruga_casco_mole Mar 20 '20 at 03:23
4

If you are using Jekyll with GitHub Pages then you will no longer be allowed to use redcarpet - kramdown will only be supported. So until kramdown supports "~~strikethough~~" with markdown I'm using a javascript to add strikethrough to page's text:

(function() {
  function strikethrough(){
    document.body.innerHTML = document.body.innerHTML.replace(
      /\~\~(.+?)\~\~/gim,
      '<del>$1</del>'
    );
  }
  strikethrough();
})();
David Douglas
  • 10,377
  • 2
  • 55
  • 53
  • " If you are currently using Rdiscount or Redcarpet we've enabled kramdown's GitHub-flavored Markdown support by default, meaning kramdown should have all the features of the two deprecated Markdown engines" – djechlin Feb 04 '16 at 14:51
  • @djechlin Is there a config option I need to add to get ~~strikethough~~ working with kramdown on github-pages as it didn't work for me (after changing from redcarpet with strikethough extension)? – David Douglas Feb 05 '16 at 11:10
  • I don't know, I just quoted the page you linked. – djechlin Feb 05 '16 at 15:44