diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts
index b3c916bcd..716af14fd 100644
--- a/packages/astro/src/vite-plugin-markdown/index.ts
+++ b/packages/astro/src/vite-plugin-markdown/index.ts
@@ -138,7 +138,6 @@ export default function markdown({ config }: AstroPluginOptions): Plugin {
const { layout = '', components = '', setup = '', ...content } = frontmatter;
content.astro = metadata;
const prelude = `---
-import { slug as $$slug } from '@astrojs/markdown-remark';
${layout ? `import Layout from '${layout}';` : ''}
${components ? `import * from '${components}';` : ''}
${hasInjectedScript ? `import '${PAGE_SSR_SCRIPT_ID}';` : ''}
diff --git a/packages/markdown/remark/src/rehype-collect-headers.ts b/packages/markdown/remark/src/rehype-collect-headers.ts
index 426b782a3..f8c071c8b 100644
--- a/packages/markdown/remark/src/rehype-collect-headers.ts
+++ b/packages/markdown/remark/src/rehype-collect-headers.ts
@@ -40,16 +40,10 @@ export default function createCollectHeaders() {
node.properties = node.properties || {};
if (typeof node.properties.id !== 'string') {
- if (isJSX) {
- // HACK: for ids that have JSX content, use $$slug helper to generate slug at runtime
- node.properties.id = `$$slug(\`${text.replace(/\{/g, '${')}\`)`;
- (node as any).type = 'raw';
- (
- node as any
- ).value = `<${node.tagName} id={${node.properties.id}}>${raw}${node.tagName}>`;
- } else {
- node.properties.id = slugger.slug(text);
- }
+ node.properties.id = slugger.slug(text);
+ // TODO: restore fix for IDs from JSX expressions
+ // Reverted due to https://github.com/withastro/astro/issues/3443
+ // See https://github.com/withastro/astro/pull/3410/files#diff-f0cc828ac662d9b8d48cbb9cb147883e319cdd8fa24f24ef401960520f1436caR44-R51
}
headers.push({ depth, slug: node.properties.id, text });
diff --git a/packages/markdown/remark/test/expressions.test.js b/packages/markdown/remark/test/expressions.test.js
index 17674c543..ba32b0c7d 100644
--- a/packages/markdown/remark/test/expressions.test.js
+++ b/packages/markdown/remark/test/expressions.test.js
@@ -14,7 +14,10 @@ describe('expressions', () => {
chai.expect(code).to.equal(`