Skip to content

Commit

Permalink
Merge 8f45767 into b00bf80
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Jan 24, 2016
2 parents b00bf80 + 8f45767 commit 65bb132
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions webpack_loader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ def filter_files(files, config):
yield F


control_sequence_re = re.compile( # See ECMA 48, 5.4 Control sequences
r'(\x1b\x5b|\x9b)' # Control Sequence Introducer
r'[\x30-\x3f]*' # Parameter Bytes
r'[\x20-\x2f]*' # Intermediate Bytes
r'[\x40-\x7e]' # Final Byte
)


def strip_control_sequences(message):
return control_sequence_re.sub('', message)


def get_bundle(bundle_name, config):
assets = get_assets(config)

Expand All @@ -80,6 +92,7 @@ def get_bundle(bundle_name, config):
elif assets.get('status') == 'error':
if 'file' not in assets:
assets['file'] = ''
assets['message'] = strip_control_sequences(assets['message'])
error = u"""
{error} in {file}
{message}
Expand Down

0 comments on commit 65bb132

Please sign in to comment.