| 
									
										
										
										
											2014-12-06 11:24:55 +00:00
										 |  |  | angular.module('code', []) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .directive('code', function() { | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     restrict: 'E', | 
					
						
							|  |  |  |     terminal: true, | 
					
						
							|  |  |  |     compile: function(element) { | 
					
						
							| 
									
										
										
										
											2015-03-17 14:56:08 +00:00
										 |  |  |       var linenums = element.hasClass('linenum'); | 
					
						
							| 
									
										
										
										
											2014-12-06 11:24:55 +00:00
										 |  |  |       var match = /lang-(\S+)/.exec(element[0].className); | 
					
						
							|  |  |  |       var lang = match && match[1]; | 
					
						
							|  |  |  |       var html = element.html(); | 
					
						
							|  |  |  |       element.html(window.prettyPrintOne(html, lang, linenums)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-03-17 14:56:08 +00:00
										 |  |  | }); |