A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/3c6ba3e44de425120990f671436a7b163742b5cb below:

strip html tags (#2479) · bootstrap-vue/bootstrap-vue@3c6ba3e · GitHub

File tree Expand file treeCollapse file tree 18 files changed

+137

-66

lines changed

Filter options

Expand file treeCollapse file tree 18 files changed

+137

-66

lines changed Original file line number Diff line number Diff line change

@@ -3,13 +3,18 @@ import { mergeData } from 'vue-functional-data-merge'

3 3

import prefixPropName from '../../utils/prefix-prop-name'

4 4

import copyProps from '../../utils/copyProps'

5 5

import { assign } from '../../utils/object'

6 +

import { htmlOrText } from '../../utils/html'

6 7

import cardMixin from '../../mixins/card-mixin'

7 8 8 9

export const props = assign({}, copyProps(cardMixin.props, prefixPropName.bind(null, 'footer')), {

9 10

footer: {

10 11

type: String,

11 12

default: null

12 13

},

14 +

footerHTML: {

15 +

type: String,

16 +

default: null

17 +

},

13 18

footerClass: {

14 19

type: [String, Object, Array],

15 20

default: null

@@ -35,7 +40,7 @@ export default {

35 40

}

36 41

]

37 42

}),

38 -

children || [h('div', { domProps: { innerHTML: props.footer } })]

43 +

children || [h('div', { domProps: htmlOrText(props.footerHTML, props.footer) })]

39 44

)

40 45

}

41 46

}

Original file line number Diff line number Diff line change

@@ -3,13 +3,18 @@ import { mergeData } from 'vue-functional-data-merge'

3 3

import prefixPropName from '../../utils/prefix-prop-name'

4 4

import copyProps from '../../utils/copyProps'

5 5

import { assign } from '../../utils/object'

6 +

import { htmlOrText } from '../../utils/html'

6 7

import cardMixin from '../../mixins/card-mixin'

7 8 8 9

export const props = assign({}, copyProps(cardMixin.props, prefixPropName.bind(null, 'header')), {

9 10

header: {

10 11

type: String,

11 12

default: null

12 13

},

14 +

headerHTML: {

15 +

type: String,

16 +

default: null

17 +

},

13 18

headerClass: {

14 19

type: [String, Object, Array],

15 20

default: null

@@ -35,7 +40,7 @@ export default {

35 40

}

36 41

]

37 42

}),

38 -

children || [h('div', { domProps: { innerHTML: props.header } })]

43 +

children || [h('div', { domProps: htmlOrText(props.headerHTML, props.header) })]

39 44

)

40 45

}

41 46

}

Original file line number Diff line number Diff line change

@@ -1,6 +1,7 @@

1 1

import BImg from '../image/img'

2 2

import idMixin from '../../mixins/id'

3 3

import { hasTouchSupport } from '../../utils/env'

4 +

import { htmlOrText } from '../../utils/html'

4 5 5 6

// @vue/component

6 7

export default {

@@ -45,31 +46,33 @@ export default {

45 46

},

46 47

contentVisibleUp: {

47 48

type: String

48 -

// default: undefined

49 49

},

50 50

contentTag: {

51 51

type: String,

52 52

default: 'div'

53 53

},

54 54

caption: {

55 55

type: String

56 -

// default: undefined

56 +

},

57 +

captionHTML: {

58 +

type: String

57 59

},

58 60

captionTag: {

59 61

type: String,

60 62

default: 'h3'

61 63

},

62 64

text: {

63 65

type: String

64 -

// default: undefined

66 +

},

67 +

textHTML: {

68 +

type: String

65 69

},

66 70

textTag: {

67 71

type: String,

68 72

default: 'p'

69 73

},

70 74

background: {

71 75

type: String

72 -

// default: undefined

73 76

}

74 77

},

75 78

data() {

@@ -126,8 +129,14 @@ export default {

126 129

this.contentTag,

127 130

{ staticClass: 'carousel-caption', class: this.contentClasses },

128 131

[

129 -

this.caption ? h(this.captionTag, { domProps: { innerHTML: this.caption } }) : h(false),

130 -

this.text ? h(this.textTag, { domProps: { innerHTML: this.text } }) : h(false),

132 +

this.caption || this.captionHTML

133 +

? h(this.captionTag, {

134 +

domProps: htmlOrText(this.captionHTML, this.caption)

135 +

})

136 +

: h(false),

137 +

this.text || this.textHTML

138 +

? h(this.textTag, { domProps: htmlOrText(this.textHTML, this.text) })

139 +

: h(false),

131 140

$slots.default

132 141

]

133 142

)

Original file line number Diff line number Diff line change

@@ -1,3 +1,4 @@

1 +

import { stripTags } from '../../utils/html'

1 2

import idMixin from '../../mixins/id'

2 3

import dropdownMixin from '../../mixins/dropdown'

3 4

import BButton from '../button/button'

@@ -138,7 +139,7 @@ export default {

138 139

click: this.click

139 140

}

140 141

},

