diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2019-04-11 15:06:52 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-04-12 20:21:04 +0200 |
commit | 0ff98114be62661af4c745d6110e6047a67adbe2 (patch) | |
tree | 13335d3f933c0280c19d75b459dcef84860ceb53 /server/sonar-web/src/main/js/components/docs/DocToc.tsx | |
parent | 4380a1d1594cb112f3d3e17b99f4a801c3d2fda8 (diff) | |
download | sonarqube-0ff98114be62661af4c745d6110e6047a67adbe2.tar.gz sonarqube-0ff98114be62661af4c745d6110e6047a67adbe2.zip |
SONAR-11956 Correct TOC parsing logic, always show sticky TOC for pages
Diffstat (limited to 'server/sonar-web/src/main/js/components/docs/DocToc.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/components/docs/DocToc.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/components/docs/DocToc.tsx b/server/sonar-web/src/main/js/components/docs/DocToc.tsx index 6f2f2cac2f3..7ff1d48a12d 100644 --- a/server/sonar-web/src/main/js/components/docs/DocToc.tsx +++ b/server/sonar-web/src/main/js/components/docs/DocToc.tsx @@ -48,11 +48,11 @@ export default class DocToc extends React.PureComponent<Props, State> { state: State = { anchors: [] }; - static getAnchors = memoize(content => { + static getAnchors = memoize((content: string) => { const file: { contents: JSX.Element } = remark() .use(reactRenderer) .use(onlyToc) - .processSync(content); + .processSync('\n## doctoc\n' + content); if (file && file.contents.props.children) { let list = file.contents; |