Commit 372fe618e6576ae4343036d3d5fbdb7d79d58d60
- Diff rendering mode:
- inline
- side by side
creole.php
(1 / 2)
|   | |||
| 415 | 415 | ), | |
| 416 | 416 | ||
| 417 | 417 | 'img' => new creole_rule_image(array( | |
| 418 | 'regex' => '/\{\{((?!\{)[^|}\n]*(?:}(?!})[^|}\n]*)*)\|' . | ||
| 419 | '([^}~\n]*((}(?!})|~.)[^}~\n]*)*)}}/' | ||
| 418 | 'regex' => '/' . $rx['image'] . '/', | ||
| 420 | 419 | )), | |
| 421 | 420 | ||
| 422 | 421 | 'escaped_sequence' => array( |
t/creole.php
(0 / 19)
|   | |||
| 539 | 539 | 'output' => '<table><tr><td> <img src="image.png" alt="Alternative text"/> </td></tr></table>' | |
| 540 | 540 | ), | |
| 541 | 541 | array( | |
| 542 | 'name' => "Image in table (strict)", | ||
| 543 | 'input' => "| {{image.png|Alternative text}} |", | ||
| 544 | 'output' => '<table><tr><td> {{image.png</td><td>Alternative text}} </td></tr></table>', | ||
| 545 | 'options' => array( 'strict' => true ) | ||
| 546 | ), | ||
| 547 | array( | ||
| 548 | 542 | 'name' => "Image in named link in table", | |
| 549 | 543 | 'input' => "| [[Link|{{image.png|Alternative text}}]] |", | |
| 550 | 544 | 'output' => '<table><tr><td> <a href="/wiki/Link"><img src="image.png" alt="Alternative text"/></a> </td></tr></table>' | |
| … | … | ||
| 549 | 549 | 'output' => '<p><img src="image.png" alt=""/></p>' | |
| 550 | 550 | ), | |
| 551 | 551 | array( | |
| 552 | 'name' => "Image without alternative text (strict)", | ||
| 553 | 'input' => "{{image.png}}", | ||
| 554 | 'output' => '<p>{{image.png}}</p>', | ||
| 555 | 'options' => array( 'strict' => true ) | ||
| 556 | ), | ||
| 557 | array( | ||
| 558 | 552 | 'name' => "Image with empty alternative text", | |
| 559 | 553 | 'input' => "{{image.png|}}", | |
| 560 | 554 | 'output' => '<p><img src="image.png" alt=""/></p>', | |
| 561 | 'options' => array( 'strict' => true ) | ||
| 562 | 555 | ), | |
| 563 | array( | ||
| 564 | 'name' => "Image with custom default alternative text", | ||
| 565 | 'input' => "{{image.png}}", | ||
| 566 | 'output' => '<p><img src="image.png" alt="Image"/></p>', | ||
| 567 | 'options' => array( 'default_image_text' => 'Image' ) | ||
| 568 | ) | ||
| 569 | 556 | ); | |
| 570 | 557 | ||
| 571 | 558 | plan(count($array)); |

