Skip to content

bugfix: fix CR+LF newlines for web version#400

Merged
svenstaro merged 1 commit intosvenstaro:masterfrom
FedericoStra:julia
Sep 13, 2022
Merged

bugfix: fix CR+LF newlines for web version#400
svenstaro merged 1 commit intosvenstaro:masterfrom
FedericoStra:julia

Conversation

@FedericoStra
Copy link
Copy Markdown
Contributor

No description provided.

@svenstaro
Copy link
Copy Markdown
Owner

This does indeed fix it, thanks!

@FedericoStra
Copy link
Copy Markdown
Contributor Author

I opted for this approach (interpolation of the carriage return character) because using newline().await would lead to this unmaintainable monstruosity:

async fn print_banner() {
    print(format!(
        r#"               {gu}"#,
        gu = Paint::green("_").bold()
    ))
    .await;
    newline().await;
    print(format!(
        r#"   {bu}       _ {ru}{g}{mu}     |  Documentation: https://docs.julialang.org"#,
        bu = Paint::blue("_").bold(),
        ru = Paint::red("_").bold(),
        g = Paint::green("(_)").bold(),
        mu = Paint::magenta("_").bold()
    ))
    .await;
    newline().await;
    print(format!(
        r#"  {b}     | {r} {m}    |"#,
        b = Paint::blue("(_)").bold(),
        r = Paint::red("(_)").bold(),
        m = Paint::magenta("(_)").bold(),
    ))
    .await;
    newline().await;
    print(r#"   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help."#).await;
    newline().await;
    print(r#"  | | | | | | |/ _` |  |"#).await;
    newline().await;
    print(r#"  | | |_| | | | (_| |  |  Version 1.7.3 (2022-05-06)"#).await;
    newline().await;
    print(r#" _/ |\__'_|_|_|\__'_|  |  Fedora 35 build"#).await;
    newline().await;
    print(r#"|__/                   |"#).await;
    newline().await;
}

@svenstaro
Copy link
Copy Markdown
Owner

svenstaro commented Sep 13, 2022

Yes, I was actually surprised how well you solved this. I played around with it myself but didn't come up with something this simple so I really appreciate it.

@svenstaro svenstaro merged commit 2d03403 into svenstaro:master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants