<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>koshigoeb</author_name>
  <author_url>https://blog.hatena.ne.jp/koshigoeb/</author_url>
  <blog_title>こしごぇ</blog_title>
  <blog_url>https://koshigoeb.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>正規表現はRubyのURI.regexp(%w(http https))から得たものを利用。こんな感じで良いのだろうか？適度に短い正規表現を使うべきだろうか。XSSに対して脆弱で無いか、試せてなし。 追記 置換対象がHTMLだと、既にリンクであるaタグのhrefの中身を置換しちゃう。置換対象をテキストノードにすると、HTMLが消えちゃう。 追記：2011/11/03 テキストノードだけを置換対象とするようにしたものも書いてみた。 追記: 2011/11/03 正確でないかもしれないけど、ブラウザのJSコンソールで見た感じ。 テキストノードのdataプロパティの値は文字参照がデコード済み set…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkoshigoeb.hatenadiary.org%2Fentry%2F20111102%2F1320222244&quot; title=&quot;URLらしき文字列をリンクに置換するJavaScript - こしごぇ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-11-02 17:24:04</published>
  <title>URLらしき文字列をリンクに置換するJavaScript</title>
  <type>rich</type>
  <url>https://koshigoeb.hatenadiary.org/entry/20111102/1320222244</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
