8000 Update html.js · bootstrap-vue/bootstrap-vue@8d0d28e · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d0d28e

Browse files
committed
Update html.js
1 parent a26e0bc commit 8d0d28e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/html.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const stripTagsRegex = /(<([^>]+)>)/gi
1+
const RX_HTML_TAGS = /(<([^>]+)>)/gi
22

3-
// Removes any thing that looks like an HTML tag from the supplied string
4-
export const stripTags = (text = '') => String(text).replace(stripTagsRegex, '')
3+
// Removes anything that looks like an HTML tag from the supplied string
4+
export const stripTags = (text = '') => String(text).replace(RX_HTML_TAGS, '')
55

6-
// Generate a domProps object for either innerHTML, textContent or nothing
6+
// Generate a `domProps` object for either `innerHTML`, `textContent` or an empty object
77
export const htmlOrText = (innerHTML, textContent) => {
88
return innerHTML ? { innerHTML } : textContent ? { textContent } : {}
99
}

0 commit comments

Comments
 (0)
0