-
Notifications
You must be signed in to change notification settings - Fork 62
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
Syntax highlighting hangs when using a substring pattern with ' #185
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
Comments
Nextra seems to be using Can you try to repro it using the latest version of |
I've reproduced the error using the current version ( import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";
import rehypeStringify from "rehype-stringify";
import rehypePrettyCode from "rehype-pretty-code";
async function main() {
const file = await unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypePrettyCode, {
// See Options section below.
})
.use(rehypeStringify)
.process(`\`\`\`rust /'a/
fn longer_array<'a>(a : &'a [i32], b : &'a [i32]) -> &'a [i32] {
}
`);
console.log(String(file));
}
main(); |
o-az
added
bug
Something isn't working
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
May 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
I have come across a problem with highlighting sections of source code using a pattern/substring using Nextra.
I am presenting code in Rust that implements lifetimes annotations marked with ' , for example:
fn longer<'a>(a : &'a [i32], b : &'a [i32]) -> &'a [i32]
.I am trying to highlight the annotation itself (
'a
) using the code:This syntax causes the page rendering to crash (even terminating the process causes the node to remain on).
The problem has been previously reported in the Nextra project (shuding/nextra#2792) and was redirected here as a code rendering issue.
The text was updated successfully, but these errors were encountered: