VE-1537: Respectively insert block or inline template (instead of always inserting inline)

This is a fix (sort of a quick fix) for a problem that is currently happening on production - and it will require further discussion with WMF guys.

https://wikia-inc.atlassian.net/browse/VE-1537