asciidoctor-dita-topic 1.3.2 → 1.3.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.
- checksums.yaml +4 -4
- data/lib/dita-topic.rb +21 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fc29eafdbe1a2cdf7ef447e252ecdcabc80af754902559bcf228e38e3b2fe04
|
4
|
+
data.tar.gz: 3ebd2721f248a9ad8dc20d428bfeb0fe6b0f1f74e8b9a24b2e62860b2bfc140f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5da5464ce466a101f87d0a047f87debb40bbb4a5ac185a5702a422e68cc9e6c4ba6bb5d5599acd38393e0e7f29824296a3a09391de91f503eecc7740f721801
|
7
|
+
data.tar.gz: cb90250840fa7fa9d8ac808dc1bbdec7b85f8f2a2378cad970c95e6705f3456331478571fc5616b365dc0dda552f800d68628f507bebb92857761b3d560866d9
|
data/lib/dita-topic.rb
CHANGED
@@ -530,13 +530,17 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
530
530
|
|
531
531
|
# Process individual list items:
|
532
532
|
node.items.each do |item|
|
533
|
+
# Compose the metadata attributes:
|
534
|
+
metadata, text = extract_attributes item.text
|
535
|
+
metadata = compose_metadata item.role if item.role
|
536
|
+
|
533
537
|
# Check if the list item contains multiple block elements:
|
534
538
|
if item.blocks?
|
535
|
-
result << %(<li#{compose_id item.id}#{
|
539
|
+
result << %(<li#{compose_id item.id}#{metadata}>#{text})
|
536
540
|
result << item.content
|
537
541
|
result << %(</li>)
|
538
542
|
else
|
539
|
-
result << %(<li#{compose_id item.id}#{
|
543
|
+
result << %(<li#{compose_id item.id}#{metadata}>#{text}</li>)
|
540
544
|
end
|
541
545
|
end
|
542
546
|
|
@@ -766,6 +770,10 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
766
770
|
|
767
771
|
# Process individual list items:
|
768
772
|
node.items.each do |item|
|
773
|
+
# Compose the metadata attributes:
|
774
|
+
metadata, text = extract_attributes item.text
|
775
|
+
metadata = compose_metadata item.role if item.role
|
776
|
+
|
769
777
|
# Check if the list item is part of a checklist:
|
770
778
|
unless item.attr? 'checkbox'
|
771
779
|
check_box = ''
|
@@ -775,11 +783,11 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
775
783
|
|
776
784
|
# Check if the list item contains multiple block elements:
|
777
785
|
if item.blocks?
|
778
|
-
result << %(<li#{compose_id item.id}#{
|
786
|
+
result << %(<li#{compose_id item.id}#{metadata}>#{check_box}#{text})
|
779
787
|
result << item.content
|
780
788
|
result << %(</li>)
|
781
789
|
else
|
782
|
-
result << %(<li#{compose_id item.id}#{
|
790
|
+
result << %(<li#{compose_id item.id}#{metadata}>#{check_box}#{text}</li>)
|
783
791
|
end
|
784
792
|
end
|
785
793
|
|
@@ -1053,6 +1061,15 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
1053
1061
|
end
|
1054
1062
|
end
|
1055
1063
|
|
1064
|
+
def extract_attributes text
|
1065
|
+
# Extract metadata attributes from an empty ph element:
|
1066
|
+
if /^\s*<ph(?<attributes> [^>]+)><\/ph>\s*/ =~ text
|
1067
|
+
return attributes, text.sub(/^\s*<ph[^>]+><\/ph>\s*/, '')
|
1068
|
+
else
|
1069
|
+
return '', text
|
1070
|
+
end
|
1071
|
+
end
|
1072
|
+
|
1056
1073
|
def format_message message
|
1057
1074
|
# Compose the warning or error message:
|
1058
1075
|
file_name = (defined? @file_name) ? %( #{@file_name}:) : ''
|