An open API service indexing awesome lists of open source software.

https://github.com/jasny/marked-more-lists

Marked extension for alphabetic and numeral lists
https://github.com/jasny/marked-more-lists

markdown markedjs

Last synced: 27 days ago
JSON representation

Marked extension for alphabetic and numeral lists

Awesome Lists containing this project

README

        

# marked-more-lists

This extension for the [marked](https://marked.js.org/) library adds support for rendering ordered lists with various
`type` attributes. It allows Markdown lists that start with `a.`, `A.`, `i.`, `I.`, and other patterns to be rendered
as `

    ` elements with corresponding `type` values (e.g., `
      `).

      It also adds support for lists that start with a custom value or that skips values, by using the `value` attribute on
      the list item.

      This enables more flexible list formatting in Markdown, enhancing the output to match the intended ordering style.

      # Usage

      ```js
      import {marked} from "marked";
      import markedMoreLists from "marked-more-lists";

      // or UMD script
      //
      //

      marked.use(markedMoreLists());

      const exampleMarkdown = `
      1. item 1
      2. item 2
      a. item 2a
      I. sub item I
      II. sub item II
      e. item 2e
      7. item 7
      `;

      marked.parse(exampleMarkdown);
      //


        //
      1. item 1

      2. //
      3. item 2
        //

          //
        1. item 2a

        2. //

            //
          1. sub item I

          2. //
          3. sub item II

          4. //

          //
        3. item 2e

        4. //

        //

      4. //
      5. item 7

      6. //

      ```