Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
44090f41
Commit
44090f41
authored
Sep 30, 2021
by
Abhijeet Chatterjee
Committed by
Kushal Pandya
Sep 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor-v-html-markdown.vue
parent
702529c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
app/assets/javascripts/notebook/cells/markdown.vue
app/assets/javascripts/notebook/cells/markdown.vue
+7
-2
No files found.
app/assets/javascripts/notebook/cells/markdown.vue
View file @
44090f41
<
script
>
import
katex
from
'
katex
'
;
import
marked
from
'
marked
'
;
import
{
GlSafeHtmlDirective
as
SafeHtml
}
from
'
@gitlab/ui
'
;
import
{
sanitize
}
from
'
~/lib/dompurify
'
;
import
{
hasContent
,
markdownConfig
}
from
'
~/lib/utils/text_utility
'
;
import
Prompt
from
'
./prompt.vue
'
;
...
...
@@ -138,6 +139,9 @@ export default {
components
:
{
prompt
:
Prompt
,
},
directives
:
{
SafeHtml
,
},
inject
:
[
'
relativeRawPath
'
],
props
:
{
cell
:
{
...
...
@@ -150,16 +154,17 @@ export default {
renderer
.
attachments
=
this
.
cell
.
attachments
;
renderer
.
relativeRawPath
=
this
.
relativeRawPath
;
return
sanitize
(
marked
(
this
.
cell
.
source
.
join
(
''
).
replace
(
/
\\
/g
,
'
\\\\
'
)),
markdownConfig
);
return
marked
(
this
.
cell
.
source
.
join
(
''
).
replace
(
/
\\
/g
,
'
\\\\
'
)
);
},
},
markdownConfig
,
};
</
script
>
<
template
>
<div
class=
"cell text-cell"
>
<prompt
/>
<div
class=
"markdown"
v-html=
"markdown /* eslint-disable-line vue/no-v-html */
"
></div>
<div
v-safe-html:
[$
options.markdownConfig]=
"markdown"
class=
"markdown
"
></div>
</div>
</
template
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment