回答編集履歴

1

width と heightをとってなかったので修正しました。

2016/08/23 09:26

投稿

nullbot
nullbot

スコア910

test CHANGED
@@ -12,6 +12,6 @@
12
12
 
13
13
  echo $org. "\n";
14
14
 
15
- echo preg_replace('/(<img.*\/>)(.*$)/u', '<figure>\\1<figcaption>\\2</figcaption></figure>', $org);
15
+ echo preg_replace('/(<img.*)width.*\/>(.*$)/u', '<figure>\\1/><figcaption>\\2</figcaption></figure>', $org);
16
16
 
17
17
  ```