1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +00:00

LibMarkdown: Add terminal color formatting

This patch adds color formatting to markdown viewed in the terminal.
This also increases readability.
This commit is contained in:
xSlendiX 2022-02-16 23:13:56 +02:00 committed by Andreas Kling
parent 5d219ad4f7
commit 7685d53654
2 changed files with 3 additions and 4 deletions

View file

@ -19,15 +19,14 @@ String Heading::render_for_terminal(size_t) const
{
StringBuilder builder;
builder.append("\033[0;31;1m\n");
switch (m_level) {
case 1:
case 2:
builder.append("\n\033[1m");
builder.append(m_text.render_for_terminal().to_uppercase());
builder.append("\033[0m\n");
break;
default:
builder.append("\n\033[1m");
builder.append(m_text.render_for_terminal());
builder.append("\033[0m\n");
break;