markusressel/openhasp-config-manager

Support URLs in img src

Closed this issue · 1 comments

Describe the bug
Urls in img src causes parisng errors

To Reproduce
Steps to reproduce the behavior:

{"page":1,"id":2,"obj":"img","x":35,"y":40,"h":250,"w":250,"src":"https://upload.wikimedia.org/wikipedia/commons/b/bf/Test_card.png","auto_size":1}

casues

FAIL  Error generating output for test_plate: Error normalizing openhasp-configs-test/devices/test_plate/test.jsonl: unexpected end of data: line 1 column 73 (char 72)

Example at
openhasp-configs-test.zip
tached

Additional context
I have tried different types of escaping the string, but nothing seems to work. Is there any escape characters or escape blocks?

BTW: Didn't it used to support percent width? so if you put an object width to 33% it would be converted to a pixel value corresponding to 33% of the screen (or parent object)?
It seems to be missing in the documentation.

The comment parser is pretty basic, it just looks for the last // in each line (if any) and ignores everything after it. Currently there is no way to escape that, so using an URL like that will not work. We will have to improve the parser for this.

BTW: Didn't it used to support percent width? so if you put an object width to 33% it would be converted to a pixel value corresponding to 33% of the screen (or parent object)?
It seems to be missing in the documentation.

Yes, I am not sure if I want to keep this though, because the same can be achieved using a template, which is much more versatile and doesn't need any special handling.