You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Bug fix
Fixes#928 Requires #1087 ( removal of _rebaseReferenceForStaticIncludes ( neccessary ) and adding getParentSiteAbsolutePath ( standardisation ) ) merged
What is the rationale for this request?
To fix the case that the user wants to use {{baseUrl}} inside the src attribute of a <include/panel>.
What changes did you make? (Give an overview)
When resolving the source file path of the included path, in addition to checking whether the source file is url, we check if the src has a {{\s*baseUrl\s*}}[/\\] regex.
If so, we recalculate the include source file path using the baseUrl of the current working file.
Added some functional tests to check for such cases
Added Markbind.unwrapIncludeSrc to the dynamic include build chain since it was missed before and my functional tests require it ( otherwise data-included-from would have my system's absolute file path, causing tests to fail )
Provide some example code that this change will affect:
...
if(baseUrlRegex.test(includePath)){// The baseUrl has not been resolved during pre-processing, but we need the source file pathconstparentSitePath=urlUtils.getParentSiteAbsolutePath(context.cwf,config.rootPath,config.baseUrlMap);filePath=path.resolve(parentSitePath,includePath.replace(baseUrlRegex,''));}else{
...
Is there anything you'd like reviewers to focus on?
na
Testing instructions:
npm run test should pass
2103 site should differ for **._include_.html files as Markbind.unwrapIncludeSrc was added. ( the wrapper div and spans with data-included-from should be deleted. )
Proposed commit message: (wrap lines at 72 characters)
Fix baseUrl not working in include src attribute
While pre-processing includes or panels, we have not yet resolved
the baseUrl of the src attribute.
This causes markbind to fail in finding the source file, since baseUrl
remains in the src attribute.
Let’s resolve the baseUrl for such cases first, allowing the user to use
the baseUrl attribute in include and panel src attributes.
While pre-processing includes or panels, we have not yet resolved
the baseUrl of the src attribute.
This causes markbind to fail in finding the source file, since baseUrl
remains in the src attribute.
Let’s resolve the baseUrl for such cases first, allowing the user to use
the baseUrl attribute in include and panel src attributes.
While pre-processing includes or panels, we have not yet resolved
the baseUrl of the src attribute.
This causes markbind to fail in finding the source file, since baseUrl
remains in the src attribute.
Let’s resolve the baseUrl for such cases first, allowing the user to use
the baseUrl attribute in include and panel src attributes.
ang-zeyu added a commit
to ang-zeyu/markbind
that referenced
this pull request
Jun 10, 2020
BaseUrl processing is done in a separate stage involving repeated and
recursive parsing / rendering of the content.
This decreases cohesiveness of variable processing, and also
performance due to the repeated parsing and rendering.
It also necessitates edge-case solutions such as that in MarkBind#1088 when we
need to resolve the baseUrl before the resolveBaseUrl stage has been
reached.
With a framework for variable processing now, let's move baseUrl
processing into it, solving the above said problems.
Furthermore, rendering of other variables containing html is dependent
on the extra htmlparser call in resolveBaseUrl.
Let's formally remove the need for this by using only the unescaped
nunjucks environment to render variables.
BaseUrl processing is done in a separate stage involving repeated and
recursive parsing / rendering of the content.
This decreases cohesiveness of variable processing, and also
performance due to the repeated parsing and rendering.
It also necessitates edge-case solutions such as that in MarkBind#1088 when we
need to resolve the baseUrl before the resolveBaseUrl stage has been
reached.
With a framework for variable processing now, let's move baseUrl
processing into it, solving the above said problems.
Furthermore, rendering of other variables containing html is dependent
on the extra htmlparser call in resolveBaseUrl.
Let's formally remove the need for this by using only the unescaped
nunjucks environment to render variables.
ang-zeyu added a commit
to ang-zeyu/markbind
that referenced
this pull request
Jun 13, 2020
BaseUrl processing is done in a separate stage involving repeated and
recursive parsing / rendering of the content.
This decreases cohesiveness of variable processing, and also
performance due to the repeated parsing and rendering.
It also necessitates edge-case solutions such as that in MarkBind#1088 when we
need to resolve the baseUrl before the resolveBaseUrl stage has been
reached.
With a framework for variable processing now, let's move baseUrl
processing into it, solving the above said problems.
Furthermore, rendering of other variables containing html is dependent
on the extra htmlparser call in resolveBaseUrl.
Let's formally remove the need for this by using only the unescaped
nunjucks environment to render variables.
ang-zeyu added a commit
to ang-zeyu/markbind
that referenced
this pull request
Jun 13, 2020
BaseUrl processing is done in a separate stage involving repeated and
recursive parsing / rendering of the content.
This decreases cohesiveness of variable processing, and also
performance due to the repeated parsing and rendering.
It also necessitates edge-case solutions such as that in MarkBind#1088 when we
need to resolve the baseUrl before the resolveBaseUrl stage has been
reached.
With a framework for variable processing now, let's move baseUrl
processing into it, solving the above said problems.
Furthermore, rendering of other variables containing html is dependent
on the extra htmlparser call in resolveBaseUrl.
Let's formally remove the need for this by using only the unescaped
nunjucks environment to render variables.
ang-zeyu added a commit
to ang-zeyu/markbind
that referenced
this pull request
Jun 22, 2020
BaseUrl processing is done in a separate stage involving repeated and
recursive parsing / rendering of the content.
This decreases cohesiveness of variable processing, and also
performance due to the repeated parsing and rendering.
It also necessitates edge-case solutions such as that in MarkBind#1088 when we
need to resolve the baseUrl before the resolveBaseUrl stage has been
reached.
With a framework for variable processing now, let's move baseUrl
processing into it, solving the above said problems.
Furthermore, rendering of other variables containing html is dependent
on the extra htmlparser call in resolveBaseUrl.
Let's formally remove the need for this by using only the unescaped
nunjucks environment to render variables.
ang-zeyu added a commit
to ang-zeyu/markbind
that referenced
this pull request
Jun 26, 2020
BaseUrl processing is done in a separate stage involving repeated and
recursive parsing / rendering of the content.
This decreases cohesiveness of variable processing, and also
performance due to the repeated parsing and rendering.
It also necessitates edge-case solutions such as that in MarkBind#1088 when we
need to resolve the baseUrl before the resolveBaseUrl stage has been
reached.
With a framework for variable processing now, let's move baseUrl
processing into it, solving the above said problems.
Furthermore, rendering of other variables containing html is dependent
on the extra htmlparser call in resolveBaseUrl.
Let's formally remove the need for this by using only the unescaped
nunjucks environment to render variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Bug fix
Fixes#928
Requires #1087 ( removal ofmerged_rebaseReferenceForStaticIncludes( neccessary ) and addinggetParentSiteAbsolutePath( standardisation ) )What is the rationale for this request?
To fix the case that the user wants to use
{{baseUrl}}inside thesrcattribute of a<include/panel>.What changes did you make? (Give an overview)
srchas a{{\s*baseUrl\s*}}[/\\]regex.If so, we recalculate the include source file path using the baseUrl of the current working file.
Markbind.unwrapIncludeSrcto the dynamic include build chain since it was missed before and my functional tests require it ( otherwisedata-included-fromwould have my system's absolute file path, causing tests to fail )Provide some example code that this change will affect:
Is there anything you'd like reviewers to focus on?
na
Testing instructions:
npm run testshould pass**._include_.htmlfiles asMarkbind.unwrapIncludeSrcwas added. ( the wrapper div and spans withdata-included-fromshould be deleted. )Proposed commit message: (wrap lines at 72 characters)
Fix baseUrl not working in include src attribute
While pre-processing includes or panels, we have not yet resolved
the baseUrl of the src attribute.
This causes markbind to fail in finding the source file, since baseUrl
remains in the src attribute.
Let’s resolve the baseUrl for such cases first, allowing the user to use
the baseUrl attribute in include and panel src attributes.