<commit_before>/**
* hexo-tag-dplayer
* Embed DPlayer(https://github.com/DIYgod/DPlayer) in Hexo posts/pages.
* Syntax:
*  {% dplayer key=value ... %}
*/
'use strict';

const fs = require('hexo-fs'),
  util = require('hexo-util'),
  log = require('hexo-log')({name:"hexo-tag-dplayer",debug:false}), // logger
  urlFn = require('url'),
  path = require('path'),
  srcDir = path.dirname(require.resolve('dplayer')),
  scriptDir = '/assets/js/', // default script directories
  styleDir = '/assets/css/',
  files = [
    ['DPlayer.min.css', styleDir],
    ['DPlayer.min.js', scriptDir],
    // some map for debug use
    //['DPlayer.min.css.map', styleDir],
    //['DPlayer.min.js.map', scriptDir],
    // if there be any other dplayer file
    //['someDplayerFile.xxx', targetDir],
  ];

String.prototype.replaceAll = function(search, replacement) {
    var target = this;
    //log.debug(target.split(search))
    return target.split(search).join(replacement);
};
  
var counter = 0,
  conf = hexo.config['hexo-tag-dplayer'] || {},
  tbIns=[];

//for hexo-all-minify:
if (hexo.config.html_minifier)
  hexo.config.html_minifier.ignoreCustomComments.push(mark);

  
if (!conf.cdn){
  files.forEach(item => {
    var destPath = item[1], filePath = path.join(srcDir, item[0]);
    if (item[1] === scriptDir){
      destPath = conf.js_path || item[1];
    } else if (item[1] === styleDir){<commit_msg>remove bad fix<commit_after>/**
* hexo-tag-dplayer
* Embed DPlayer(https://github.com/DIYgod/DPlayer) in Hexo posts/pages.
* Syntax:
*  {% dplayer key=value ... %}
*/
'use strict';

const fs = require('hexo-fs'),
  util = require('hexo-util'),
  log = require('hexo-log')({name:"hexo-tag-dplayer",debug:false}), // logger
  urlFn = require('url'),
  path = require('path'),
  srcDir = path.dirname(require.resolve('dplayer')),
  scriptDir = '/assets/js/', // default script directories
  styleDir = '/assets/css/',
  files = [
    ['DPlayer.min.css', styleDir],
    ['DPlayer.min.js', scriptDir],
    // some map for debug use
    //['DPlayer.min.css.map', styleDir],
    //['DPlayer.min.js.map', scriptDir],
    // if there be any other dplayer file
    //['someDplayerFile.xxx', targetDir],
  ];

String.prototype.replaceAll = function(search, replacement) {
    var target = this;
    //log.debug(target.split(search))
    return target.split(search).join(replacement);
};
  
var counter = 0,
  conf = hexo.config['hexo-tag-dplayer'] || {},
  tbIns=[];

  
if (!conf.cdn){
  files.forEach(item => {
    var destPath = item[1], filePath = path.join(srcDir, item[0]);
    if (item[1] === scriptDir){
      destPath = conf.js_path || item[1];
    } else if (item[1] === styleDir){
{'fraction_non_alphanumeric': 0.1958878504672897, 'fraction_numerical': 0.004485981308411215, 'mean_word_length': 3.4824120603015074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3118599', 'n_tokens_mistral': 955, 'n_tokens_neox': 941, 'n_words': 186}