Skip to content

A tiny function created in-house to convert HTML to Markdown format using original JavaScript, which can be used to convert web content from the clipboard into Markdown format.自制的一个体积超小、使用原生 JS 实现将 HTML 转化为 Markdown 格式的小函数,可用于将剪切板的网页内容变成 markdown 格式

Notifications You must be signed in to change notification settings

kohunglee/html2md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

html2md

自制的一个体积超小、使用原生 JS 实现将 HTML 转化为 Markdown 格式的小函数,可用于将剪切板的网页内容变成 markdown 格式


这是两个示例

  1. HTML 转换 -- https://kohunglee.github.io/html2md/example/conversion.html
  2. 直接就粘贴成 markdown 格式 -- https://kohunglee.github.io/html2md/example/Paste_and_convert.html

具体使用可查看示例文件夹里的源码

因为制作初期并没有想到会做成完整版,故代码写的比较简单,但对于 99% 的网页,转换绝对够用了。基本上常用的标签都支持了,如果发现缺陷以及感兴趣的话,可以提个 issue ,感谢!

目前暂不支持 Safari 和 iOS 设备平台,因为这它们不支持零点断言这种正则语法,以后有空会优化的。 也暂不支持 WPS 等其他格式的标签语言转换。

目前来看,轻度使用绝对是够了,毕竟不能什么都靠机器,机器已经把 90% 的工作做了,你只需要再微调一下就行了。

About

A tiny function created in-house to convert HTML to Markdown format using original JavaScript, which can be used to convert web content from the clipboard into Markdown format.自制的一个体积超小、使用原生 JS 实现将 HTML 转化为 Markdown 格式的小函数,可用于将剪切板的网页内容变成 markdown 格式

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published