-
Notifications
You must be signed in to change notification settings - Fork 193
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
Glow truncates code; output incomplete #463
Comments
Seems like |
Update: the space after Line 226 in 5ecb5ac
Because of the $ , matches only if on end of line.By removing the $ , the whole line gets parsed as comment, and content after */ is also handled as comment.So this needs some more handling. Also, if comment is not ended, it should still comment the code until the end. |
Nicely spotted @nobkd — clearly needs a fix. |
In the initial example I could probably just remove the whitespace after import { glow } from 'nue-glow';
const code = `const machine = defineMachine<State, Event>({
// ...
on {
[EVENT_NAME]: {
data: ({ state, event }) => ({ ...state, /* ... */ }),
},
},
});
`;
const html = glow(code, { language: 'typescript', numbered: true });
console.info(html);
const appDiv: HTMLElement = document.getElementById('app');
appDiv.innerHTML = `<pre>${html}</pre>`; Renders
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
Glow truncates code; output is incomplete.
Rendered output is
Live demo: https://stackblitz.com/edit/typescript-playground-tenktfl9?file=index.ts
Environment
Web, node
"nue-glow": "^0.2.2"
Minimal Reproduction
As above
Logs & Additional Context
The text was updated successfully, but these errors were encountered: