- if ( $old_content && $old_content->getModel() !== $content->getModel() ) {
- $tags[] = 'mw-contentmodelchange';
+ $handler = $content->getContentHandler();
+ $tag = $handler->getChangeTag( $old_content, $content, $flags );
+ // If there is no applicable tag, null is returned, so we need to check
+ if ( $tag ) {
+ $tags[] = $tag;