Skip to content

Commit

Permalink
Merge pull request #4 from Alwinator/add_links
Browse files Browse the repository at this point in the history
Fix #3
  • Loading branch information
Alwinator authored Dec 16, 2021
2 parents 1d7bd5f + 0d791fb commit 6bba0ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
*.gem
*.pdf
*.pdf
*.html
4 changes: 3 additions & 1 deletion lib/asciidoctor-lists/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def process(document)
document.find_by(context: eval(element_name)).each do |element|

if element.caption
element.id = SecureRandom.uuid
unless element.id
element.id = SecureRandom.uuid
end
references_asciidoc << %(xref:#{element.id}[#{element.caption}]#{element.title} +)
end
end
Expand Down

0 comments on commit 6bba0ec

Please sign in to comment.