diff --git a/tools/respec2html.js b/tools/respec2html.js index 5c6769d029..7aa33e43de 100755 --- a/tools/respec2html.js +++ b/tools/respec2html.js @@ -48,21 +48,25 @@ class Logger { * @param {RsError} rsError */ error(rsError) { - const header = colors.bgRed.white.bold("[ERROR]"); const message = colors.red(this._formatMarkdown(rsError.message)); - console.error(header, message); - if (rsError.plugin) { - this._printDetails(rsError); + if (rsError.location) { + for (const loc of rsError.location) { + const [file, lineNumber] = loc.split(":"); + console.error(file); + console.error(` ${lineNumber}:0`, "error", message); + } } } /** @param {RsError} rsError */ warn(rsError) { - const header = colors.bgYellow.black.bold("[WARNING]"); const message = colors.yellow(this._formatMarkdown(rsError.message)); - console.error(header, message); - if (rsError.plugin) { - this._printDetails(rsError); + if (rsError.location) { + for (const loc of rsError.location) { + const [file, lineNumber] = loc.split(":"); + console.error(file); + console.error(` ${lineNumber}:0`, "warning", message); + } } }