Let's say I print a cell like so.
CellPrint@Cell[
BoxData[" "], "Input", Evaluatable -> True,
CellEvaluationFunction -> Function[Print[#];]
]
Now I type in several lines of text in the Cell
in Mathematica.
For example
1
2
I hit Shift+Enter and get the following output.
BoxData[List["1","3"]]
But when I do Ctrl+Shift+e, the Cell
s content is really
BoxData[
RowBox[{" ",
RowBox[{
"1", "\[IndentingNewLine]", "\[IndentingNewLine]", "3"}]}]]
Why doesn't CellEvaluationFuction
receive the actual cell data? Is there a hidden function/argument that might give me such information?
CellEvaluationFunction
is applied to theBoxData
expression representing the input to be evaluated." [Emphasis mine.] The docs do not say that the Front End won't substitute some simplification of the expression in the cell. I believe forTagBox
andInterpretationBox
, the difference might be quite a bit different. At the least, one should not be surprised that any "typesetting" differences are stripped. $\endgroup$CellTags
right now, but I have some doubts on how dependable it will be with multiple cells. $\endgroup$UndocumentedTestFEParserPacket[string, False]
would give the unmodified Box form for thatstring
. This is not directly applicable but it may be useful at some point. $\endgroup$