Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
condenser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
condenser
Commits
f4d50ea4
Commit
f4d50ea4
authored
7 years ago
by
Benjamin Chodoroff
Browse files
Options
Downloads
Patches
Plain Diff
disable HtmlReady processing for HelpContent pages
closes #2539 we control this text, and it does not need to be readied
parent
2abb206e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/cards/MarkdownViewer.jsx
+10
-3
10 additions, 3 deletions
src/app/components/cards/MarkdownViewer.jsx
src/app/components/elements/HelpContent.jsx
+1
-0
1 addition, 0 deletions
src/app/components/elements/HelpContent.jsx
with
11 additions
and
3 deletions
src/app/components/cards/MarkdownViewer.jsx
+
10
−
3
View file @
f4d50ea4
...
@@ -28,6 +28,7 @@ class MarkdownViewer extends Component {
...
@@ -28,6 +28,7 @@ class MarkdownViewer extends Component {
highQualityPost
:
React
.
PropTypes
.
bool
,
highQualityPost
:
React
.
PropTypes
.
bool
,
noImage
:
React
.
PropTypes
.
bool
,
noImage
:
React
.
PropTypes
.
bool
,
allowDangerousHTML
:
React
.
PropTypes
.
bool
,
allowDangerousHTML
:
React
.
PropTypes
.
bool
,
bypassHtmlReady
:
React
.
PropTypes
.
bool
,
hideImages
:
React
.
PropTypes
.
bool
,
// whether to replace images with just a span containing the src url
hideImages
:
React
.
PropTypes
.
bool
,
// whether to replace images with just a span containing the src url
// used for the ImageUserBlockList
// used for the ImageUserBlockList
};
};
...
@@ -36,6 +37,7 @@ class MarkdownViewer extends Component {
...
@@ -36,6 +37,7 @@ class MarkdownViewer extends Component {
className
:
''
,
className
:
''
,
large
:
false
,
large
:
false
,
allowDangerousHTML
:
false
,
allowDangerousHTML
:
false
,
bypassHtmlReady
:
false
,
hideImages
:
false
,
hideImages
:
false
,
};
};
...
@@ -59,7 +61,12 @@ class MarkdownViewer extends Component {
...
@@ -59,7 +61,12 @@ class MarkdownViewer extends Component {
};
};
render
()
{
render
()
{
const
{
noImage
,
hideImages
}
=
this
.
props
;
const
{
noImage
,
hideImages
,
allowDangerousHTML
,
bypassHtmlReady
,
}
=
this
.
props
;
const
{
allowNoImage
}
=
this
.
state
;
const
{
allowNoImage
}
=
this
.
state
;
let
{
text
}
=
this
.
props
;
let
{
text
}
=
this
.
props
;
if
(
!
text
)
text
=
''
;
// text can be empty, still view the link meta data
if
(
!
text
)
text
=
''
;
// text can be empty, still view the link meta data
...
@@ -93,13 +100,13 @@ class MarkdownViewer extends Component {
...
@@ -93,13 +100,13 @@ class MarkdownViewer extends Component {
}
}
// Embed videos, link mentions and hashtags, etc...
// Embed videos, link mentions and hashtags, etc...
if
(
renderedText
)
if
(
renderedText
&&
!
bypassHtmlReady
)
renderedText
=
HtmlReady
(
renderedText
,
{
hideImages
}).
html
;
renderedText
=
HtmlReady
(
renderedText
,
{
hideImages
}).
html
;
// Complete removal of javascript and other dangerous tags..
// Complete removal of javascript and other dangerous tags..
// The must remain as close as possible to dangerouslySetInnerHTML
// The must remain as close as possible to dangerouslySetInnerHTML
let
cleanText
=
renderedText
;
let
cleanText
=
renderedText
;
if
(
this
.
props
.
allowDangerousHTML
===
true
)
{
if
(
allowDangerousHTML
===
true
)
{
console
.
log
(
'
WARN
\t
MarkdownViewer rendering unsanitized content
'
);
console
.
log
(
'
WARN
\t
MarkdownViewer rendering unsanitized content
'
);
}
else
{
}
else
{
cleanText
=
sanitize
(
cleanText
=
sanitize
(
...
...
This diff is collapsed.
Click to expand it.
src/app/components/elements/HelpContent.jsx
+
1
−
0
View file @
f4d50ea4
...
@@ -145,6 +145,7 @@ export default class HelpContent extends React.Component {
...
@@ -145,6 +145,7 @@ export default class HelpContent extends React.Component {
className
=
"HelpContent"
className
=
"HelpContent"
text
=
{
value
}
text
=
{
value
}
allowDangerousHTML
allowDangerousHTML
bypassHtmlReady
=
{
true
}
/>
/>
);
);
}
}
...
...
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