summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/lib/utils/lang.js
blob: 9da737bbae2aadc4f20f0130bc9b3ef9cad7808a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var MAP = {
    'py': 'python',
    'js': 'javascript',
    'rb': 'ruby',
    'csharp': 'cs',
};

function normalize(lang) {
    if(!lang) { return null; }

    var lower = lang.toLowerCase();
    return MAP[lower] || lower;
}

// Exports
module.exports = {
    normalize: normalize,
    MAP: MAP
};