filename | example of code |
---|---|
client/.happo.js | require('dotenv').config(); |
client/globalSetup.ts | require('dotenv').config({ |
Created
February 15, 2022 13:42
-
-
Save havenchyk/559beeb456b2fe9078bd4294634e4f3b to your computer and use it in GitHub Desktop.
GitHub markdown table with code formatting
@havenchyk this is the behavior by design per spec, see Section 4.10 (although it does not mention NOT supporting block-level elements inside MD tables). Also, here's a spec-compliant test-suite for that specific rule.
If you want a coumn-like layout, you MUST use HTML tables for that.
There's a trick of rendering Markdown within HTML though.
The rule is like that: if you want to render markdown within a <table>
-based layout, you need to include newlines before and after the MD block:
<td>
**This line** will be rendered as _markdown_
</td>
Markdown table & videos are tears:
| ios | android |
|---|---|
| https://user-images.githubusercontent.com/95620376/154093638-056f3bef-f56a-4f0d-a0e3-89f2fad52244.mp4 | https://user-images.githubusercontent.com/95620376/154093638-056f3bef-f56a-4f0d-a0e3-89f2fad52244.mp4 |
HTML variant
<table>
<tr>
<td>
ios
</td>
<td>
android
</td>
</tr>
<tr>
<td>
https://user-images.githubusercontent.com/95620376/154093638-056f3bef-f56a-4f0d-a0e3-89f2fad52244.mp4
</td>
<td>
https://user-images.githubusercontent.com/95620376/154093638-056f3bef-f56a-4f0d-a0e3-89f2fad52244.mp4
</td>
</tr>
</table>
ios |
android |
151585253-8b33b097-4bf6-460a-85ab-078816128071.mp4 |
151585253-8b33b097-4bf6-460a-85ab-078816128071.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mr-mig I just wanted to put block code to the table. If we have a clear and simple syntax for MD tables without using tr and td, we have a syntax for highlighting code, why can't we have some abstraction to use both together without HTML tags?