spencermountain / compromise

modest natural-language processing

Home Page:http://compromise.cool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If there is a Pre tag, the text from that term is not included in the HTML export

ryancasburn-KAI opened this issue · comments

out += t.pre || '' + t.text || ''

Test case:

  doc = nlp(`if i can recall, my grey dog loves pizza crusts (they are really good).`)
  html = doc.html({ '.red': 'my grey dog', '.blue': doc.match('loves') })
  t.equal(
    html,
    `if i can recall, <span class="red">my grey dog</span> <span class="blue">loves</span> pizza crusts (they are really good).`,
    here + 'html two classes'
  )

Currently returning:

if i can recall, <span class="red">my grey dog</span> <span class="redTwo">loves</span> pizza crusts ( are really good).

suggestion is:

out += t.pre || ''
out += t.text || ''

Any issues with that?

oh my gosh, it's missing the word??
yeah! please add a fix!
holy cow

released as 14.11.1 - thank you!