import * as React from 'react'; import * as marked from 'marked'; import { resolvePath } from '../utilities/path'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; import connect, { Connect } from '../../../../framework/src/flux/connect'; import { Markdown } from "../components/markdown"; import '!style-loader!css-loader!github-markdown-css/github-markdown.css' const mapProps = (state: IApplicationStoreState) => ({ content: state.help.content, currentPath: state.help.currentPath }); type HelpApplicationComponentProps = Connect; class HelpApplicationComponent extends React.Component { /** * Initializes a new instance. */ constructor (props: HelpApplicationComponentProps) { super(props); this.renderer = new marked.Renderer(); this.renderer.link = (href: string, title: string, text: string) => { // check if href is rel or abs const absUrlMatch = href.trim().match(/^https?:\/\//i); return `${text}` }; this.renderer.image = (href: string, title: string) => { return `${title}` }; } render(): JSX.Element { return this.props.content ? ( ) : (

Loading ...

) } private renderer: marked.Renderer; } export const HelpApplication = connect(mapProps)(HelpApplicationComponent); export default HelpApplication;