'use strict' ; var visit = require ( 'unist-util-visit' ) ; var parseLineNumberRange = require ( './parse-line-number-range' ) ; var highlightCode = require ( './highlight-code' ) ; module . exports = function ( _ref ) { var markdownAST = _ref . markdownAST ; visit ( markdownAST , 'code' , function ( node ) { var language = node . lang ; var _parseLineNumberRange = parseLineNumberRange ( language ) , splitLanguage = _parseLineNumberRange . splitLanguage , highlightLines = _parseLineNumberRange . highlightLines , path = _parseLineNumberRange . path , nocopy = _parseLineNumberRange . nocopy ; language = splitLanguage ; var preCssClassLanguage = 'none' ; if ( language ) { language = language . toLowerCase ( ) ; preCssClassLanguage = language ; } var pathString = path ? ' path="' + path + '"' : '' ; var copyString = ' nocopy="' + nocopy + '"' ; node . type = 'html' ; node . value = '<div class="gatsby-highlight">\n      <pre class="language-' + preCssClassLanguage + '" ' + pathString + ' ' + copyString + '><code>' + highlightCode ( language , node . value , highlightLines ) + '</code></pre>\n      </div>' ; } ) ; } ;