ic/tzo: fix chapter anchors
This commit is contained in:
parent
4417945078
commit
22dd4a6d9c
@ -106,10 +106,11 @@ class TZOPart
|
||||
|
||||
// chapter markers
|
||||
$html = preg_replace_callback(
|
||||
'/<center>(?:# )?(\(\d+\)|([\w\s?]+))<\/center>/',
|
||||
'/<center>(?:# )?(\((\d+)\)|([\w\s?]+))<\/center>/',
|
||||
function ($matches) {
|
||||
$number = $matches[1];
|
||||
return '<p class="tzo-chapter" id="chapter'.$number.'">'.$number.'</p>';
|
||||
$id = isset($matches[2]) && $matches[2] != '' ? 'chapter'.$matches[2] : '';
|
||||
return '<p class="tzo-chapter" id="'.$id.'">'.$number.'</p>';
|
||||
},
|
||||
$html
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user