<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

const path = require('path');
const i18n = require('i18n-abide');

module.exports = function (grunt) {
  'use strict';

  // convert localized TOS/PP agreements from markdown to html partials.

  function rename(destPath, destFile) {
    // Normalize the filenames to use the locale name.
    return path.join(destPath, i18n.localeFrom(destFile));
  }

  grunt.config('marked', {
    options: {
      sanitize: false,
      gfm: true
    },
    tos_pp: {
      files: [
        {
          expand: true,
          cwd: '<%= yeoman.pp_md_src %>',
          src: ['**/*.md'],
          dest: '<%= yeoman.pp_html_dest %>',
          ext: '.html',
          rename: rename
        },
        {
          expand: true,
          cwd: '<%= yeoman.tos_md_src %>',
          src: ['**/*.md'],
          dest: '<%= yeoman.tos_html_dest %>',
          ext: '.html',
          rename: rename
        }
      ]
    }
  });
};<commit_msg>fix(build): Use lowercase extensions on output files in marked.<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

const path = require('path');
const i18n = require('i18n-abide');

module.exports = function (grunt) {
  'use strict';

  // convert localized TOS/PP agreements from markdown to html partials.

  function rename(destPath, destFile) {
    // Normalize the filenames to use the locale name.
    var lang = destFile.replace('.md', '');
    return path.join(destPath, i18n.localeFrom(lang) + '.html');
  }

  grunt.config('marked', {
    options: {
      sanitize: false,
      gfm: true
    },
    tos_pp: {
      files: [
        {
          expand: true,
          cwd: '<%= yeoman.pp_md_src %>',
          src: ['**/*.md'],
          dest: '<%= yeoman.pp_html_dest %>',
          rename: rename
        },
        {
          expand: true,
          cwd: '<%= yeoman.tos_md_src %>',
          src: ['**/*.md'],
          dest: '<%= yeoman.tos_html_dest %>',
          rename: rename
        }
      ]
    }
  });
};
{'fraction_non_alphanumeric': 0.14974402730375427, 'fraction_numerical': 0.008532423208191127, 'mean_word_length': 2.0454545454545454, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6571476', 'n_tokens_mistral': 788, 'n_tokens_neox': 755, 'n_words': 210}