diff --git a/src/build/fix-links.mjs b/src/build/fix-links.mjs index d07d9e567f..dfb58e70be 100644 --- a/src/build/fix-links.mjs +++ b/src/build/fix-links.mjs @@ -59,7 +59,10 @@ export default function attacher(options) { } } catch (error) { console.error(error); - console.error(`Error fixing url in Markdown ${nodeType} in ${file.path}:\n`, trunc(repr(node), 200)); + console.error( + `Error fixing url in Markdown ${nodeType} in ${file.path}:\n`, + trunc(repr(node), 200) + ); } }); } diff --git a/src/lib/utils.js b/src/lib/utils.js index e00835b4c7..5c08267e5b 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -38,9 +38,9 @@ module.exports.repr = repr; /** Truncate long strings with an ellipsis, and leave alone strings that are already short enough. */ -function trunc(str, maxLen, endChar="…") { +function trunc(str, maxLen, endChar = "…") { if (str.length > maxLen) { - return str.slice(0, maxLen)+endChar; + return str.slice(0, maxLen) + endChar; } else { return str; }