New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2576 by saving all attributes on the img tag. #2773
Fixes #2576 by saving all attributes on the img tag. #2773
Conversation
} | ||
|
||
if (preg_match($imgmatch, $img->src, $matches)) { | ||
$img->outertext = '<concrete-picture fID="' . $matches[1] . '" ' . $attrString . ' />'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that, for an empty attrString
, this results in two consecutive spaces. This is why the Travis build is failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, tweaking now.
This seems to be more in line with the specs, and consistent with the non-responsive img solution.
Alright, this latest 'fail' I think is the result of a poorly written test. The test asserts that
This is failing because the new code doesn't arbitrarily add empty attributes. I'd propose changing to to:
|
Alternatively, if there's a good reason why the empty attributes should be there, I can force those to always output. |
👍 I tested the code and it applies the attributes to the img tag on save as expected. Regarding any confusion relating to the placement of attributes. http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-picture-element "While all of them contain source elements, the sourceelement's src attribute has no meaning when the element is nested within a picture element, and the resource selection algorithm is different. As well, thepicture element itself does not display anything; it merely provides a context for its contained img element that enables it to choose from multiple URLs" |
No, there's no need to output the empty attributes. We probably just need to update the test so that it passes and then we'll get the pull request applied. |
…mdix/concrete5 into content-block-image-attr-2576
Will this fix be part of the next release? |
Fixes #2576 by saving all attributes on the img tag.
Thanks! |
No description provided.