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 22- [ Foo] ( /example/router-mode-history/foo.md#section-3 )
33- [ Bar A Long Long Long Title] ( /example/router-mode-history/bar.md )
44- [ 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 {
5959 return {
6060 name : this . hyperlink . innerText ,
6161 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' ,
6364 }
6465 }
6566}
@@ -100,7 +101,7 @@ const template = {
100101 return [
101102 data . prev && `
102103 <div class="pagination-item pagination-item--previous">
103- <a href="${ data . prev . href } ">
104+ <a href="${ data . prev . href } " ${ data . prev . isExternal ? 'target="_blank"' : '' } >
104105 <div class="pagination-item-label">
105106 <svg width="10" height="16" viewBox="0 0 10 16" xmlns="http://www.w3.org/2000/svg">
106107 <polyline fill="none" vector-effect="non-scaling-stroke" points="8,2 2,8 8,14"/>
@@ -115,7 +116,7 @@ const template = {
115116 ` ,
116117 data . next && `
117118 <div class="pagination-item pagination-item--next">
118- <a href="${ data . next . href } ">
119+ <a href="${ data . next . href } " ${ data . next . isExternal ? 'target="_blank"' : '' } >
119120 <div class="pagination-item-label">
120121 <span>${ nextText } </span>
121122 <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