plugins/line-numbers/prism-line-numbers.js
function (element, number) {
			if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
				return;
			}

			var lineNumberRows = element.querySelector('.line-numbers-rows');
			var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
			var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);

			if (number < lineNumberStart) {
				number = lineNumberStart;
			}
			if (number > lineNumberEnd) {
				number = lineNumberEnd;
			}

			var lineIndex = number - lineNumberStart;

			return lineNumberRows.children[lineIndex];
		}
function (element, number) {
			if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
				return;
			}

			var lineNumberRows = element.querySelector('.line-numbers-rows');
			var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
			var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);

			if (number < lineNumberStart) {
				number = lineNumberStart;
			}
			if (number > lineNumberEnd) {
				number = lineNumberEnd;
			}

			var lineIndex = number - lineNumberStart;

			return lineNumberRows.children[lineIndex];
		}
function ( element , number ) { if ( element . tagName !== 'PRE' || ! element . classList . contains ( PLUGIN_NAME ) ) { return ; } var lineNumberRows = element . querySelector ( '.line-numbers-rows' ) ; var lineNumberStart = parseInt ( element . getAttribute ( 'data-start' ) , 10 ) || 1 ; var lineNumberEnd = lineNumberStart + ( lineNumberRows . children . length - 1 ) ; if ( number < lineNumberStart ) { number = lineNumberStart ; } if ( number > lineNumberEnd ) { number = lineNumberEnd ; } var lineIndex = number - lineNumberStart ; return lineNumberRows . children [ lineIndex ] ; }
Get node for provided line number
@param {Element} element pre element
@param {Number} number line number
@return {Element|undefined}
Get node for provided line number