filename | example of code |
---|---|
client/.happo.js | require('dotenv').config(); |
client/globalSetup.ts | require('dotenv').config({ |
-
-
Save havenchyk/559beeb456b2fe9078bd4294634e4f3b to your computer and use it in GitHub Desktop.
client/.happo.js |
|
client/globalSetup.ts |
require('dotenv').config({
path: path.resolve(process.cwd(), 'client', '.env'),
}); |
The code:
<table>
<tr>
<td>
client/.happo.js
</td>
<td>
`require('dotenv').config();`
</td>
</tr>
<tr>
<td>
client/globalSetup.ts
</td>
<td>
```js
require('dotenv').config({
path: path.resolve(process.cwd(), 'client', '.env'),
});
```
</td>
</tr>
</table>
@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?
@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 |
The issue with that layout is that you are using a markdown table with
pre
.I do not think it is supposed to work as you want per spec - MD tables were designed for simple usecases and can't habe block elements inserted.