Skip to content

Commit c7f1160

Browse files
authored
Fix sidebars via correct web API for anchor href values (#3934)
1 parent f8a55e4 commit c7f1160

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

lib/resources/docs.dart.js

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resources/docs.dart.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/model/directives/categorization.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ final RegExp _categoryRegExp =
1111
/// Mixin parsing the `@category` directive for ModelElements.
1212
mixin Categorization on DocumentationComment {
1313
@override
14-
String buildDocumentationAddition(String rawDocs) =>
15-
_stripAndSetDartdocCategories(super.buildDocumentationAddition(rawDocs));
14+
String buildDocumentationAddition(String docs) =>
15+
_stripAndSetDartdocCategories(super.buildDocumentationAddition(docs));
1616

1717
/// Parse `{@category ...}` and related information in API comments, stripping
1818
/// out that information from the given comments and returning the stripped

web/sidebars.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,14 @@ void _loadSidebar(
9797
/// if "base href" is not being used.
9898
void _updateLinks(String baseHref, Node node) {
9999
if (node.isA<HTMLAnchorElement>()) {
100-
final hrefString = (node as HTMLAnchorElement).href;
101-
final href = Uri.tryParse(hrefString);
100+
final hrefValue =
101+
(node as HTMLAnchorElement).attributes.getNamedItem('href')?.value;
102+
if (hrefValue == null) {
103+
return;
104+
}
105+
final href = Uri.tryParse(hrefValue);
102106
if (href != null && !href.isAbsolute) {
103-
node.href = '$baseHref$hrefString';
107+
node.href = '$baseHref$hrefValue';
104108
}
105109
}
106110

web/sig.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
45250896CEC08BF6C3F52F3320C7E033
1+
22A0DF76266C40F6C6821F473937789F

0 commit comments

Comments
 (0)