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

Fix markdown tables not rendering in messages #240

Closed
wants to merge 1 commit into from

Conversation

chris-at-work
Copy link
Contributor

@chris-at-work chris-at-work commented Aug 16, 2022

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):

Uncaught TypeError: self.parser.lazy is undefined

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.

@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2022

Codecov Report

Merging #240 (59078bb) into main (2605631) will increase coverage by 0.00%.
The diff coverage is 50.00%.

❗ Current head 59078bb differs from pull request most recent head c5a150b. Consider uploading reports for the commit c5a150b to get more accurate results

@@           Coverage Diff           @@
##             main     #240   +/-   ##
=======================================
  Coverage   69.40%   69.40%           
=======================================
  Files         184      184           
  Lines        8550     8551    +1     
  Branches      256      256           
=======================================
+ Hits         5934     5935    +1     
  Misses       2363     2363           
  Partials      253      253           
Impacted Files Coverage Δ
...ite/TestSuiteDetails/TestListItem/TestListItem.tsx 16.08% <50.00%> (+0.29%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chris-at-work chris-at-work changed the title Fix markdown tables not rendering in messages Draft: Fix markdown tables not rendering in messages Aug 16, 2022
@chris-at-work
Copy link
Contributor Author

chris-at-work commented Aug 16, 2022

Looks like there is an existing test that is breaking with the previously mentioned ES modules error because of the library.

@chris-at-work chris-at-work changed the title Draft: Fix markdown tables not rendering in messages Fix markdown tables not rendering in messages Aug 24, 2022
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):

```
Uncaught TypeError: self.parser.lazy is undefined
```

So I bumped the versions to latest of react-markdown and the gfm plugin and
then it worked.
@chris-at-work
Copy link
Contributor Author

chris-at-work commented Aug 25, 2022

#247 is going to conflict with this so I'm going to cherry-pick etc and start over.

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

Successfully merging this pull request may close these issues.

2 participants