| @@ -11,8 +11,11 @@ | ||
| 11 | 11 | # <http://daringfireball.net/projects/markdown/> |
| 12 | 12 | # |
| 13 | 13 | # Tweaked to remove WordPress interface |
| 14 | 14 | |
| 15 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 16 | + exit( 0 ); | |
| 17 | +} | |
| 15 | 18 | |
| 16 | 19 | define( 'MARKDOWN_VERSION', "1.0.2" ); # 29 Nov 2013 |
| 17 | 20 | define( 'MARKDOWNEXTRA_VERSION', "1.2.8" ); # 29 Nov 2013 |
| 18 | 21 | |
| @@ -1587,9 +1590,23 @@ | ||
| 1587 | 1590 | |
| 1588 | 1591 | # Predefined abbreviations. |
| 1589 | 1592 | public $predef_abbr = array(); |
| 1590 | 1593 | |
| 1594 | + /** | |
| 1595 | + * Reference attribute. | |
| 1596 | + * | |
| 1597 | + * @var array | |
| 1598 | + */ | |
| 1599 | + public $ref_attr; | |
| 1591 | 1600 | |
| 1601 | + /** | |
| 1602 | + * Parsing mode. | |
| 1603 | + * | |
| 1604 | + * @var string | |
| 1605 | + */ | |
| 1606 | + public $mode; | |
| 1607 | + | |
| 1608 | + | |
| 1592 | 1609 | ### Parser Implementation ### |
| 1593 | 1610 | |
| 1594 | 1611 | function __construct() { |
| 1595 | 1612 | # |
| @@ -2607,8 +2624,9 @@ | ||
| 2607 | 2624 | $content = preg_replace('/[|] *$/m', '', $content); |
| 2608 | 2625 | |
| 2609 | 2626 | # Reading alignement from header underline. |
| 2610 | 2627 | $separators = preg_split('/ *[|] */', $underline); |
| 2628 | + $attr = array(); | |
| 2611 | 2629 | foreach ($separators as $n => $s) { |
| 2612 | 2630 | if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"'; |
| 2613 | 2631 | else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"'; |
| 2614 | 2632 | else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"'; |
| @@ -2991,9 +3009,9 @@ | ||
| 2991 | 3009 | $footnote = $this->runBlockGamut("$footnote\n"); |
| 2992 | 3010 | $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', |
| 2993 | 3011 | array(&$this, '_appendFootnotes_callback'), $footnote); |
| 2994 | 3012 | |
| 2995 | - $attr = str_replace("%%", ++$num, $attr); | |
| 3013 | + $attr = str_replace("%%", (string) ++$num, $attr); | |
| 2996 | 3014 | $note_id = $this->encodeAttribute($note_id); |
| 2997 | 3015 | |
| 2998 | 3016 | # Prepare backlink, multiple backlinks if multiple references |
| 2999 | 3017 | $backlink = "<a href=\"#fnref:$note_id\"$attr>↩</a>"; |