aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/docs
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-05-28 12:05:03 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-28 20:20:43 +0200
commit9819fb14345f1e57c9c1e8f59ec6cda6fe367750 (patch)
treef93c3f4c085f814a95372f190379848065c27f7f /server/sonar-web/src/main/js/components/docs
parent4063ffe9d2b7190497514ff7e476fedb57203d5e (diff)
downloadsonarqube-9819fb14345f1e57c9c1e8f59ec6cda6fe367750.tar.gz
sonarqube-9819fb14345f1e57c9c1e8f59ec6cda6fe367750.zip
get rid of gray-matter (#280)
Diffstat (limited to 'server/sonar-web/src/main/js/components/docs')
-rw-r--r--server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
index 8d3ae04e71d..384f0339d78 100644
--- a/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
+++ b/server/sonar-web/src/main/js/components/docs/DocMarkdownBlock.tsx
@@ -21,11 +21,11 @@ import * as React from 'react';
import * as classNames from 'classnames';
import remark from 'remark';
import reactRenderer from 'remark-react';
-import * as matter from 'gray-matter';
import * as PropTypes from 'prop-types';
import DocLink from './DocLink';
import DocParagraph from './DocParagraph';
import DocImg from './DocImg';
+import { separateFrontMatter } from '../../helpers/markdown';
interface Props {
className?: string;
@@ -40,10 +40,10 @@ export default class DocMarkdownBlock extends React.PureComponent<Props> {
render() {
const { className, content, displayH1 } = this.props;
- const parsed = matter(content || '');
+ const parsed = separateFrontMatter(content || '');
return (
<div className={classNames('markdown', className)}>
- {displayH1 && <h1>{parsed.data.title}</h1>}
+ {displayH1 && <h1>{parsed.frontmatter.title}</h1>}
{
remark()
// .use(remarkInclude)