Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No indentation in the latest version #50

Closed
Ihatetomatoes opened this issue Nov 15, 2020 · 3 comments
Closed

No indentation in the latest version #50

Ihatetomatoes opened this issue Nov 15, 2020 · 3 comments

Comments

@Ihatetomatoes
Copy link

Hi there, thanks for the cool plugin. For some reason, in the latest version ("remark-prism": "^1.3.1"), the indentation is removed when the snippet is processed by remark-prism.

import remark from "remark";
import html from "remark-html";
import prism from 'remark-prism';

export default async function markdownToHtml(markdown) {
  const result = await remark().use(html).use(prism).process(markdown);
  return result.toString();
}

Here is the resulting HTML in the browser.

image

When I use an older version ("remark-prism": "^1.1.14"), the indentation is working as expected.

image

Any idea why?

FYI I am using Next.js with TailwindCSS and statically generating posts that include the code snippets.

@sergioramos
Copy link
Owner

One of the latest commits broke indentation, only on JSX, and I didn't catch it. I'm working on a fix.

@sergioramos
Copy link
Owner

please let me know if the latest version fixed the issue @Ihatetomatoes

@Ihatetomatoes
Copy link
Author

Yep, all good. The latest version fixed the issue, thanks! Great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants