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

Markups not being rendered #19

Open
roikiermedia opened this issue Jan 6, 2019 · 0 comments
Open

Markups not being rendered #19

roikiermedia opened this issue Jan 6, 2019 · 0 comments

Comments

@roikiermedia
Copy link

Version: 1.0.0

I build a vue component to render mobiledoc on the server side. The normal mobiledoc-kit editor has no problem rendering the bold and italic markup. mobiledoc-vdom-renderer only generates empty paragraph tags for all sections including markup. Text without markup is not affected.

<script>
import Renderer from "mobiledoc-vdom-renderer";

let doc = {
  version: "0.3.1",
  atoms: [],
  cards: [],
  markups: [["em"], ["strong"]],
  sections: [
    [1, "p", [[0, [], 0, "Normal Text"]]],
    [1, "p", [[0, [1], 1, "Bold"]]],
    [1, "p", [[0, [0], 1, "Italic"]]],
    [1, "p", [[0, [0], 0, ""], [0, [1], 2, "Bold-Italic"]]]
  ]
};

export default {
  render(h) {
    const render = Renderer({
      createElement: h
    });
    return <article>{render(doc)}</article>;
  }
};
</script>

Results in:

<article data-v-286199e1="" doc="[object Object]">
  <p>Normal Text</p>
  <p></p>
  <p></p>
  <p></p>
</article>

I already tried importing and using getMarkupComponentDefault as described in the readme but got the same result.

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

No branches or pull requests

1 participant