141 -

[this.$slots['button-content'] || this.$slots.text || this.text]

142 +

[this.$slots['button-content'] || this.$slots.text || this.html || stripTags(this.text)]

142 143

)

143 144

}

144 145

const toggle = h(

@@ -165,7 +166,7 @@ export default {

165 166

[

166 167

this.split

167 168

? h('span', { class: ['sr-only'] }, [this.toggleText])

168 -

: this.$slots['button-content'] || this.$slots.text || this.text

169 +

: this.$slots['button-content'] || this.$slots.text || this.html || stripTags(this.text)

169 170

]

170 171

)

171 172

const menu = h(

Original file line number Diff line number Diff line change

@@ -5,6 +5,7 @@ import formSizeMixin from '../../mixins/form-size'

5 5

import formStateMixin from '../../mixins/form-state'

6 6

import formCustomMixin from '../../mixins/form-custom'

7 7

import { from as arrayFrom } from '../../utils/array'

8 +

import { htmlOrText } from '../../utils/html'

8 9 9 10

// @vue/component

10 11

export default {

@@ -78,7 +79,7 @@ export default {

78 79

return h('option', {

79 80

key: `option_${index}_opt`,

80 81

attrs: { disabled: Boolean(option.disabled) },

81 -

domProps: { innerHTML: option.text, value: option.value }

82 +

domProps: { ...htmlOrText(option.html, option.text), value: option.value }

82 83

})

83 84

})

84 85

return h(

Original file line number Diff line number Diff line change

@@ -1,25 +1,27 @@

1 1

import { mergeData } from 'vue-functional-data-merge'

2 -

import stripScripts from '../../utils/strip-scripts'

3 2

import InputGroupPrepend from './input-group-prepend'

4 3

import InputGroupAppend from './input-group-append'

5 4

import InputGroupText from './input-group-text'

5 +

import { htmlOrText } from '../../utils/html'

6 6 7 7

export const props = {

8 8

id: {

9 -

type: String,

10 -

default: null

9 +

type: String

11 10

},

12 11

size: {

13 -

type: String,

14 -

default: null

12 +

type: String

15 13

},

16 14

prepend: {

17 -

type: String,

18 -

default: null

15 +

type: String

16 +

},

17 +

prependHTML: {

18 +

type: String

19 19

},

20 20

append: {

21 -

type: String,

22 -

default: null

21 +

type: String

22 +

},

23 +

appendHTML: {

24 +

type: String

23 25

},

24 26

tag: {

25 27

type: String,

@@ -41,7 +43,9 @@ export default {

41 43

if (props.prepend) {

42 44

childNodes.push(

43 45

h(InputGroupPrepend, [

44 -

h(InputGroupText, { domProps: { innerHTML: stripScripts(props.prepend) } })

46 +

h(InputGroupText, {

47 +

domProps: htmlOrText(props.prependHTML, props.prepend)

48 +

})

45 49

])

46 50

)

47 51

} else {

@@ -66,7 +70,9 @@ export default {

66 70

if (props.append) {

67 71

childNodes.push(

68 72

h(InputGroupAppend, [

69 -

h(InputGroupText, { domProps: { innerHTML: stripScripts(props.append) } })

73 +

h(InputGroupText, {

74 +

domProps: htmlOrText(props.appendHTML, props.append)

75 +

})

70 76

])

71 77

)

72 78

} else {

Original file line number Diff line number Diff line change

@@ -1,5 +1,5 @@

1 1

import { mergeData } from 'vue-functional-data-merge'

2 -

import stripScripts from '../../utils/strip-scripts'

2 +

import { stripTags } from '../../utils/html'

3 3

import Container from '../layout/container'

4 4 5 5

export const props = {

@@ -15,6 +15,10 @@ export const props = {

15 15

type: String,

16 16

default: null

17 17

},

18 +

headerHTML: {

19 +

type: String,

20 +

default: null

21 +

},

18 22

headerTag: {

19 23

type: String,

20 24

default: 'h1'

@@ -27,6 +31,10 @@ export const props = {

27 31

type: String,

28 32

default: null

29 33

},

34 +

leadHTML: {

35 +

type: String,

36 +

default: null

37 +

},

30 38

leadTag: {

31 39

type: String,

32 40

default: 'p'

@@ -61,7 +69,7 @@ export default {

61 69

const $slots = slots()

62 70 63 71

// Header

64 -

if (props.header || $slots.header) {

72 +

if (props.header || $slots.header || props.headerHTML) {

65 73

childNodes.push(

66 74

h(

67 75

props.headerTag,

@@ -70,15 +78,19 @@ export default {

70 78

[`display-${props.headerLevel}`]: Boolean(props.headerLevel)

71 79

}

72 80

},

73 -

$slots.header || stripScripts(props.header)

81 +

$slots.header || props.headerHTML || stripTags(props.header)

74 82

)

75 83

)

76 84

}

77 85 78 86

// Lead

79 -

if (props.lead || $slots.lead) {

87 +

if (props.lead || $slots.lead || props.leadHTML) {

80 88

childNodes.push(

81 -

h(props.leadTag, { staticClass: 'lead' }, $slots.lead || stripScripts(props.lead))

89 +

h(

90 +

props.leadTag,

91 +

{ staticClass: 'lead' },

92 +

$slots.lead || props.leadHTML || stripTags(props.lead)

93 +

)

82 94

)

83 95

}

84 96 Original file line number Diff line number Diff line change

@@ -6,7 +6,7 @@ import observeDom from '../../utils/observe-dom'

6 6

import warn from '../../utils/warn'

7 7

import KeyCodes from '../../utils/key-codes'

8 8

import BvEvent from '../../utils/bv-event.class'

9 -

import stripScripts from '../../utils/strip-scripts'

9 +

import { stripTags } from '../../utils/html'

10 10 11 11

import {

12 12

addClass,

@@ -94,6 +94,9 @@ export default {

94 94

type: String,

95 95

default: ''

96 96

},

97 +

titleHTML: {

98 +

type: String

99 +

},

97 100

titleTag: {

98 101

type: String,

99 102

default: 'h5'

@@ -230,10 +233,16 @@ export default {

230 233

type: String,

231 234

default: 'Cancel'

232 235

},

236 +

cancelTitleHTML: {

237 +

type: String

238 +

},

233 239

okTitle: {

234 240

type: String,

235 241

default: 'OK'

236 242

},

243 +

okTitleHTML: {

244 +

type: String

245 +

},

237 246

cancelVariant: {

238 247

type: String,

239 248

default: 'secondary'

@@ -802,7 +811,7 @@ export default {

802 811

}

803 812

modalHeader = [

804 813

h(this.titleTag, { class: ['modal-title'] }, [

805 -

$slots['modal-title'] || stripScripts(this.title)

814 +

$slots['modal-title'] || this.titleHTML || stripTags(this.title)

806 815

]),

807 816

closeButton

808 817

]

@@ -850,7 +859,7 @@ export default {

850 859

}

851 860

}

852 861

},

853 -

[$slots['modal-cancel'] || stripScripts(this.cancelTitle)]

862 +

[$slots['modal-cancel'] || this.cancelTitleHTML || stripTags(this.cancelTitle)]

854 863

)

855 864

}

856 865

const okButton = h(

@@ -867,7 +876,7 @@ export default {

867 876

}

868 877

}

869 878

},

870 -

[$slots['modal-ok'] || stripScripts(this.okTitle)]

879 +

[$slots['modal-ok'] || this.okTitleHTML || stripTags(this.okTitle)]

871 880

)

872 881

modalFooter = [cancelButton, okButton]

873 882

}

Original file line number Diff line number Diff line change

@@ -1,6 +1,6 @@

1 1

import idMixin from '../../mixins/id'

2 2

import dropdownMixin from '../../mixins/dropdown'

3 -

import stripScripts from '../../utils/strip-scripts'

3 +

import { htmlOrText } from '../../utils/html'

4 4 5 5

// @vue/component

6 6

export default {

@@ -78,7 +78,7 @@ export default {

78 78

[

79 79

this.$slots['button-content'] ||

80 80

this.$slots.text ||

81 -

h('span', { domProps: { innerHTML: stripScripts(this.text) } })

81 +

h('span', { domProps: htmlOrText(this.html, this.text) })

82 82

]

83 83

)

84 84

const menu = h(

Original file line number Diff line number Diff line change

@@ -1,4 +1,4 @@

1 -

import stripScripts from '../../utils/strip-scripts'

1 +

import { htmlOrText } from '../../utils/html'

2 2 3 3

// @vue/component

4 4

export default {

@@ -12,6 +12,9 @@ export default {

12 12

type: String,

13 13

default: null

14 14

},

15 +

labelHTML: {

16 +

type: String

17 +

},

15 18

// $parent prop values take precedence over the following props

16 19

// Which is why they are defaulted to null

17 20

max: {

@@ -96,8 +99,8 @@ export default {

96 99

let childNodes = h(false)

97 100

if (this.$slots.default) {

98 101

childNodes = this.$slots.default

99 -

} else if (this.label) {

100 -

childNodes = h('span', { domProps: { innerHTML: stripScripts(this.label) } })

102 +

} else if (this.label || this.labelHTML) {

103 +

childNodes = h('span', { domProps: htmlOrText(this.labelHTML, this.label) })

101 104

} else if (this.computedShowProgress) {

102 105

childNodes = this.progress.toFixed(this.computedPrecision)

103 106

} else if (this.computedShowValue) {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4