Bug introduced in 11 or earlier and persisting through 12.1
[...] I have filed a report to the development team, raising the issue to them. [...]
[CASE:3802659]
CellPrint[Cell["test", "Text"]]
CellPrint[Cell["test2", "Text", "MyStyle"]]
CellPrint[Cell["test3", "Text", "Text"]]
NotebookImport[EvaluationNotebook[], "Text"]
{"test"}
Since multiple style cells are officially supported I would consider it a bug. Or have I missed something?
CellPrint[Cell["test3", {"Whatever", "Text"}]]but it is a good direction and at the endx__ /; ! FreeQ[{x}, "Text"]works, the problem is we need it for each mentioned style as it can happen in general. – Kuba Dec 20 '16 at 18:56