diff --git a/Developer/Resources/WorkspaceStyles.wl b/Developer/Resources/WorkspaceStyles.wl index 453fceed..2ac32805 100644 --- a/Developer/Resources/WorkspaceStyles.wl +++ b/Developer/Resources/WorkspaceStyles.wl @@ -27,6 +27,13 @@ Cell[ ] +(* Ensure that raw cell expressions can be toggled back to formatted view: *) +Cell[ + StyleData[ "CellExpression" ], + Selectable -> True +] + + Cell[ StyleData[ "WorkspaceChatStyleSheetInformation" ], TaggingRules -> <| "WorkspaceChatStyleSheetVersion" -> $stylesheetVersion |> diff --git a/FrontEnd/Assets/Extensions/CoreExtensions.nb b/FrontEnd/Assets/Extensions/CoreExtensions.nb index 80819bdd..b10571b2 100644 --- a/FrontEnd/Assets/Extensions/CoreExtensions.nb +++ b/FrontEnd/Assets/Extensions/CoreExtensions.nb @@ -11,7 +11,7 @@ Notebook[ Cell["Chatbook Core.nb Extensions", "Title"], Cell[ StyleData["ChatStyleSheetInformation"], - TaggingRules -> <|"StyleSheetVersion" -> "1.5.2.3940399854"|> + TaggingRules -> <|"StyleSheetVersion" -> "1.5.2.3940575613"|> ], Cell[ StyleData["NotebookAssistant`Text"], diff --git a/FrontEnd/StyleSheets/Chatbook.nb b/FrontEnd/StyleSheets/Chatbook.nb index 23fe8f0f..45c13798 100644 --- a/FrontEnd/StyleSheets/Chatbook.nb +++ b/FrontEnd/StyleSheets/Chatbook.nb @@ -824,7 +824,7 @@ Notebook[ ], Cell[ StyleData["ChatStyleSheetInformation"], - TaggingRules -> <|"StyleSheetVersion" -> "1.5.2.3940405830"|> + TaggingRules -> <|"StyleSheetVersion" -> "1.5.2.3940575613"|> ], Cell[ StyleData["NotebookAssistant`Text"], diff --git a/FrontEnd/StyleSheets/Wolfram/WorkspaceChat.nb b/FrontEnd/StyleSheets/Wolfram/WorkspaceChat.nb index 7df8a5c9..65bd9e79 100644 --- a/FrontEnd/StyleSheets/Wolfram/WorkspaceChat.nb +++ b/FrontEnd/StyleSheets/Wolfram/WorkspaceChat.nb @@ -72,9 +72,10 @@ Notebook[ Magnification -> 0.85, Background -> GrayLevel[1] ], + Cell[StyleData["CellExpression"], Selectable -> True], Cell[ StyleData["WorkspaceChatStyleSheetInformation"], - TaggingRules -> <|"WorkspaceChatStyleSheetVersion" -> "1.5.2.3940399854"|> + TaggingRules -> <|"WorkspaceChatStyleSheetVersion" -> "1.5.2.3940575613"|> ], Cell[ StyleData[ diff --git a/Source/Chatbook/Serialization.wl b/Source/Chatbook/Serialization.wl index 9183ec2f..e9d5993b 100644 --- a/Source/Chatbook/Serialization.wl +++ b/Source/Chatbook/Serialization.wl @@ -539,7 +539,15 @@ cellToString[ Cell[ a__, $$subSubItemStyle, b___ ] ] := ]; (* Cells showing raw data (ctrl-shift-e) *) -cellToString[ Cell[ RawData[ str_String ], ___ ] ] := (needsBasePrompt[ "Notebooks" ]; str); +cellToString[ Cell[ RawData[ str_String ], ___ ] ] := + Catch @ Module[ { held }, + If[ ! TrueQ @ $WorkspaceChat, needsBasePrompt[ "Notebooks" ]; Throw @ str ]; + held = Quiet @ ToExpression[ str, InputForm, HoldComplete ]; + If[ MatchQ[ held, HoldComplete[ _Cell ] ], + cellToString @@ held, + needsBasePrompt[ "Notebooks" ]; str + ] + ]; (* Include a stack trace for message cells when available *) cellToString[ Cell[ a__, "Message", "MSG", b___ ] ] :=