Skip to content

Commit

Permalink
📝 markdown-escape-backquot
Browse files Browse the repository at this point in the history
  • Loading branch information
elzup committed Jul 6, 2020
1 parent ebd4d0a commit a7d62e3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
47 changes: 47 additions & 0 deletions content/blog/2020/2020-07-06___markdown-escape-backquote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Markdown でコードブロックの中にバックスラッシュ3つを書く
date: 2020-07-06 12:00:00
tags:
- Markdown
---

Markdown の複数行コードブロックは普通以下のように書きます。

````md
sample code

```
console.log('hello')
```
````

その中に` ``` `を書くときは ` ```` ` を使います。

`````md
Markdown の複数行コードブロックは普通以下のように書きます。

````
sample code

```
console.log('hello')
```
````
`````

※この記事はマークダウンで書いているので更に ` ````` ` で囲っています。

#### 補足

バックスラッシュでエスケープしようとするとそのままでてしまいます。

```md
sample code

\`\`\`
console.log('hello')
\`\`\`
```

このリポジトリの readme を書いていたときに知ったネタでした。
[elzup/codeblock\-cat](https://github.com/elzup/codeblock-cat)
7 changes: 7 additions & 0 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ pre[class*='language-'] {
background: blue;
}

&.language-md::before {
content: 'MD';
color: white;
background: black;
}


&.language-css::before {
content: 'CSS';
color: white;
Expand Down

0 comments on commit a7d62e3

Please sign in to comment.