Skip to content
Snippets Groups Projects
Unverified Commit 45e0ea2d authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Closes #3771; Fix some oembed issues

parent 2ce617cb
No related branches found
No related tags found
No related merge requests found
......@@ -106,20 +106,20 @@ OEmbed.getUrlMeta = (url, withFragment) ->
if content?.body?
metas = {}
content.body.replace /<title>((.|\n)+?)<\/title>/gmi, (meta, title) ->
metas.pageTitle = he.unescape title
content.body.replace /<title[^>]*>([^<]*)<\/title>/gmi, (meta, title) ->
metas.pageTitle ?= he.unescape title
content.body.replace /<meta[^>]*(?:name|property)=[']([^']*)['][^>]*content=[']([^']*)['][^>]*>/gmi, (meta, name, value) ->
metas[changeCase.camelCase(name)] = he.unescape value
content.body.replace /<meta[^>]*(?:name|property)=[']([^']*)['][^>]*\scontent=[']([^']*)['][^>]*>/gmi, (meta, name, value) ->
metas[changeCase.camelCase(name)] ?= he.unescape value
content.body.replace /<meta[^>]*(?:name|property)=["]([^"]*)["][^>]*content=["]([^"]*)["][^>]*>/gmi, (meta, name, value) ->
metas[changeCase.camelCase(name)] = he.unescape value
content.body.replace /<meta[^>]*(?:name|property)=["]([^"]*)["][^>]*\scontent=["]([^"]*)["][^>]*>/gmi, (meta, name, value) ->
metas[changeCase.camelCase(name)] ?= he.unescape value
content.body.replace /<meta[^>]*content=[']([^']*)['][^>]*(?:name|property)=[']([^']*)['][^>]*>/gmi, (meta, value, name) ->
metas[changeCase.camelCase(name)] = he.unescape value
content.body.replace /<meta[^>]*\scontent=[']([^']*)['][^>]*(?:name|property)=[']([^']*)['][^>]*>/gmi, (meta, value, name) ->
metas[changeCase.camelCase(name)] ?= he.unescape value
content.body.replace /<meta[^>]*content=["]([^"]*)["][^>]*(?:name|property)=["]([^"]*)["][^>]*>/gmi, (meta, value, name) ->
metas[changeCase.camelCase(name)] = he.unescape value
content.body.replace /<meta[^>]*\scontent=["]([^"]*)["][^>]*(?:name|property)=["]([^"]*)["][^>]*>/gmi, (meta, value, name) ->
metas[changeCase.camelCase(name)] ?= he.unescape value
if metas.fragment is '!' and not withFragment?
......
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