Method: IsoDoc::WordFunction::Postprocess#toWord

Defined in:
lib/isodoc/word_function/postprocess.rb

#toWord(result, filename, dir, header) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/isodoc/word_function/postprocess.rb', line 17

def toWord(result, filename, dir, header)
  result = from_xhtml(word_cleanup(to_xhtml(result)))
    .gsub("-DOUBLE_HYPHEN_ESCAPE-", "--")
  @wordstylesheet = wordstylesheet_update
  Html2Doc.new(
    filename: filename, imagedir: @localdir,
    stylesheet: @wordstylesheet&.path,
    header_file: header&.path, dir: dir,
    asciimathdelims: [@openmathdelim, @closemathdelim],
    liststyles: { ul: @ulstyle, ol: @olstyle }
  ).process(result)
  header&.unlink
  @wordstylesheet.unlink if @wordstylesheet.is_a?(Tempfile)
end