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

Cannot use a | character in table header #229

Open
collincchoy opened this issue Oct 26, 2022 · 0 comments
Open

Cannot use a | character in table header #229

collincchoy opened this issue Oct 26, 2022 · 0 comments
Labels
bug Something isn't working commonmark Relates to commonmark round-tripping or syntax

Comments

@collincchoy
Copy link

collincchoy commented Oct 26, 2022

Describe the bug
The stacks-editor overwrites/parses markdown when switching between preview and markdown views which is not allowing me to put a | character into a header. Some variations that I've tried:

  • Add \ to escape the pipes. the editor strips out my escapes.
  • Use the HTML character code |. This also gets parsed out and translated to just | which loses the escape
  • Combine the above 2 approaches - I\|Like\|\|Pipes Maybe we can escape the character code and escape the escapes! Toggling between markdown and preview modes progressively modifies the markdown source until the table is broken as in, it renders a proper table but shows I|Like||Pipes and then I|Like|Pipes and then broken table.
  • Try editing in the preview mode instead of the markdown. So build the table and then add the pipes in from the preview mode. Also doesn't work.

To Reproduce

  1. Try to create a table where one of the headers has a | in it. Example:
| Column1 | I\|Like\|Pipes |
| ------- | -------------- |
| tables  | r fun          |
  1. Switch to preview mode to ensure the escapes worked as I'd expect and see I|Like|Pipes in the preview.
  2. Either post or switch back to markdown view and see that the table no longer renders correctly.

Expected behavior
I should be able to put a | character into a table header if I'd like either by escaping them or using |. I'd expect toggling between view modes not to produce different results.

Screenshots
editor-table-pipe-bug

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] chrome
  • Version [e.g. 22] 107.0.5304.63

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

@collincchoy collincchoy added the bug Something isn't working label Oct 26, 2022
@b-kelly b-kelly added the commonmark Relates to commonmark round-tripping or syntax label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working commonmark Relates to commonmark round-tripping or syntax
Projects
Status: Todo
Development

No branches or pull requests

2 participants