When I run node on the following code:
import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";
import rehypeStringify from "rehype-stringify";
import remarkCaptions from "remark-captions";
const processor = unified()
.use(remarkParse)
.use(remarkCaptions)
.use(remarkRehype)
.use(rehypeStringify);
const markdown = `
head1| head2
-----|------
bla|bla
Table: figcapt1`;
processor.process(markdown, (err, file) => {
if (err) throw err;
console.log(String(file));
});
The following is produced:
<p>head1| head2
-----|------
bla|bla
Table: figcapt1</p>
However, according to the remark-captions README, it should produce:
<figure>
<table>
<thead>
<tr>
<th>head1</th>
<th>head2</th>
</tr>
</thead>
<tbody>
<tr>
<td>bla</td>
<td>bla</td>
</tr>
</tbody>
</table>
<figcaption>figcapt1</figcaption>
</figure>
When I run
nodeon the following code:The following is produced:
However, according to the
remark-captionsREADME, it should produce: