can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
26 lines (25 loc) • 762 B
JavaScript
/*!
* CanJS - 2.3.34
* http://canjs.com/
* Copyright (c) 2018 Bitovi
* Mon, 30 Apr 2018 20:56:51 GMT
* Licensed MIT
*/
/*can@2.3.34#util/vdom/build_fragment/build_fragment*/
define([
'can/util/vdom/make_parser',
'can/util/library'
], function (makeParser, can) {
var oldBuildFrag = can.buildFragment;
can.buildFragment = function (text, context) {
if (context && context.length) {
context = context[0];
}
if (context && (context.ownerDocument || context) !== can.global.document && !context._yuid) {
var parser = makeParser(context.ownerDocument || context);
return parser.parse(text);
} else {
return oldBuildFrag.apply(this, arguments);
}
};
});