russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.41k stars 596 forks source link

Feature: Allow adding custom styles to images #712

Open marcizhu opened 10 months ago

marcizhu commented 10 months 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.