Skip to content

Commit 18acbec

Browse files
committed
Bugfix: Some boxes serialized as graphics weren't recognized as graphics later on
1 parent 59a2cd7 commit 18acbec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Source/Chatbook/Graphics.wl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ $$graphicsPattern = HoldPattern @ Alternatives[
1616
_Graphics3D,
1717
_Image,
1818
_Image3D,
19-
_Legended
19+
_Legended,
20+
Dynamic[ RawBoxes[ _FEPrivate`ImportImage ], ___ ]
2021
];
2122

2223
$$definitelyNotGraphics = HoldPattern @ Alternatives[

Source/Chatbook/Serialization.wl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,11 @@ boxesToExpressionURI[ boxes_ ] :=
11901190
Replace[
11911191
Quiet @ ToExpression[ boxes, StandardForm, HoldComplete ],
11921192
{
1193-
HoldComplete[ expr_ ] :> MakeExpressionURI @ Unevaluated @ expr,
1193+
HoldComplete[ expr_ ] :> (
1194+
(* Ensure that the expression is recognized as a graphics expression later: *)
1195+
HoldPattern[ graphicsQ[ Verbatim @ expr ] ] = True;
1196+
MakeExpressionURI @ Unevaluated @ expr
1197+
),
11941198
_? FailureQ :> MakeExpressionURI[ "image", RawBoxes @ StyleBox[ boxes, "GraphicsRawBoxes" ] ]
11951199
}
11961200
];

0 commit comments

Comments
 (0)