Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipe characters within a inline link is parsed as a table (rather than a link) #791

Closed
timdiggins opened this issue Jul 31, 2023 · 1 comment
Assignees

Comments

@timdiggins
Copy link

Hi - thanks for the work on Kramdown.

Given:

simple [with | embedded | pipe characters](with-pipe-characters.html)

I would expect kramdown to produce html:

<p>simple <a href="with-pipe-characters.html">with | embedded | pipe characters</a></p>

However it produces (prioritises table parsing over inline link.

<table>
<tbody>
<tr>
<td>simple [with</td>
<td>embedded</td>
<td>pipe characters](with-pipe-characters.html)</td>
</tr>
</tbody>
</table>

This then percolates down also into GFM (see kramdown/parser-gfm#35).

Furthermore:

I have got Kramdown working in development (non-trivial), can make a failing testcase for this (trivial), but haven't been able to propose a patch change to date. With a hint or two I might be able to get there.

My current workaround is to replace pipecharacters with escaped pipecharacters (as I'm not using tables).

As an alternative workaround is there a way to turn a single parser (e.g. Kramdown::Parser::Table) off in the Kramdown / GFM options?

PS: I could contribute a PR with some additions to README to help ruby developer on MacOS using bundler if that would be regarded as helfpul.

@gettalong gettalong self-assigned this Jul 31, 2023
@gettalong
Copy link
Owner

Your work-around is the way to go in this case, as per the syntax documentation - see https://kramdown.gettalong.org/syntax.html#tables.

Yes, you could subclass the GFM parser and remove the table parser method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants