File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1182,6 +1182,21 @@ void main() {
1182
1182
expect (docsAsHtml,
1183
1183
contains ('<code>ThisIsNotHereNoWay<MyType></code>' ));
1184
1184
});
1185
+
1186
+ test ('leaves relative href resulting in a broken link' , () {
1187
+ // Dartdoc does emit a brokenLink warning for this.
1188
+ expect (docsAsHtml,
1189
+ contains ('<a href="SubForDocComments/localMethod.html">link</a>' ));
1190
+ });
1191
+
1192
+ test ('leaves relative href resulting in a working link' , () {
1193
+ // Ideally doc comments should not make assumptions about Dartdoc output
1194
+ // files, but unfortunately some do...
1195
+ expect (
1196
+ docsAsHtml,
1197
+ contains (
1198
+ '<a href="../SubForDocComments/localMethod.html">link</a>' ));
1199
+ });
1185
1200
});
1186
1201
1187
1202
test ('multi-underscore names in brackets do not become italicized' , () {
Original file line number Diff line number Diff line change @@ -887,6 +887,10 @@ class BaseForDocComments {
887
887
/// Reference containing a type parameter [ExtraSpecialList<Object>]
888
888
///
889
889
/// Reference to something that doesn't exist containing a type parameter [ThisIsNotHereNoWay<MyType>]
890
+ ///
891
+ /// Link to a nonexistent file (erroneously expects base href): [link] (SubForDocComments/localMethod.html)
892
+ ///
893
+ /// Link to an existing file: [link] (../SubForDocComments/localMethod.html)
890
894
String doAwesomeStuff (int value) => null ;
891
895
892
896
void anotherMethod () {}
You can’t perform that action at this time.
0 commit comments