File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ function preprocess(filename) {
45
45
. replace ( / \b i m p o r t \. m e t a \b / g, 'EMSCRIPTEN$IMPORT$META' )
46
46
. replace ( / \b a w a i t i m p o r t \b / g, 'EMSCRIPTEN$AWAIT$IMPORT' ) ;
47
47
}
48
+ // Remove windows line endings, if any
49
+ text = text . replace ( / \r \n / g, '\n' ) ;
48
50
49
51
const IGNORE = 0 ;
50
52
const SHOW = 1 ;
@@ -65,21 +67,19 @@ function preprocess(filename) {
65
67
66
68
try {
67
69
for ( let [ i , line ] of lines . entries ( ) ) {
68
- if ( line [ line . length - 1 ] === '\r' ) {
69
- line = line . substr ( 0 , line . length - 1 ) ; // Windows will have '\r' left over from splitting over '\r\n'
70
- }
71
- if ( isHtml && line . includes ( '<style' ) && ! inStyle ) {
72
- inStyle = true ;
73
- }
74
- if ( isHtml && line . includes ( '</style' ) && inStyle ) {
75
- inStyle = false ;
76
- }
77
-
78
- if ( inStyle ) {
79
- if ( showCurrentLine ( ) ) {
80
- ret += line + '\n' ;
70
+ if ( isHtml ) {
71
+ if ( line . includes ( '<style' ) && ! inStyle ) {
72
+ inStyle = true ;
73
+ }
74
+ if ( line . includes ( '</style' ) && inStyle ) {
75
+ inStyle = false ;
76
+ }
77
+ if ( inStyle ) {
78
+ if ( showCurrentLine ( ) ) {
79
+ ret += line + '\n' ;
80
+ }
81
+ continue ;
81
82
}
82
- continue ;
83
83
}
84
84
85
85
const trimmed = line . trim ( ) ;
You can’t perform that action at this time.
0 commit comments