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

feat: adds new transformer for inline code nodes inside table cells #805

Conversation

dannobytes
Copy link
Contributor

@dannobytes dannobytes commented Aug 11, 2023

PR App Fix RM-7646

🧰 Changes

This unescapes escaped pipe chars when rendering html. There appears to be a bug in remark or rehype where it displays the escaped pipe character in inline code spans within a table cell.

When using pipe characters in code spans within tables, you have to escape the pipe character, otherwise, it would result in additional table cells.

Consider the following markdown:

| td |
| -  |
| `echo \| cat` |

This would result in:

<table>
  <thead>
    <tr>
      <td><code>echo \| cat</code></td>
    </tr>
  </thead>
</table>

Which doesn't seem like what was intended.

🧬 QA & Testing

This unescapes escaped pipe chars loaded into our editor from MD so that
users don't have to see them when editing.

RM-7646
@dannobytes dannobytes requested review from kellyjosephprice and a team August 11, 2023 23:53
Copy link
Collaborator

@kellyjosephprice kellyjosephprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Copy link
Collaborator

@kellyjosephprice kellyjosephprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, what happens when we write out plain markdown:

md(mdast(``
| td         | td |
| -          | -  |
| `uh \| oh` |    |
``))

@kellyjosephprice kellyjosephprice requested a review from a team August 14, 2023 18:39
Copy link
Contributor

@kevinports kevinports left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works when I tested!

@kellyjosephprice kellyjosephprice merged commit 9e42dd9 into next Aug 15, 2023
7 checks passed
@kellyjosephprice kellyjosephprice deleted the daniels/rm-7646-pipe-character-in-table-cell-code-block-creates-new-column branch August 15, 2023 16:19
rafegoldberg pushed a commit that referenced this pull request Aug 15, 2023
## Version 6.66.0

### 🛠 Fixes & Updates

* **dependabot:** only notify on prod deps ([#802](#802)) ([fb8cb96](fb8cb96))

### ✨ New & Improved

* adds new transformer for inline code nodes inside table cells ([#805](#805)) ([9e42dd9](9e42dd9))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

This PR was released!

🚀 Changes included in v6.66.0

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

Successfully merging this pull request may close these issues.

4 participants