Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
2d06a1d9
Commit
2d06a1d9
authored
Feb 22, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: set open external link in new tab as an option
parent
fc79d924
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
definition.yml
server/modules/rendering/html-core/definition.yml
+6
-0
renderer.js
server/modules/rendering/html-core/renderer.js
+3
-1
No files found.
server/modules/rendering/html-core/definition.yml
View file @
2d06a1d9
...
...
@@ -12,3 +12,9 @@ props:
title
:
Treat relative links as root absolute
hint
:
For example, a link to foo/bar on page xyz will render as /foo/bar instead of /xyz/foo/bar.
order
:
1
openExternalLinkNewTab
:
type
:
Boolean
default
:
false
title
:
Open external links in a new tab
hint
:
External links will have a _blank target attribute added automatically.
order
:
2
server/modules/rendering/html-core/renderer.js
View file @
2d06a1d9
...
...
@@ -113,7 +113,9 @@ module.exports = {
}
}
else
{
$
(
elm
).
addClass
(
`is-external-link`
)
$
(
elm
).
attr
(
'target'
,
'_blank'
)
if
(
this
.
config
.
openExternalLinkNewTab
)
{
$
(
elm
).
attr
(
'target'
,
'_blank'
)
}
}
// -> Update element
...
...
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