-
Notifications
You must be signed in to change notification settings - Fork 26
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
Line numbers #30
Comments
also looking for this function. Were you manage to implement this? @samuelgoldenbaum |
Here is a partial solution if it can help : const totalLines = codeString.length;
const maxDigits = totalLines.toString().length;
const formattedCodeString = codeString.map((line, index) => {
const lineNumber = (index + 1).toString().padStart(maxDigits, ' ');
return `${lineNumber} | ${line}`;
}).join('\n'); |
This version actually support showLineNumber, also there is some problems about the format of linenumber. Here is my solution temporarily. function createNativeElement({ node, stylesheet, key, defaultColor, fontFamily, fontSize = 12 }) { if (type === 'text') { |
Before I go down the rabbit hole of trying to implement line numbers, is there a reason they were not implemented—anything I need to be aware of?
The text was updated successfully, but these errors were encountered: