Fix markdown tables not rendering in messages #240
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Github Flavored Markdown (GFM) has a tables syntax. GFM is not in the
react-markdown library we are using. Add the GFM plugin that makes table
rendering possible. In addition, the plugin did not work at first with
the existing versions that were locked (react-markdown 6.0.2):
So I bumped the versions to latest of react-markdown and the gfm plugin and
then it worked.
Testing Guidance
Jest isn't working because react-markdown has never been loaded. It throws a few errors and I'm punting on it for this branch. This component didn't have a test and can't be loaded by Jest right now. I have another branch started but it's complicated.This was unblocked by the vitest change #242.
Testing has to be done manually in a really bad way. You'd have to find a test that generates the markdown while installing a local gem or something. What I did was make a variable with markdown content to see it work once. 😬 I'd prefer to have a test so we can know when libraries break etc.I've added a test.