josemarluedke / remark-hbs

Remark plugin that allows writing markdown with Ember handlebars templates
MIT License
6 stars 2 forks source link

[Bugfix]: Nested components with text content cause error #10

Closed NullVoxPopuli closed 3 years ago

NullVoxPopuli commented 3 years ago

I did some refactoring a bit, too -- to separate out fixture tests from manual test so that we can focus on individual problems, rather than rely on on big markdown files -- with node --inspect-brk and jest test name matching, it also means we'll be able to debug easier, too

NullVoxPopuli commented 3 years ago

image

NullVoxPopuli commented 3 years ago

I was able to determine this:

 [
        {
          type: 'html',
          position: { start: [Object], end: [Object] },
          value: '<Nested::Component>'
        },
        {
          type: 'text',
          value: '\nsome text\n</Nested::Component>',
          position: { start: [Object], end: [Object] }
        }
      ]

but like... if that node is text, idk what to do with it :thinking: maybe the plugin needs to keep track of the open tags, and see if a closing tag exists in text nodes?

NullVoxPopuli commented 3 years ago

Answer: nope. This was much easier than expected

josemarluedke commented 3 years ago

Published in v0.3.3.