Skip to content
Snippets Groups Projects
Commit eb4da933 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Make oembed parse title in ungreedy form

parent 99b206d8
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,7 @@ OEmbed.getUrlMeta = (url, withFragment) -> ...@@ -103,7 +103,7 @@ OEmbed.getUrlMeta = (url, withFragment) ->
if content?.body? if content?.body?
metas = {} metas = {}
content.body.replace /<title>((.|\n)+)<\/title>/gmi, (meta, title) -> content.body.replace /<title>((.|\n)+?)<\/title>/gmi, (meta, title) ->
metas.pageTitle = title metas.pageTitle = title
content.body.replace /<meta[^>]*(?:name|property)=[']([^']*)['][^>]*content=[']([^']*)['][^>]*>/gmi, (meta, name, value) -> content.body.replace /<meta[^>]*(?:name|property)=[']([^']*)['][^>]*content=[']([^']*)['][^>]*>/gmi, (meta, name, value) ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment