Socket
Book a DemoInstallSign in
Socket

md-reverse

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

md-reverse

written by JavaScript. Convert HTML to Markdown.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mdReserve

将HTML文本转换为Markdown格式文本。由JavaScript编写

Demo

安装

npm:

npm install md-reserve

script引入:

<script src="../dist/md-reverse.browser.js" type="application/javascript"></script>

前往Github下载

用法

ES6 Modules
import {MdReverse, TablePlugin, StrikethroughPlugin} from "md-reverse";

const mdReserve = new MdReverse();
mdReserve.toMarkdown(`<h1>Hello World!</h1>`);

// 使用插件扩展Table, Strikethrough语法
mdReserve.use(TablePlugin);
mdReserve.use(StrikethroughPlugin);
mdReserve.toMarkdown(`<h1><delHello World!</del></h1>`);

原生js
const mdReserve = new MdReverse();
mdReserve.toMarkdown(`<h1>Hello World!</h1>`);

// 使用插件扩展Table, Strikethrough语法
mdReserve.use(MdReverse.plugin['table']);
mdReserve.use(MdReverse.plugin['strikethrough']);
mdReserve.toMarkdown(`<h1><delHello World!</del></h1>`);

支持语法

提示

  • 因为各个网站的网页结构千奇百怪,做不到匹配所有网站,建议转换的HTML文本本身就是由Markdown编写的或符合Markdown规范。 在转换非Markdown规范的HTML文本可能准确性会大大下降。
  • 目前仅能支持Markdown的基本语法扩展语法部分会在之后陆续完成。
  • 为了提高转换的准确性,对于无法识别的HTML标签,md-reserve会将其删除。这个问题在扩展语法部分完成后会尝试解决。

Keywords

htmltomarkdown

FAQs

Package last updated on 27 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.