Skip to content

Commit 5aebd24

Browse files
committed
tweak code fonts
1 parent ee64586 commit 5aebd24

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

lib/markdown_processor.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Documentation {
6969
String tempHtml = renderMarkdownToHtml(raw, element);
7070
_asHtmlDocument = parse(tempHtml);
7171
_asHtmlDocument.querySelectorAll('script').forEach((s) => s.remove());
72-
_asHtmlDocument.querySelectorAll('code').forEach((e) {
72+
_asHtmlDocument.querySelectorAll('pre').forEach((e) {
7373
e.classes.addAll(['prettyprint', 'lang-dart']);
7474
});
7575
_asHtml = _asHtmlDocument.body.innerHtml;
@@ -98,9 +98,9 @@ class _InlineCodeSyntax extends md.InlineSyntax {
9898
@override
9999
bool onMatch(md.InlineParser parser, Match match) {
100100
var element = new md.Element.text('code', htmlEscape(match[1]));
101-
var c = element.attributes.putIfAbsent("class", () => "");
102-
c = (c.isEmpty ? "" : " ") + "prettyprint";
103-
element.attributes["class"] = c;
101+
// var c = element.attributes.putIfAbsent("class", () => "");
102+
// c = (c.isEmpty ? "" : " ") + "prettyprint";
103+
// element.attributes["class"] = c;
104104
parser.addNode(element);
105105
return true;
106106
}
@@ -124,7 +124,9 @@ NodeList<CommentReference> _getCommentRefs(ModelElement modelElement) {
124124
if (modelElement.element.node is AnnotatedNode) {
125125
if ((modelElement.element.node as AnnotatedNode).documentationComment !=
126126
null) {
127-
return (modelElement.element.node as AnnotatedNode).documentationComment.references;
127+
return (modelElement.element.node as AnnotatedNode)
128+
.documentationComment
129+
.references;
128130
}
129131
} else if (modelElement.element is LibraryElement) {
130132
// handle anonymous libraries

lib/resources/styles.css

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ a, a:hover {
122122
color: #1976D2;
123123
}
124124

125-
pre {
125+
pre.prettyprint {
126126
font-family: 'Source Code Pro', monospace;
127127
color: black;
128128
border-radius: 4px;
@@ -146,11 +146,8 @@ pre code {
146146
code {
147147
font-family: 'Source Code Pro', monospace;
148148
/* overriding bootstrap */
149-
font-size: 15px;
150149
color: inherit;
151-
border-radius: 0;
152-
padding: 0;
153-
background-color: inherit;
150+
background-color: #f7f7f7;
154151
}
155152

156153
@media(max-width: 768px) {

0 commit comments

Comments
 (0)