diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-01-08 11:01:45 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-01-16 09:42:57 +0100 |
commit | 505b1f5c8e6ee8f4f5376ffb7ad173dbd70c846b (patch) | |
tree | 7aca9e394521373602127c71b87f04961d6dfaf7 /server/sonar-docs/src/templates | |
parent | 47068be19be3b7e80b27c34ccb9278c2e83ae9de (diff) | |
download | sonarqube-505b1f5c8e6ee8f4f5376ffb7ad173dbd70c846b.tar.gz sonarqube-505b1f5c8e6ee8f4f5376ffb7ad173dbd70c846b.zip |
DOC-131 Improve @include handling
Diffstat (limited to 'server/sonar-docs/src/templates')
-rw-r--r-- | server/sonar-docs/src/templates/page.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/server/sonar-docs/src/templates/page.js b/server/sonar-docs/src/templates/page.js index d627cd7a338..12d16defb24 100644 --- a/server/sonar-docs/src/templates/page.js +++ b/server/sonar-docs/src/templates/page.js @@ -46,13 +46,10 @@ export default class Page extends React.PureComponent { render() { const page = this.props.data.markdownRemark; - let htmlWithInclusions = page.html.replace(/<p>@include (.*)<\/p>/, (_, path) => { - const chunk = data.allMarkdownRemark.edges.find(edge => edge.node.fields.slug === path); - return chunk ? chunk.node.html : ''; - }); const realHeadingsList = removeExtraHeadings(page.html, page.headings); + let htmlWithInclusions = page.html; htmlWithInclusions = removeTableOfContents(htmlWithInclusions); htmlWithInclusions = createAnchorForHeadings(htmlWithInclusions, realHeadingsList); htmlWithInclusions = replaceDynamicLinks(htmlWithInclusions); |