abertschi / postcards

A CLI for the Swiss Postcard Creator :postbox:
https://abertschi.ch/blog/2022/receiving-postcards/
MIT License
36 stars 8 forks source link

Rendering line breaks in `message` #55

Closed jorisnoo closed 3 years ago

jorisnoo commented 3 years ago

Thanks again for your continued work on this library, @abertschi! Following the example, I sent a card with --message "Happy <br/> coding!". However, the <br/> tag always gets rendered as text instead of being converted to a line break.

(With my limited python experience) I tried adding something like

msg = msg.replace("<br />", "\n").replace("<br/>", "\n").replace("<br>", "\n")

before passing the text to create_text_image, which seems to solve this.

abertschi commented 3 years ago

As far as I recall, html tags are no longer supported with the update to a text cover which is pixel and no longer text based. I should update the readme and remove these examples. Feel free to create a pull request which uses newlines i.e. \n in the examples instead.

jorisnoo commented 3 years ago

Thank you — you're right!