Skip to content

Commit 74e60a7

Browse files
committed
Link to html wrapper page instead of yaml
1 parent 926e5a6 commit 74e60a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/md2html/md2html.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,14 @@ for (let l in lines) {
271271

272272
// fix relative links (to examples)
273273
if (!inCodeBlock && line.indexOf('](../examples/') >= 0) {
274+
// links to examples go to learn site, links to yaml files go to wrapper html
274275
line = line.replace(/\(\.\.\/examples\/([^)]+)\)/g,function(match,group1){
275276
console.warn("example link",group1);
276-
//TODO: group1 = group1.replace('.yaml','.html');
277+
group1 = group1.replace('.yaml','.html');
277278
return `(https://learn.openapis.org/examples/${group1})`;
278279
})
279280
} else if (!inCodeBlock && line.indexOf('](../') >= 0) {
281+
// links to other sibling files go to github
280282
const regExp = /\((\.\.[^)]+)\)/g;
281283
line = line.replace(regExp,function(match,group1){
282284
console.warn('relative link',group1);

0 commit comments

Comments
 (0)