8

Bug introduced in 10.4 or earlier and fixed in 11.2


I've found that NotebookImport[file,"Input" -> "HeldInterpretedCell"] doesn't seem to cope when the closing bracket of a command is on the following line of an input cell.

So if I save a notebook test.nb with the following input cell (as one cell):

Plot[x, {x, 0, 1}
 ]

Then NotebookImport["test.nb","Input" -> "HeldInterpretedCell"] gives a Failure[] box instead of the expected HoldComplete[Plot[x,{x,0,1}]].

With multiple different cells with different permutations:

Plot[x, {x, 0, 1}
 ]

Plot[x, {x, 0, 1}]

Plot[x,
 {x, 0, 1}]

Plot[
 x,
 {x, 0, 1}]

the first and last will fail, but the middle two are fine. It looks like it is related to the square brackets of the outmost command being the end/start of a line.

Is this a bug?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
SPPearce
  • 5,653
  • 2
  • 18
  • 40

1 Answers1

1

Wolfram Support emailed me to let me know that this has been fixed in v11.2, which I've confirmed.

SPPearce
  • 5,653
  • 2
  • 18
  • 40