From 6026c86eccdc7838cd8edbf8b7f20f206e07d448 Mon Sep 17 00:00:00 2001 From: John Schember Date: Wed, 26 Jan 2011 12:42:26 -0500 Subject: [PATCH] Fix bug #8565: PML Input handle invalid \T markup. --- src/calibre/ebooks/pml/pmlconverter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/pml/pmlconverter.py b/src/calibre/ebooks/pml/pmlconverter.py index 3fdd627d7e..d2eb2c3736 100644 --- a/src/calibre/ebooks/pml/pmlconverter.py +++ b/src/calibre/ebooks/pml/pmlconverter.py @@ -576,10 +576,15 @@ class PML_HTMLizer(object): if indent_state[c]: basic_indent = True elif c == 'T': - indent_state[c] = not indent_state[c] - if indent_state[c]: + # Ensure we only store the value on the first T set for the line. + if not indent_state['T']: adv_indent = True adv_indent_val = self.code_value(line) + else: + # We detected a T previously on this line. + # Don't replace the first detected value. + self.code_value(line) + indent_state['T'] = True elif c == '-': empty = False text = '­'