From cc2085d249509fd0409a5612857d2287b25d8616 Mon Sep 17 00:00:00 2001 From: Michael Ginalick Date: Thu, 23 Feb 2023 08:36:42 -0600 Subject: [PATCH] Support span tags in render_node method --- lib/contentstack_utils/model/options.rb | 4 +++- spec/lib/model/option_spec.rb | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/contentstack_utils/model/options.rb b/lib/contentstack_utils/model/options.rb index 5db11c9..94abecb 100644 --- a/lib/contentstack_utils/model/options.rb +++ b/lib/contentstack_utils/model/options.rb @@ -105,9 +105,11 @@ def render_node(node_type, node, inner_html) renderString = "#{inner_html}" when 'reference' renderString = "" + when 'span' + renderString = "#{inner_html}" end renderString end end end -end \ No newline at end of file +end diff --git a/spec/lib/model/option_spec.rb b/spec/lib/model/option_spec.rb index 9e4f3ff..23be650 100644 --- a/spec/lib/model/option_spec.rb +++ b/spec/lib/model/option_spec.rb @@ -305,5 +305,12 @@ def getMetadata(itemType=nil, styleType=nil, linkText=nil) expect(result).to eq "" end + it 'Should return span string for span node type' do + doc = getJson(BlankDocument) + + result = subject.render_node('span', doc, linkText) + expect(result).to eq "#{linkText}" + end + end -end \ No newline at end of file +end