File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1553,5 +1553,23 @@ <h1>Acknowledgements</h1>
1553
1553
[[HTML5]] and his useful comments.
1554
1554
</ section >
1555
1555
1556
+ < script >
1557
+ try {
1558
+ var urlMap = {
1559
+ "DOM4" : "http://www.w3.org/TR/dom/#" ,
1560
+ "HTML5" : "http://www.w3.org/TR/html5/single-page.html#" ,
1561
+ } ;
1562
+ [ ] . forEach . call ( document . querySelectorAll ( "[class=externalDFN]" ) , function ( el ) {
1563
+ var key = el . getAttribute ( "data-spec" ) ;
1564
+ if ( ! key ) throw Error ( "Missed a 'data-spec' attribute on an class='externalDFN' reference for title='" + el . title + "'" ) ;
1565
+ if ( typeof urlMap [ key ] == "undefined" ) throw Error ( "Unknown 'data-spec' attribute value '" + key + "'" ) ;
1566
+ var link = el . title ;
1567
+ if ( link == "" ) throw Error ( "title value not provided on external reference for 'data-spec' attribute value '" + key + "'" ) ;
1568
+ if ( el . localName != "a" ) throw Error ( "Reference used on a non-anchor element: '" + el . localName + "'" ) ;
1569
+ el . removeAttribute ( "data-spec" ) ;
1570
+ el . href = urlMap [ key ] + link ;
1571
+ } ) ;
1572
+ } catch ( ex ) { alert ( ex ) ; }
1573
+ </ script >
1556
1574
</ body >
1557
1575
</ html >
You can’t perform that action at this time.
0 commit comments