diff --git a/src/lib/markbind/src/preprocessors/componentPreprocessor.js b/src/lib/markbind/src/preprocessors/componentPreprocessor.js index 7e3e642a33..2659b6438e 100644 --- a/src/lib/markbind/src/preprocessors/componentPreprocessor.js +++ b/src/lib/markbind/src/preprocessors/componentPreprocessor.js @@ -236,30 +236,10 @@ function _isHtmlIncludingMarkdown(node, context, filePath) { return isIncludeSrcMd; } -function _preprocessDynamicInclude(node, context, parser, hash, filePath, actualFilePath) { - const element = node; - element.name = 'panel'; - element.attribs.src = filePath; - - element.attribs['no-close'] = true; - element.attribs['no-switch'] = true; - element.attribs.header = element.attribs.name || ''; - - if (hash) { - element.attribs.fragment = hash.substring(1); - } - - parser.dynamicIncludeSrc.push({ from: context.cwf, to: actualFilePath, asIfTo: element.attribs.src }); - delete element.attribs.dynamic; - - return element; -} - /** * PreProcesses includes. * Replaces it with an error node if the specified src is invalid, * or an empty node if the src is invalid but optional. - * Replaces it with a panel with the appropriate content if the dynamic attribute is specified. */ function _preprocessInclude(node, context, config, parser) { const element = node; @@ -295,14 +275,10 @@ function _preprocessInclude(node, context, config, parser) { const isInline = _.has(element.attribs, 'inline'); const isTrim = _.has(element.attribs, 'trim'); - const isDynamic = _.has(element.attribs, 'dynamic'); element.name = isInline ? 'span' : 'div'; element.attribs[ATTRIB_INCLUDE_PATH] = filePath; - // Use a 'plain' panel for a dynamic include - if (isDynamic) return _preprocessDynamicInclude(element, context, parser, hash, filePath, actualFilePath); - // No need to process url contents if (isUrl) return element; diff --git a/test/functional/test_site/_markbind/boilerplates/folder/inside.md b/test/functional/test_site/_markbind/boilerplates/folder/inside.md index eb2d22c07c..62021a33e5 100644 --- a/test/functional/test_site/_markbind/boilerplates/folder/inside.md +++ b/test/functional/test_site/_markbind/boilerplates/folder/inside.md @@ -1,6 +1,4 @@ -# Path within the boilerplate folder is separately specified - -This is dynamically included. +# Path within the boilerplate folder is separately specified Like static include, pages within the site should be able to use files located in folders within boilerplate. diff --git a/test/functional/test_site/expected/index.html b/test/functional/test_site/expected/index.html index dcf2201aa4..c6c586ef41 100644 --- a/test/functional/test_site/expected/index.html +++ b/test/functional/test_site/expected/index.html @@ -287,19 +287,22 @@
Requirements gathering, requirements elicitation, requirements analysis, requirements capture are some of the terms commonly and interchangeably used to represent the activity of understanding what a software product should do.
-Dynamic include
-
- Dynamic Include
Boilerplate include
Boilerplate Includes
- Referencing specified path in boilerplate
Like static include, pages within the site should be able to use files located in folders within boilerplate.
+Also, the boilerplate file name (e.g. inside.md) and the file that it is supposed to act as (notInside.md) can be different.
This file should behaves as if it is in the requirements folder:
Tested with the folllowing include
+ +Nested include