File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function preprocess(text) {
8080 var comments = [ ] ;
8181 var index , previousNode , comment ;
8282
83- if ( node . lang && SUPPORTED_SYNTAXES . indexOf ( node . lang . toLowerCase ( ) ) >= 0 ) {
83+ if ( node . lang && SUPPORTED_SYNTAXES . indexOf ( node . lang . split ( " " ) [ 0 ] . toLowerCase ( ) ) >= 0 ) {
8484 index = parent . children . indexOf ( node ) - 1 ;
8585 previousNode = parent . children [ index ] ;
8686 while ( previousNode && previousNode . type === "html" ) {
Original file line number Diff line number Diff line change @@ -257,6 +257,17 @@ describe("processor", function() {
257257 assert . equal ( blocks . length , 1 ) ;
258258 } ) ;
259259
260+ it ( "should ignore anything after the first word of the info string" , function ( ) {
261+ var code = [
262+ "```js more words are ignored" ,
263+ "var answer = 6 * 7;" ,
264+ "```"
265+ ] . join ( "\n" ) ;
266+ var blocks = processor . preprocess ( code ) ;
267+
268+ assert . equal ( blocks . length , 1 ) ;
269+ } ) ;
270+
260271 it ( "should find code fences not surrounded by blank lines" , function ( ) {
261272 var code = [
262273 "<!-- eslint-disable -->" ,
You can’t perform that action at this time.
0 commit comments