Merge branch 'okdana-lib' into lib

This commit is contained in:
Michel Fortin 2015-10-16 21:20:48 -04:00
commit f0911e737d
2 changed files with 18 additions and 2 deletions

View file

@ -32,6 +32,11 @@ class MarkdownExtra extends \Michelf\Markdown {
public $fn_link_class = "footnote-ref";
public $fn_backlink_class = "footnote-backref";
# Content to be displayed within footnote backlinks. The default is '↩';
# the U+FE0E on the end is a Unicode variant selector used to prevent iOS
# from displaying the arrow character as an emoji.
public $fn_backlink_html = '↩︎';
# Class name for table cell alignment (%% replaced left/center/right)
# For instance: 'go-%%' becomes 'go-left' or 'go-right' or 'go-center'
# If empty, the align attribute is used instead of a class name.
@ -1475,6 +1480,7 @@ class MarkdownExtra extends \Michelf\Markdown {
$title = $this->encodeAttribute($title);
$attr .= " title=\"$title\"";
}
$backlink_text = $this->fn_backlink_html;
$num = 0;
while (!empty($this->footnotes_ordered)) {
@ -1494,9 +1500,9 @@ class MarkdownExtra extends \Michelf\Markdown {
$note_id = $this->encodeAttribute($note_id);
# Prepare backlink, multiple backlinks if multiple references
$backlink = "<a href=\"#fnref:$note_id\"$attr>&#8617;</a>";
$backlink = "<a href=\"#fnref:$note_id\"$attr>$backlink_text</a>";
for ($ref_num = 2; $ref_num <= $ref_count; ++$ref_num) {
$backlink .= " <a href=\"#fnref$ref_num:$note_id\"$attr>&#8617;</a>";
$backlink .= " <a href=\"#fnref$ref_num:$note_id\"$attr>$backlink_text</a>";
}
# Add backlink to last paragraph; create new paragraph if needed.
if (preg_match('{</p>$}', $footnote)) {

View file

@ -187,6 +187,16 @@ Current Version
of the special attribute block). Credits to Mario Konrad for providing the
implementation.
* The curled arrow character for the backlink in footnotes is now followed
by a Unicode variant selector to prevent it from being displayed in emoji
form on iOS.
Note that in older browsers the variant selector is often interpreted as a
separate character, making it visible after the arrow. So there is now a
also a `fn_backlink_html` configuration variable that can be used to set
the link text to something else. Credits to Dana for providing the
implementation.
PHP Markdown Lib 1.5.0 (1 Mar 2015)