mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix RTFinput not handling underlined text
This commit is contained in:
parent
efb332b121
commit
c8e820760a
@ -256,7 +256,7 @@
|
||||
<xsl:value-of select="'italic'"/>
|
||||
<xsl:text>;</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="@underline and @underline != 'false'">
|
||||
<xsl:if test="@underlined and @underlined != 'false'">
|
||||
<xsl:text>text-decoration:underline</xsl:text>
|
||||
<xsl:text>;</xsl:text>
|
||||
</xsl:if>
|
||||
|
@ -41,7 +41,7 @@ border_style_map = {
|
||||
|
||||
class InlineClass(etree.XSLTExtension):
|
||||
|
||||
FMTS = ('italics', 'bold', 'underlined', 'strike-through', 'small-caps')
|
||||
FMTS = ('italics', 'bold', 'strike-through', 'small-caps')
|
||||
|
||||
def __init__(self, log):
|
||||
etree.XSLTExtension.__init__(self)
|
||||
@ -54,6 +54,9 @@ class InlineClass(etree.XSLTExtension):
|
||||
for x in self.FMTS:
|
||||
if input_node.get(x, None) == 'true':
|
||||
classes.append(x)
|
||||
#underlined is special
|
||||
if input_node.get('underlined', 'false') != 'false':
|
||||
classes.append('underlined')
|
||||
fs = input_node.get('font-size', False)
|
||||
if fs:
|
||||
if fs not in self.font_sizes:
|
||||
|
@ -25,7 +25,7 @@ class Configure:
|
||||
if self.__show_config_file and self.__configuration_file:
|
||||
sys.stderr.write('configuration file is "%s"\n' % self.__configuration_file)
|
||||
if self.__show_config_file and not self.__configuration_file:
|
||||
sys.stderr.write('No configuraiton file found; using default vaules\n')
|
||||
sys.stderr.write('No configuraiton file found; using default values\n')
|
||||
if self.__configuration_file:
|
||||
read_obj = open(self.__configuration_file, 'r')
|
||||
line_to_read = 1
|
||||
|
@ -411,7 +411,7 @@ class Inline:
|
||||
self.__set_list_func(line)
|
||||
action = self.__state_dict.get(self.__state)
|
||||
if action is None:
|
||||
sys.stderr.write('No matching state in module inline_for_lists.py\n')
|
||||
sys.stderr.write('No matching state in module inline.py\n')
|
||||
sys.stderr.write(self.__state + '\n')
|
||||
action(line)
|
||||
copy_obj = copy.Copy(bug_handler = self.__bug_handler)
|
||||
|
@ -214,7 +214,27 @@ class ProcessTokens:
|
||||
'nosupersub' : ('ci', 'no-su-supe', self.__no_sup_sub_func),
|
||||
'up' : ('ci', 'font-up___', self.divide_by_2),
|
||||
'v' : ('ci', 'hidden____', self.default_func),
|
||||
# table => tb
|
||||
# underline
|
||||
# can't see why it isn't a char info: 'ul'=>'ci'
|
||||
'ul' : ('ci', 'underlined<continous', self.two_part_func),
|
||||
'uld' : ('ci', 'underlined<dotted', self.two_part_func),
|
||||
'uldash' : ('ci', 'underlined<dash', self.two_part_func),
|
||||
'uldashd' : ('ci', 'underlined<dash-dot', self.two_part_func),
|
||||
'uldashdd' : ('ci', 'underlined<dash-dot-dot', self.two_part_func),
|
||||
'uldb' : ('ci', 'underlined<double', self.two_part_func),
|
||||
'ulhwave' : ('ci', 'underlined<heavy-wave', self.two_part_func),
|
||||
'ulldash' : ('ci', 'underlined<long-dash', self.two_part_func),
|
||||
'ulth' : ('ci', 'underlined<thich', self.two_part_func),
|
||||
'ulthd' : ('ci', 'underlined<thick-dotted', self.two_part_func),
|
||||
'ulthdash' : ('ci', 'underlined<thick-dash', self.two_part_func),
|
||||
'ulthdashd' : ('ci', 'underlined<thick-dash-dot', self.two_part_func),
|
||||
'ulthdashdd' : ('ci', 'underlined<thick-dash-dot-dot', self.two_part_func),
|
||||
'ulthldash' : ('ci', 'underlined<thick-long-dash', self.two_part_func),
|
||||
'ululdbwave' : ('ci', 'underlined<double-wave', self.two_part_func),
|
||||
'ulw' : ('ci', 'underlined<word', self.two_part_func),
|
||||
'ulwave' : ('ci', 'underlined<wave', self.two_part_func),
|
||||
'ulnone' : ('ci', 'underlined<false', self.two_part_func),
|
||||
# table => tb
|
||||
'trowd' : ('tb', 'row-def___', self.default_func),
|
||||
'cell' : ('tb', 'cell______', self.default_func),
|
||||
'row' : ('tb', 'row_______', self.default_func),
|
||||
@ -274,25 +294,6 @@ class ProcessTokens:
|
||||
'paperh' : ('pa', 'paper-hght', self.divide_by_20),
|
||||
# annotation => an
|
||||
'annotation' : ('an', 'annotation', self.default_func),
|
||||
# underline
|
||||
'ul' : ('ul', 'underlined<continous', self.two_part_func),
|
||||
'uld' : ('ul', 'underlined<dotted', self.two_part_func),
|
||||
'uldash' : ('ul', 'underlined<dash', self.two_part_func),
|
||||
'uldashd' : ('ul', 'underlined<dash-dot', self.two_part_func),
|
||||
'uldashdd' : ('ul', 'underlined<dash-dot-dot', self.two_part_func),
|
||||
'uldb' : ('ul', 'underlined<double', self.two_part_func),
|
||||
'ulhwave' : ('ul', 'underlined<heavy-wave', self.two_part_func),
|
||||
'ulldash' : ('ul', 'underlined<long-dash', self.two_part_func),
|
||||
'ulth' : ('ul', 'underlined<thich', self.two_part_func),
|
||||
'ulthd' : ('ul', 'underlined<thick-dotted', self.two_part_func),
|
||||
'ulthdash' : ('ul', 'underlined<thick-dash', self.two_part_func),
|
||||
'ulthdashd' : ('ul', 'underlined<thick-dash-dot', self.two_part_func),
|
||||
'ulthdashdd' : ('ul', 'underlined<thick-dash-dot-dot', self.two_part_func),
|
||||
'ulthldash' : ('ul', 'underlined<thick-long-dash', self.two_part_func),
|
||||
'ululdbwave' : ('ul', 'underlined<double-wave', self.two_part_func),
|
||||
'ulw' : ('ul', 'underlined<word', self.two_part_func),
|
||||
'ulwave' : ('ul', 'underlined<wave', self.two_part_func),
|
||||
'ulnone' : ('ul', 'underlined<false', self.two_part_func),
|
||||
# border => bd
|
||||
'trbrdrh' : ('bd', 'bor-t-r-hi', self.default_func),
|
||||
'trbrdrv' : ('bd', 'bor-t-r-vi', self.default_func),
|
||||
|
@ -496,7 +496,7 @@ Instead, ingore all section information in a field-block.
|
||||
self.__token_info = line[:16]
|
||||
action = self.__state_dict.get(self.__state)
|
||||
if action == None:
|
||||
sys.stderr.write('no no matching state in module sections.py\n')
|
||||
sys.stderr.write('no matching state in module sections.py\n')
|
||||
sys.stderr.write(self.__state + '\n')
|
||||
action(line)
|
||||
read_obj.close()
|
||||
|
@ -103,8 +103,6 @@ class Styles:
|
||||
'sect-note_' : 'endnotes-in-section',
|
||||
# list=> ls
|
||||
'list-text_' : 'list-text',
|
||||
# this line must be wrong because it duplicates an earlier one
|
||||
'list-text_' : 'list-text',
|
||||
'list______' : 'list',
|
||||
'list-lev-d' : 'list-level-definition',
|
||||
'list-cardi' : 'list-cardinal-numbering',
|
||||
|
Loading…
x
Reference in New Issue
Block a user