asciidoctor-dita-topic 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dita-topic.rb +21 -19
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 172e330842b5b5f390c287fd0adfe4e51a055c669145c09a0a4b07d7a85057ba
4
- data.tar.gz: 3e76bd3a36ed2954827156500d393ac982506862395fbceb30b84c075db95e72
3
+ metadata.gz: 26ce0f384369b685c43454ec161ac81cdd99c630c85bef52d16e0cff55423166
4
+ data.tar.gz: ba0257aa9f21b1f958e07103ecc9c7bd5476bf02038c0110feeb8c8c0fc36731
5
5
  SHA512:
6
- metadata.gz: 4f5cc15df1b03d9198a87d9996859b067a957928375a6469c8901c3850d76dc0f06f5f3e9e3ff9eb86a8f369c55bf9d7c9a9074e2937ff5798b7b9157bb4a428
7
- data.tar.gz: 2986bb1e278b253df0d1d0768d695e8799191253f3527c58f8ef027159ce237e7a09e517dfa78d6cc1043d0c437ff09866848c6ddbe8db7cbb7781806c342252
6
+ metadata.gz: bf9814f61b806557250d29b32cf5ae640cf4345a9e5657a856ce4173de9cbdbc1a2a89a4295a528a82d073f4ccae11a3b321e00902531ed9c18256f8dd6472f9
7
+ data.tar.gz: c0693f56fccd42fdc39813a676ca5475670bd7aa5e4a3a5ecb71d45e140d2bfb8861bc093fa6334af3bb4c1f20fafc143237f03557fda52f816a9b055b0b4459
data/lib/dita-topic.rb CHANGED
@@ -142,42 +142,36 @@ class DitaTopic < Asciidoctor::Converter::Base
142
142
  # Reset the counter:
143
143
  number = 0
144
144
 
145
- # Open the table:
146
- result = ['<table outputclass="callout-list">']
147
- result << %(<tgroup cols="2">)
148
- result << %(<colspec colwidth="15*" />)
149
- result << %(<colspec colwidth="85*" />)
150
- result << %(<tbody>)
145
+ # Open the definition list:
146
+ result = ['<dl outputclass="callout-list">']
151
147
 
152
148
  # Process individual list items:
153
149
  node.items.each do |item|
154
150
  # Increment the counter:
155
151
  number += 1
156
152
 
157
- # Open the table row:
158
- result << %(<row>)
153
+ # Open the definition entry:
154
+ result << %(<dlentry>)
159
155
 
160
156
  # Compose the callout number:
161
- result << %(<entry>#{compose_circled_number number}</entry>)
157
+ result << %(<dt>#{compose_circled_number number}</dt>)
162
158
 
163
159
  # Check if description contains multiple block elements:
164
160
  if item.blocks
165
- result << %(<entry>)
166
- result << %(<p>#{item.text}</p>)
161
+ result << %(<dd>)
162
+ result << item.text
167
163
  result << item.content
168
- result << %(</entry>)
164
+ result << %(</dd>)
169
165
  else
170
166
  result << %(<entry>#{item.text}</entry>)
171
167
  end
172
168
 
173
- # Close the row:
174
- result << %(</row>)
169
+ # Close the definition entry:
170
+ result << %(</dlentry>)
175
171
  end
176
172
 
177
- # Close the table:
178
- result << %(</tbody>)
179
- result << %(</tgroup>)
180
- result << %(</table>)
173
+ # Close the definition list:
174
+ result << %(</dl>)
181
175
 
182
176
  # Return the XML output:
183
177
  result.join LF
@@ -248,12 +242,16 @@ class DitaTopic < Asciidoctor::Converter::Base
248
242
  %(<p outputclass="title sect#{node.level}"><b>#{node.title}</b></p>)
249
243
  end
250
244
 
251
- def convert_image(node)
245
+ def convert_image node
252
246
  # Check if additional attributes are specified:
253
247
  width = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : ''
254
248
  height = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : ''
255
249
  scale = (node.attr? 'scale') ? %( scale="#{(node.attr 'scale').tr('%', '')}") : ''
256
250
 
251
+ # Exclude width and height attributes with percentage values:
252
+ width = '' if width.include? '%'
253
+ height = '' if height.include? '%'
254
+
257
255
  # Check if the image has a title specified:
258
256
  if node.title?
259
257
  <<~EOF.chomp
@@ -365,6 +363,10 @@ class DitaTopic < Asciidoctor::Converter::Base
365
363
  width = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : ''
366
364
  height = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : ''
367
365
 
366
+ # Exclude width and height attributes with percentage values:
367
+ width = '' if width.include? '%'
368
+ height = '' if height.include? '%'
369
+
368
370
  # Return the XML output:
369
371
  %(<image href="#{node.image_uri node.target}"#{width}#{height} placement="inline"><alt>#{node.alt}</alt></image>)
370
372
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-dita-topic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaromir Hradilek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-23 00:00:00.000000000 Z
11
+ date: 2025-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor