Markdown.pl: do not mistake table for code block
commit9c7c5a0c116de2faac3f9a37595656a648c5a99e
authorKyle J. McKay <mackyle@gmail.com>
Sat, 5 Jun 2021 05:38:38 +0000 (4 22:38 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 5 Jun 2021 05:38:38 +0000 (4 22:38 -0700)
treeebdcbf295e69009f4b9a61893058bcf3fcc4aa1a
parentaa05222a090deeadbe69aba79c035a209158e256
Markdown.pl: do not mistake table for code block

When making a nice looking table such as this:

     Term      |     Detail
-------------- | --------------
  First term   |   number one
  Second term  |   number two

There is a potential to misinterpret the header line as
the beginning of a code block (the indented type) since
it begins with 5 spaces.

Of course this could be addressed either by moving the
"Term" string to the left at least 2 spaces or by adding
the optional leading "|" to the beginning of the column,
but that's unnecessarily ugly.

Instead, when parsing a code block, check to see if the
code block consists of exactly one line and when combined
with the next line represents a valid table start.

A valid table start specifies a header row and a separator
row with exactly the same (positive integer) number of columns.

If a valid table start is found, avoid making it into a
code block and instead allow the table code to grab it and
make it into a table.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Markdown.pl