New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@amanda-mitchell/remark-footer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amanda-mitchell/remark-footer

A Remark plugin that parses footer elements according to the proposal at https://talk.commonmark.org/t/syntax-for-footer/2070

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

There is a current proposal for a CommonMark extension for a footer element here: https://talk.commonmark.org/t/syntax-for-footer/2070

This package implements that proposal as a remark-parse plugin.

Installation

yarn add @amanda-mitchell/remark-footer

Use

Construct a unified parser and pass footers to it as a plugin:

import vfile from 'to-vfile';
import report from 'vfile-reporter';
import { unified } from 'unified';
import parse from 'remark-parse';
import { footers } from '@amanda-mitchell/remark-footer';
import remark2rehype from 'remark-rehype';
import stringify from 'rehype-stringify';

const document = `^^ a footer`;

unified()
  .use(parse)
  .use(footers)
  .use(remark2rehype)
  .use(stringify)
  .process(vfile.readSync('example.md'), function (err, file) {
    console.error(report(err || file));
    console.log(String(file));
  });

When run, this script will print

<footer><p>A footer</p></footer>

Implementation notes

Many remark-parse plugins also provide behavior to serialize an mdast syntax tree back to markdown. This plugin does not support this, but again, I'd be happy to accept a PR that adds the feature!

Keywords

FAQs

Package last updated on 26 Feb 2022

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