I've got a migration set up whose source was apparently filled out using MS Word. The JSON source for the migration looks like this in places:
{
"field_courses": "<p class=\"MsoNormal\" style=\"line-height: 14pt; background-position: initial initial; background-repeat: initial initial;\"><u><span style=\"font-size:10.0pt; font-family:\" new=\"\">Courses Taught (selected)<br />\r\n</span></u>...</p>"
}
When the migration completes and I open the resulting node, the field is rendered like this:
The field in question is allowed to use everything from Plain Text all the way to Full HTML. When I save the node manually, not making any changes, all the nonsense is stripped out and I'm left with relatively sane HTML when I check out the source of that field.
I thought maybe it would be as simple as loading the entity by its pathauto
alias (eg. /people/[person_id]
) and running $entity->save()
on it as soon as it's been imported, but that's not removing the formatting. Any way that I can get it to display correctly without requiring a content manager to manually save 500+ nodes?