Skip to content

Commit

Permalink
Merge pull request #24 from hyesungoh/feat/#23
Browse files Browse the repository at this point in the history
feat: #23
  • Loading branch information
hyesungoh authored Apr 4, 2022
2 parents 4dd942c + 3640454 commit e338467
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rehype-add-classes": "^1.0.0",
"rehype-external-links": "^1.0.1",
"rehype-prism-plus": "^1.3.2",
"rehype-slug": "^5.0.1",
"rehype-stringify": "^9.0.3",
Expand Down
2 changes: 2 additions & 0 deletions apps/blog/src/lib/markdownToHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import remarkRehype from 'remark-rehype';
import rehypeSlug from 'rehype-slug';
import rehypeAddClasses from 'rehype-add-classes';
import rehypePrism from 'rehype-prism-plus';
import rehypeExternalLinks from 'rehype-external-links';
import rehypeStringify from 'rehype-stringify';

export default async function markdownToHtml(markdown: string) {
Expand All @@ -15,6 +16,7 @@ export default async function markdownToHtml(markdown: string) {
.use(rehypeSlug)
.use(rehypeAddClasses, { 'h1,h2': 'heading' })
.use(rehypePrism, { ignoreMissing: true })
.use(rehypeExternalLinks, { target: '_blank', rel: ['noopener', 'noreferer'] })
.use(rehypeStringify, { allowDangerousHtml: true })
.process(markdown);
return result.toString();
Expand Down
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,11 @@ intl-messageformat@^9.6.12:
"@formatjs/icu-messageformat-parser" "2.0.19"
tslib "^2.1.0"

is-absolute-url@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-4.0.1.tgz#16e4d487d4fded05cfe0685e53ec86804a5e94dc"
integrity sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==

is-alphabetical@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b"
Expand Down Expand Up @@ -3365,6 +3370,18 @@ rehype-add-classes@^1.0.0:
dependencies:
hast-util-select "^1.0.1"

rehype-external-links@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/rehype-external-links/-/rehype-external-links-1.0.1.tgz#9e5d21c606b04d8098012e2d3c811919762d0ba2"
integrity sha512-SrMMtIO2tPLWDfvibhECAn9cuEMW6Fi40ZVK2UQSPTnDEv3LraLzGVyKGb/vrDlUy4RCYTcmm0rq/ss9nPqrsw==
dependencies:
"@types/hast" "^2.0.0"
extend "^3.0.0"
is-absolute-url "^4.0.0"
space-separated-tokens "^2.0.0"
unified "^10.0.0"
unist-util-visit "^4.0.0"

rehype-parse@^8.0.2:
version "8.0.4"
resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-8.0.4.tgz#3d17c9ff16ddfef6bbcc8e6a25a99467b482d688"
Expand Down

2 comments on commit e338467

@vercel
Copy link

@vercel vercel bot commented on e338467 Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

comet-land-resume – ./apps/resume

comet-land-resume.vercel.app
comet-land-resume-hyesungoh.vercel.app
comet-land-resume-git-main-hyesungoh.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e338467 Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

comet-land-blog – ./apps/blog

comet-land-blog-hyesungoh.vercel.app
comet-land-blog-git-main-hyesungoh.vercel.app
comet-land-blog.vercel.app

Please sign in to comment.