Log a warning if dataURI property is missing from image argument specification in extension info. Default to empty string if dataURI or alt are not provided.

This commit is contained in:
Karishma Chadha 2019-09-20 16:56:02 -07:00
parent 167f502edc
commit 6afbe192d8

View file

@ -1244,10 +1244,13 @@ class Runtime extends EventEmitter {
// check if this is not one of those cases. E.g. an inline image on a block. // check if this is not one of those cases. E.g. an inline image on a block.
if (argTypeInfo.type && !argTypeInfo.shadowType && !argTypeInfo.fieldType) { if (argTypeInfo.type && !argTypeInfo.shadowType && !argTypeInfo.fieldType) {
if (argTypeInfo.type === 'IMAGE') { if (argTypeInfo.type === 'IMAGE') {
if (!argInfo.dataURI) {
log.warn('Missing data URI in extension block with argument type IMAGE');
}
argJSON = { argJSON = {
type: 'field_image', type: 'field_image',
alt: argInfo.alt, alt: argInfo.alt || '',
src: argInfo.dataURI, src: argInfo.dataURI || '',
// TODO these probably shouldn't be hardcoded...? // TODO these probably shouldn't be hardcoded...?
width: 24, width: 24,
height: 24, height: 24,