/* * Copyright 2011 eBay Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; var escapeXml = require('raptor-util/escapeXml'); var escapeXmlAttr = escapeXml.attr; var runtime = require('./'); // Circular dependency, but that is okay var attr = require('raptor-util/attr'); var isArray = Array.isArray; var STYLE_ATTR = 'style'; var CLASS_ATTR = 'class'; var escapeEndingScriptTagRegExp = /<\//g; function notEmpty(o) { if (o == null) { return false; } else if (Array.isArray(o)) { return !!o.length; } else if (o === '') { return false; } return true; } function classListHelper(arg, classNames) { var len; if (arg) { if (typeof arg === 'string') { classNames.push(arg); } else if (typeof (len = arg.length) === 'number') { for (var i=0; i body to avoid the `' * }; * * * * Without escaping the ending '' sequence the opening