<commit_before>// Copyright (C) 2006 Google Inc.
//
// 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.

/**
 * This is a copy of html-sanitizer.js @r4805.  The current
 * html-sanitizer.js uses a faster but significantly different parsing
 * algorithm, so we're keeping this to check for regressions.
 */

/**
 * @fileoverview
 * An HTML sanitizer that can satisfy a variety of security policies.
 *
 * <p>
 * The HTML sanitizer is built around a SAX parser and HTML element and
 * attributes schemas.
 *
 * @author <EMAIL>
 * \@requires html4
 * \@overrides window
 * \@provides html, html_sanitize
 */

/**
 * \@namespace
 */
var html = (function(html4) {
  var lcase;
  // The below may not be true on browsers in the Turkish locale.
  if ('script' === 'SCRIPT'.toLowerCase()) {
    lcase = function(s) { return s.toLowerCase(); };<commit_msg>Add deprecation message to sanitizer-legacy.js<commit_after>// Copyright (C) 2006 Google Inc.
//
// 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.

/**
 * This is a copy of html-sanitizer.js @r4805.  The current
 * html-sanitizer.js uses a faster but significantly different parsing
 * algorithm, so we're keeping this to check for regressions.
 */

/**
 * @fileoverview
 * An HTML sanitizer that can satisfy a variety of security policies.
 *
 * <p>
 * The HTML sanitizer is built around a SAX parser and HTML element and
 * attributes schemas.
 *
 * @author <EMAIL>
 * \@requires html4
 * \@overrides window
 * \@provides html, html_sanitize
 */

/**
 * \@namespace
 */
var html = (function(html4) {
   // As of January 31st, 2021, the Caja project is going to be deprecated 
  // Print a note about it in the browser's console
  var deprecation_message = [
    'On January 31st, 2021, we will be archiving the Caja project. ',
    'After January 31, no new features will be added, pull requests and other ',
    'issues will no longer be addressed, including patches for security issues, ',
    'and the repository will be marked as archived. Caja has not been actively ',
    'maintained or developed to keep up with the latest research on web security. ',
    'As a result, several security vulnerabilities have been reported to Caja, ',
    'both by Google’s security engineers and by external researchers.\n\n',
    'We encourage users of Caja\'s HTML and CSS sanitizers to migrate to Closure ', 
    'toolkit (https://developers.google.com/closure/), an open source toolkit for ',
    'Javascript. Closure is used by applications, including Search, Gmail, Docs ',
    'and Maps. \n\n', 
    'The Closure library (https://github.com/google/closure-library) has built-in ',
    'HTML and CSS sanitizers and provides native support for key security ',
    'mitigations like Content Security Policy and Trusted Types. Additionally, ',
    'Closure templates (https://github.com/google/closure-templates) provide ', 
    'a strictly contextual auto-escaping system, which can drastically reduce ', 
    'the risk of XSS in your application.'
  ]
  console.warn(deprecation_message.join(''));

  var lcase;
  // The below may not be true on browsers in the Turkish locale.
  if ('script' === 'SCRIPT'.toLowerCase()) {
    lcase = function(s) { return s.toLowerCase(); };
{'fraction_non_alphanumeric': 0.09860487112792622, 'fraction_numerical': 0.009931425868999763, 'mean_word_length': 3.420062695924765, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3221138', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1145, 'n_words': 533}