Fix shortening of filenames containing surrogate pairs.
This commit is contained in:
parent
5844ad7943
commit
dda29feda1
@ -9,10 +9,9 @@ Build =
|
||||
{'&': '&', ''': "'", '"': '"', '<': '<', '>': '>', ',': ','}[c]
|
||||
|
||||
shortFilename: (filename) ->
|
||||
threshold = 30
|
||||
ext = filename.match(/\.?[^\.]*$/)[0]
|
||||
if filename.length - ext.length > threshold
|
||||
"#{filename[...threshold - 5]}(...)#{ext}"
|
||||
if filename.length - ext.length > 30
|
||||
"#{filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]}(...)#{ext}"
|
||||
else
|
||||
filename
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user