Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

It converts HTML to Markdown based on remark and rehype.

License

NotificationsYou must be signed in to change notification settings

inkdropapp/html2markdown

Repository files navigation

It converts HTML to Markdown usingremark andrehype.

install

npm install @inkdropapp/html2markdown

How to use

Say we have the following markdown file,example.md:

<h1>Hello, world!</h1>

And our script,example.js, looks as follows:

import{html2Markdown}from'@inkdropapp/html2markdown'importfsfrom'fs'constdoc=fs.readFileSync('example.md')constmd=html2Markdown(doc)console.log(md)

Now, runningnode example yields:

#Hello,world!

API

html2Markdown(html, options)

Converts the given HTML to Markdown.

Options

License

MIT ©Takuya Matsuyama


[8]ページ先頭

©2009-2025 Movatter.jp