bootstrap-vue
Version:
BootstrapVue, with over 40 plugins and more than 80 custom components, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
10 lines (7 loc) • 401 B
JavaScript
const stripTagsRegex = /(<([^>]+)>)/gi
// Removes any thing that looks like an HTML tag from the supplied string
export const stripTags = (text = '') => String(text).replace(stripTagsRegex, '')
// Generate a domProps object for either innerHTML, textContent or nothing
export const htmlOrText = (innerHTML, textContent) => {
return innerHTML ? { innerHTML } : textContent ? { textContent } : {}
}