Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax highlighting #19

Merged
merged 7 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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