You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ When you are using Version 1.0 of league\commonmark
The current version of this pacakge is only compatible with `League\CommonMark 2.0`, for `1.0` compatibility install the latest `1.0` version of this package like so:
By default, only the loading="lazy" attribute is added
While this should hopefully be sufficient in the future, you can use the provided options to integrate with various lazy loading libraries.
Here is an example how to use this package with the lozad library:
$environment = newEnvironment([
// ... other config'lazy_image' => [
'strip_src' => true, // remove the "src" to add it later via js, optional'html_class' => 'lozad', // the class that should be added, optional'data_attribute' => 'src', // how the data attribute is named that provides the source to get picked up by js, optional
]
]);
$environment->addExtension(newCommonMarkCoreExtension())
->addExtension(newLazyImageExtension());
$converter = newMarkdownConverter($environment);
$html = $converter->convert('');