If you use a finer grid in that example, and if you first determine which cells are completely empty, then it works
Still perform the same recursive algorithm where you step through each portal into the neighboring cells (ignoring empty cells), adding the planes you've crossed to a stack as you traverse the cells. It should work just the same as in the BSP-tree example, except with BSP you can have a bit more control over where these splitting planes are placed (often the level designers / map makers can manually place these portals as well as relying on the BSP-compiler to create them automatically). To get decent results, your cells will have to be small enough so that you get some empty cells between rooms/corridors.
Grey cells are empty (no geometry, so don't treat them as being neighbours that you can traverse).
Starting at the green cell in the centre picture, when we step downwards from there, we add the orange line to our stack of planes. When traversing further from there, we can never step back up over that orange line, so the corner ends up functioning as an occluder.
In a more complex level it ends up looking like this (Starting at "A", green is visible, grey are empty cells, white are not visible for "A")