forked from asciidoctor/asciidoctor-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use the term "format" instead of "type" to refer to image format
- Loading branch information
1 parent
3951f4d
commit 354b14e
Showing
5 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
module Asciidoctor | ||
module Image | ||
class << self | ||
def image_type path | ||
(::File.extname path)[1..-1].downcase | ||
def format path, node = nil | ||
(node && (node.attr 'format', nil, false)) || (::File.extname path).downcase[1..-1] | ||
end | ||
end | ||
|
||
def image_type | ||
(attr 'format', nil, false) || ::File.extname(inline? ? target : (attr 'target'))[1..-1].downcase | ||
def format | ||
(attr 'format', nil, false) || ::File.extname(inline? ? target : (attr 'target')).downcase[1..-1] | ||
end | ||
|
||
def target_with_image_type | ||
image_path = inline? ? (target) : (attr 'target') | ||
[image_path, (attr 'format', nil, false) || (::File.extname image_path)[1..-1].downcase] | ||
def target_and_format | ||
image_path = inline? ? target : (attr 'target') | ||
[image_path, (attr 'format', nil, false) || (::File.extname image_path).downcase[1..-1]] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters