Skip to content

Instantly share code, notes, and snippets.

@rkaneko
Last active October 30, 2016 10:10
Show Gist options
  • Save rkaneko/c88c2a1e75e44f473235f14b314b2786 to your computer and use it in GitHub Desktop.
Save rkaneko/c88c2a1e75e44f473235f14b314b2786 to your computer and use it in GitHub Desktop.

Why?

I want to support inline code block in remark-react-lowlight project. However, the specs of libraries which remark-react-lowlight depends on unable me to confirm code block is inline or not. Of course, in mdast there are differences between inlinecode and non-inlinecode, but the props bound from remark-react to remark-react-lowlight doesn't contains the differences. The difference is lost procedure to convert mdast to hast, so I don't know how to support inline code block in remark-react-lowlight.

Problems

  1. inline code block

e.g.

`some inline code block`

Props bound from remark-react is

props = {
  children: ["some inline code block"]
};
  1. code block without a specific language

e.g.

\`\`\`
some
code
block
\`\`\`

Props bound from remark-react is

props = {
  children: ["some\ncode\nblock\n"]
}

We cannot confirm code block is inline or not from props bound from 'remark-react' because the same props bound from 'remark-react';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment