-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
| [![PR App][icn]][demo] | Fix RM-XYZ | | :--------------------: | :--------: | ## 🧰 Changes Describe your changes in detail. ## 🧬 QA & Testing - [Broken on production][prod]. - [Working in this PR app][demo]. [demo]: https://markdown-pr-PR_NUMBER.herokuapp.com [prod]: https://SUBDOMAIN.readme.io [icn]: https://user-images.githubusercontent.com/886627/160426047-1bee9488-305a-4145-bb2b-09d8b757d38a.svg
- Loading branch information
1 parent
35c38e3
commit df6f7c3
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { mdast, mdx } from '../../index'; | ||
|
||
describe('html-block compiler', () => { | ||
it('compiles html blocks within containers', () => { | ||
const markdown = ` | ||
> 🚧 It compiles! | ||
> | ||
> <HTMLBlock>{\` | ||
> <strong style="color: olive">Hello, World!</strong> | ||
> \`}</HTMLBlock> | ||
`; | ||
|
||
expect(mdx(mdast(markdown)).trim()).toBe(markdown.trim()); | ||
}); | ||
|
||
it('compiles html blocks with indents', () => { | ||
const markdown = ` | ||
<HTMLBlock>{\` | ||
<pre><code> | ||
const foo = () => { | ||
const bar = { | ||
baz: 'blammo' | ||
} | ||
return bar | ||
} | ||
</code></pre> | ||
\`}</HTMLBlock> | ||
`; | ||
|
||
expect(mdx(mdast(markdown)).trim()).toBe(markdown.trim()); | ||
Check failure on line 31 in __tests__/compilers/html-block.test.ts GitHub Actions / Test (lts/-1, 16)__tests__/compilers/html-block.test.ts > html-block compiler > compiles html blocks with indents
Check failure on line 31 in __tests__/compilers/html-block.test.ts GitHub Actions / Test (lts/-1, 17)__tests__/compilers/html-block.test.ts > html-block compiler > compiles html blocks with indents
Check failure on line 31 in __tests__/compilers/html-block.test.ts GitHub Actions / Test (lts/-1, 18)__tests__/compilers/html-block.test.ts > html-block compiler > compiles html blocks with indents
|
||
}); | ||
}); |