Skip to content

Commit

Permalink
Added fcf directive too format compound formulas with subscripts
Browse files Browse the repository at this point in the history
Signed-off-by: Mehmet Baker <[email protected]>
  • Loading branch information
mehmetb committed Jan 17, 2022
1 parent 790ff53 commit 37035ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
{ src: '~/plugins/element-ui', ssr: false },
{ src: '~/plugins/vue-gtag.js', ssr: false, mode: 'client' },
{ src: '~/plugins/vue-sanitize', ssr: false },
{ src: '~/plugins/directives', ssr: false },
],

// Auto import components: https://go.nuxtjs.dev/config-components
Expand Down
7 changes: 7 additions & 0 deletions plugins/directives.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Vue from 'vue'

Vue.directive('fcf', {
inserted(el) {
el.innerHTML = el.innerHTML.replace(/(\d+)/g, `<sub>$1</sub>`)
},
})

0 comments on commit 37035ac

Please sign in to comment.