|
|
|
@ -184,6 +184,8 @@ class ReferenceFootnotesFilter extends FootnotesFilter {
|
|
|
|
|
$randstr = $this->randstr(); |
|
|
|
|
|
|
|
|
|
$value = $this->extractAttribute($matches, 'value'); |
|
|
|
|
$page = $this->extractAttribute($matches, 'page'); |
|
|
|
|
$reference = $this->extractAttribute($matches, 'reference'); |
|
|
|
|
|
|
|
|
|
if ($value) { |
|
|
|
|
// A value label was found. If it is numeric, record it in $n so further |
|
|
|
@ -195,7 +197,7 @@ class ReferenceFootnotesFilter extends FootnotesFilter {
|
|
|
|
|
$n = $value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
elseif ($opt_collapse and $value_existing = $this->findFootnote($matches[2], $store_matches)) { |
|
|
|
|
elseif ($opt_collapse and $value_existing = $this->findFootnote($matches[2], $reference, $store_matches)) { |
|
|
|
|
// An identical footnote already exists. Set value to the previously |
|
|
|
|
// existing value. |
|
|
|
|
$value = $value_existing; |
|
|
|
@ -211,8 +213,6 @@ class ReferenceFootnotesFilter extends FootnotesFilter {
|
|
|
|
|
// attribute. |
|
|
|
|
$value_id = preg_replace('|[^\w\-]|', '', $value); |
|
|
|
|
|
|
|
|
|
$page = $this->extractAttribute($matches, 'page'); |
|
|
|
|
$reference = $this->extractAttribute($matches, 'reference'); |
|
|
|
|
|
|
|
|
|
// Create a sanitized version of $text that is suitable for using as HTML |
|
|
|
|
// attribute value. (In particular, as the title attribute to the footnote |
|
|
|
@ -279,10 +279,10 @@ class ReferenceFootnotesFilter extends FootnotesFilter {
|
|
|
|
|
/** |
|
|
|
|
* @inheritdoc |
|
|
|
|
*/ |
|
|
|
|
private function findFootnote($text, &$store_matches) { |
|
|
|
|
private function findFootnote($text, $reference, &$store_matches) { |
|
|
|
|
if (!empty($store_matches)) { |
|
|
|
|
foreach ($store_matches as &$fn) { |
|
|
|
|
if ($fn['text'] == $text) { |
|
|
|
|
if ($fn['text'] == $text && $fn['reference'] == $reference) { |
|
|
|
|
return $fn['value']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|