Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/*
* This function is not intended to be invoked directly. Instead it will be
* triggered by an orchestrator function.
*/
const storage = require("azure-storage"),
matter = require("gray-matter"),
remarkable = require('remarkable'),
hljs = require('highlight.js'),
blobService = storage.createBlobService(process.env['AzureWebJobsStorage']);
var md = new remarkable.Remarkable({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
} catch (err) {}
}
try {
return hljs.highlightAuto(str).value;
} catch (err) {}
return ''; // use external default escaping
},
typographer: true,
html: true
});
// eslint-disable-next-line import/named
import { COMMUNITY_CHEATSHEET } from '@config'
import { uid } from '@utils'
import {
Wrapper,
CardWrapper,
ErrorWrapper,
ErrorTitle,
ErrorLink,
} from './styles/cheatsheet'
import parser from './parser'
import CheatSheetStyle from './styles/CheatsheetMarkStyles'
const md = new Remarkable()
const Cards = ({ cards }) =>
cards.map(item => (
<div>
))
const Cheatsheet = ({ source, communityRaw }) => {</div>
const highlight = require('highlight.js')
const http = require('http')
const morgan = require('morgan')
const path = require('path')
const pug = require('pug')
const { Remarkable } = require('remarkable')
const config = require('../config')
const desktopApi = require('./desktop-api')
const PORT = Number(process.argv[2]) || 4000
const app = express()
const server = http.createServer(app)
const remark = new Remarkable({
html: true,
highlight: function (code, lang) {
const h = lang
? highlight.highlight(lang, code)
: highlight.highlightAuto(code)
return '<div class="hljs">' + h.value + '</div>'
}
})
pug.filters.markdown = (md, options) => {
return remark.render(md)
}
// Trust "X-Forwarded-For" and "X-Forwarded-Proto" nginx headers
app.enable('trust proxy')
import { Remarkable } from 'remarkable'
import emojiPlugin from 'remarkable-emoji'
import mentionsPlugin from 'remarkable-mentions'
import Prism from 'mastani-codehighlight'
import { MENTION_USER_ADDR } from '@config'
import { buildLog } from '@utils'
import MarkDownStyle from '@containers/ThemeWrapper/MarkDownStyle'
import { PreviewerContainer } from './styles'
/* eslint-disable-next-line */
const log = buildLog('c:MarkDownRender:index')
// const md = new Remarkable()
const md = new Remarkable('full', {
// NOTE: html should always be false
// Enable HTML tags in source
html: false,
breaks: false,
linkTarget: '_blank',
})
md.use(mentionsPlugin({ url: MENTION_USER_ADDR }))
md.use(emojiPlugin)
class MarkDownRender extends React.Component {
constructor(props) {
super(props)
this.state = { body: '' }
}
id: faq
title: Frequently Asked Questions (FAQ)
---
import {Question, FaqTags} from '@theme/Faq'
<br><br>
`
md = new Remarkable()
faq.forEach((el) => {
markdownPage += `\n`
markdownPage += `${el.tags
.map((tag) => {
return '#' + tag
})
.join(' ')}
`
markdownPage += md.render(`**Q**: ${el.q}`)
markdownPage += md.render(`**A**: ${el.a}`)
if (el.context) {
markdownPage += md.render(`context: ${el.context}`)
}
markdownPage += `
<br>
function flush (cb) {
var self = this
var mdParser = new Remarkable(opts.remarkable.preset, extend({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value
} catch (err) {}
}
try {
return hljs.highlightAuto(str).value
} catch (err) {}
return ''
}
}, opts.remarkable))
opts.remarkable.plugins.forEach(function (plugin) {
constructor(props: ITooltipProps) {
super(props);
this.state = {
md: new Remarkable()
};
}
constructor() {
super();
this.state = { expanded: false };
this.remarkable = new Remarkable();
}