Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sitdown/wechat

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sitdown/wechat

Convert 微信 HTML into Markdown with JavaScript.

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

@sitdown/wechat

微信 html 转 md 注意处:

  1. 图片转储,且访问有鉴权
  2. 图片描述放在 figcaption 里
  3. 微信不支持外链,所以用脚注的方式兼容。
  4. 代码块转回来永远是一行。
  5. 微信有独创的居中块,html 是 span 带有 display:block;text-align:center; 样式
  6. 公式用 svg 画出来的
  7. 文章开头的作者信息和结束的信息,包裹在 section 里

Usage

import { Sitdown,RootNode } from 'sitdown';
import { applyWechatRule, extraFootLinks } from '@sitdown/wechat';

let sitdown = new Sitdown({
    keepFilter: ['style'],
    codeBlockStyle: 'fenced',
    bulletListMarker: '-',
    hr: '---',
  });
sitdown.use(applyWechatRule);

support mdnice wechat footlink:

const wechatToMD = (html: string) => {
const root = new sitdown.RootNode(html);
const footLinks = extraFootLinks(root);
    return sitdown.HTMLToMD(html, { footLinks });
};

FAQs

Package last updated on 10 Apr 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc