Occasionally, people are asking about image scaling in Markdown. One possibility is to (mis-)use a query string in the image URL, e.g. “width=half”:

and add this to your CSS:
figure :has(img[src*="width=half"]),
img[src*="width=half"]{
width: 50%;
}
One has to use two rules, since images can occur inline (2nd rule) or in their own paragraph, in which case they’re rendered inside a figure
element.
Alas, one can’t get at the value following the =
sign in CSS. If that were possible, one could write generic CSS rules that simply take the width from the query string…