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

Pipes inside image alt text lead to unwanted table output #135

Closed
kleinfreund opened this issue Jun 13, 2014 · 6 comments
Closed

Pipes inside image alt text lead to unwanted table output #135

kleinfreund opened this issue Jun 13, 2014 · 6 comments
Assignees

Comments

@kleinfreund
Copy link

The following...

![What | is | wrong](/img.jpg)

outputs this:

<table>
  <tbody>
    <tr>
      <td>![What</td>
      <td>is</td>
      <td>wrong](/img.jpg)</td>
    </tr>
  </tbody>
</table>

This is unexpected. Inside an image alt text/link text shouldn't be any markup.

@gettalong
Copy link
Owner

This is a known problem, see #46.

@kleinfreund
Copy link
Author

Will it be fixed? Or can we somehow disable kramdown tables?

@gettalong
Copy link
Owner

It will certainly be fixed but I can't tell you when.

You can subclass the kramdown parser and remove the table parsing method. Have a look at the Markdown parser or the GFM parser for examples.

@gettalong
Copy link
Owner

You can work around this specific case by escaping the pipe symbols:

![What \| is \| wrong](/img.jpg)

This will currently result in:

<p><img src="/img.jpg" alt="What \| is \| wrong" /></p>

The next version will contain a fix so that any escaped character (see http://kramdown.gettalong.org/syntax.html#automatic-and-manual-escaping) in the alternative text will be unescaped:

<p><img src="/img.jpg" alt="What | is | wrong" /></p>

This should mitigate the problem in this case.

gettalong added a commit that referenced this issue Jun 14, 2014
This fixes #135 insofar that there is a working solution by
escaping the pipe characters.
@gettalong gettalong self-assigned this Jun 17, 2014
@whuwangyong
Copy link

whuwangyong commented Apr 1, 2022

The bug is still there? I am struggling with it. There version is 2.3.

@gettalong
Copy link
Owner

@whuwangyong See #431 (comment)

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

3 participants