metanorma-itu 2.4.5 → 2.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,9 +4,9 @@ module IsoDoc
4
4
  def word_preface_cleanup(docxml)
5
5
  docxml.xpath("//h1[@class = 'AbstractTitle'] | "\
6
6
  "//h1[@class = 'IntroTitle']").each do |h2|
7
- h2.name = "p"
8
- h2["class"] = "h1Preface"
9
- end
7
+ h2.name = "p"
8
+ h2["class"] = "h1Preface"
9
+ end
10
10
  end
11
11
 
12
12
  def word_term_cleanup(docxml); end
@@ -68,23 +68,32 @@ module IsoDoc
68
68
  end
69
69
 
70
70
  def toWord(result, filename, dir, header)
71
+ Html2Doc.new(
72
+ filename: filename, imagedir: @localdir,
73
+ stylesheet: @wordstylesheet&.path,
74
+ header_file: header&.path, dir: dir,
75
+ asciimathdelims: [@openmathdelim, @closemathdelim],
76
+ liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" }
77
+ ).process(result)
78
+ header&.unlink
79
+ @wordstylesheet&.unlink if @wordstylesheet.is_a?(Tempfile)
80
+ end
81
+
82
+ def postprocess_cleanup(result)
83
+ result = from_xhtml(cleanup(to_xhtml(textcleanup(result))))
71
84
  result = populate_template(result, :word)
72
85
  result = from_xhtml(word_cleanup(to_xhtml(result)))
73
86
  .gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
87
+ end
88
+
89
+ def wordstylesheet_update
90
+ super
74
91
  unless @landscapestyle.nil? || @landscapestyle.empty?
75
92
  @wordstylesheet&.open
76
93
  @wordstylesheet&.write(@landscapestyle)
77
94
  @wordstylesheet&.close
78
95
  end
79
- Html2Doc.new(
80
- filename: filename,
81
- stylesheet: @wordstylesheet&.path,
82
- header_file: header&.path, dir: dir,
83
- asciimathdelims: [@openmathdelim, @closemathdelim],
84
- liststyles: { ul: @ulstyle, ol: @olstyle, steps: "l4" }
85
- ).process(result)
86
- header&.unlink
87
- @wordstylesheet&.unlink
96
+ @wordstylesheet
88
97
  end
89
98
 
90
99
  def authority_hdr_cleanup(docxml)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.4.5".freeze
3
+ VERSION = "2.4.6".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "metanorma-standoc", "~> 2.8.4"
29
- spec.add_dependency "pubid-itu"
29
+ spec.add_dependency "pubid"
30
30
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
31
31
  spec.add_dependency "tzinfo-data" # we need this for windows only
32
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.5
4
+ version: 2.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-25 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.8.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: pubid-itu
28
+ name: pubid
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="