Michele Bachmann had been doing so well. The tea-party darling from Minnesota is almost neck and neck with Mitt Romney as favourite for the Republican nomination for next year's presidential race.

So far she's largely avoided the pitfalls that Sarah Palin stumbled into in the 2008 White House race, while enjoying almost Palinesque outpourings of adulation on the campaign trail. That is until this weekend when she walked right into a row over slavery.

She clearly didn't see it coming. Last week she became the first Republican candidate to sign a "marriage vow" put forward by an evangelical group in the electorally crucial state of Iowa. At a cursory glance, it seemed a no-brainer: to pledge herself to the sanctity of marriage and family. She is openly opposed to gay marriages, and has five children as well as having fostered 23 others. Marriage, family – no problem!

But then the details of the pledge were picked up on the blogosphere, notably a clause in it referring to slavery. As Politico pointed out, the preamble of the pledge contains this phrase:

"Slavery had a disastrous impact on African-American families, yet sadly a child born into slavery in 1860 was more likely to be raised by his mother and father in a two-parent household than was an African-American baby born after the election of the USA's first African-American President."

As a general matter of course, it is not a good idea for American politicians to stray into the subject of slavery unless they've done a great deal of homework and are extremely confident about what they are saying. And as intelligent commentary on slavery goes, the preamble missed the target by miles. As Alexandra Petri put it in the Washington Post:

"Now you go and sign a pledge that includes a statement that can be summarized "gee, slavery was terrible for slaves, but at least they grew up in two-parent households?" There might have been two parents there, but that doesn't really improve your family situation if the children are being treated like property. Do we really want to go down this path?"

Anger was quick to follow. On the black political blog Jack & Jill Politics, Cheryl Contee was livid:

"Given that families were broken up regularly for sales during slavery and that rape by masters was pretty common, this could not be more offensive. I mean, putting aside the statistics on this, which are likely off-base, I could not be more angry. When will Republicans inquire with actual Black people whether or not we're ok with invoking slavery to score cheap political points? It has to stop."

When the full scale of the internet backlash was clear, the Iowa group that devised the pledge, the FAMiLY LEADER removed the paragraph on slavery. But the damage had been done, in that Bachmann, as well as her fellow presidential candidate Rick Santorum, had already signed the unexpurgated version.

To rub salt into the wound, Nate Silver, the New York Times's razor-sharp political statistician, pointed out on his Twitter account that the highly dubious claim about black families had in fact come from a research paper from the Institute for American Values that referred to the period 1880-1910 and had nothing to do with slavery in any case.

With seven months to go before the Iowa caucuses, Bachmann still has a long way to go before she gets to the nomination, let alone the White House. So this may come as a salutary lesson for her: before you sign anything, read the small print.