View Single Post
Old 11-10-2015, 10:11 PM   #732
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,043
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by edeniz View Post
Uploaded the epub in question.
Assuming you're still using the personal.ini that uploaded earlier, the problem is because you're using chapter_title_strip_pattern to remove chapters titles like 'Chapter 1', but you didn't set add_chapter_numbers true, so nothing is replacing them.

Relevant settings:
Spoiler:
Code:
## Do not like the numbers at the start of chapter titles on some
## sites?  You can use strip_chapter_numbers to strip them off.  Just
## want to make them all look the same?  Strip them off, then add them
## back on with add_chapter_numbers:true.  Only want them added back
## on for Table of Contents(toc)? Use add_chapter_numbers:toconly.
## (toconly does not work on mobi output.)  Do not like the way it
## strips numbers or adds them back?  See chapter_title_strip_pattern
## and chapter_title_add_pattern.
strip_chapter_numbers:true

## add_chapter_numbers can be true, false or toconly
## (Note number is not added when there is only one chapter.)
##add_chapter_numbers:true

## (Two versions of chapter_title_strip_pattern are shown below.  You
## should only have one uncommented.)
## This version will remove the leading number from:
## "1." => ""
## "1. The Beginning" => "The Beginning"
## "1: Start" => "Start"
## "2, Chapter the second" => "Chapter the second"
## etc
#chapter_title_strip_pattern:^[0-9]+[\.: -]+

## This version will strip all of the above *plus* remove 'Chapter 1':
## "Chapter 1" => ""
## "1. Chapter 1" => ""
## "1. Chapter 1, Bob's First Clue" => "Bob's First Clue"
## "Chapter 2 - Pirates Place" => "Pirates Place"
## etc
chapter_title_strip_pattern:^([0-9]+[\.: -]+)?(Chapter *[0-9]+[\.:, -]*)?

You could add add_chapter_numbers:true and you'd get chapters '1.', '2.', etc.

You could set strip_chapter_numbers:false or change to the default chapter_title_strip_pattern instead of the more aggressive one.

Alternatively, you could experiment with look ahead regex pattern matches for chapter_title_strip_pattern so you only remove 'Chapter 1' if there's something after it.

I will also consider if I should change the system in some way to prevent this behavior, or if it would ever be desirable.
JimmXinu is offline   Reply With Quote