Skip to content

Ability to provide more context to errors #40

@cody1024d

Description

@cody1024d

It would be nice to provide an options parameter to allow more context to be given in the case of an error. In my scenario, I'm providing users with the feedback, and right now, in a long LaTeX document, it may be hard to spot the occurence of the error, without additional context to where the error occurred.

I believe this is the part that needs to be configurable within the code:

node-latex/index.js

Lines 55 to 63 in 780c588

lines.forEach((line, i) => {
if (line.startsWith('! Undefined control sequence.')) {
errors.push(lines[i - 1])
errors.push(lines[i])
errors.push(lines[i + 1])
} else if (line.startsWith('!')) {
errors.push(line)
}
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions