mfontanini / presenterm

A markdown terminal slideshow tool
https://mfontanini.github.io/presenterm/
BSD 2-Clause "Simplified" License
1.33k stars 32 forks source link

Code execution output alignment issue #259

Closed AllenFind closed 5 months ago

AllenFind commented 5 months ago

Hi,

I am trying to use this to print a Python snippet:

def print_box_with_rounded_corners(width, height):
    if width < 3 or height < 3:
        print("Width and height should be at least 3 to draw rounded corners.")
        return

    # Top rounded corners and top border
    print('╭' + '─' * (width - 2) + '╮')

    # Middle part
    for _ in range(height - 2):
        print('│' + ' ' * (width - 2) + '│')

    # Bottom rounded corners and bottom border
    print('╰' + '─' * (width - 2) + '╯')

# Set the dimensions of the box
box_width = 10
box_height = 5

# Print the box
print_box_with_rounded_corners(box_width, box_height)

However, it gave out:

print_align

Could you help take a look?

mfontanini commented 5 months ago

Thanks for the report! This is fixed in master now.