MSzturc / obsidian-advanced-slides

Create markdown-based reveal.js presentations in Obsidian
https://mszturc.github.io/obsidian-advanced-slides/
MIT License
948 stars 80 forks source link

AutoClosingProcessor deforms my embedded TSX/React code #222

Open bdudelsack opened 1 year ago

bdudelsack commented 1 year ago

It is kinda of edge case, but the logic of the AutoClosingProcessor is too simple to handle this correctly.

Source:

/* ... */

render(
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<App />} />
      <Route path="expenses" element={<Expenses />} />
      <Route path="invoices" element={<Invoices />} />
    </Routes>
  </BrowserRouter>,
  rootElement
);

Rendered code:

/* ... */

render(
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<App ></Route>} />
      <Route path="expenses" element={<Expenses ></Route>} />
      <Route path="invoices" element={<Invoices ></Route>} />
    </Routes>
  </BrowserRouter>,
  rootElement
);

The logic of the AutoClosingProcessor should include this case, because sometimes we pass Components as Attributes in React.