You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, this package is amazing - thanks for your hard work on it!
I'm using rehypeKatex along with this package. In rehypeKatex (and most other LaTex-like markdown libraries) you denote block-style equations with opening and closing double dollar signs ($$). For example,
rehype-pretty-code then incorrectly assumes this is inline code and styles it accordingly. I believe the definition for isInlineCode is to blame.
export function isInlineCode(
element: Element,
parent: Element | Root | undefined,
): element is Element {
return (
(element.tagName === 'code' &&
isElement(parent) &&
parent.tagName !== 'pre') ||
element.tagName === 'inlineCode'
);
}
As a temporary hack, I can avoid the issue by placing rehypeKatexbeforerehypePrettyCode in my processor. But I would rather not do this.
Could you alter the definition for isInlineCode() to be a little more strict, perhaps confirming that the element className does not include 'language-math'?
The text was updated successfully, but these errors were encountered:
Firstly, this package is amazing - thanks for your hard work on it!
I'm using
rehypeKatex
along with this package. InrehypeKatex
(and most other LaTex-like markdown libraries) you denote block-style equations with opening and closing double dollar signs ($$
). For example,This products an AST like this
rehype-pretty-code
then incorrectly assumes this is inline code and styles it accordingly. I believe the definition forisInlineCode
is to blame.As a temporary hack, I can avoid the issue by placing
rehypeKatex
beforerehypePrettyCode
in my processor. But I would rather not do this.Could you alter the definition for
isInlineCode()
to be a little more strict, perhaps confirming that the element className does not include'language-math'
?The text was updated successfully, but these errors were encountered: