From 87958400a1232c3a20e45c77aa4d35c37a07f40b Mon Sep 17 00:00:00 2001 From: Chi Ngan Lee Date: Fri, 9 Feb 2018 11:22:17 +0800 Subject: [PATCH] When we regex-check the MIME header we should also support zero space between the type and the charset, say "text/html;charset=utf-8". --- lib/readability.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/readability.ex b/lib/readability.ex index c50c715..d214c97 100644 --- a/lib/readability.ex +++ b/lib/readability.ex @@ -61,7 +61,7 @@ defmodule Readability do protect_attrs: ~r/^(?!id|rel|for|summary|title|href|src|alt|srcdoc)/i ] - @markup_mimes ~r/^(application|text)\/[a-z\-_\.\+]+ml(;\s+charset=.*)?$/i + @markup_mimes ~r/^(application|text)\/[a-z\-_\.\+]+ml(;\s*charset=.*)?$/i @type html_tree :: tuple | list @type raw_html :: binary