html-to-content-model
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -25,3 +25,4 @@ 'use strict'; | ||
LINK: 'LINK', | ||
IMAGE: 'IMAGE' | ||
IMAGE: 'IMAGE', | ||
INPUT: 'INPUT' | ||
}; | ||
@@ -60,2 +61,2 @@ | ||
// These elements are special because they cannot contain childNodes. | ||
var SELF_CLOSING_ELEMENTS = exports.SELF_CLOSING_ELEMENTS = { img: 1 }; | ||
var SELF_CLOSING_ELEMENTS = exports.SELF_CLOSING_ELEMENTS = { img: 1, input: 1 }; |
@@ -58,3 +58,8 @@ 'use strict'; | ||
a: { href: 'url', rel: 'rel', target: 'target', title: 'title' }, | ||
img: { src: 'src', alt: 'alt' } | ||
img: { src: 'src', alt: 'alt' }, | ||
input: { | ||
type: 'type', | ||
value: 'value', | ||
placeholder: 'placeholder' | ||
} | ||
}; | ||
@@ -87,2 +92,11 @@ | ||
} | ||
}, | ||
input: function input(tagName, element) { | ||
var data = getEntityData(tagName, element); | ||
return { | ||
key: getKey(), | ||
type: _Constants.ENTITY_TYPE.INPUT, | ||
mutability: 'MUTABLE', | ||
data: data | ||
}; | ||
} | ||
@@ -89,0 +103,0 @@ }; |
{ | ||
"name": "html-to-content-model", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "html-to-content-model", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
31962
897