inkle / inky

An editor for ink: inkle's narrative scripting language
http://www.inklestudios.com/ink
2.39k stars 290 forks source link

Update main.js with the ability to ignore empty paragraph. #491

Closed allaze-eroler closed 4 months ago

allaze-eroler commented 1 year ago

Functionality

The added code performs the following actions:

1.  It checks the paragraphText variable to see if it is empty or consists only of whitespace characters.
2.  If paragraphText is empty, it uses the continue statement to skip any further processing for that paragraph.
3.  This enhancement helps in avoiding unnecessary processing of empty paragraphs, optimizing the code’s performance and readability.

The results from this functionality:

image

image

Why is this change needed?

This change is important because it ensures that the code doesn’t perform any unnecessary operations on empty paragraphs, which can improve the efficiency of the program and make the code more robust.

Additional Information

•   This change does not introduce any new external dependencies.
•   It has been tested and verified to work as intended.

Please review and merge this pull request if it meets the project’s coding standards and requirements. Thank you!

joethephish commented 4 months ago

Thanks!

allaze-eroler commented 4 months ago

you're welcome!