Support more Typeform subdomains (#410)

Support more Typeform subdomains (#410)

Dashes or underscores seem to be allowed by Typeform but did not trigger the mixin so far. Adapting the regex already fixed the issue for our customer.

diff --git a/lib/onebox/engine/typeform_onebox.rb b/lib/onebox/engine/typeform_onebox.rb
index d537fc6..da53a84 100644
--- a/lib/onebox/engine/typeform_onebox.rb
+++ b/lib/onebox/engine/typeform_onebox.rb
@@ -5,7 +5,7 @@ module Onebox
     class TypeformOnebox
       include Engine
 
-      matches_regexp(/^https?:\/\/[a-z0-9]+\.typeform\.com\/to\/[a-zA-Z0-9]+/)
+      matches_regexp(/^https?:\/\/[a-z0-9\-_]+\.typeform\.com\/to\/[a-zA-Z0-9]+/)
       always_https
 
       def to_html

GitHub sha: 652161b7

1 Like