Skip to content

Commit 3f5dd01

Browse files
committed
Add Apple Pages paragraph styles to default style map
1 parent 5b1dddd commit 3f5dd01

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.10.0
2+
3+
* Add "Heading" and "Body" styles, as found in documents created by Apple Pages,
4+
to the default style map.
5+
16
# 1.9.1
27

38
* Ignore AlternateContent elements when there is no Fallback element.

lib/options-reader.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,26 @@ var defaultStyleMap = exports._defaultStyleMap = [
2222
"p[style-name='heading 4'] => h4:fresh",
2323
"p[style-name='heading 5'] => h5:fresh",
2424
"p[style-name='heading 6'] => h6:fresh",
25-
25+
26+
// Apple Pages
27+
"p.Heading => h1:fresh",
28+
"p[style-name='Heading'] => h1:fresh",
29+
2630
"r[style-name='Strong'] => strong",
27-
31+
2832
"p[style-name='footnote text'] => p:fresh",
2933
"r[style-name='footnote reference'] =>",
3034
"p[style-name='endnote text'] => p:fresh",
3135
"r[style-name='endnote reference'] =>",
3236
"p[style-name='annotation text'] => p:fresh",
3337
"r[style-name='annotation reference'] =>",
34-
38+
3539
// LibreOffice
3640
"p[style-name='Footnote'] => p:fresh",
3741
"r[style-name='Footnote anchor'] =>",
3842
"p[style-name='Endnote'] => p:fresh",
3943
"r[style-name='Endnote anchor'] =>",
40-
44+
4145
"p:unordered-list(1) => ul > li:fresh",
4246
"p:unordered-list(2) => ul|ol > li > ul > li:fresh",
4347
"p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh",
@@ -48,10 +52,14 @@ var defaultStyleMap = exports._defaultStyleMap = [
4852
"p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh",
4953
"p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh",
5054
"p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh",
51-
55+
5256
"r[style-name='Hyperlink'] =>",
53-
54-
"p[style-name='Normal'] => p:fresh"
57+
58+
"p[style-name='Normal'] => p:fresh",
59+
60+
// Apple Pages
61+
"p.Body => p:fresh",
62+
"p[style-name='Body'] => p:fresh"
5563
];
5664

5765
var standardOptions = exports._standardOptions = {

0 commit comments

Comments
 (0)