Skip to content

Commit c042502

Browse files
committed
Surrounding html content with anchor only when it is an external link
1 parent 90de4c1 commit c042502

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/docx/containers/text_run.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ def underlined?
9595
end
9696

9797
def hyperlink?
98-
@node.name == 'hyperlink'
98+
@node.name == 'hyperlink' && external_link?
99+
end
100+
101+
def external_link?
102+
!@node.attributes['id'].nil?
99103
end
100104

101105
def href

0 commit comments

Comments
 (0)