Index: utils/dartdoc/interact.dart |
diff --git a/utils/dartdoc/interact.dart b/utils/dartdoc/interact.dart |
index 81c7b226eaed098048c7b7283350095633a667f1..1aecdb2ba9bcb525ca84696811099eacb07f8a90 100644 |
--- a/utils/dartdoc/interact.dart |
+++ b/utils/dartdoc/interact.dart |
@@ -6,6 +6,10 @@ |
#library('interact'); |
#import('dart:html'); |
+#import('../../frog/lang.dart'); |
+#import('markdown.dart', prefix: 'md'); |
+ |
+#source('classify.dart'); |
main() { |
window.on.contentLoaded.add((e) { |
@@ -21,9 +25,14 @@ main() { |
if (pre.classes.contains('expanded')) { |
pre.classes.remove('expanded'); |
} else { |
+ // Syntax highlight. |
+ if (!pre.classes.contains('formatted')) { |
+ pre.innerHTML = classifySource(new SourceFile('', pre.text)); |
+ pre.classes.add('formatted'); |
+ }; |
pre.classes.add('expanded'); |
} |
}); |
} |
}); |
-} |
+} |