mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-10 21:40:00 +00:00
Picture Element #270
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TerribleDev on GitHub (Feb 4, 2019).
I plan on writing an extension that emits
<picture>elements instead of<img>with some customizable suffixes for different image formatswebp,jpeg xr, and src setsAs a bit of background I use this markdown compiler for my blog, it gets all 100's in lighthouse, and my last performance bottleneck left to tackle is to ship next gen image formats, but to do that I have to start telling the browsers to use a different image formats based on what the browser supports. The picture element describes an image to load based on rules including format, src set, media query, etc.
For now I'm just going to keep this extension in a separate repo
I've been doing a lot of private extension development for my blog, and I have a decent grasp with how it all fits together. For my new extension, do you think I should just make a renderer that inherits from
LinkInlineRendererbut one that just emits picture elements instead if theLinkInlineis has the Image property?Any other tips I should consider when making this thing?
@kaylumah commented on GitHub (Mar 31, 2024):
@TerribleDev did you ever get around to creating this extension?
@TerribleDev commented on GitHub (Mar 31, 2024):
I did but 5 years ago is quite a while back so idk what I did with the code.
@kaylumah commented on GitHub (Mar 31, 2024):
Oh yeah I can imagine!
Found this issue due to the fact that this was one of the last things affecting my lighthouse scores
A quick scan of your public repositories allowed be to find the code in question (its in your blog repo, not the linked repo)
A quick look at the code, and it looks like it gives me enough pointers on how to achieve something similar
@TerribleDev commented on GitHub (Mar 31, 2024):
I do remember getting good at markdig extensions. if I recall correctly there's quite a few in there