Skip to content

Commit

Permalink
Merge pull request #955 from WolframResearch/954-internal-error-cause…
Browse files Browse the repository at this point in the history
…d-by-rawboxescell-when-checking-for-graphics

Bugfix: Fixed an internal failure caused by `RawBoxes` in graphics check
  • Loading branch information
rhennigan authored Nov 26, 2024
2 parents f319547 + 2943f3d commit 76afcaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/Chatbook/Graphics.wl
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Source/Chatbook/Serialization.wl
Original file line number Diff line number Diff line change
Expand Up @@ -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" ] ]
}
];

Expand Down

0 comments on commit 76afcaa

Please sign in to comment.