File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
example/router-mode-history Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 2
2
- [ Foo] ( /example/router-mode-history/foo.md#section-3 )
3
3
- [ Bar A Long Long Long Title] ( /example/router-mode-history/bar.md )
4
4
- [ Baz] ( /example/router-mode-history/baz.md )
5
+ - [ External] ( https://github.com/ )
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ class Link {
59
59
return {
60
60
name : this . hyperlink . innerText ,
61
61
href : this . hyperlink . getAttribute ( 'href' ) ,
62
- chapterName : this . chapter && this . chapter . innerText || ''
62
+ chapterName : this . chapter && this . chapter . innerText || '' ,
63
+ isExternal : this . hyperlink . getAttribute ( 'target' ) === '_blank' ,
63
64
}
64
65
}
65
66
}
@@ -100,7 +101,7 @@ const template = {
100
101
return [
101
102
data . prev && `
102
103
<div class="pagination-item pagination-item--previous">
103
- <a href="${ data . prev . href } ">
104
+ <a href="${ data . prev . href } " ${ data . prev . isExternal ? 'target="_blank"' : '' } >
104
105
<div class="pagination-item-label">
105
106
<svg width="10" height="16" viewBox="0 0 10 16" xmlns="http://www.w3.org/2000/svg">
106
107
<polyline fill="none" vector-effect="non-scaling-stroke" points="8,2 2,8 8,14"/>
@@ -115,7 +116,7 @@ const template = {
115
116
` ,
116
117
data . next && `
117
118
<div class="pagination-item pagination-item--next">
118
- <a href="${ data . next . href } ">
119
+ <a href="${ data . next . href } " ${ data . next . isExternal ? 'target="_blank"' : '' } >
119
120
<div class="pagination-item-label">
120
121
<span>${ nextText } </span>
121
122
<svg width="10" height="16" viewBox="0 0 10 16" xmlns="http://www.w3.org/2000/svg">
You can’t perform that action at this time.
0 commit comments