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 Cells 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?
CellEvaluationFunctionis applied to theBoxDataexpression 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 forTagBoxandInterpretationBox, the difference might be quite a bit different. At the least, one should not be surprised that any "typesetting" differences are stripped. – Michael E2 Aug 01 '13 at 23:34CellTagsright now, but I have some doubts on how dependable it will be with multiple cells. – William Aug 01 '13 at 23:37UndocumentedTestFEParserPacket[string, False]would give the unmodified Box form for thatstring. This is not directly applicable but it may be useful at some point. – Mr.Wizard Aug 06 '13 at 07:31