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

Add support for As mentioned in @Shech2019 like in rehypeCitation #58

Open
github-actions bot opened this issue Jun 6, 2022 · 0 comments
Open
Labels

Comments

@github-actions
Copy link

github-actions bot commented Jun 6, 2022

Add support for As mentioned in @Shech2019 like in rehypeCitation

https://github.com/ThomasFKJorna/thesis-visualization/blob/913b062c0a6db3c9f16c8d6b320503a294977d78/libs/zkp-editor/src/lib/transformers/mdx/transformers/mdx.ts#L13

import {} from 'remark-slate-transformer'
import {
  MdxFlowExpression,
  MdxjsEsm,
  MdxJsxExpressionAttribute,
  MdxJsxFlowElement,
  MdxJsxTextElement,
  MdxTextExpression,
} from 'mdast-util-mdx'
import { SlateMDX } from '../../../types'

/**
 * TODO: Add support for `As mentioned in @Shech2019` like in rehypeCitation
 */
export const mdx = (
  node:
    | MdxTextExpression
    | MdxFlowExpression
    | MdxJsxTextElement
    | MdxjsEsm
    | MdxJsxFlowElement
    | MdxJsxExpressionAttribute,
  next: (children: any[]) => any,
) => {
  const { type, position, value, ...rest } = node
  console.log(node)
  return {
    ...rest,
    type: 'mdx',
    ...(value || rest.data ? { text: value || '' } : {}),
  }
}

d87cd1e920d5ea784ba1324d3ad1161418566323

@github-actions github-actions bot added the todo label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants