Skip to content

Commit 27a73f7

Browse files
committed
Trim lines within code blocks
1 parent 4944b22 commit 27a73f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/node_modules/@stdlib/repl/presentation/lib/parse_slide.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var emoji = require( './emoji.js' );
3232

3333
var FRAGMENT_SEP = '--';
3434
var NOTES_SEP = '~~~';
35-
var RE_CODE_DELIMITER = /^```\s*([a-z]+)?$/;
35+
var RE_CODE_DELIMITER = /^\s*```\s*([a-z]+)?$/;
3636
var CODE_INDENTATION = ' ';
3737

3838
// Hash for normalizing code block languages:
@@ -121,7 +121,7 @@ function parseSlide( text ) {
121121
continue;
122122
}
123123
if ( CODE_BLOCK ) {
124-
out.code[ out.code.length-1 ].src.push( line );
124+
out.code[ out.code.length-1 ].src.push( trim( line ) );
125125
line = CODE_INDENTATION + line;
126126

127127
// TODO: apply syntax highlighting

0 commit comments

Comments
 (0)