@@ -6,18 +6,18 @@ def read_options(options):
66 custom_style_map_text = options .pop ("style_map" , "" ) or ""
77 embedded_style_map_text = options .pop ("embedded_style_map" , "" ) or ""
88 include_default_style_map = options .pop ("include_default_style_map" , True )
9-
9+
1010 read_style_map_result = results .combine ([
1111 _read_style_map (custom_style_map_text ),
1212 _read_style_map (embedded_style_map_text ),
1313 ])
14-
14+
1515 custom_style_map , embedded_style_map = read_style_map_result .value
1616 style_map = custom_style_map + embedded_style_map
17-
17+
1818 if include_default_style_map :
1919 style_map += _default_style_map
20-
20+
2121 options ["ignore_empty_paragraphs" ] = options .get ("ignore_empty_paragraphs" , True )
2222 options ["style_map" ] = style_map
2323 return read_style_map_result .map (lambda _ : options )
@@ -27,7 +27,7 @@ def _read_style_map(style_text):
2727 lines = filter (None , map (_get_line , style_text .split ("\n " )))
2828 return results .combine (lists .map (read_style_mapping , lines )) \
2929 .map (lambda style_mappings : lists .filter (None , style_mappings ))
30-
30+
3131
3232def _get_line (line ):
3333 line = line .strip ()
@@ -57,6 +57,10 @@ def _get_line(line):
5757p[style-name='heading 5'] => h5:fresh
5858p[style-name='heading 6'] => h6:fresh
5959
60+ # Apple Pages
61+ p.Heading => h1:fresh
62+ p[style-name='Heading'] => h1:fresh
63+
6064r[style-name='Strong'] => strong
6165
6266p[style-name='footnote text'] => p:fresh
@@ -65,7 +69,7 @@ def _get_line(line):
6569r[style-name='endnote reference'] =>
6670p[style-name='annotation text'] => p:fresh
6771r[style-name='annotation reference'] =>
68-
72+
6973# LibreOffice
7074p[style-name='Footnote'] => p:fresh
7175r[style-name='Footnote anchor'] =>
@@ -86,6 +90,10 @@ def _get_line(line):
8690r[style-name='Hyperlink'] =>
8791
8892p[style-name='Normal'] => p:fresh
93+
94+ # Apple Pages
95+ p.Body => p:fresh
96+ p[style-name='Body'] => p:fresh
8997""" )
9098
9199
0 commit comments