79170214

Date: 2024-11-08 13:32:36
Score: 1
Natty:
Report link

Looks like adding allowDangerousHtml:true to your options should allow the html elements to get through unchanged.

See the readme: https://github.com/micromark/micromark/blob/main/packages/micromark/readme.md#options

import { micromark } from 'micromark';
import { gfm, gfmHtml } from 'micromark-extension-gfm';

const mdd = `
# Title
<div>
  This is HTML inside markdown.
  <img src="image.jpg" alt="Example image" />
</div>
`;
console.log(micromark(mdd, { allowDangerousHtml:true, extensions:[ gfm() ] }));
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ray Wallace