Skip to content

Commit

Permalink
Surrounding html content with anchor only when it is an external link
Browse files Browse the repository at this point in the history
  • Loading branch information
satoryu committed Oct 29, 2023
1 parent 90de4c1 commit c042502
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/docx/containers/text_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def underlined?
end

def hyperlink?
@node.name == 'hyperlink'
@node.name == 'hyperlink' && external_link?
end

def external_link?
!@node.attributes['id'].nil?
end

def href
Expand Down

0 comments on commit c042502

Please sign in to comment.