سؤال

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.

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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();
})();
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top