Discourse로 다운로드된 게시글 이미지가 표시되지 않습니다

@Arkshine 님이 이미지 앞에 빈 공백을 추가하는 해결책을 보내주셨어요:

add_filter('wp_discourse_excerpt', [$this, 'wp_discourse_excerpt'], 10, 1);

/**
 * 모든 <img> 태그 위에 빈 공백을 추가합니다.
 * 목적은 Discourse에서 마크다운으로 다운로드된 이미지가 표시되지 않는 문제를 방지하는 것입니다.
 *
 * @param $post_content
 *
 * @return string
 */
public function wp_discourse_excerpt($post_content)
{
    $post_content = preg_replace('/(<img\s)/i', "\n\n$1", $post_content);
    $post_content = preg_replace('/[\n]{3,}/', "\n\n", $post_content);

    return $post_content;
}