markdown-it-table-sort
v1.0.1
Published
A plugin for Markdown It to sort table by content
Downloads
21
Maintainers
Readme
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.