True. That was more of a deliberate imprisonment though, as I recall.Doc_Subtlety said:
Well, the Moloch thing was sorta similar - he was stored in a book, and later sucked out via a scanner.
So it's within Buffyverse logic for a book to hold bad mojo like a battery.