bootstrap-vue
Version:
BootstrapVue, with more than 85 custom components, over 45 plugins, several custom directives, and over 300 icons, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated W
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 } : {}
}