Fix printDocToString calls (#19983)
This commit is contained in:
1 parent
7e4fe3157e
commit
a1364d3c3b
2 files changed
+6
-1
No files matched your search
@@ -228,6 +228,7 @@ function printTemplateExpression(
|
|||||||
const renderedExpression = printDocToString(expressionDoc, {
|
const renderedExpression = printDocToString(expressionDoc, {
|
||||||
...options,
|
...options,
|
||||||
printWidth: Number.POSITIVE_INFINITY,
|
printWidth: Number.POSITIVE_INFINITY,
|
||||||
|
endOfLine: "lf",
|
||||||
}).formatted;
|
}).formatted;
|
||||||
|
|
||||||
// ... unless one will be introduced anyway, e.g. by a nested function.
|
// ... unless one will be introduced anyway, e.g. by a nested function.
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ function printTable(path, options, print) {
|
|||||||
const contents = path.map(
|
const contents = path.map(
|
||||||
() =>
|
() =>
|
||||||
path.map(({ index: columnIndex }) => {
|
path.map(({ index: columnIndex }) => {
|
||||||
const text = printDocToString(print(), options).formatted;
|
const text = printDocToString(print(), {
|
||||||
|
...options,
|
||||||
|
printWidth: Number.POSITIVE_INFINITY,
|
||||||
|
endOfLine: "lf",
|
||||||
|
}).formatted;
|
||||||
const width = getStringWidth(text);
|
const width = getStringWidth(text);
|
||||||
columnMaxWidths[columnIndex] = Math.max(
|
columnMaxWidths[columnIndex] = Math.max(
|
||||||
columnMaxWidths[columnIndex] ?? 3, // minimum width = 3 (---, :--, :-:, --:)
|
columnMaxWidths[columnIndex] ?? 3, // minimum width = 3 (---, :--, :-:, --:)
|
||||||
|
|||||||
Reference in new issue
Block a user