Skip to content

Commit

Permalink
#417 Include block type and digest algorithm in checksum string
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijnve committed Jun 12, 2023
1 parent ba571a6 commit 332c220
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
= Asciidoctor-diagram Changelog

== 2.2.10

Bugfixes::

* Issue #417: Avoid reusing images when block type is different but source code is identical


== 2.2.9

Bugfixes::
Expand Down
4 changes: 2 additions & 2 deletions lib/asciidoctor-diagram/diagram_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def create_image_metadata
end

def checksum
@checksum ||= compute_checksum(code)
@checksum ||= "#{config[:type]}:#{compute_checksum(code)}"
end

protected
Expand All @@ -248,7 +248,7 @@ def compute_checksum(code)
md5 << k.to_s if k
md5 << v.to_s if v
end
md5.hexdigest
"md5:#{md5.hexdigest}"
end
end

Expand Down

0 comments on commit 332c220

Please sign in to comment.