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

markedパッケージのバージョンを1.0.0から最新の4.0.10へ更新 #1380

Merged
merged 3 commits into from
Jan 17, 2022

Conversation

tronperidot
Copy link
Contributor

@tronperidot tronperidot commented Jan 17, 2022

fix #1377
md-to-htmlとrefactor-and-unittestで利用しているmarkedのバージョンを最新の4系へ更新しました。
それに伴って関数の呼び出しが marked(html) -> marked.parse(html) へ変更されたので置換して、testが通ることを確認しました。

@bot-user
Copy link

bot-user commented Jan 17, 2022

✔️ Deploy Preview for js-primer ready!

🔨 Explore the source changes: 56028a9

🔍 Inspect the deploy log: https://app.netlify.com/sites/js-primer/deploys/61e5504b519e350007072f05

😎 Browse the preview: https://deploy-preview-1380--js-primer.netlify.app

Copy link
Collaborator

@azu azu left a comment

Choose a reason for hiding this comment

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

ありがとうございます!
一つだけ 2つコメントしました。

Copy link
Collaborator

@azu azu left a comment

Choose a reason for hiding this comment

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

あと

markedパッケージをインポートしたmarked関数は、Markdown文字列を引数にとり、HTML文字列に変換して返します。

markedパッケージをインポートして取得したmarked.parse関数は、Markdown文字列を引数にとり、HTML文字列に変換して返します。

とかに変更が必要ですかね。

markedパッケージをインポートした`marked`関数は、Markdown文字列を引数にとり、HTML文字列に変換して返します。


他には marked を関数として言及しているところはなさそうですかね。
https://deploy-preview-1380--js-primer.netlify.app/use-case/nodecli/md-to-html/

@tronperidot
Copy link
Contributor Author

@azu

あと

markedパッケージをインポートしたmarked関数は、Markdown文字列を引数にとり、HTML文字列に変換して返します。

markedパッケージをインポートして取得したmarked.parse関数は、Markdown文字列を引数にとり、HTML文字列に変換して返します。

とかに変更が必要ですかね。

markedパッケージをインポートした`marked`関数は、Markdown文字列を引数にとり、HTML文字列に変換して返します。

他には marked を関数として言及しているところはなさそうですかね。 https://deploy-preview-1380--js-primer.netlify.app/use-case/nodecli/md-to-html/

同ページ内にある

こうして作成したcliOptionsオブジェクトから、markedにオプションを渡しましょう。 main.jsの全体は次のようになります。

の marked ですが、こちらも marked.parse にした方が良いですかね?
どちらでも意味が通じそうな気はしますが。

@azu
Copy link
Collaborator

azu commented Jan 17, 2022

こうして作成したcliOptionsオブジェクトから、markedにオプションを渡しましょう。 main.jsの全体は次のようになります。

ていねいに次みたいな感じですかね。

こうして作成したcliOptionsオブジェクトから、markedのparse関数にオプションを渡しましょう。 main.jsの全体は次のようになります。

marked自体はパッケージを示しているので、どちらでも大丈夫そうですね。

こうして作成したcliOptionsオブジェクトを、markedのparse関数へオプションとして渡しましょう。 main.jsの全体は次のようになります。

微妙な助詞が気になるので、こうした方が分かりやすいですかね。

@tronperidot
Copy link
Contributor Author

こうして作成したcliOptionsオブジェクトを、markedのparse関数へオプションとして渡しましょう。 main.jsの全体は次のようになります。

微妙な助詞が気になるので、こうした方が分かりやすいですかね。

こちらの文章良いですね!
上のmarked -> marked.parse の変更と合わせて2点修正しました。

Copy link
Collaborator

@azu azu left a comment

Choose a reason for hiding this comment

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

LGTM

ありがとうございます!

@azu
Copy link
Collaborator

azu commented Jan 17, 2022

📝 default exportは消えたけど、named exportである parse とかはそのまま残ってるという感じらしい
公式Docは const { marked } = require("marked") だけど、まあ特にDestructuringする意味はなさそう
https://github.com/markedjs/marked/releases/tag/v4.0.0
https://github.com/markedjs/marked/blob/96c46c75957fa6fbcd9153f29ac71322eb4c74b8/lib/marked.cjs#L2926

@azu azu merged commit 79211f9 into asciidwango:master Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Marked@4 へアップデート
3 participants