{"size": 718, "ext": "js", "max_stars_repo_path": "proto/setContent.js", "max_stars_repo_name": "jgjake2/scribunto-console", "max_stars_repo_stars_event_min_datetime": "2020-05-15T01:39:15.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-19T21:20:42.000Z", "max_issues_repo_path": "proto/setContent.js", "max_issues_repo_name": "jgjake2/scribunto-console", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "proto/setContent.js", "max_forks_repo_name": "jgjake2/scribunto-console", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.1612903226, "max_line_length": 100, "alphanum_fraction": 0.561281337}

module.exports = (function(ScribuntoConsole){
	
	var getBlockComment = /^(--\[\[\s*[\r\n]+(?:(?![^\\]\]\]--)[\s\S])+[.\s\r\n]\]\]--[^\r\n]*?)/m;
	function stripComments(str){
		var result;
		while ((result = getBlockComment.exec(str)) !== null) {
			if(result[1]){
				var stripped = result[1].replace(/[^\r\n]+/g, '');
				
				str = str.substring(0, result.index) + stripped + str.substring(result.index + result[1].length)
			} else
				break;
		};
		
		str = str.replace(/^--[^\[][^\r\n]*$/gm, '');
		
		return str;
	}
	
	ScribuntoConsole.fn.setContent = function(txt){
		if(this.options.stripComments){
			txt = stripComments(txt);
		}
		
		this.content = txt;
		
		return (this.content ? true : false);
	};

});