1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-10 15:04:32 +03:00

sixel: allow slightly poorly formed sixel data

The issue appears to be due to a rogue trailing semicolon in the input
data.  Support for this appears to be mixed: an online converter didn't
produce valid output, but image magick's convert utility accepted it.

This commit allows an optional trailing semicolon at the end of the
color definition regex and enables wezterm to render the image.

refs: https://github.com/wez/wezterm/issues/1711
This commit is contained in:
Wez Furlong 2022-03-19 14:24:10 -07:00
parent 737eb6e912
commit 0fcdea0789

View File

@ -358,7 +358,7 @@ impl SixelBuilder {
let repeat_re = Regex::new("^!(\\d+)([\x3f-\x7e])").unwrap();
let raster_re = Regex::new("^\"(\\d+);(\\d+)(;(\\d+))?(;(\\d+))?").unwrap();
let colordef_re = Regex::new("^#(\\d+);(\\d+);(\\d+);(\\d+);(\\d+)").unwrap();
let colordef_re = Regex::new("^#(\\d+);(\\d+);(\\d+);(\\d+);(\\d+);?").unwrap();
let coloruse_re = Regex::new("^#(\\d+)([^;\\d]|$)").unwrap();
Self {