Fix unpleasant behaviour of Markdown format

This commit is contained in:
Alexey Milovidov 2021-04-15 02:08:43 +03:00
parent 9b546f3b89
commit 15153e504a

View File

@ -21,16 +21,13 @@ void MarkdownRowOutputFormat::writePrefix()
} }
writeCString("\n|", out); writeCString("\n|", out);
String left_alignment = ":-|"; String left_alignment = ":-|";
String central_alignment = ":-:|";
String right_alignment = "-:|"; String right_alignment = "-:|";
for (size_t i = 0; i < columns; ++i) for (size_t i = 0; i < columns; ++i)
{ {
if (isInteger(types[i])) if (types[i]->shouldAlignRightInPrettyFormats())
writeString(right_alignment, out); writeString(right_alignment, out);
else if (isString(types[i]))
writeString(left_alignment, out);
else else
writeString(central_alignment, out); writeString(left_alignment, out);
} }
writeChar('\n', out); writeChar('\n', out);
} }