Skip to content

Commit d3e4237

Browse files
committed
fix an issue w/ references in dartdoc not being hyperlinked
1 parent 0ed6627 commit d3e4237

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+75
-65
lines changed

lib/src/markdown_processor.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,10 @@ class Documentation {
192192
// See https://github.com/dart-lang/markdown/commit/a7bf3dd
193193
e.classes.add('prettyprint');
194194

195-
// only "assume" the user intended dart if there are no other classes
196-
// present
197-
// TODO(kevmoo): This should be `language-dart`.
198-
// Waiting on pkg/markdown v0.10
199-
// See https://github.com/dart-lang/markdown/commit/a7bf3dd
195+
// Only "assume" the user intended dart if there are no other classes
196+
// present.
200197
if (e.classes.length == 1) {
201-
e.classes.add('lang-dart');
198+
e.classes.add('language-dart');
202199
}
203200
}
204201
var asHtml = asHtmlDocument.body.innerHtml;

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ packages:
120120
name: markdown
121121
url: "https://pub.dartlang.org"
122122
source: hosted
123-
version: "0.8.0"
123+
version: "0.10.1"
124124
matcher:
125125
description:
126126
name: matcher

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
collection: ^1.2.0
1414
html: ^0.12.1
1515
logging: '>=0.9.0 <0.12.0'
16-
markdown: ^0.8.0
16+
markdown: ^0.10.1
1717
mustache4dart: ^1.0.9
1818
path: ^1.3.0
1919
quiver: '>=0.18.0 <0.23.0'

testing/test_package/lib/example.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ class PublicClassImplementsPrivateInterface implements _PrivateInterface {
261261
void test() {}
262262
}
263263

264+
/// [Object] foo bar
265+
///
266+
/// 3. All references should be hyperlinks. [Object] [MyError] [ShapeType]
267+
/// [MyError] [MyException]
268+
/// [MyError] [MyException] [Object]
269+
/// [ShapeType] foo bar
264270
class ShapeType extends _RetainedEnum {
265271
static const ShapeType rect = const ShapeType._internal("Rect");
266272
static const ShapeType ellipse = const ShapeType._internal("Ellipse");

testing/test_package_docs/code_in_comments/code_in_comments-library.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ <h5><a href="index.html">test_package</a></h5>
8383
<div class="col-xs-12 col-sm-9 col-md-8 main-content">
8484

8585
<section class="desc markdown">
86-
<pre class="dart prettyprint"><code>void main() {
86+
<pre class="prettyprint language-dart"><code class="language-dart">void main() {
8787
// in Dart!
8888
}
8989
</code></pre>
90-
<pre class="yaml prettyprint"><code>and_yaml:
90+
<pre class="prettyprint language-dart"><code class="language-yaml">and_yaml:
9191
- value
9292
- "value"
9393
- 3.14

testing/test_package_docs/ex/Apple-class.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ <h5><a href="ex/ex-library.html">ex</a></h5>
136136
<div class="col-xs-12 col-sm-9 col-md-8 main-content">
137137

138138
<section class="desc markdown">
139-
<p>Sample class <code>String</code></p><pre class="prettyprint lang-dart"> A
139+
<p>Sample class <code>String</code></p><pre class="prettyprint language-dart"> A
140140
B
141141
</pre>
142142
</section>

testing/test_package_docs/ex/Apple/m1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
115115
</section>
116116
<section class="desc markdown">
117117
<p>This is a method.</p>
118-
<pre class="prettyprint lang-dart"><code>new Apple().m1();
118+
<pre class="prettyprint language-dart"><code>new Apple().m1();
119119
</code></pre>
120120
</section>
121121

testing/test_package_docs/ex/B-class.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h5><a href="ex/ex-library.html">ex</a></h5>
134134
<div class="col-xs-12 col-sm-9 col-md-8 main-content">
135135

136136
<section class="desc markdown">
137-
<p>Extends class <a href="ex/Apple-class.html">Apple</a>, use <a href="ex/Apple/Apple.html">new Apple</a> or <a href="ex/Apple/Apple.fromString.html">new Apple.fromString</a></p><pre class="prettyprint lang-dart"> B extends A
137+
<p>Extends class <a href="ex/Apple-class.html">Apple</a>, use <a href="ex/Apple/Apple.html">new Apple</a> or <a href="ex/Apple/Apple.fromString.html">new Apple.fromString</a></p><pre class="prettyprint language-dart"> B extends A
138138
B implements C
139139
</pre>
140140
</section>

testing/test_package_docs/ex/B/m1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ <h5><a href="ex/B-class.html">B</a></h5>
120120
</section>
121121
<section class="desc markdown">
122122
<p>This is a method.</p>
123-
<pre class="prettyprint lang-dart"><code>new Apple().m1();
123+
<pre class="prettyprint language-dart"><code>new Apple().m1();
124124
</code></pre>
125125
</section>
126126

testing/test_package_docs/ex/ShapeType-class.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ <h5><a href="ex/ex-library.html">ex</a></h5>
131131

132132
<div class="col-xs-12 col-sm-9 col-md-8 main-content">
133133

134+
<section class="desc markdown">
135+
<p><code>Object</code> foo bar</p><ol><li>
136+
<p>All references should be hyperlinks. <code>Object</code> <code>MyError</code> <a href="ex/ShapeType-class.html">ShapeType</a>
137+
<code>MyError</code> <code>MyException</code>
138+
<code>MyError</code> <code>MyException</code> <code>Object</code>
139+
<a href="ex/ShapeType-class.html">ShapeType</a> foo bar</p></li></ol>
140+
</section>
134141

135142

136143
<section class="summary offset-anchor" id="constants">

0 commit comments

Comments
 (0)