10.0.3 • Published 8 months ago

@sfdocs-internal/remark-lint-markdown-tables v10.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

remark-lint-markdown-tables

Warn when hard tabs (\t) are used instead of spaces in the markdown content except that of code blocks.

What/why

This plugin validates that all the Valid Tags ,, which is in Whitelist and if there are not some tags not exsit in the whitelist tasgs then display an error message !

Fix

@sfdocs-internal/no-tabs-except-codeblocks uses spaces where tabs are used for indentation, but retains tabs used in codeblocks.

Example

Only ul and li is allowed inside the Table and without other complicated Tags !!

    |     <ul><li> </li></ul>  |       |       |
    |  ---  |  ---  |  ---  |
    |       |       |       |
    |       |       |       |
    |       |       |       |

 2) do not allow p tag in table markdown content

    |    <p/>   |       |       |
    |  ---  |  ---  |  ---  |
    |       |       |       |
    |       |       |       |
    |       |       |       |

  3) allow multiple ul and li tags in table markdown content
     |     <ul><li> </li></ul> <ul><li></li><li></><ul> |       |       |
    |  ---  |  ---  |  ---  |
    |      |       |       |
    |      |       |       |
    |       |       |       |
 
  4) Allow single li and ul in table markdown content
      |     <ul><li> </li></ul>  |       |       |
    |  ---  |  ---  |  ---  |
    |      |       |       |
    |      |       |       |
    |       |       |       |
    `);
ok.md
In

Note: · represents a space.

Foo Bar

····Foo
Out

No messages.

not-ok.md
In

Note: » represents a tab.

»Here's one before a code block.

Here's a tab:», and here is another:».

And this is in `inline»code`.

>»This is in a block quote.

*»And…

»1.»in a list.

And this is a tab as the last character.»
Out
1:1: Use spaces instead of tabs
3:14: Use spaces instead of tabs
3:37: Use spaces instead of tabs
5:23: Use spaces instead of tabs
7:2: Use spaces instead of tabs
9:2: Use spaces instead of tabs
11:1: Use spaces instead of tabs
11:4: Use spaces instead of tabs
13:41: Use spaces instead of tabs

Install

yarn install @sfdocs-internal/no-tabs-except-codeblocks

Use

You probably want to use it through a config file:

 …
 "pluginsConf": {
     …
     
+    "'sfdocs-lint:no-tabs-except-codeblocks': [require('@sfdocs-internal/no-tabs-except-codeblocks'), ['warning']]",
     …
 }
 …

License

MIT