From 085ac405057c28c08f93c7d3ce0fce4c323e3b9a Mon Sep 17 00:00:00 2001 From: henoheno Date: Wed, 20 Jul 2005 00:38:35 +0900 Subject: [PATCH] BugTrack2/93: Correct duplicate id / Output auto-generated content id for backward compatibility (Pointed out by Cue) --- lib/convert_html.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/convert_html.php b/lib/convert_html.php index 0615b39..e3171fe 100644 --- a/lib/convert_html.php +++ b/lib/convert_html.php @@ -1,6 +1,6 @@ id . '_' . $this->count; + // Heading id (auto-generated) + $autoid = 'content_' . $this->id . '_' . $this->count; $this->count++; + // Heading id (specified by users) + $id = make_heading($text, FALSE); // Cut fixed-anchor from $text + if ($id == '') { + // Not specified + $id = & $autoid; + $anchor = ''; + } else { + $anchor = ' &aname(' . $id . ',super,full){' . $_symbol_anchor . '};'; + } + $text = ' ' . $text; + + // Add 'page contents' link to its heading $this->contents_last = & $this->contents_last->add(new Contents_UList($text, $level, $id)); - return array($text . $anchor, $this->count > 1 ? "\n" . $top : '', $id); + // Add heding + return array($text . $anchor, $this->count > 1 ? "\n" . $top : '', $autoid); } function & insert(& $obj) -- 2.11.0