├── ruby ├── Gemfile ├── server.rb └── Gemfile.lock ├── tests ├── 5.html ├── 1.html ├── 2.html ├── 3.html ├── 6.html ├── 7.html ├── 8.html ├── 4.html ├── 10.html ├── 9.html ├── 13.html ├── 12.html ├── 11.html ├── 14.html ├── 5.json ├── 1.json ├── 4.json ├── 7.json ├── 2.json ├── 3.json ├── 6.json ├── 8.json ├── 10.json ├── 9.json ├── 11.json ├── 13.json ├── 14.json └── 12.json ├── README.md ├── LICENSE ├── results ├── results.php ├── output.json └── results.html └── run.php /ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org/' 2 | 3 | gem 'sinatra' 4 | gem 'microformats' 5 | gem 'puma' 6 | -------------------------------------------------------------------------------- /tests/5.html: -------------------------------------------------------------------------------- 1 |
2 |
Hello 3 | World
4 |
5 | -------------------------------------------------------------------------------- /tests/1.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello World

3 |
4 | -------------------------------------------------------------------------------- /tests/2.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello
World

3 |
4 | -------------------------------------------------------------------------------- /tests/3.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello
3 | World

4 |
5 | -------------------------------------------------------------------------------- /tests/6.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello

World

3 |
4 | -------------------------------------------------------------------------------- /tests/7.html: -------------------------------------------------------------------------------- 1 |
2 |
Hello
3 | World
4 |
5 | -------------------------------------------------------------------------------- /tests/8.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello
World
3 |
4 | -------------------------------------------------------------------------------- /tests/4.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Hello World

4 |
5 |
6 | -------------------------------------------------------------------------------- /tests/10.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
one
4 | two
5 | three
6 |
7 |
8 | -------------------------------------------------------------------------------- /tests/9.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

One

4 |

Two

5 |

Three

6 |
7 |
8 | -------------------------------------------------------------------------------- /ruby/server.rb: -------------------------------------------------------------------------------- 1 | require 'sinatra' 2 | require 'microformats' 3 | 4 | post "/parse" do 5 | doc = Microformats.parse(params[:html]) 6 | JSON.pretty_generate(doc.to_h) 7 | end 8 | -------------------------------------------------------------------------------- /tests/13.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Hello World
4 |       one
5 |       two
6 |       three
And Hello Mars! 7 |
8 |
-------------------------------------------------------------------------------- /tests/12.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Correct name 4 | 5 | Correct summary 6 |
7 | 8 | -------------------------------------------------------------------------------- /tests/11.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Hello World 4 |
 5 |       one
 6 |       two
 7 |       three
 8 |     
9 |
10 |
11 | -------------------------------------------------------------------------------- /tests/14.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Hello World

4 |
5 |       one
6 |       two
7 |       three

And Hello Mars!

8 |
9 |
-------------------------------------------------------------------------------- /tests/5.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello World" 10 | ], 11 | "content": [ 12 | { 13 | "html": "Hello\nWorld", 14 | "value": "Hello World" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello World" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

Hello World

", 14 | "value": "Hello World" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello World" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

Hello World

