metanorma-ieee 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56f7f0388b6fb0a8842e97ea9c3c3edf6fa03cc9989f5ae31c0c9c30a5b2d88e
4
- data.tar.gz: cfa588f4ad63ed775313e27afc4e981ed340a78c557badb9fc8b7da0d5d35ea4
3
+ metadata.gz: 1fcccb9ecbb7f583ec84c5e85aa31e33f997e97710354839a3a72bed031d0765
4
+ data.tar.gz: d5147dabd75d8aaeebef7f8b3451320a20f8bad6b455b07a70506e26060acd07
5
5
  SHA512:
6
- metadata.gz: aca4e3edeb8aee38ade1db7f3ef6868ffd969f943d75a1ff435f14e1efe8fb72e5196ec57acae8cb10106b09d7e3c28f96fd783027f02ba5a347c533555e0bdc
7
- data.tar.gz: 5b1a3a15c5b027a38779df25641a2edd44efec2bf7b44d1adaf41debdb2b707f8a4d7b9768eb7095640d2b0232b3bd17de2ac856f406eba972ac577c41315b6e
6
+ metadata.gz: ef4b1f8961eaf3e59265eb81e8b3fe0ee021a557a5444fa89a504a5c759ef121d324732f8e7a7b851caf0fb2e19b968266754afe25785a3ea67fbbe557621cb8
7
+ data.tar.gz: 3d4b86db388a053e2fda8a3bbf885f84d8f940f5959a1651b96b6b279c33b0f598b2c034e57d521ac745a67601526af27b4dbe4897cbbbe8110e9d9797e11b5d
@@ -1,8 +1,32 @@
1
1
  class Html2Doc
2
2
  class IEEE < ::Html2Doc
3
3
  def style_list(elem, level, liststyle, listnumber)
4
- super
4
+ return unless liststyle
5
+
6
+ sameelem_level = elem.ancestors.map(&:name).count(elem.parent.name)
7
+ if elem["style"]
8
+ elem["style"] += ";"
9
+ else
10
+ elem["style"] = ""
11
+ end
12
+ sameelem_level1 = sameelem_level
13
+ if liststyle == "l11" && sameelem_level.to_i > 1
14
+ liststyle = "l21"
15
+ sameelem_level1 -= 1
16
+ end
17
+ if liststyle == "l16"
18
+ s = case elem.parent["type"]
19
+ when "a" then 1
20
+ when "1" then 2
21
+ else 3
22
+ end
23
+ sameelem_level1 += s - (sameelem_level1 % 3)
24
+ sameelem_level1 < 1 and sameelem_level1 += 3
25
+ end
26
+ elem["style"] += "mso-list:#{liststyle} level#{sameelem_level1} lfo#{listnumber}-#{level};"
27
+ elem["style"] += "text-indent:-0.79cm; margin-left:#{0.4 + (level.to_i * 0.76)}cm;"
5
28
  elem.parent["level"] = level
29
+ elem.parent["sameelem_level"] = sameelem_level
6
30
  end
7
31
 
8
32
  def list2para(list)
@@ -10,7 +34,9 @@ class Html2Doc
10
34
 
11
35
  level = list["level"] || "1"
12
36
  list.delete("level")
13
- list2para1(list, level, list.name)
37
+ samelevel = list["sameelem_level"] || "1"
38
+ list.delete("sameelem_level")
39
+ list2para1(list, samelevel, list.name)
14
40
  end
15
41
 
16
42
  def list2para1(list, level, type)