diff options
| author | Hannah Issermann <[email protected]> | 2023-03-27 11:10:25 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-27 12:10:25 +0300 |
| commit | 06f7c3b6c73580cd05b131bdab4d156a864d418c (patch) | |
| tree | 910759161d3155be5559f1a4d331a0ad40c1674b /js/src | |
| parent | 31f93e2aff5050877f499faca05dc4341942a40a (diff) | |
| download | bootstrap-06f7c3b6c73580cd05b131bdab4d156a864d418c.tar.xz bootstrap-06f7c3b6c73580cd05b131bdab4d156a864d418c.zip | |
Add js-docs shortcode to ensure consistency between doc and js code (#38316)
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/util/sanitizer.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js index af846a21e..5a07a67c1 100644 --- a/js/src/util/sanitizer.js +++ b/js/src/util/sanitizer.js @@ -16,8 +16,6 @@ const uriAttributes = new Set([ 'xlink:href' ]) -const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i - /** * A pattern that recognizes a commonly useful subset of URLs that are safe. * @@ -48,6 +46,9 @@ const allowedAttribute = (attribute, allowedAttributeList) => { .some(regex => regex.test(attributeName)) } +// js-docs-start allow-list +const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i + export const DefaultAllowlist = { // Global attributes allowed on any supplied element below. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], @@ -81,6 +82,7 @@ export const DefaultAllowlist = { u: [], ul: [] } +// js-docs-end allow-list export function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { if (!unsafeHtml.length) { |
