Skip to content

Commit

Permalink
Show del and ins tags
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Jan 2, 2025
1 parent 91c11b6 commit ec946d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion feed-parsers/class-feed-parser-activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,13 @@ private function handle_incoming_update_person( $activity, User_Feed $user_feed
$diff = new \Text_Diff( explode( PHP_EOL, $friend_user->description ), explode( PHP_EOL, $summary ) );
$renderer = new \WP_Text_Diff_Renderer_inline();
$details['summary'] = $renderer->render( $diff );
if ( empty( $details['summary'] ) ) {
unset( $details['summary'] );
} else {
$message .= ' ' . __( 'Updated description.', 'friends' );
}

$friend_user->description = $summary;
$message .= ' ' . __( 'Updated description.', 'friends' );
}
if ( ! empty( $activity['icon']['url'] ) && $friend_user->get_avatar_url() !== $activity['icon']['url'] ) {
$details['old-icon'] = '<img src="' . esc_url( $friend_user->get_avatar_url() ) . '" style="max-height: 32px; max-width: 32px" />';
Expand Down
12 changes: 11 additions & 1 deletion templates/admin/logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@
<td>
<details>
<summary><?php echo wp_kses_post( $log->post_title ); ?></summary>
<pre><?php echo wp_kses_post( $log->post_content ); ?></pre>
<pre>
<?php
echo wp_kses(
str_replace( array( '&lt;del&gt;', '&lt;/del&gt;', '&lt;ins&gt;', '&lt;/ins&gt;' ), array( '<del>', '</del>', '<ins>', '</ins>' ), esc_html( $log->post_content ) ),
array(
'ins' => array(),
'del' => array(),
)
);
?>
</pre>
</details>
</td>
<td><?php echo esc_html( get_the_author_meta( 'display_name', $log->post_author ) ); ?></td>
Expand Down

0 comments on commit ec946d5

Please sign in to comment.