Storybook: Escaped Pipe creates new table cell

Created on 23 May 2019  路  7Comments  路  Source: storybookjs/storybook

Describe the bug
In Storybook-Addon-Notes: I'm using markdown-files with tables. Inside a table-cell I use escaped pipes. These pipes are creating new cells

To Reproduce
Steps to reproduce the behavior:

  1. Create a story
  2. Use addon notes
  3. Create a markdown file with this table:
| Attribute    | Type                  |
| ------------ | --------------------- |
| `position`   | `"left" \| "right"`   |

Which should render this:

| Attribute | Type |
| ------------ | --------------------- |
| position | "left" \| "right" |

But it actually renders like this:

| Attribute | Type | |
| ------------ | ---------| ---------- |
| position | "left" | "right" |

Expected behavior
Do not ignore escaped pipes. Do not create new table cells.

Screenshots
table

System:

  • OS: Windows7
  • Browser: Chrome
  • Addons: Notes
  • Version: 5.0.11
notes bug

Most helpful comment

This has now been fixed in latest markdown-to-jsx release, 6.10.3. Huge thanks to @ariabuckles in the underlying simple-markdown for providing a fix and submitting it downstream as well.

Submitted a PR to upgrade the markdown-to-jsx version for notes addon.

All 7 comments

Same issue here, unfortunately.

I wanted to try and find the root cause, and checked the markdown-to-jsx library for clues, but no similar issue reported there. Anyone have any insights into what part of the code or library is parsing this wrong?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

I wanted to try and find the root cause, and checked the markdown-to-jsx library for clues, but no similar issue reported there. Anyone have any insights into what part of the code or library is parsing this wrong?

I could investigate this further, and maybe attempt a fix, but would be helpful with some pointers on where in the code to look - or if it's entirely a markdown-to-jsx issue. Pinging some recently active contributors @Gongreg @tmeasday @ndelangen @danielduan.

Hey,

  <Markdown>{textAfterFormatted}</Markdown>

this is all ondevice-notes addon is doing.
So I assume the issue is in markdown-to-jsx lib

@Gongreg Thanks! I will try to reproduce with plain markdown-to-jsx, and report any findings to their project. Propose to keep this open for now, for visibility.

This has now been fixed in latest markdown-to-jsx release, 6.10.3. Huge thanks to @ariabuckles in the underlying simple-markdown for providing a fix and submitting it downstream as well.

Submitted a PR to upgrade the markdown-to-jsx version for notes addon.

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.24 containing PR #7694 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arunoda picture arunoda  路  3Comments

alexanbj picture alexanbj  路  3Comments

miljan-aleksic picture miljan-aleksic  路  3Comments

wahengchang picture wahengchang  路  3Comments

ZigGreen picture ZigGreen  路  3Comments