<commit_before>'use strict';

/**
 * Plugin for video.
 * 
 * Markdown syntax:
 * 
 * ### video: /path/to/example.mp4, /backup/example.mp4
 * 
 * HTML output:
 * 
 * <video width="100%" controls>
 *   <source src="/path/to/example.mp4">
 *   <source src="/backup/example.mp4">
 * </video>
 */

const SPLIT = /,/;

module.exports = {
    type: 'heading',
    plugin: 'video',
    render: function (text) {
        let sources = text.split(SPLIT).map((s) => {
            return s && s.trim();
        }).filter((s) => {
            return s && s.trim();
        }).map((s) => {
            return '<source src="' + s + '">';
        }).join('');
        return '<video width="100%" controls>' + sources + '</video>\n';
    }
};<commit_msg>minor fix bilibili video<commit_after>'use strict';

/**
 * Plugin for video.
 * 
 * Markdown syntax:
 * 
 * ### video: /path/to/example.mp4, /backup/example.mp4
 * 
 * HTML output:
 * 
 * <video width="100%" controls>
 *   <source src="/path/to/example.mp4">
 *   <source src="/backup/example.mp4">
 * </video>
 */

const SPLIT = /,/;

module.exports = {
    type: 'heading',
    plugin: 'video',
    render: function (text) {
        text = text.trim();
        if (text.indexOf('//www.bilibili.com/html/html5player.html') >= 0) {
            return '<iframe style="width:100%; height:600px; border: 0" src="' + text + '"></iframe>';
        }
        let sources = text.split(SPLIT).map((s) => {
            return s && s.trim();
        }).filter((s) => {
            return s && s.trim();
        }).map((s) => {
            return '<source src="' + s + '">';
        }).join('');
        return '<video width="100%" controls>' + sources + '</video>\n';
    }
};
{'fraction_non_alphanumeric': 0.22111436950146626, 'fraction_numerical': 0.017008797653958945, 'mean_word_length': 2.1828358208955225, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '501074', 'n_tokens_mistral': 603, 'n_tokens_neox': 570, 'n_words': 121}