I am trying to resave a number of nodes to apply the text format changes to the body field. I’ve written a drush command to do this. The command does update the text format, but the text in the body field remains unprocessed.
public function saveNode() {
$result = $this->entityTypeManager->getStorage('node');
foreach ($result as $node) {
$node->save();
}
}
}
If I manually edit and save the node the text in the body field is correctly processed, but not when saved programmatically.
Notes: By "unprocessed" I mean the body field is still showing faulty HTML. If I manually edit and save the node the faulty HTML is fixed.