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

Refactor slate-remark-transformer #271

Open
cloverich opened this issue Nov 22, 2024 · 0 comments
Open

Refactor slate-remark-transformer #271

cloverich opened this issue Nov 22, 2024 · 0 comments
Labels
markdown Issue related to markdown parsing or serializing refactor Refactoring, tech debt, clean-up - things that would be done if I was less time constrained

Comments

@cloverich
Copy link
Owner

I forked this library ages ago to add some customizations (noted in code comments). In #265 I further trimmed it down dropping unused nodes and its types. Ideally I'd make the following additional changes time permitting:

  • Re-work to be a proper mdast-util plugin, rather than a wrapping utility
  • Re-work inner switch statement to be a parameter at setup time

i.e. should work more like this:

export const parseMarkdown = (markdown: string): mdast.Root => {
  return fromMarkdown(markdown, {
    mdastExtensions: [mdastSlateTransformer({
      paragraph: (node: Mdast): slate.Node => {}, ...
      code: // ... etc
    })],
  });
};

That would solve the original fork-ing need and better organize the customized code; don't have a good idea of how best to organize the slate / plate / mdast customizations but its in a better state than before, and this change will make it better still.

@cloverich cloverich added refactor Refactoring, tech debt, clean-up - things that would be done if I was less time constrained markdown Issue related to markdown parsing or serializing labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown Issue related to markdown parsing or serializing refactor Refactoring, tech debt, clean-up - things that would be done if I was less time constrained
Projects
None yet
Development

No branches or pull requests

1 participant