<commit_before>require 'spec_helper'

RSpec.describe AbstractXmlHelper, type: :helper do
  fixtures :all
  let(:user_signed_in?) { true }

  before do
    @collection = Collection.first
  end

  it "returns a <br> tag with preserve_lb=true" do
    xml_text = "<?xml version='1.0' encoding='UTF-8'?>    \n      <page>\n        <p>guide the reader <lb/>to the correct pron<lb break='no'/>ounciation [sic].</p><p>I am Dear Sir<lb/>Yours Faithfully<lb/><NAME></p>\n      </page>\n"
    expect(xml_to_html(xml_text, true, true)).to include("correct pron<br/>\nounciation")
  end

  it "returns a <span> tag and a hyphen with preserve_lb=false" do
    xml_text = "<?xml version='1.0' encoding='UTF-8'?>    \n      <page>\n        <p>guide the reader <lb/>to the correct pron<lb break='no'/>ounciation [sic].</p><p>I am Dear Sir<lb/>Yours Faithfully<lb/><NAME></p>\n      </page>\n"
    expect(xml_to_html(xml_text, false, true)).to include("pron<span class='line-break'>-</span>ounciation")
  end<commit_msg>AbstractXmlHelper: whitespace fix<commit_after>require 'spec_helper'

RSpec.describe AbstractXmlHelper, type: :helper do
  fixtures :all

  let(:user_signed_in?) { true }

  before do
    @collection = Collection.first
  end

  it "returns a <br> tag with preserve_lb=true" do
    xml_text = "<?xml version='1.0' encoding='UTF-8'?>    \n      <page>\n        <p>guide the reader <lb/>to the correct pron<lb break='no'/>ounciation [sic].</p><p>I am Dear Sir<lb/>Yours Faithfully<lb/><NAME></p>\n      </page>\n"
    expect(xml_to_html(xml_text, true, true)).to include("correct pron<br/>\nounciation")
  end

  it "returns a <span> tag and a hyphen with preserve_lb=false" do
    xml_text = "<?xml version='1.0' encoding='UTF-8'?>    \n      <page>\n        <p>guide the reader <lb/>to the correct pron<lb break='no'/>ounciation [sic].</p><p>I am Dear Sir<lb/>Yours Faithfully<lb/><NAME></p>\n      </page>\n"
    expect(xml_to_html(xml_text, false, true)).to include("pron<span class='line-break'>-</span>ounciation")
  end
{'fraction_non_alphanumeric': 0.17135802469135802, 'fraction_numerical': 0.005925925925925926, 'mean_word_length': 3.823809523809524, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 4, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '660169', 'n_tokens_mistral': 736, 'n_tokens_neox': 718, 'n_words': 175}