sisyphsu / hexo-enhancer

hexo enhance plugin
MIT License
38 stars 7 forks source link

一个旧功能的修改建议 #9

Closed fightinggg closed 4 years ago

fightinggg commented 4 years ago

建议作者把源代码这样修改,于是就不会出现大写的tag无法匹配小写的问题了,个人认为tag不应该区分大小写,例如:JAVA、Java和java应该是一个tag

/**
 * Find `tags` that `src` contains.
 * @param {string} src
 * @param {Array} tags
 * @return {Array}
 */
module.exports.matchTags = function (src, tags) {
    let result = [];
    if (src && tags) {
        tags.forEach(tag => {
            if (src.toLowerCase().indexOf(tag.toLowerCase()) > 0) {
                result.push(tag);
            }
        });
    }
    return result;
};
fightinggg commented 4 years ago

你这个插件,是真的爽,我咋看咋喜欢,

fightinggg commented 4 years ago

相见恨晚

sisyphsu commented 4 years ago

这个建议很赞啊,谢谢~ 稍后我发布新版本把它给加上

sisyphsu commented 4 years ago

最新版本1.0.8已经加上了这个功能~