Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text with formatting and empty lines is not animated correctly #890

Closed
olshevski opened this issue Jul 29, 2023 · 4 comments
Closed

Text with formatting and empty lines is not animated correctly #890

olshevski opened this issue Jul 29, 2023 · 4 comments
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@olshevski
Copy link

Issue summary

When I try to echo (with typing animation) some text with any kind of formatting and with some empty line, the empty lines are skipped during the animation and appear only when the animation ends. See the attached video:

Screen.Recording.2023-07-29.at.12.38.43.mov

Any text without formatting is always animated correctly.

Expected behavior

Any text should animate empty lines correctly, not depending on the presence of the formatting syntax.

Actual behavior

The presence of the formatting syntax breaks the animation of empty lines in a text.

Steps to reproduce

Here is the code from the video:

<script>
    $(function () {
        $('body').terminal({
            test: function() {
                this.echo("Hello\n\n[[;green;]world]", { typing: true, delay: 200})
            }
        }, {
            greetings: null,
        })
    })
</script>

And here is the codepen: https://codepen.io/olshevski/pen/zYMMpgy

Browser and OS

The issue is reproduced on:
MacOS Ventura 13.3.1
Google Chrome 115.0.5790.114 (Official Build) (arm64)
Safari 16.4 (18615.1.26.110.1)

@olshevski olshevski added the Bug label Jul 29, 2023
@jcubic
Copy link
Owner

jcubic commented Jul 29, 2023

Thanks for reporting the issue.

@jcubic
Copy link
Owner

jcubic commented Jul 29, 2023

The problem is with the prompt, it doesn't render empty lines:

$('body').terminal({
}, {
    greetings: null,
    prompt: "Hello\n\n[[;green;]world]"
})

Prompt is used during animation.

jcubic added a commit that referenced this issue Jul 29, 2023
@jcubic
Copy link
Owner

jcubic commented Jul 29, 2023

Fixed on the devel branch, the problem was that for an unknown reason I added filter(Boolean) to lines, and empty lines got removed before rendering.

@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Jul 29, 2023
@jcubic
Copy link
Owner

jcubic commented Jul 30, 2023

Released in 2.37.0

@jcubic jcubic closed this as completed Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

2 participants