xoofx / xoofx/markdig

PipeTable: NewLine > Code Delimiter > Column Delimiter Precedence

Open
#419 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

Rule #7
A backtick/code delimiter has a higher precedence than a column delimiter |:

A new line inside of pipe tables should have a higher precedence than a code delimiter. Pipe tables are not designed for multi line cells, therefore code inside pipe tables may not be multiline.
Currently backticks that are not in the same cell break the complete pipe table. Example:

Col1 | Col2
---|---
first`|row`
second|row

Result:

<p>Col1 | Col2
---|---
first<code>|row</code>
second|row</p>

Desired:

<table>
	<thead>
		<tr>
			<th>Col1</th>
			<th>Col2</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>first<code>|row</code></td>
			<td></td>
		</tr>
		<tr>
			<td>second</td>
			<td>row</td>
		</tr>
	</tbody>
</table>

It is safer to recognize code blocks in one line only, as it only breaks that particular line, not the whole table. Example:
markdown-it demo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the markdown-it example and compare the current and desired HTML shown in the issue. Locate Markdig's pipe-table parsing path and add coverage for a backtick containing a pipe across adjacent lines. Done means the first row remains a table row with an empty second cell, while the following line is parsed as its own table row.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, markdown
Domain
content, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.