Skip to content

Remark plugin that merges adjacent identical inline nodes

License

Notifications You must be signed in to change notification settings

vwkd/remark-merge-adjacent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Remark plugin that merges adjacent identical inline nodes

Features

  • merges adjacent identical inline nodes
  • inline nodes currently used: emphasis, strong, link

Example

import { unified, rehypeParse, rehypeRemark, remarkStringify } from "./deps.ts";
import remarkMergeAdjacent from "./src/main.ts";

const result = (await unified()
  .use(rehypeParse, { fragment: true })
  .use(rehypeRemark)
  .use(remarkMergeAdjacent)
  .use(remarkStringify)
  .process(`<strong>foo</strong><strong>bar</strong>`))
  .toString();
console.log(result);

Before

<strong>foo</strong><strong>bar</strong>

After

**foobar**

About

Remark plugin that merges adjacent identical inline nodes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published