markdown-it-table-x
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

markdown-it-table-x

NPM version

Caution: The plugin is usable but not perfect. There may be conflicts with other markdown plugin. I don't have enough testing in my project

Install

yarn add markdown-it-table-x

Example

markup must start on the first character of the line

{| class="html_attrs_in_table_tag success" style="height:12rem;" align="right"
! class="html_attrs_in_th_tag" align="center" || Name
! Description
|-
!class="html_attrs_in_th_tag" || *row-1-col-1*
|*here is td tag*
|-
!here is th tag
|class="html_attrs_in_td_tag" align="right"
* Embedding markdown content.
* Embedding markdown content.
 ![space_on_first_character]()
|}

rendered as

<table class="html_attrs_in_table_tag success" style="height:12rem;" align="right">
    <tbody>
        <tr>
            <th class="html_attrs_in_th_tag" align="center">Name</th>
            <th>Description</th>
        </tr>
        <tr>
            <th class="html_attrs_in_th_tag"><em>row-1-col-1</em></th>
            <td><em>here is td tag</em></td>
        </tr>
        <tr>
            <th>here is th tag</th>
            <td class="html_attrs_in_td_tag" align="right">
                <ul>
                    <li>Embedding markdown content.</li>
                    <li>Embedding markdown content.</li>
                </ul>
                <p><img src="" alt="space_on_first_character"></p>
            </td>
        </tr>
    </tbody>
</table>

Params

  • attrSeparate - custom attribute separate (default: || )
  • allowedAttrs - custom alloowed attributes (default: ['id', 'class', 'style', 'width', 'height', 'align', 'rowspan', 'colspan'], set [] for allow all)

Package Sidebar

Install

npm i markdown-it-table-x

Weekly Downloads

11

Version

0.1.6

License

MIT

Unpacked Size

31.9 kB

Total Files

12

Last publish

Collaborators

  • rocwong16