| 
									
										
										
										
											2017-04-29 15:24:43 +01:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Render markdown code blocks as `<code-example>` tags | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | module.exports = function code(h, node) { | 
					
						
							|  |  |  |   var value = node.value ? ('\n' + node.value + '\n') : ''; | 
					
						
							|  |  |  |   var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); | 
					
						
							| 
									
										
										
										
											2019-07-10 21:19:58 +01:00
										 |  |  |   var props = { | 
					
						
							|  |  |  |     linenums: 'false' | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2017-04-29 15:24:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if (lang) { | 
					
						
							|  |  |  |     props.language = lang; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return h(node, 'code-example', props, [{ type: 'text', value }]); | 
					
						
							|  |  |  | }; |