The Harry Potter author says she wanted to draw attention to the stigma many still face.

JK Rowling delighted fans recently after she announced the release of three new Hogwarts e-books which collect together material from her ‘Pottermore’ project.

The books – released on September 6 – are packed full of trivia on a range of characters from the series, including fan favourite Remus Lupin.

In a section of ‘Short Stories From Hogwarts of Heroism, Hardship, and Dangerous Hobbies’, Rowling details the life of Lupin, writing that the professor’s werewolf condition is a metaphor for illnesses that carry a stigma.

Lupin — who Rowling calls “one of her favourite characters in the entire Potter series” — was plagued by his condition and often faced rejection from the wizarding world.

“Lupin’s condition of lycanthropy was a metaphor for those illnesses that carry a stigma, like HIV and AIDS,” Rowling reveals in the book.

“All kinds of superstitions seem to surround blood-borne conditions, probably due to taboos surrounding blood itself.

“The wizarding community is as prone to hysteria and prejudice as the Muggle one, and the character of Lupin gave me a chance to examine those attitudes.”

However, despite the stigma he previously faced, Rowling reminds readers that Lupin eventually found acceptance with “a wife, a son, wonderful friends” – not to mention helping rid the world of the most evil wizard of them all.

Some of the information was previously detailed on Pottermore.

Rowling was forced to hit back earlier this week, after receiving “tons of abuse” from disgruntled Harry Potter fans after they wrongly believed she had said that Sirius Black – Lupin’s close friend and confidante – is not gay.

The “announcement” – the result of an unrelated cryptic message from Rowling simply saying “No, he isn’t” – infuriated some Twitter users, who quickly began attacking the author using the #JKRowlingIsOverParty hashtag.

Some ‘fans’ declared her a “traitor to the LGBT cause”, with others claiming the author – who recently defended Olympian Tom Daley from anti-gay trolls – is actually a “homophobe”.