From 2943f3db6506bef9393ae23e111c61d65666a9da Mon Sep 17 00:00:00 2001 From: Rick Hennigan Date: Tue, 26 Nov 2024 16:08:48 -0500 Subject: [PATCH] Bugfix: Fixed an internal failure caused by `RawBoxes` in graphics check --- Source/Chatbook/Graphics.wl | 1 + Source/Chatbook/Serialization.wl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Chatbook/Graphics.wl b/Source/Chatbook/Graphics.wl index 8bbb78c1..d30ebdc0 100644 --- a/Source/Chatbook/Graphics.wl +++ b/Source/Chatbook/Graphics.wl @@ -69,6 +69,7 @@ graphicsBoxQ[ TemplateBox[ { box_, ___ }, $$graphicsBoxIgnoredTemplates, ___ ] ] graphicsBoxQ[ RowBox[ boxes_List ] ] := AnyTrue[ boxes, graphicsBoxQ ]; graphicsBoxQ[ TemplateBox[ boxes_List, "RowDefault", ___ ] ] := AnyTrue[ boxes, graphicsBoxQ ]; graphicsBoxQ[ GridBox[ boxes_List, ___ ] ] := AnyTrue[ Flatten @ boxes, graphicsBoxQ ]; +graphicsBoxQ[ StyleBox[ _, "GraphicsRawBoxes", ___ ] ] := True; graphicsBoxQ[ ___ ] := False; graphicsBoxQ // endDefinition; diff --git a/Source/Chatbook/Serialization.wl b/Source/Chatbook/Serialization.wl index f482915c..ca4300c6 100644 --- a/Source/Chatbook/Serialization.wl +++ b/Source/Chatbook/Serialization.wl @@ -1105,7 +1105,7 @@ boxesToExpressionURI[ boxes_ ] := Quiet @ ToExpression[ boxes, StandardForm, HoldComplete ], { HoldComplete[ expr_ ] :> MakeExpressionURI @ Unevaluated @ expr, - _? FailureQ :> MakeExpressionURI[ "image", RawBoxes @ boxes ] + _? FailureQ :> MakeExpressionURI[ "image", RawBoxes @ StyleBox[ boxes, "GraphicsRawBoxes" ] ] } ];