<commit_before>(function(module) {
    "use strict";

    var Twitter = {},
        embed = '<blockquote class="content twitter-tweet" lang="en"><a href="https://twitter.com/$1/status/$2"></a></blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';

    Twitter.parse = function(data, callback) {
        var regularUrl = /<a href="(?:https?:\/\/)?(?:twitter\.com)\/([^\/"\s]*)\/statuse?s?\/([^\/"\s]*)(\/photo\/1|)">.+?<\/a>/g
        var postContent = data && data.postData && data.postData.content;

        if (postContent && postContent.match(regularUrl)) {
            data.postData.content = postContent.replace(regularUrl, embed);
        }

        callback(null, data);<commit_msg>Update regex to take into account rel attributes if present, fix issue https://github.com/dovydaskukalis/nodebb-plugin-twitter/issues/6<commit_after>(function(module) {
    "use strict";

    var Twitter = {},
        embed = '<blockquote class="content twitter-tweet" lang="en"><a href="https://twitter.com/$1/status/$2"></a></blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';

    Twitter.parse = function(data, callback) {
        var regularUrl = /<a href="(?:https?:\/\/)?(?:twitter\.com)\/([^\/"\s]*)\/statuse?s?\/([^\/"\s]*)(\/photo\/\d|)".*?>.+?<\/a>/g
        var postContent = data && data.postData && data.postData.content;

        if (postContent && postContent.match(regularUrl)) {
            data.postData.content = postContent.replace(regularUrl, embed);
        }

        callback(null, data);
{'fraction_non_alphanumeric': 0.2215909090909091, 'fraction_numerical': 0.005050505050505051, 'mean_word_length': 3.2379679144385025, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 3, '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': '1239040', 'n_tokens_mistral': 509, 'n_tokens_neox': 492, 'n_words': 79}