Skip to content

Commit 1662cbb

Browse files
committed
Append the href of each library with a slash
1 parent c7f1160 commit 1662cbb

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

lib/resources/docs.dart.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/model/library.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class Library extends ModelElement
219219
// The file name for a library is 'index.html', so we just link to the
220220
// directory name. This keeps the URL looking short, _without_ the
221221
// 'index.html' in the URL.
222-
return '${package.baseHref}$dirName';
222+
return '${package.baseHref}$dirName/';
223223
}
224224

225225
/// The previous value of [filePath].

test/end2end/model_test.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,17 +1194,25 @@ void main() async {
11941194
expect(
11951195
aFunctionUsingRenamedLib.documentationAsHtml,
11961196
contains(
1197-
'Link to library: <a href="${htmlBasePlaceholder}mylibpub">renamedLib</a>'),
1197+
'Link to library: '
1198+
'<a href="${htmlBasePlaceholder}mylibpub/">renamedLib</a>',
1199+
),
11981200
);
11991201
expect(
12001202
aFunctionUsingRenamedLib.documentationAsHtml,
12011203
contains(
1202-
'Link to constructor (implied, no new): <a href="${htmlBasePlaceholder}mylibpub/YetAnotherHelper/YetAnotherHelper.html">renamedLib.YetAnotherHelper()</a>'),
1204+
'Link to constructor (implied, no new): '
1205+
'<a href="${htmlBasePlaceholder}mylibpub/YetAnotherHelper/YetAnotherHelper.html">'
1206+
'renamedLib.YetAnotherHelper()</a>',
1207+
),
12031208
);
12041209
expect(
12051210
aFunctionUsingRenamedLib.documentationAsHtml,
12061211
contains(
1207-
'Link to class: <a href="${htmlBasePlaceholder}mylibpub/YetAnotherHelper-class.html">renamedLib.YetAnotherHelper</a>'),
1212+
'Link to class: '
1213+
'<a href="${htmlBasePlaceholder}mylibpub/YetAnotherHelper-class.html">'
1214+
'renamedLib.YetAnotherHelper</a>',
1215+
),
12081216
);
12091217
expect(
12101218
aFunctionUsingRenamedLib.documentationAsHtml,

test/libraries_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ A doc comment.
174174
var dartAsyncLib = sdkPackage.libraries.named('dart:async');
175175
expect(dartAsyncLib.name, 'dart:async');
176176
expect(dartAsyncLib.dirName, 'dart-async');
177-
expect(dartAsyncLib.href, '${htmlBasePlaceholder}dart-async');
177+
expect(dartAsyncLib.href, '${htmlBasePlaceholder}dart-async/');
178178
});
179179
}
180180

@@ -191,7 +191,7 @@ class LibrariesTest extends DartdocTestBase {
191191

192192
expect(library.name, 'libraries');
193193
expect(library.qualifiedName, 'libraries');
194-
expect(library.href, '${placeholder}libraries');
194+
expect(library.href, '${placeholder}libraries/');
195195
}
196196

197197
void test_library_containsClassWithSameNameAsDartSdk() async {
@@ -212,7 +212,7 @@ class LibrariesTest extends DartdocTestBase {
212212

213213
expect(library.name, 'lib1');
214214
expect(library.qualifiedName, 'lib1');
215-
expect(library.href, '${placeholder}lib1');
215+
expect(library.href, '${placeholder}lib1/');
216216
expect(library.redirectingPath, 'lib1/lib1-library.html');
217217
}
218218

@@ -230,7 +230,7 @@ export 'src/library.dart';
230230
);
231231
expect(library.qualifiedName, 'libraries');
232232
expect(library.name, 'libraries');
233-
expect(library.href, '${placeholder}public');
233+
expect(library.href, '${placeholder}public/');
234234
}
235235
}
236236

@@ -278,7 +278,7 @@ version: 0.0.1
278278

279279
expect(library.name, 'lib2');
280280
expect(library.qualifiedName, 'lib2');
281-
expect(library.href, '${placeholder}package-two_lib2');
281+
expect(library.href, '${placeholder}package-two_lib2/');
282282
expect(
283283
library.redirectingPath,
284284
'package-two_lib2/package-two_lib2-library.html',
@@ -292,7 +292,7 @@ version: 0.0.1
292292

293293
expect(library.name, 'lib2');
294294
expect(library.qualifiedName, 'lib2');
295-
expect(library.href, '${placeholder}package-two_lib2');
295+
expect(library.href, '${placeholder}package-two_lib2/');
296296
expect(
297297
library.redirectingPath,
298298
'package-two_lib2/package-two_lib2-library.html',
@@ -306,7 +306,7 @@ version: 0.0.1
306306

307307
expect(library.name, 'lib2');
308308
expect(library.qualifiedName, 'lib2');
309-
expect(library.href, '${placeholder}lib2');
309+
expect(library.href, '${placeholder}lib2/');
310310
expect(library.redirectingPath, 'lib2/lib2-library.html');
311311
}
312312
}

test/prefixes_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int x = 0;
3232
var x = library.properties.named('x');
3333
expect(
3434
x.documentationAsHtml,
35-
'<p>Text <a href="$dartAsyncUrlPrefix">async</a>.</p>',
35+
'<p>Text <a href="$dartAsyncUrlPrefix/">async</a>.</p>',
3636
);
3737
}
3838

test/search_index_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class C {}
8484
equals({
8585
'name': 'index_json',
8686
'kind': Kind.library.index,
87-
'href': '%%__HTMLBASE_dartdoc_internal__%%index_json',
87+
'href': '%%__HTMLBASE_dartdoc_internal__%%index_json/',
8888
}),
8989
);
9090
}

0 commit comments

Comments
 (0)