1.0.1 • Published 9 months ago

markdown-it-table-sort v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

English | 中文

Install

pnpm i markdown-it-table-sort -D

Usage

import md from 'markdown-it'
import tableSort from 'markdown-it-table-sort'

md().use(tableSort)

// With options
md().use(tableSort, { reverse: true })

Options

export interface PluginOptions {
  /**
   * Whether to reverse the sorted result
   *
   * @default false
   */
  reverse?: boolean,
  /**
   * Specify a method to sort rows by content
   */
  sortRows?: (prev: string[], next: string[]) => number
}

Contributors

Thanks for all the contributions!

License

MIT License.