@@ -37,20 +37,6 @@ function restrictReferences(utils, content) {
37
37
return ( base . innerHTML ) ;
38
38
}
39
39
40
- // Mark definitions to be exported
41
- function exportReferences ( utils , content ) {
42
- const base = document . createElement ( "div" ) ;
43
- base . innerHTML = content ;
44
-
45
- const defns = base . querySelectorAll ( "dfn:not([data-cite])" ) ;
46
- for ( const item of defns ) {
47
- const de = document . createAttribute ( "data-export" ) ;
48
- item . setAttributeNode ( de ) ;
49
- }
50
-
51
- return ( base . innerHTML ) ;
52
- }
53
-
54
40
// add a handler to come in after all the definitions are resolved
55
41
//
56
42
// New logic: If the reference is within a 'dl' element of
@@ -128,63 +114,6 @@ require(["core/pubsubhub"], (respecEvents) => {
128
114
} ) ;
129
115
} ) ;
130
116
131
- /*
132
- *
133
- * Replace github.io references to /TR references.
134
- * The issue is as follows: when several specs are developed in parallel, it is a good idea
135
- * to use, for mutual references, the github.io URI-s. That ensures that the editors' drafts are always
136
- * correct in terms of mutual references.
137
- *
138
- * However, when publishing the documents, all those references must be exchanged against the final, /TR
139
- * URI-s. That process, when done manually, is boring and error prone. This script solves the issue:
140
- *
141
- * * Create a separate file with the 'conversions' array. See, e.g., https://github.com/w3c/csvw/blob/gh-pages/local-biblio.js
142
- * for an example.
143
- * * Include a reference to that file and this to the respec code, after the inclusion of respec. E.g.:
144
- * ```
145
- * <script class="remove" src="../local-biblio.js"></script>
146
- * <script class="remove" src="https://www.w3.org/Tools/respec/respec-w3c-common"></script>
147
- * <script class="remove" src="../replace-ed-uris.js"></script>
148
- * ```
149
- *
150
- * This function will be automatically executed when the respec source is saved in an (X)HTML file.
151
- * Note that
152
- *
153
- * * Links in the header part will *not* be changed. That part is usually generated automatically, and the reference to the
154
- * editor's draft must stay unchanged
155
- * * The text content of an <a> element will also be converted (if needed). This means that the reference list may also
156
- * use include the github.io address (as it should...)
157
- *
158
- */
159
- require ( [ "core/pubsubhub" ] , ( respecEvents ) => {
160
- "use strict" ;
161
- respecEvents . sub ( 'beforesave' , ( documentElement ) => {
162
- for ( const anchor of document . querySelectorAll ( "a[href]" ) ) {
163
- const dd = anchor . closest ( 'dd' ) ;
164
-
165
- // Don't replace specific anchors
166
- if ( dd ) {
167
- const dt = dd . previousElementSibling ;
168
- if ( dt . textContent . match ( / L a t e s t e d i t o r | T e s t s u i t e | I m p l e m e n t a t i o n r e p o r t / ) ) return ;
169
- }
170
- if ( anchor . closest ( 'section.preserve' ) ) return ;
171
-
172
- if ( anchor . href === undefined ) return ;
173
-
174
- for ( const toReplace in jsonld . conversions ) {
175
- if ( anchor . href . indexOf ( toReplace ) !== - 1 ) {
176
- const replacement = jsonld . conversions [ toReplace ] ;
177
- const newHref = anchor . href . replace ( toReplace , replacement ) ;
178
- anchor . setAttribute ( 'href' , newHref ) ;
179
- if ( anchor . textContent . indexOf ( toReplace ) !== - 1 ) {
180
- anchor . textContent = anchor . textContent . replace ( toReplace , replacement ) ;
181
- }
182
- }
183
- }
184
- }
185
- } ) ;
186
- } ) ;
187
-
188
117
/*
189
118
* Implement tabbed examples.
190
119
*/
0 commit comments