A jealous boyfriend carried out a violent attack on his partner after she ended their relationship.
Thomas Riley was also arrested for drugs offences when police were called to the victim’s home and officers found drugs in his car.
Riley, 26, continued to harass the victim by sending threatening texts from a mobile phone hidden in his prison cell.
Leeds Crown Court heard Riley attacked the woman at her home in Horbury, near Wakefield, after she told him she no longer wanted to be in a relationship with.
He became violent after grabbing the woman’s mobile phone and reading a text she had sent to a friend saying she no longer wanted to be with him.
Nicholas Askins, prosecuting, said Riley punched the woman in the back of the head around 15 times as she lay curled up in a ball on the floor.
He also spat at her, pulled her hair and held her in a head lock.
Mr Askins said: “She tried to escape through a bathroom window but he pulled her inside.”
A member of the public saw the incident and called police.
Officers went to the house and the woman showed them two bags of MCat which she said Riley had left there.
His car was searched outside the property and found to contain £1,000 in cash.
A text message on his mobile phone referred to him leaving the drugs at her home as a “present.”
Riley then sent text messages to the victim while he was in custody.
He threatened to attack her and her mother and damage her father’s grave.
Riley, of Bridle Lane, Gawthorpe, pleaded guilty to assault, harassment, possessing a class B drug with intent, possession of criminal property and possessing an electrical device while in prison.
Nick Adlington, mitigating, said Riley had been in custody since the attack, which took place on March 26 this year.
Riley was given a 14 month prison sentence.