diff --git a/src/store.js b/src/store.js
index <HASH>..<HASH> 100644
--- a/src/store.js
+++ b/src/store.js
@@ -72,8 +72,9 @@ const store = new Vuex.Store({
         file
       }
       let html = marked(text, {
-        renderer: markedRenderer(env, hooks),
-        highlight
+        renderer: markedRenderer(hooks),
+        highlight,
+        env
       })
       html = hooks.process('processHTML', html)
       commit('SET_PAGE_TITLE', env.title)
diff --git a/src/utils/markedRenderer.js b/src/utils/markedRenderer.js
index <HASH>..<HASH> 100644
--- a/src/utils/markedRenderer.js
+++ b/src/utils/markedRenderer.js
@@ -1,12 +1,13 @@
 import marked from './marked'
 import {slugify} from '.'
 
-export default (env, hooks) => {
+export default hooks => {
   const renderer = new marked.Renderer()
 
-  env.headings = []
   const slugs = []
   renderer.heading = function(text, level, raw) {
+    const {env} = this.options
+
     let slug = slugify(raw)
     slugs.push(slug)
     const sameSlugCount = slugs.filter(v => v === slug).length
refactor: inject env to marked options

so that plugins can use env too