Skip to content

Commit

Permalink
🐛 Remove blank space around included content
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed Apr 10, 2024
1 parent 2a532d7 commit 966ce5f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/quick-kiwis-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'myst-to-react': patch
---

Fix included content spacing
9 changes: 9 additions & 0 deletions packages/myst-to-react/src/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ type Keyboard = {
type: 'keyboard';
};

type Include = {
type: 'include';
};

type BasicNodeRenderers = {
text: NodeRenderer<spec.Text>;
span: NodeRenderer<GenericNode>;
Expand Down Expand Up @@ -90,6 +94,7 @@ type BasicNodeRenderers = {
definitionTerm: NodeRenderer<DefinitionTerm>;
definitionDescription: NodeRenderer<DefinitionDescription>;
aside: NodeRenderer<Aside>;
include: NodeRenderer<Include>;
};

const BASIC_RENDERERS: BasicNodeRenderers = {
Expand Down Expand Up @@ -387,6 +392,10 @@ const BASIC_RENDERERS: BasicNodeRenderers = {
</kbd>
);
},
include({ node }) {
// TODO, provider could give context about the filename
return <MyST ast={node.children} />;
},
};

export default BASIC_RENDERERS;

0 comments on commit 966ce5f

Please sign in to comment.