ruby-docx / docx

a ruby library/gem for interacting with .docx files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

to_html only considers some styles and not others

sixtyfive opened this issue · comments

Not sure if this should be a bug report or a feature request. In any case, if there is an existing Issue for this, please just close, but I couldn't find one after searching for a while.

With a docx test file that includes the following styles applied to different words:

  • none
  • red
  • bold
  • italics
  • striked through
  • underscored

... and then converted to HTML by .paragraphs.first.to_html, I get the following styles back out:

  • text-align:left (which was apparently applied without me specifically having done so in Word; fair enough)
  • <strong>
  • <em>
  • text-decoration:underline

So color:red and <s> are missing.

Is that something where every style has to be explicitly implemented or should this be working? If it's the former I'd like to give it a shot to implement it if there could be a little bit of guidance as to what places of the code to look at?

Hi @satoryu , the above is fixed in my PR : #144 . Kindly review it and let me know further updates.