Skip to content

Commit

Permalink
skip source if ref is empty (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
HassanAkbar authored Aug 8, 2024
1 parent 2cbae1a commit cccfa69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/metanorma/plugin/glossarist/dataset_preprocessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def concept_bibliography(concept)
bibliography = concept["eng"]["sources"].map do |source|
ref = source["origin"]["ref"]

next if @rendered_bibliographies[ref]
next if @rendered_bibliographies[ref] || ref.nil? || ref.empty?

@rendered_bibliographies[ref] = ref.gsub(/[ \/:]/, "_")
"* [[[#{@rendered_bibliographies[ref]},#{ref}]]]"
Expand Down Expand Up @@ -289,6 +289,7 @@ def notes(dataset_name, concept_name)
def sources(dataset_name, concept_name)
<<~SOURCES
{% for source in #{dataset_name}['#{concept_name}']['eng'].sources %}
{%- if source.origin.ref == nil or source.origin.ref == '' %}{% continue %}{% endif %}
[.source]
<<{{ source.origin.ref | replace: ' ', '_' | replace: '/', '_' | replace: ':', '_' }},{{ source.origin.clause }}>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ data:
ref: ISO/TS 14812:2022
clause: 3.1.1.1
link: https://www.iso.org/standard/79779.html
- type: lineage
origin:
ref: ''

0 comments on commit cccfa69

Please sign in to comment.