", 14 | "value": "Hello World" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/7.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello\nWorld" 10 | ], 11 | "content": [ 12 | { 13 | "html": "Hello
\n World", 14 | "value": "Hello\nWorld" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello\nWorld" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

Hello
World

", 14 | "value": "Hello\nWorld" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/3.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello\nWorld" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

Hello
\nWorld

", 14 | "value": "Hello\nWorld" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/6.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello\nWorld" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

Hello

World

", 14 | "value": "Hello\nWorld" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/8.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello\nWorld" 10 | ], 11 | "content": [ 12 | { 13 | "html": "
Hello
World
", 14 | "value": "Hello\nWorld" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/10.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "one\ntwo\nthree" 10 | ], 11 | "content": [ 12 | { 13 | "html": "
one\ntwo\nthree
", 14 | "value": "one\ntwo\nthree" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/9.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "One\nTwo\nThree" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

One

\n

Two

\n

Three

", 14 | "value": "One\nTwo\nThree" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/11.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello World\n one\n two\n three" 10 | ], 11 | "content": [ 12 | { 13 | "html": "Hello World\n
      one\n      two\n      three\n    
", 14 | "value": "Hello World\n one\n two\n three" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ruby/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | json (2.1.0) 5 | microformats (4.0.7) 6 | json 7 | nokogiri 8 | mini_portile2 (2.3.0) 9 | mustermann (1.0.2) 10 | nokogiri (1.8.2) 11 | mini_portile2 (~> 2.3.0) 12 | puma (3.11.2) 13 | rack (2.0.4) 14 | rack-protection (2.0.1) 15 | rack 16 | sinatra (2.0.1) 17 | mustermann (~> 1.0) 18 | rack (~> 2.0) 19 | rack-protection (= 2.0.1) 20 | tilt (~> 2.0) 21 | tilt (2.0.8) 22 | 23 | PLATFORMS 24 | ruby 25 | 26 | DEPENDENCIES 27 | microformats 28 | puma 29 | sinatra 30 | 31 | BUNDLED WITH 32 | 1.16.0 33 | -------------------------------------------------------------------------------- /tests/13.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello World\n one\n two\n three\nAnd Hello Mars" 10 | ], 11 | "content": [ 12 | { 13 | "html": "Hello World
\n      one\n      two\n      three\n    
And Hello Mars", 14 | "value": "Hello World\n one\n two\n three\nAnd Hello Mars" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/14.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Hello World\n one\n two\n three\nAnd Hello Mars" 10 | ], 11 | "content": [ 12 | { 13 | "html": "

Hello World

\n
\n      one\n      two\n      three\n    

And Hello Mars

", 14 | "value": "Hello World\n one\n two\n three\nAnd Hello Mars" 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/12.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "type": [ 5 | "h-entry" 6 | ], 7 | "properties": { 8 | "name": [ 9 | "Correct name" 10 | ], 11 | "summary": [ 12 | "Correct summary" 13 | ], 14 | "content": [ 15 | { 16 | "html": "Correct name\n\nCorrect summary", 17 | "value": "Correct name Correct summary" 18 | } 19 | ] 20 | } 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Microformats Blankspace Tests 2 | ============================= 3 | 4 | Some test cases for blank space handling in Microformats. 5 | 6 | More details: 7 | 8 | * https://github.com/microformats/microformats2-parsing/issues/15 9 | * https://github.com/microformats/microformats2-parsing/issues/48 10 | 11 | 12 | Test Results 13 | ------------ 14 | 15 | https://pin13.net/mf2/blankspace.html 16 | 17 | 18 | Compiling Results 19 | ----------------- 20 | 21 | Run the parser against all the tests by running: 22 | 23 | ``` 24 | php run.php 25 | ``` 26 | 27 | That will send the test HTML to each parser, and store the results in `results/output.json`. It will also compile the results into an HTML file `results/results.html` which you can view in a browser. 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /results/results.php: -------------------------------------------------------------------------------- 1 | and
to
for comparing equality 13 | return str_replace(['
','
'], '
', $input); 14 | } 15 | 16 | ob_start(); 17 | ?> 18 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | $test): ?> 69 | $prop): ?> 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 |
TestHTMLPropertyExpectedPHPRubyPythonGoNode
85 | ]*>(.+)~ms', $response, $match)) { 14 | $data = json_decode(htmlspecialchars_decode($match[1]), true); 15 | return $data['items'][0]['properties']; 16 | } 17 | } 18 | return false; 19 | } 20 | 21 | function get($url) { 22 | $ch = curl_init($url); 23 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 24 | curl_setopt($ch, CURLOPT_REFERER, 'https://github.com/aaronpk/microformats-blankspace-tests'); 25 | $response = curl_exec($ch); 26 | $data = json_decode($response, true); 27 | if($data && isset($data['items'][0]['properties'])) { 28 | return $data['items'][0]['properties']; 29 | } 30 | return false; 31 | } 32 | 33 | function get_parsed_result($parser, $html, $num=false) { 34 | switch($parser) { 35 | case 'python': 36 | $url = 'https://python.microformats.io/'; 37 | $param = 'doc'; 38 | // $url = 'https://kartikprabhu.com/connection/mfparser'; 39 | // $param = 'content'; 40 | break; 41 | case 'ruby': 42 | $url = 'http://localhost:4567/parse'; 43 | $param = 'html'; 44 | break; 45 | case 'php': 46 | $url = 'https://mf2.io.dev/mf2/'; 47 | $param = 'html'; 48 | break; 49 | case 'go': 50 | $url = 'https://go.microformats.io/'; 51 | $param = 'html'; 52 | break; 53 | case 'node': 54 | $url = 'https://sturdy-backbone.glitch.me/mf2/?url=https://raw.githubusercontent.com/aaronpk/microformats-blankspace-tests/main/tests/%.html'; 55 | break; 56 | } 57 | 58 | echo "\tRunning $parser\n"; 59 | if($num) { 60 | $response = get(str_replace('%', $num, $url)); 61 | } else { 62 | $response = post($url, [$param => $html, 'format'=>'json']); 63 | } 64 | 65 | return [ 66 | 'name' => $response['name'][0], 67 | 'content.value' => $response['content'][0]['value'], 68 | 'content.html' => $response['content'][0]['html'], 69 | ]; 70 | } 71 | 72 | chdir(__DIR__); 73 | $tests = glob('tests/*.html'); 74 | 75 | usort($tests, function($a, $b) { 76 | preg_match('/(\d+)/', $a, $ma); 77 | preg_match('/(\d+)/', $b, $mb); 78 | return (int)$ma[1] > (int)$mb[1]; 79 | }); 80 | 81 | $data = []; 82 | 83 | foreach($tests as $htmlfile) { 84 | $num = str_replace('.html', '', basename($htmlfile)); 85 | $html = file_get_contents($htmlfile); 86 | $jsonfile = str_replace('.html', '.json', $htmlfile); 87 | $json = json_decode(file_get_contents($jsonfile), true); 88 | $expected = [ 89 | 'name' => $json['items'][0]['properties']['name'][0], 90 | 'content.value' => $json['items'][0]['properties']['content'][0]['value'], 91 | 'content.html' => $json['items'][0]['properties']['content'][0]['html'], 92 | ]; 93 | 94 | // $python = get_parsed_result('python', $html); 95 | // print_r($python); 96 | // die(); 97 | 98 | echo "Testing $htmlfile\n"; 99 | $php = get_parsed_result('php', $html); 100 | $ruby = get_parsed_result('ruby', $html); 101 | $python = get_parsed_result('python', $html); 102 | $go = get_parsed_result('go', $html); 103 | $node = get_parsed_result('node', $html, $num); 104 | 105 | $data[] = [ 106 | 'test' => $num, 107 | 'expected' => $expected, 108 | 'php' => $php, 109 | 'ruby' => $ruby, 110 | 'python' => $python, 111 | 'go' => $go, 112 | 'node' => $node, 113 | ]; 114 | } 115 | 116 | file_put_contents('results/output.json', json_encode($data, JSON_PRETTY_PRINT+JSON_UNESCAPED_SLASHES)); 117 | 118 | require('results/results.php'); 119 | 120 | -------------------------------------------------------------------------------- /results/output.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "test": "1", 4 | "expected": { 5 | "name": "Hello World", 6 | "content.value": "Hello World", 7 | "content.html": "

Hello World

" 8 | }, 9 | "php": { 10 | "name": "Hello World", 11 | "content.value": "Hello World", 12 | "content.html": "

Hello World

" 13 | }, 14 | "ruby": { 15 | "name": "Hello World", 16 | "content.value": "Hello World", 17 | "content.html": "

Hello World

" 18 | }, 19 | "python": { 20 | "name": "Hello World", 21 | "content.value": "Hello World", 22 | "content.html": "

Hello World

" 23 | }, 24 | "go": { 25 | "name": "Hello World", 26 | "content.value": "Hello World", 27 | "content.html": "

Hello World

" 28 | }, 29 | "node": { 30 | "name": "Hello World", 31 | "content.value": "Hello World", 32 | "content.html": "

Hello World

" 33 | } 34 | }, 35 | { 36 | "test": "2", 37 | "expected": { 38 | "name": "Hello\nWorld", 39 | "content.value": "Hello\nWorld", 40 | "content.html": "

Hello
World

" 41 | }, 42 | "php": { 43 | "name": "Hello\nWorld", 44 | "content.value": "Hello\nWorld", 45 | "content.html": "

Hello
World

" 46 | }, 47 | "ruby": { 48 | "name": "HelloWorld", 49 | "content.value": "HelloWorld", 50 | "content.html": "

Hello
World

" 51 | }, 52 | "python": { 53 | "name": "HelloWorld", 54 | "content.value": "HelloWorld", 55 | "content.html": "

Hello
World

" 56 | }, 57 | "go": { 58 | "name": "HelloWorld", 59 | "content.value": "HelloWorld", 60 | "content.html": "

Hello
World

" 61 | }, 62 | "node": { 63 | "name": "HelloWorld", 64 | "content.value": "HelloWorld", 65 | "content.html": "

Hello
World

" 66 | } 67 | }, 68 | { 69 | "test": "3", 70 | "expected": { 71 | "name": "Hello\nWorld", 72 | "content.value": "Hello\nWorld", 73 | "content.html": "

Hello
\nWorld

" 74 | }, 75 | "php": { 76 | "name": "Hello\nWorld", 77 | "content.value": "Hello\nWorld", 78 | "content.html": "

Hello
\nWorld

" 79 | }, 80 | "ruby": { 81 | "name": "Hello\nWorld", 82 | "content.value": "Hello\nWorld", 83 | "content.html": "

Hello
\nWorld

" 84 | }, 85 | "python": { 86 | "name": "Hello\nWorld", 87 | "content.value": "Hello\nWorld", 88 | "content.html": "

Hello
\nWorld

" 89 | }, 90 | "go": { 91 | "name": "Hello\nWorld", 92 | "content.value": "Hello\nWorld", 93 | "content.html": "

Hello
\nWorld

" 94 | }, 95 | "node": { 96 | "name": "Hello\nWorld", 97 | "content.value": "Hello\nWorld", 98 | "content.html": "

Hello
\nWorld

" 99 | } 100 | }, 101 | { 102 | "test": "4", 103 | "expected": { 104 | "name": "Hello World", 105 | "content.value": "Hello World", 106 | "content.html": "

Hello World

" 107 | }, 108 | "php": { 109 | "name": "Hello World", 110 | "content.value": "Hello World", 111 | "content.html": "

Hello World

" 112 | }, 113 | "ruby": { 114 | "name": "Hello World", 115 | "content.value": "Hello World", 116 | "content.html": "\n

Hello World

\n" 117 | }, 118 | "python": { 119 | "name": "Hello World", 120 | "content.value": "\n Hello World\n ", 121 | "content.html": "\n

Hello World

\n " 122 | }, 123 | "go": { 124 | "name": "Hello World", 125 | "content.value": "\n Hello World\n ", 126 | "content.html": "

Hello World

" 127 | }, 128 | "node": { 129 | "name": "Hello World", 130 | "content.value": "Hello World", 131 | "content.html": "\n

Hello World

\n " 132 | } 133 | }, 134 | { 135 | "test": "5", 136 | "expected": { 137 | "name": "Hello World", 138 | "content.value": "Hello World", 139 | "content.html": "Hello\nWorld" 140 | }, 141 | "php": { 142 | "name": "Hello World", 143 | "content.value": "Hello World", 144 | "content.html": "Hello\nWorld" 145 | }, 146 | "ruby": { 147 | "name": "Hello\nWorld", 148 | "content.value": "Hello\nWorld", 149 | "content.html": "Hello\nWorld" 150 | }, 151 | "python": { 152 | "name": "Hello\nWorld", 153 | "content.value": "Hello\nWorld", 154 | "content.html": "Hello\nWorld" 155 | }, 156 | "go": { 157 | "name": "Hello\nWorld", 158 | "content.value": "Hello\nWorld", 159 | "content.html": "Hello\nWorld" 160 | }, 161 | "node": { 162 | "name": "Hello\nWorld", 163 | "content.value": "Hello\nWorld", 164 | "content.html": "Hello\nWorld" 165 | } 166 | }, 167 | { 168 | "test": "6", 169 | "expected": { 170 | "name": "Hello\nWorld", 171 | "content.value": "Hello\nWorld", 172 | "content.html": "

Hello

World

" 173 | }, 174 | "php": { 175 | "name": "Hello\nWorld", 176 | "content.value": "Hello\nWorld", 177 | "content.html": "

Hello

World

" 178 | }, 179 | "ruby": { 180 | "name": "Hello\nWorld", 181 | "content.value": "Hello\nWorld", 182 | "content.html": "

Hello

\n

World

" 183 | }, 184 | "python": { 185 | "name": "HelloWorld", 186 | "content.value": "HelloWorld", 187 | "content.html": "

Hello

World

" 188 | }, 189 | "go": { 190 | "name": "HelloWorld", 191 | "content.value": "HelloWorld", 192 | "content.html": "

Hello

World

" 193 | }, 194 | "node": { 195 | "name": "HelloWorld", 196 | "content.value": "HelloWorld", 197 | "content.html": "

Hello

World

" 198 | } 199 | }, 200 | { 201 | "test": "7", 202 | "expected": { 203 | "name": "Hello\nWorld", 204 | "content.value": "Hello\nWorld", 205 | "content.html": "Hello
\n World" 206 | }, 207 | "php": { 208 | "name": "Hello\nWorld", 209 | "content.value": "Hello\nWorld", 210 | "content.html": "Hello
\n World" 211 | }, 212 | "ruby": { 213 | "name": "Hello\n World", 214 | "content.value": "Hello\n World", 215 | "content.html": "Hello
\n World" 216 | }, 217 | "python": { 218 | "name": "Hello\n World", 219 | "content.value": "Hello\n World", 220 | "content.html": "Hello
\n World" 221 | }, 222 | "go": { 223 | "name": "Hello\n World", 224 | "content.value": "Hello\n World", 225 | "content.html": "Hello
\n World" 226 | }, 227 | "node": { 228 | "name": "Hello\n World", 229 | "content.value": "Hello\n World", 230 | "content.html": "Hello
\n World" 231 | } 232 | }, 233 | { 234 | "test": "8", 235 | "expected": { 236 | "name": "Hello\nWorld", 237 | "content.value": "Hello\nWorld", 238 | "content.html": "
Hello
World
" 239 | }, 240 | "php": { 241 | "name": "Hello\nWorld", 242 | "content.value": "Hello\nWorld", 243 | "content.html": "
Hello
World
" 244 | }, 245 | "ruby": { 246 | "name": "HelloWorld", 247 | "content.value": "HelloWorld", 248 | "content.html": "
Hello
World
" 249 | }, 250 | "python": { 251 | "name": "HelloWorld", 252 | "content.value": "HelloWorld", 253 | "content.html": "
Hello
World
" 254 | }, 255 | "go": { 256 | "name": "HelloWorld", 257 | "content.value": "HelloWorld", 258 | "content.html": "
Hello
World
" 259 | }, 260 | "node": { 261 | "name": "HelloWorld", 262 | "content.value": "HelloWorld", 263 | "content.html": "
Hello
World
" 264 | } 265 | }, 266 | { 267 | "test": "9", 268 | "expected": { 269 | "name": "One\nTwo\nThree", 270 | "content.value": "One\nTwo\nThree", 271 | "content.html": "

One

\n

Two

\n

Three

" 272 | }, 273 | "php": { 274 | "name": "One\nTwo\nThree", 275 | "content.value": "One\nTwo\nThree", 276 | "content.html": "

One

\n

Two

\n

Three

" 277 | }, 278 | "ruby": { 279 | "name": "One\n Two\n Three", 280 | "content.value": "One\n Two\n Three", 281 | "content.html": "\n

One

\n

Two

\n

Three

\n" 282 | }, 283 | "python": { 284 | "name": "One\n Two\n Three", 285 | "content.value": "\n One\n Two\n Three\n ", 286 | "content.html": "\n

One

\n

Two

\n

Three

\n " 287 | }, 288 | "go": { 289 | "name": "One\n Two\n Three", 290 | "content.value": "\n One\n Two\n Three\n ", 291 | "content.html": "

One

\n

Two

\n

Three

" 292 | }, 293 | "node": { 294 | "name": "One\n Two\n Three", 295 | "content.value": "One\n Two\n Three", 296 | "content.html": "\n

One

\n

Two

\n

Three

\n " 297 | } 298 | }, 299 | { 300 | "test": "10", 301 | "expected": { 302 | "name": "one\ntwo\nthree", 303 | "content.value": "one\ntwo\nthree", 304 | "content.html": "
one\ntwo\nthree
" 305 | }, 306 | "php": { 307 | "name": "one two three", 308 | "content.value": "one two three", 309 | "content.html": "
one\ntwo\nthree
" 310 | }, 311 | "ruby": { 312 | "name": "one\ntwo\nthree", 313 | "content.value": "one\ntwo\nthree", 314 | "content.html": "\n
one\ntwo\nthree
\n" 315 | }, 316 | "python": { 317 | "name": "one\ntwo\nthree", 318 | "content.value": "\n one\ntwo\nthree\n ", 319 | "content.html": "\n
one\ntwo\nthree
\n " 320 | }, 321 | "go": { 322 | "name": "one\ntwo\nthree", 323 | "content.value": "\n one\ntwo\nthree\n ", 324 | "content.html": "
one\ntwo\nthree
" 325 | }, 326 | "node": { 327 | "name": "one\ntwo\nthree", 328 | "content.value": "one\ntwo\nthree", 329 | "content.html": "\n
one\ntwo\nthree
\n " 330 | } 331 | }, 332 | { 333 | "test": "11", 334 | "expected": { 335 | "name": "Hello World\n one\n two\n three", 336 | "content.value": "Hello World\n one\n two\n three", 337 | "content.html": "Hello World\n
\n      one\n      two\n      three\n    
" 338 | }, 339 | "php": { 340 | "name": "Hello World one two three", 341 | "content.value": "Hello World one two three", 342 | "content.html": "Hello World\n
\n      one\n      two\n      three\n    
" 343 | }, 344 | "ruby": { 345 | "name": "Hello World\n \n one\n two\n three", 346 | "content.value": "Hello World\n \n one\n two\n three", 347 | "content.html": "\n Hello World\n
\n      one\n      two\n      three\n    
\n" 348 | }, 349 | "python": { 350 | "name": "Hello World\n one\n two\n three", 351 | "content.value": "\n Hello World\n one\n two\n three\n \n ", 352 | "content.html": "\n Hello World\n
      one\n      two\n      three\n    
\n " 353 | }, 354 | "go": { 355 | "name": "Hello World\n one\n two\n three", 356 | "content.value": "\n Hello World\n one\n two\n three\n \n ", 357 | "content.html": "Hello World\n
      one\n      two\n      three\n    
" 358 | }, 359 | "node": { 360 | "name": "Hello World\n \n one\n two\n three", 361 | "content.value": "Hello World\n \n one\n two\n three", 362 | "content.html": "\n Hello World\n
\n      one\n      two\n      three\n    
\n " 363 | } 364 | }, 365 | { 366 | "test": "12", 367 | "expected": { 368 | "name": "Correct name", 369 | "content.value": "Correct name Correct summary", 370 | "content.html": "Correct name\n\nCorrect summary" 371 | }, 372 | "php": { 373 | "name": "Correct name", 374 | "content.value": "Correct name Correct summary", 375 | "content.html": "Correct name\n\nCorrect summary" 376 | }, 377 | "ruby": { 378 | "name": "Correct name", 379 | "content.value": "Correct name\n\nCorrect summary", 380 | "content.html": "\nCorrect name\n\nCorrect summary\n" 381 | }, 382 | "python": { 383 | "name": "Correct name", 384 | "content.value": "\nCorrect name\n\nCorrect summary\n", 385 | "content.html": "\nCorrect name\n\nCorrect summary\n" 386 | }, 387 | "go": { 388 | "name": "Correct name", 389 | "content.value": "\nCorrect name\n\nCorrect summary\n", 390 | "content.html": "Correct name\n\nCorrect summary" 391 | }, 392 | "node": { 393 | "name": "Correct name", 394 | "content.value": "Correct name\n\nCorrect summary", 395 | "content.html": "\nCorrect name\n\nCorrect summary\n" 396 | } 397 | } 398 | ] -------------------------------------------------------------------------------- /results/results.html: -------------------------------------------------------------------------------- 1 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 |
TestHTMLPropertyExpectedPHPRubyPythonGoNode
1
<div class="h-entry">
 54 |   <div class="e-content p-name"><p>Hello World</p></div>
 55 | </div>
 56 | 
name
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
content.value
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
content.html
<p>Hello World</p>
<p>Hello World</p>
<p>Hello World</p>
<p>Hello World</p>
<p>Hello World</p>
<p>Hello World</p>
2
<div class="h-entry">
 86 |   <div class="e-content p-name"><p>Hello<br>World</p></div>
 87 | </div>
 88 | 
name
Hello\nWorld
Hello\nWorld
HelloWorld
HelloWorld
HelloWorld
HelloWorld
content.value
Hello\nWorld
Hello\nWorld
HelloWorld
HelloWorld
HelloWorld
HelloWorld
content.html
<p>Hello<br>World</p>
<p>Hello<br>World</p>
<p>Hello<br>World</p>
<p>Hello<br/>World</p>
<p>Hello<br/>World</p>
<p>Hello<br />World</p>
3
<div class="h-entry">
118 |   <div class="e-content p-name"><p>Hello<br>
119 | World</p></div>
120 | </div>
121 | 
name
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
content.value
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
content.html
<p>Hello<br>\nWorld</p>
<p>Hello<br>\nWorld</p>
<p>Hello<br>\nWorld</p>
<p>Hello<br/>\nWorld</p>
<p>Hello<br/>\nWorld</p>
<p>Hello<br />\nWorld</p>
4
<div class="h-entry">
151 |   <div class="e-content p-name">
152 |     <p>Hello World</p>
153 |   </div>
154 | </div>
155 | 
name
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
content.value
Hello World
Hello World
Hello World
\n    Hello World\n  
\n    Hello World\n  
Hello World
content.html
<p>Hello World</p>
<p>Hello World</p>
\n    <p>Hello World</p>\n
\n    <p>Hello World</p>\n  
<p>Hello World</p>
\n    <p>Hello World</p>\n  
5
<div class="h-entry">
185 |   <div class="e-content p-name">Hello
186 | World</div>
187 | </div>
188 | 
name
Hello World
Hello World
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
content.value
Hello World
Hello World
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
content.html
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
Hello\nWorld
6
<div class="h-entry">
218 |   <div class="e-content p-name"><p>Hello</p><p>World</p></div>
219 | </div>
220 | 
name
Hello\nWorld
Hello\nWorld
Hello\nWorld
HelloWorld
HelloWorld
HelloWorld
content.value
Hello\nWorld
Hello\nWorld
Hello\nWorld
HelloWorld
HelloWorld
HelloWorld
content.html
<p>Hello</p><p>World</p>
<p>Hello</p><p>World</p>
<p>Hello</p>\n<p>World</p>
<p>Hello</p><p>World</p>
<p>Hello</p><p>World</p>
<p>Hello</p><p>World</p>
7
<div class="h-entry">
250 |   <div class="e-content p-name">Hello<br>
251 |     World</div>
252 | </div>
253 | 
name
Hello\nWorld
Hello\nWorld
Hello\n    World
Hello\n    World
Hello\n    World
Hello\n    World
content.value
Hello\nWorld
Hello\nWorld
Hello\n    World
Hello\n    World
Hello\n    World
Hello\n    World
content.html
Hello<br>\n    World
Hello<br>\n    World
Hello<br>\n    World
Hello<br/>\n    World
Hello<br/>\n    World
Hello<br />\n    World
8
<div class="h-entry">
283 |   <div class="e-content p-name"><br>Hello<br>World<br></div>
284 | </div>
285 | 
name
Hello\nWorld
Hello\nWorld
HelloWorld
HelloWorld
HelloWorld
HelloWorld
content.value
Hello\nWorld
Hello\nWorld
HelloWorld
HelloWorld
HelloWorld
HelloWorld
content.html
<br>Hello<br>World<br>
<br>Hello<br>World<br>
<br>Hello<br>World<br>
<br/>Hello<br/>World<br/>
<br/>Hello<br/>World<br/>
<br />Hello<br />World<br />
9
<div class="h-entry">
315 |   <div class="e-content p-name">
316 |     <p>One</p>
317 |     <p>Two</p>
318 |     <p>Three</p>
319 |   </div>
320 | </div>
321 | 
name
One\nTwo\nThree
One\nTwo\nThree
One\n    Two\n    Three
One\n    Two\n    Three
One\n    Two\n    Three
One\n    Two\n    Three
content.value
One\nTwo\nThree
One\nTwo\nThree
One\n    Two\n    Three
\n    One\n    Two\n    Three\n  
\n    One\n    Two\n    Three\n  
One\n    Two\n    Three
content.html
<p>One</p>\n    <p>Two</p>\n    <p>Three</p>
<p>One</p>\n    <p>Two</p>\n    <p>Three</p>
\n    <p>One</p>\n    <p>Two</p>\n    <p>Three</p>\n
\n    <p>One</p>\n    <p>Two</p>\n    <p>Three</p>\n  
<p>One</p>\n    <p>Two</p>\n    <p>Three</p>
\n    <p>One</p>\n    <p>Two</p>\n    <p>Three</p>\n  
10
<div class="h-entry">
351 |   <div class="e-content p-name">
352 |     <pre>one
353 | two
354 | three</pre>
355 |   </div>
356 | </div>
357 | 
name
one\ntwo\nthree
one two three
one\ntwo\nthree
one\ntwo\nthree
one\ntwo\nthree
one\ntwo\nthree
content.value
one\ntwo\nthree
one two three
one\ntwo\nthree
\n    one\ntwo\nthree\n  
\n    one\ntwo\nthree\n  
one\ntwo\nthree
content.html
<pre>one\ntwo\nthree</pre>
<pre>one\ntwo\nthree</pre>
\n    <pre>one\ntwo\nthree</pre>\n
\n    <pre>one\ntwo\nthree</pre>\n  
<pre>one\ntwo\nthree</pre>
\n    <pre>one\ntwo\nthree</pre>\n  
11
<div class="h-entry">
387 |   <div class="e-content p-name">
388 |     Hello World
389 |     <pre>
390 |       one
391 |       two
392 |       three
393 |     </pre>
394 |   </div>
395 | </div>
396 | 
name
Hello World\n      one\n      two\n      three
Hello World one two three
Hello World\n    \n      one\n      two\n      three
Hello World\n          one\n      two\n      three
Hello World\n          one\n      two\n      three
Hello World\n    \n      one\n      two\n      three
content.value
Hello World\n      one\n      two\n      three
Hello World one two three
Hello World\n    \n      one\n      two\n      three
\n    Hello World\n          one\n      two\n      three\n    \n  
\n    Hello World\n          one\n      two\n      three\n    \n  
Hello World\n    \n      one\n      two\n      three
content.html
Hello World\n    <pre>\n      one\n      two\n      three\n    </pre>
Hello World\n    <pre>\n      one\n      two\n      three\n    </pre>
\n    Hello World\n    <pre>\n      one\n      two\n      three\n    </pre>\n
\n    Hello World\n    <pre>      one\n      two\n      three\n    </pre>\n  
Hello World\n    <pre>      one\n      two\n      three\n    </pre>
\n    Hello World\n    <pre>\n      one\n      two\n      three\n    </pre>\n  
12
<body class="h-entry">
426 | <div class="e-content">
427 | <span class="p-name">Correct name</span>
428 | 
429 | <span class="p-summary">Correct summary</span>
430 | </div>
431 | </body>
432 | 
name
Correct name
Correct name
Correct name
Correct name
Correct name
Correct name
content.value
Correct name Correct summary
Correct name Correct summary
Correct name\n\nCorrect summary
\nCorrect name\n\nCorrect summary\n
\nCorrect name\n\nCorrect summary\n
Correct name\n\nCorrect summary
content.html
<span class="p-name">Correct name</span>\n\n<span class="p-summary">Correct summary</span>
<span class="p-name">Correct name</span>\n\n<span class="p-summary">Correct summary</span>
\n<span class="p-name">Correct name</span>\n\n<span class="p-summary">Correct summary</span>\n
\n<span class="p-name">Correct name</span>\n\n<span class="p-summary">Correct summary</span>\n
<span class="p-name">Correct name</span>\n\n<span class="p-summary">Correct summary</span>
\n<span class="p-name">Correct name</span>\n\n<span class="p-summary">Correct summary</span>\n
461 | --------------------------------------------------------------------------------