Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
045ea512
Commit
045ea512
authored
6 years ago
by
Mathias Maaß
Browse files
Options
Downloads
Patches
Plain Diff
Create different html rule sets. Part of #1854
parent
94972957
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/src/components/SanitizedHtml.test.js
+1
-1
1 addition, 1 deletion
__tests__/src/components/SanitizedHtml.test.js
src/lib/htmlRules.js
+22
-2
22 additions, 2 deletions
src/lib/htmlRules.js
with
23 additions
and
3 deletions
__tests__/src/components/SanitizedHtml.test.js
+
1
−
1
View file @
045ea512
...
...
@@ -5,7 +5,7 @@ import SanitizedHtml from '../../../src/components/SanitizedHtml';
const
wrapper
=
shallow
(
<
SanitizedHtml
htmlString
=
"
<script>doBadThings()</script><b>Don't worry!</b>
"
ruleSet
=
"
basic
"
ruleSet
=
"
iiif
"
/>
,
);
...
...
This diff is collapsed.
Click to expand it.
src/lib/htmlRules.js
+
22
−
2
View file @
045ea512
const
basic
=
{
// Only remove security related tags and attributes. Allow each other.
const
liberal
=
{};
// No html at all. Only text will remain.
const
noHtml
=
{
ALLOWED_TAGS
:
[],
};
// Presentation API 2 suggestion.
const
iiif
=
{
ALLOWED_TAGS
:
[
'
a
'
,
'
b
'
,
'
br
'
,
'
i
'
,
'
img
'
,
'
p
'
,
'
span
'
],
ALLOWED_ATTR
:
[
'
href
'
,
'
src
'
,
'
alt
'
],
};
// Rule set that is used in Mirador 2.
const
mirador2
=
{
ALLOWED_TAGS
:
[
'
a
'
,
'
b
'
,
'
br
'
,
'
i
'
,
'
img
'
,
'
p
'
,
'
span
'
,
'
strong
'
,
'
em
'
,
'
ul
'
,
'
ol
'
,
'
li
'
],
ALLOWED_ATTR
:
[
'
href
'
,
'
target
'
,
'
src
'
,
'
alt
'
,
'
dir
'
],
};
export
default
{
basic
};
export
default
{
liberal
,
noHtml
,
iiif
,
mirador2
,
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment