File tree Expand file tree Collapse file tree 1 file changed +25
-9
lines changed
Expand file tree Collapse file tree 1 file changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -219,31 +219,47 @@ export default class Feature extends AbstractFeature {
219219 }
220220
221221 get draftLink ( ) {
222+ let link = this . def . links ?. dev ?? this . def . link ;
223+
224+ if ( ! link ) {
225+ return '' ;
226+ }
227+
228+ let isAbsolute = link ?. startsWith ( 'https://' ) ;
229+
230+ if ( isAbsolute ) {
231+ return link ;
232+ }
233+
222234 let specLink = this . spec ?. draftLink ;
223235
224236 if ( ! specLink ) {
225237 return '' ;
226238 }
227239
228- let link = this . def . links ?. dev ?? this . def . link ;
229-
230- return link ? specLink + link : '' ;
240+ return new URL ( link , specLink ) . href ;
231241 }
232242
233243 get specLink ( ) {
234- let specLink = this . spec ?. specLink ;
244+ let link = this . def . links ?. tr ?? this . def . link ;
235245
236- if ( ! specLink ) {
246+ if ( ! link ) {
237247 return '' ;
238248 }
239249
240- let link = this . def . links ?. tr ?? this . def . link ;
250+ let isAbsolute = link ?. startsWith ( 'https://' ) ;
241251
242- if ( link ) {
243- return specLink + link ;
252+ if ( isAbsolute ) {
253+ return link ;
254+ }
255+
256+ let specLink = this . spec ?. specLink ;
257+
258+ if ( ! specLink ) {
259+ return '' ;
244260 }
245261
246- return link ;
262+ return new URL ( link , specLink ) . href ;
247263 }
248264
249265 get mdnLink ( ) {
You can’t perform that action at this time.
0 commit comments