Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1637)

Side by Side Diff: app/lib/colored_markdown.dart

Issue 2341963009: pub site: update dependencies and fix analyzer (Closed)
Patch Set: better Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | app/lib/upload_signer_service.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub_dartlang_org.colored_markdown; 5 library pub_dartlang_org.colored_markdown;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:analyzer/analyzer.dart'; 9 import 'package:analyzer/analyzer.dart';
10 import 'package:analyzer/src/generated/scanner.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
11 import 'package:analyzer/src/dart/scanner/reader.dart';
12 import 'package:analyzer/src/dart/scanner/scanner.dart';
11 import 'package:analyzer/src/string_source.dart'; 13 import 'package:analyzer/src/string_source.dart';
12 import 'package:html/parser.dart' as html; 14 import 'package:html/parser.dart' as html;
13 import 'package:markdown/markdown.dart'; 15 import 'package:markdown/markdown.dart';
14 16
15 String markdownToHtml(String text) { 17 String markdownToHtml(String text) {
16 var lines = text.replaceAll('\r\n', '\n').split('\n'); 18 var lines = text.replaceAll('\r\n', '\n').split('\n');
17 var document = new Document(); 19 var document = new Document();
18 var blocks = document.parseLines(lines); 20 var blocks = document.parseLines(lines);
19 21
20 var colorizer = new ColorizeDartCode(); 22 var colorizer = new ColorizeDartCode();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 215
214 bool _isCodeElement(Element element) 216 bool _isCodeElement(Element element)
215 => element.tag == 'code' && 217 => element.tag == 'code' &&
216 element.attributes['class'] == 'language-dart' && 218 element.attributes['class'] == 'language-dart' &&
217 element.children.length == 1 && 219 element.children.length == 1 &&
218 element.children[0] is Text; 220 element.children[0] is Text;
219 221
220 Text _getSourceFromElement(Element element) 222 Text _getSourceFromElement(Element element)
221 => (element.children.first as Element).children.first as Text; 223 => (element.children.first as Element).children.first as Text;
222 } 224 }
OLDNEW
« no previous file with comments | « no previous file | app/lib/upload_signer_service.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698