1

Topic: Bug: sizes attribute not allowed on img tags

htmLawed correctly allows using the srcset attribute on img tags:

'srcset'=>array('img'=>1)

But if the srcset attribute uses width descriptors, the sizes attribute must also be present, or the srcset itself will be ignored (https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset).

So, this entry in $attrEleAr:

'sizes'=>array('link'=>1)

should be changed to:

'sizes'=>array('img'=>1, 'link'=>1)

to allow srcset and sizes to be used together.

2

Re: Bug: sizes attribute not allowed on img tags

Thank you. Will fix soon.

3

Re: Bug: sizes attribute not allowed on img tags

New release (1.2.12) permits 'sizes' in the 'img' and 'source' elements as well.