stormz / kramdown-prismic

Kramdown to prismic's rich text format and the other way around
https://rubygems.org/gems/kramdown-prismic
MIT License
23 stars 11 forks source link

<strong> tag with extra whitespace is parsed incorrectly #10

Closed sendmenas closed 2 years ago

sendmenas commented 2 years ago

I have an issue when parsing from html to rich text. If I pass such text <p>Some text in <strong>strong </strong> style</p>, rich text json is created correctly. But if there is a whitespace inside the tag <p>Some text in <strong> strong</strong> style</p>, then this part of the text gets lost.

[
  {
    type: 'paragraph',
    content: { text: 'Some text in  style', spans: [] }
  }
]

Works the same if the space is in the beginning or end. Am I missing something or is this a bug?

francois2metz commented 2 years ago

Hi! I was able to reproduce it. This seems to be a bug. I'll try to fix it later.

sendmenas commented 2 years ago

Hi! I was able to reproduce it. This seems to be a bug. I'll try to fix it later.

I have made a workaround with regex, so no rush from my side 😸

francois2metz commented 2 years ago

I have released the v0.3.8 that fix this issue.