From d5c3ccf1a14667d0a15abc8897eab8dd34a6498b Mon Sep 17 00:00:00 2001 From: Eason Chang Date: Sat, 3 Sep 2022 18:22:06 +0800 Subject: [PATCH] Update post to highlight specific lines of code Format can be found here: Show line number: https://github.com/timlrx/rehype-prism-plus#sample-markdown-to-html-output Show diff lines: https://github.com/timlrx/rehype-prism-plus/pull/53 --- content/posts/20220901-post-with-code.mdx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/posts/20220901-post-with-code.mdx b/content/posts/20220901-post-with-code.mdx index 576da7c..13c611d 100644 --- a/content/posts/20220901-post-with-code.mdx +++ b/content/posts/20220901-post-with-code.mdx @@ -10,12 +10,12 @@ type: Post Some other posts! with `some inline code`! -```js +```js showLineNumbers const a = 1; a = 2; ``` -```tsx +```tsx showLineNumbers {5,15-17} import "@/styles/globals.css"; import type { AppProps } from "next/app"; @@ -40,6 +40,13 @@ function MyApp({ Component, pageProps }: AppProps) { export default MyApp; ``` +```diff-js showLineNumbers {3-4} +const a = 1; +- a = 2; ++ a = 2; +a = 3; +``` + ```shell $ echo "Hello world!" ```