githubmarkdowngithub-flavored-markdownstrikethrough

strikethrough code in markdown on github


I am talking about github markdown here, for files like README.md.

Question: Is it possible to strikethrough a complete code block in markdown on github?

I know how to mark text as a block of code

this is
multiline code

and this

this

also

by indenting by 4 spaces or by using ``` or `...

I also know how to strike through texts using

Temporary solution:

Independently they work fine, but together not as expected or desired. I tried several combinations of the above mentioned.

For now, I use this:

striked

through

by using ~~ and ` for every single line.

Requirement:

I would like to have a code formatted text striked through, where the code block is continuous:

unfortunately, this is
not striked through

or at least with only a small paragraph in between:

unfortunately, also not striked through

Is this possible at all?

I found some old posts and hints on using jekyll, but what I was searching for is a simple way, preferably in markdown.


Solution

  • After much much trying, I finally got it to work! It boils down to this:

    <strike>
    
    ```language
      this is
      multiline code
    ```
    
    </strike>
    

    P.S. ``` blocks should always be surrounded by blank lines to work