diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -135,7 +135,7 @@ HtmlWebpackPugPlugin.prototype.injectAssetsIntoSlim = function (file, styles, sc
  */
 HtmlWebpackPugPlugin.prototype.injectAssets = function (file, head, body, assets) {
   var self = this;
-  var bodyRegExp = /( *)(%?body)/i;
+  var bodyRegExp = /^( *)(%?body)\b/im;
 
   var match = bodyRegExp.exec(file);
   if (match) {
Fix adding link tag to head when word 'body' is present in content