13 lines
453 B
JavaScript
13 lines
453 B
JavaScript
|
var requireObjectCoercible = require('../internals/require-object-coercible');
|
||
|
|
||
|
var quot = /"/g;
|
||
|
|
||
|
// `CreateHTML` abstract operation
|
||
|
// https://tc39.es/ecma262/#sec-createhtml
|
||
|
module.exports = function (string, tag, attribute, value) {
|
||
|
var S = String(requireObjectCoercible(string));
|
||
|
var p1 = '<' + tag;
|
||
|
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
|
||
|
return p1 + '>' + S + '</' + tag + '>';
|
||
|
};
|