But the Hague Convetion (the one that actually governs how war is fought) states:
SECTION II
HOSTILITIES
CHAPTER I
Means of Injuring the Enemy,
Sieges, and bombardments
Art. 25.
The attack or bombardment, by whatever means, of towns, villages, dwellings, or buildings which are undefended is prohibited.
Art. 26.
The officer in command of an attacking force must, before commencing a bombardment, except in cases of assault, do all in his power to warn the authorities.
Art. 27.
In sieges and bombardments all necessary steps must be taken to spare, as far as possible, buildings dedicated to religion, art, science, or charitable purposes, historic monuments, hospitals, and places where the sick and wounded are collected, provided they are not being used at the time for military purposes.
It is the duty of the besieged to indicate the presence of such buildings or places by distinctive and visible signs, which shall be notified to the enemy beforehand.
Israel is acting well within the law.