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