Skip to content

Commit

Permalink
[HotFix] Heading Supporting Internal Link Usage
Browse files Browse the repository at this point in the history
    * Version bump 0.3.1
    * Heading supporting internal link usage
  • Loading branch information
MuhammetDilmac committed Jul 3, 2017
1 parent 9b581c1 commit c54e6a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Html2Docx/document.rb
Expand Up @@ -30,7 +30,7 @@ def add_html(html)
paragraph.add_paragraph(element)
@contents.push paragraph.render
when /h[1-9]/
heading = DocumentObjects::Heading.new(@document)
heading = DocumentObjects::Heading.new(@document, @relation)
heading.add_heading(element)
@contents.push heading.render
when 'table'
Expand Down
5 changes: 3 additions & 2 deletions lib/Html2Docx/document_objects/heading.rb
@@ -1,16 +1,17 @@
module Html2Docx
module DocumentObjects
class Heading
def initialize(document)
def initialize(document, relation)
@document = document
@relation = relation
@heading = nil
end

def add_heading(heading_object)
heading_object['class'] = "Heading#{heading_object.name.scan(/[0-9]/).first}"
heading_object.name = 'p'

paragraph = Paragraph.new(@document, nil)
paragraph = Paragraph.new(@document, @relation)
paragraph.add_paragraph(heading_object)

@heading = paragraph.render
Expand Down
2 changes: 1 addition & 1 deletion lib/Html2Docx/version.rb
@@ -1,3 +1,3 @@
module Html2Docx
VERSION = '0.3.0'
VERSION = '0.3.1'
end

0 comments on commit c54e6a4

Please sign in to comment.