natemoo-re / astro-remote

Render remote HTML or Markdown content in Astro with full control over the output
MIT License
181 stars 9 forks source link

Some content disappear inside paragraph tags #1

Closed JulianCataldo closed 2 years ago

JulianCataldo commented 2 years ago

Thanks @natemoo-re, that's an awesome plugin for SSR uses!

I'm actually evaluating it for this work-in-progress: https://github.com/JulianCataldo/content-maestro It's a content edition framework, with advanced Astro integration in mind, for SSR live-content feeding.

astro-remote is promising for my uses cases, and I've successfully binded the two and injected custom components, however,

I've encountered this major issue:


Setup:

pnpx degit natemoo-re/astro-remote .
pnpm i
pnpm run dev

Edit ./packages/demo/src/pages/index.astro

      <Markdown
        content={`

      Double spaces here ->  
      Oh no! Everything disappear

      Works fine here.

      `}
        components={{}}
      />

result:

      <p><br></p><p>Works fine here.</p>

Add some bold:

      <Markdown
        content={`

      Double spaces here ->  
      Oh no! **Everything** (BOLDed) disappear

      Works fine here.

      `}
        components={{}}
      />

result:

<p><br>Oh no! <strong>Everything</strong></p><p>Works fine here.</p>

Might be a bug with the parser maybe? (ultra-html).

This occurs also with the <Markup /> component, which I was using in the first place, with pre-transformed markdown from content-maestro server.

natemoo-re commented 2 years ago

Yep, definitely sounds like a bug in the parser. I'll take a look as soon as I can!

natemoo-re commented 2 years ago

OK, finally was able to track this down and fix it in https://github.com/natemoo-re/ultrahtml/releases/tag/v0.1.0. About to update this and get a patch out!