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 · 4 comments

Comments

Projects
None yet
2 participants
@kleinfreund

kleinfreund commented Jun 13, 2014

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

This comment has been minimized.

Owner

gettalong commented Jun 13, 2014

This is a known problem, see #46.

@gettalong gettalong closed this Jun 13, 2014

@kleinfreund

This comment has been minimized.

kleinfreund commented Jun 13, 2014

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

@gettalong

This comment has been minimized.

Owner

gettalong commented Jun 13, 2014

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

This comment has been minimized.

Owner

gettalong commented Jun 14, 2014

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

Escaped characters in alt text of image links are now unescaped
This fixes #135 insofar that there is a working solution by
escaping the pipe characters.

@gettalong gettalong self-assigned this Jun 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment