relaton-render 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15d7bd7a186b81235cfc86e2259970512612706cd33cc09a87b98c06202d7ee7
4
- data.tar.gz: 511378e83688bb4c0590f6012be5176cda67edd1e368e0994251b3bd638627bd
3
+ metadata.gz: 3e355ba215a67c891399708f72baabeba37cddfc01a43df6d722c0a1aa769878
4
+ data.tar.gz: cdc21aa38ecdadab907db21b1b0cf58b8ce1f2ebc7966be7a894b4f58ffc3919
5
5
  SHA512:
6
- metadata.gz: 48d082ba071e7b794ffced1cc4a74c691e1715b0bfad3adcfa85d58ef7b8a2dd0cc37931c6f4d9505b91209889415f930dc4d887d2b7aac5151c061912f3f8ee
7
- data.tar.gz: 6a6786748486fbf4f065fac5951acdb5f647a5d7de652ed4dbf6d07cd344f5a3fcab3c4e9d59da521301fdc93f8e0d1552cdf0404a8d3bf363d145143f9117cc
6
+ metadata.gz: f52456f0d7708e911a731fb6f584aed61cced226ed4f7a5de54407b0563ccaa5e5d182472cc0d01d2a59e13d1955910b8cfed1fd601d79ac88745ec6cab45743
7
+ data.tar.gz: aeb47b97f4146f90bdc86a3e2b5637e35675c67e37bb79b49010a450d34adcfb5c2792b3334ecedf8ff2749bc3511afaeb42442cf35eb8ef840f56d2599f654c
data/README.adoc CHANGED
@@ -191,6 +191,7 @@ The Liquid template surrounds each field by preceding and following punctuation.
191
191
  * Underscore is escaped by \. So `<span_class="std\_note">` maps to `<span class="std_note">`.
192
192
  * If punctuation is space delimited, it is inserted regardless of preceding content. So `{{ creatornames }} ({{date}}) .` will insert the full stop whether or not the date is present.
193
193
  * Space between punctuation and before punctuation is automatically removed.
194
+ * Spaces within fields are globally converted to underscores. For that reason, any filter operations in Liquid need to refer to underscore instead of space.
194
195
 
195
196
  For example:
196
197
 
@@ -23,7 +23,7 @@ module Relaton
23
23
  .compact.map { |x| x.sub(/(.)\.?$/, "\\1.") }
24
24
  forenames.empty? and initials.empty? and return [nil, nil, nil]
25
25
  initials.empty? and initials = forenames.map { |x| "#{x[0]}." }
26
- [forenames.first, forenames[1..-1], initials]
26
+ [forenames.first, forenames[1..-1], Array(initials)]
27
27
  end
28
28
 
29
29
  def extractname(contributor)
@@ -56,9 +56,10 @@ module Relaton
56
56
  def series_title(series, _doc)
57
57
  return nil if series.nil?
58
58
 
59
- series.title.respond_to?(:titles) and
59
+ series.title.respond_to?(:titles) && !series.title.titles.empty? and
60
60
  return series.title.titles.first.title.content
61
- series.title&.title&.content || series.formattedref&.content
61
+ series.title.respond_to?(:title) and return series.title.title&.content
62
+ series.title.respond_to?(:formattedref) and series.formattedref.content
62
63
  end
63
64
 
64
65
  def series_formatted(series, _doc)
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Render
3
- VERSION = "0.4.3".freeze
3
+ VERSION = "0.4.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-render
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-22 00:00:00.000000000 Z
11
+ date: 2022-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler