Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ryancasburn-KAI opened this issue Jan 3, 2024 · 2 comments

Comments

@ryancasburn-KAI
Copy link
Contributor

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?

@spencermountain
Copy link
Owner

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

@spencermountain
Copy link
Owner

released as 14.11.1 - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants