To modify the HTML that is generated from posts in Markdown format in AstroJS, we may use plugins for remark as well as rehype.
Remark transforms a Markdown file into HTML and Rehype may then subsequently be used to modify the HTML generated from the Markdown file. So, the pipeline looks like this
markdown --remark--> html --rehype--> html'