Villagers can try to breed through blocks
Villagers can attempt to breed vertically through blocks like slabs and farmland (even with crops), but can't actually have a baby.
For some reason this doesn't work in a 1x1 space, so if you test, make sure to make a bigger space.
The pictures have barriers to keep the villagers in.