Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
a4927884
Verified
Commit
a4927884
authored
Jan 19, 2023
by
Chocobozzz
Browse files
Support mailto for custom markup
parent
32fde390
Changes
2
Hide whitespace changes
Inline
Side-by-side
client/src/app/core/renderer/markdown.service.ts
View file @
a4927884
...
...
@@ -64,8 +64,8 @@ export class MarkdownService {
textMarkdownToHTML
(
options
:
{
markdown
:
string
withHtml
?:
boolean
withEmoji
?:
boolean
withHtml
?:
boolean
// default false
withEmoji
?:
boolean
// default false
})
{
const
{
markdown
,
withHtml
=
false
,
withEmoji
=
false
}
=
options
...
...
@@ -76,8 +76,8 @@ export class MarkdownService {
enhancedMarkdownToHTML
(
options
:
{
markdown
:
string
withHtml
?:
boolean
withEmoji
?:
boolean
withHtml
?:
boolean
// default false
withEmoji
?:
boolean
// default false
})
{
const
{
markdown
,
withHtml
=
false
,
withEmoji
=
false
}
=
options
...
...
@@ -99,6 +99,8 @@ export class MarkdownService {
return
this
.
render
({
name
:
'
customPageMarkdownIt
'
,
markdown
,
withEmoji
:
true
,
additionalAllowedTags
})
}
// ---------------------------------------------------------------------------
processVideoTimestamps
(
videoShortUUID
:
string
,
html
:
string
)
{
return
html
.
replace
(
/
((\d{1,2})
:
)?(\d{1,2})
:
(\d{1,2})
/g
,
function
(
str
,
_
,
h
,
m
,
s
)
{
const
t
=
(
3600
*
+
(
h
||
0
))
+
(
60
*
+
(
m
||
0
))
+
(
+
(
s
||
0
))
...
...
shared/core-utils/renderer/html.ts
View file @
a4927884
...
...
@@ -38,7 +38,11 @@ export function getCustomMarkupSanitizeOptions (additionalAllowedTags: string[]
...
additionalAllowedTags
,
'
div
'
,
'
h1
'
,
'
h2
'
,
'
h3
'
,
'
h4
'
,
'
h5
'
,
'
h6
'
,
'
img
'
],
allowedSchemes
:
base
.
allowedSchemes
,
allowedSchemes
:
[
...
base
.
allowedSchemes
,
'
mailto
'
],
allowedAttributes
:
{
...
base
.
allowedAttributes
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment