diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html b/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html
index 3357ae011..cda57386e 100644
--- a/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html
+++ b/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html
@@ -14,6 +14,7 @@
+
@@ -28,6 +29,10 @@
+
+
+
+
@@ -45,7 +50,8 @@
outproperty: {value:"payload", validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }) },
tag: {value:""},
ret: {value:"html"},
- as: {value:"single"}
+ as: {value:"single"},
+ chr: { value: "_" }
},
inputs:1,
outputs:1,
@@ -59,6 +65,13 @@
oneditprepare: function() {
$("#node-input-property").typedInput({default:'msg',types:['msg']});
$("#node-input-outproperty").typedInput({default:'msg',types:['msg']});
+ $('#node-input-ret').on( 'change', () => {
+ if ( $('#node-input-ret').val() == "compl" ) {
+ $('#html-prefix-row').show()
+ } else {
+ $('#html-prefix-row').hide()
+ }
+ });
}
});
diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.js b/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.js
index 073b98689..c4485fe9b 100644
--- a/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.js
+++ b/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.js
@@ -25,6 +25,7 @@ module.exports = function(RED) {
this.tag = n.tag;
this.ret = n.ret || "html";
this.as = n.as || "single";
+ this.chr = n.chr || "_";
var node = this;
this.on("input", function(msg,send,done) {
var value = RED.util.getMessageProperty(msg,node.property);
@@ -47,6 +48,11 @@ module.exports = function(RED) {
if (node.ret === "attr") {
pay2 = Object.assign({},this.attribs);
}
+ if (node.ret === "compl") {
+ var bse = {}
+ bse[node.chr] = $(this).html().trim()
+ pay2 = Object.assign(bse, this.attribs);
+ }
//if (node.ret === "val") { pay2 = $(this).val(); }
/* istanbul ignore else */
if (pay2) {
@@ -69,6 +75,11 @@ module.exports = function(RED) {
var attribs = Object.assign({},this.attribs);
pay.push( attribs );
}
+ if (node.ret === "compl") {
+ var bse = {}
+ bse[node.chr] = $(this).html().trim()
+ pay.push( Object.assign(bse, this.attribs) )
+ }
//if (node.ret === "val") { pay.push( $(this).val() ); }
}
index++;
diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json
index 1f07a868d..99e9cfdc5 100644
--- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json
+++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json
@@ -894,12 +894,14 @@
"label": {
"select": "Selector",
"output": "Output",
- "in": "in"
+ "in": "in",
+ "prefix": "Property name for HTML content"
},
"output": {
"html": "the html content of the elements",
"text": "only the text content of the elements",
- "attr": "an object of any attributes of the elements"
+ "attr": "an object of any attributes of the elements",
+ "compl": "an object of any attributes of the elements and html contents"
},
"format": {
"single": "as a single message containing an array",