Skip to content

Commit

Permalink
Merge pull request #19 from sandypockets/fix-syntax-highlighting
Browse files Browse the repository at this point in the history
Fix syntax highlighting
  • Loading branch information
sandypockets authored Nov 20, 2024
2 parents 937c79e + fa9289c commit f06574e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,28 @@ For example, if you want to use the `prism-duotone-sea` theme, then adjust the i

### Dev Dependencies
- **@babel/core**: ^7.15.0
- **@storybook/addon-actions**: ^6.3.7
- **@chromatic-com/storybook**: ^1.2.25
- **@mdx-js/loader**: ^3.0.1
- **@storybook/addon-actions**: ^8.0.4
- **@storybook/addon-essentials**: ^8.0.4
- **@storybook/addon-interactions**: ^8.0.4
- **@storybook/addon-links**: ^8.0.4
- **@storybook/addon-onboarding**: ^8.0.4
- **@storybook/blocks**: ^8.0.4
- **@storybook/cli**: ^8.0.4
- **@storybook/nextjs**: ^8.0.4
- **@storybook/react**: ^8.0.4
- **@storybook/test**: ^8.0.4
- **autoprefixer**: ^10.4.19
- **babel-loader**: ^8.2.2
- **eslint**: ^8.57.0
- **eslint-config-next**: 14.1.4
- **eslint-plugin-storybook**: ^0.8.0
- **globby**: ^14.0.1
- **postcss**: ^8.4.38
- **prettier**: ^3.2.5
- **rss**: ^1.2.2
- **storybook**: ^8.0.4
- **tailwindcss**: ^3.4.1

## How it works
Expand Down
2 changes: 1 addition & 1 deletion _posts/markdown-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ And many more. Check out the [full list of supported langauges](https://prismjs.

### Collapsible summaries

```markdown
```html
<details>
<summary>Click to open or close</summary>
```ejs
Expand Down
1 change: 0 additions & 1 deletion components/Post/markdown-styles.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* Markdown CSS */
.markdown code[class*='language-'] {
@apply text-black;
text-shadow: none;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/markdownToHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import remarkGfm from 'remark-gfm'

export default async function markdownToHtml(markdown) {
const result = await remark()
.use(html)
.use(remarkGfm)
.use(prism)
.use(remarkGfm)
.use(html)
.process(markdown)
return result.toString()
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sandypockets-nextjs-blog-starter",
"version": "2.1.0",
"version": "2.2.0",
"description": "A create-next-app blog starter",
"license": "MIT",
"bugs": {
Expand Down
12 changes: 10 additions & 2 deletions pages/posts/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ import Layout from '../../components/Layout/Layout'
import PostBody from '../../components/Post/PostBody'
import PostHeader from '../../components/Post/PostHeader'
import PostTitle from '../../components/Post/PostTitle'
// import 'prism-themes/themes/prism-atom-dark.min.css';
// import 'prismjs/themes/prism-okaidia.css';
import Prism from 'prismjs';
import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-jsx';
import 'prismjs/components/prism-ruby';
import 'prismjs/components/prism-sass';
import 'prismjs/components/prism-scss';
import 'prismjs/components/prism-markdown';
import 'prism-themes/themes/prism-atom-dark.min.css';


export default function Post({ post, morePosts, preview }) {
const router = useRouter()
Expand Down

0 comments on commit f06574e

Please sign in to comment.