Skip to content

Commit

Permalink
Merge pull request #512 from WolframResearch/510-explode-cells-fails-…
Browse files Browse the repository at this point in the history
…when-there-are-language-agnostic-code-blocks-in-the-output

Bugfix: Exploding cells failure when there's a language-agnostic code block
  • Loading branch information
rhennigan committed Jan 4, 2024
2 parents dc41168 + adce4dd commit dd0fefc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FrontEnd/StyleSheets/Chatbook.nb
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ Notebook[
],
Cell[
StyleData["ChatStyleSheetInformation"],
TaggingRules -> <|"StyleSheetVersion" -> "1.3.6.3913177292"|>
TaggingRules -> <|"StyleSheetVersion" -> "1.3.7.3913365950"|>
],
Cell[
StyleData["Text"],
Expand Down
5 changes: 4 additions & 1 deletion Source/Chatbook/Explode.wl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Begin[ "`Private`" ];
Needs[ "Wolfram`Chatbook`" ];
Needs[ "Wolfram`Chatbook`Common`" ];

$$newCellStyle = "Section"|"Subsection"|"Subsubsection"|"Subsubsubsection"|"Item"|"Input"|"ExternalLanguage";
$$newCellStyle = "Section"|"Subsection"|"Subsubsection"|"Subsubsubsection"|"Item"|"Input"|"ExternalLanguage"|"Program";

(* ::**************************************************************************************************************:: *)
(* ::Section::Closed:: *)
Expand Down Expand Up @@ -70,6 +70,9 @@ $preprocessingRules := $preprocessingRules = Dispatch @ {
(* Remove "ChatCodeBlock" styling: *)
Cell[ BoxData[ cell_Cell, ___ ], "ChatCodeBlock", ___ ] :> cell,

(* Language-agnostic code blocks: *)
Cell[ text_, "ChatPreformatted", ___ ] :> Cell[ text, "Program" ],

(* Remove "ChatCodeBlockTemplate" template boxes: *)
TemplateBox[ { cell_Cell }, "ChatCodeBlockTemplate" ] :> cell,

Expand Down

0 comments on commit dd0fefc

Please sign in to comment.