Summary
When MarkdownToNotebook[..., "Evaluate" -> True] captures a message emitted by an executable cell, messageCell[s_String] wraps the captured text in a bare Cell[s, "Message", "MSG"] — plain, unstyled text. An interactive front end renders the same message as a TemplateBox[{...}, "MessageTemplate2"] styled banner, carrying {symbol, tag, formatted-text, 2, 1, 2, id, "Local", full-name} and prefixed with a During evaluation of In[n]:= cell label.
As a result, captured messages in a built notebook do not look like what the same code produces when evaluated live: no styled banner, no "During evaluation of" label, no message-suppression affordance.
Repro
# T
```wl #| eval: true
Sqrt[x] /. x -> {1, 2, 3}
A cell that throws (e.g. a `::tag` message) captures the message text and currently emits it as a plain `Cell["Sym::tag: body", "Message", "MSG"]`.
## Expected
The captured `Sym::tag: body` text is reconstructed as the front end's `MessageTemplate2` `TemplateBox`, so the built cell matches a live evaluation (styled banner + `During evaluation of In[1]:=` label). A string that is **not** in `Symbol::tag` form should fall back to the plain text `Message` cell.
## Notes (root cause)
`messageCell[s_String]` in `MarkdownToNotebook.wl`. The kernel only ever writes a message as text; the styled box is an FE rendering. Reconstruct it by parsing `Sym::tag: body` and emitting the `MessageTemplate2` box. The `id` / context args drive only the suppression menu, not the display (rendering is identical for any id/context), so a best-effort `Names[sym]` is sufficient; the formatted body must be a quoted string box (`ToString[.., InputForm]`) or the FE parses a `-` in the text as a math operator.
Summary
When
MarkdownToNotebook[..., "Evaluate" -> True]captures a message emitted by an executable cell,messageCell[s_String]wraps the captured text in a bareCell[s, "Message", "MSG"]— plain, unstyled text. An interactive front end renders the same message as aTemplateBox[{...}, "MessageTemplate2"]styled banner, carrying{symbol, tag, formatted-text, 2, 1, 2, id, "Local", full-name}and prefixed with aDuring evaluation of In[n]:=cell label.As a result, captured messages in a built notebook do not look like what the same code produces when evaluated live: no styled banner, no "During evaluation of" label, no message-suppression affordance.
Repro