rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No `display: grid;` was added to `code` element by default

GoodbyeNJN opened this issue · comments

According to the changelog of v0.10.0:

grid: true option has been added to prevent lines from collapsing by default with code blocks, allowing you to remove the onVisitLine callback hook.

And the code of processing grid: true option:

if (grid && codeElement.properties) {
  codeElement.properties.style += 'display: grid;';
}

https://github.com/atomiks/rehype-pretty-code/blob/master/src/index.ts#L268-L270

It seems a property style="display: grid;" should be added to code element, but it does not take effect in the current version.

It looks like a bug, I would open a new pull request.