diff --git a/docs/components/main-docs.js b/docs/components/main-docs.js index c6f051f1143..ef5b09aed71 100644 --- a/docs/components/main-docs.js +++ b/docs/components/main-docs.js @@ -5,6 +5,12 @@ import Section from '~/components/section' import { mergeData } from 'vue-functional-data-merge' import { bootstrapVersion, vueVersion } from '~/content' +const interpolate = (template, ctx) => + template.replace(/\[\[([\s\S]+?)\]\]/g, (_, key) => { + key = key.trim() + return ctx[key] || '' + }) + // @vue/component export default { name: 'BVMainDocs', @@ -59,15 +65,13 @@ export default { const $quickLinks = h(QuickLinks) // Body section - const $bodySectionContent = h({ - delimiters: ['[[', ']]'], // change the delimiters to avoid conflicts with code examples - data() { - return { + const $bodySectionContent = h('div', { + domProps: { + innerHTML: interpolate(body || '', { bootstrapVersion, vueVersion - } - }, - template: `
${body}
` + }) + } }) const $bodySection = h(