russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.45k stars 602 forks source link

Feature: Allow adding custom styles to images #712

Open marcizhu opened 1 year ago

marcizhu commented 1 year ago

This PR adds a small but very useful feature: in our use case, we would like to limit the size of images so that the final HTML file can be exported as PDF and not be distorted by huge images. This can easily be achieved by adding a style tag to all images in the generated HTML data.

Not only that, but this would allow other styling changes to images, such as centering them, which could be useful for many users.