UNPKG

can

Version:

MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.

23 lines (22 loc) 695 B
/*! * 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*/ var makeParser = require('./make_parser.js'); var can = require('../../util.js'); 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); } };