How to use the marksy.marksy function in marksy

To help you get started, we’ve selected a few marksy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Royal-Navy / standards-toolkit / packages / docs-site / readme-preparser.js View on Github external
function compile(markdown, options) {
  const tableData = transformTableData(markdown)

  return marksy({
    createElement,
    elements: {
      code({ language, code }) {
        let children = babel.transform(code, {
          plugins: ['@babel/plugin-transform-react-jsx'],
        }).code

        children = children.replace(/(?<=createElement\().*?(?=, )/g, match => {
          return `'${match}'`
        })

        return createElement(
          'CodeHighlighter',
          {
            source: encodeProp(code),
            language: language || 'javascript',
github cerebral / cerebral / website / builder / builder / extractMarkdownFiles.js View on Github external
const React = require('react')
const path = require('path')
const marksy = require('marksy').marksy
const {readFile, fileExistsSync} = require('./utils')
const config = require('../config.json')

const compile = marksy({
  components: {
    Youtube (props) {
      return (
        <div style="{{textAlign:">
          </div>

marksy

Convert markdown into react components

MIT
Latest version published 5 years ago

Package Health Score

53 / 100
Full package analysis