Skip to content

Commit

Permalink
Additional block tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
dikmax committed Nov 23, 2016
1 parent 29ec7c1 commit 2e96496
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 5 deletions.
7 changes: 6 additions & 1 deletion lib/src/parsers/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final Pattern _htmlBlock3Test = '<?';
final Pattern _htmlBlock4Test = '<!';
final Pattern _htmlBlock5Test = '<!\[CDATA\[';
final Pattern _htmlBlock6Test = new RegExp(
r'</?([a-zA-Z1]+)(?:\s|/?>|$)',
r'</?([a-zA-Z1-6]+)(?:\s|/?>|$)',
);
final Set<String> _blockTags = new Set<String>.from(<String>[
'address',
Expand Down Expand Up @@ -52,6 +52,11 @@ final Set<String> _blockTags = new Set<String>.from(<String>[
'frame',
'frameset',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'head',
'header',
'hr',
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: md_proc
version: 0.10.1
version: 0.10.2
description: Fast CommonMark-compliant markdown parser
author: Maxim Dikun <[email protected]>
homepage: https://github.com/dikmax/md_proc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,76 @@ Test additional cases for inner links
<p><a href="/uri">foo <sub>[bar]</sub></a></p>
````````````````````````````````

Tests for raw html blocks

```````````````````````````````` example
<h1></h1>
``` c
int x = 33;
```
.
<h1></h1>
``` c
int x = 33;
```
````````````````````````````````

```````````````````````````````` example
<h2></h2>
``` c
int x = 33;
```
.
<h2></h2>
``` c
int x = 33;
```
````````````````````````````````

```````````````````````````````` example
<h3></h3>
``` c
int x = 33;
```
.
<h3></h3>
``` c
int x = 33;
```
````````````````````````````````

```````````````````````````````` example
<h4></h4>
``` c
int x = 33;
```
.
<h4></h4>
``` c
int x = 33;
```
````````````````````````````````

```````````````````````````````` example
<h5></h5>
``` c
int x = 33;
```
.
<h5></h5>
``` c
int x = 33;
```
````````````````````````````````

```````````````````````````````` example
<h6></h6>
``` c
int x = 33;
```
.
<h6></h6>
``` c
int x = 33;
```
````````````````````````````````
File renamed without changes.
4 changes: 2 additions & 2 deletions test/data/test_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ final Map<String, String> smartPunctuation = _$smartPunctuationTests;
final Map<String, String> regression = _$regressionTests;

/// Additional md->md tests
@EmbedTests('markdownToMarkdown.txt')
@EmbedTests('markdown_markdown.txt')
final Map<String, String> markdownToMarkdown = _$markdownToMarkdownTests;

/// Additional md->html tests
@EmbedTests('additionalMarkdownToHtml.txt')
@EmbedTests('additional.txt')
final Map<String, String> additionalMarkdownToHtml =
_$additionalMarkdownToHtmlTests;

Expand Down
54 changes: 54 additions & 0 deletions test/data/test_data.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion test/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ void serviceTests() {
attr2.add('key2', 'value2');

t.test('toString', () {
t.expect(attr.toString(), t.equals('Attributes(#id .class1 .class2 key1=value1 key2=value2)'));
t.expect(
attr.toString(),
t.equals(
'Attributes(#id .class1 .class2 key1=value1 key2=value2)'));
});
t.test('==', () {
t.expect(
Expand Down

0 comments on commit 2e96496

Please sign in to comment.