-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix baseUrl not working in include src attribute #1088
Merged
Merged
Conversation
This file contains 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
2a67704
to
9165b20
Compare
Can be reviewed now that #1087 has been merged! |
900881a
to
0972aef
Compare
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.
yamgent
approved these changes
Mar 29, 2020
marvinchin
pushed a commit
that referenced
this pull request
Apr 10, 2020
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.
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.
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 thesrc
attribute of a<include/panel>
.What changes did you make? (Give an overview)
src
has a{{\s*baseUrl\s*}}[/\\]
regex.If so, we recalculate the include source file path using the baseUrl of the current working file.
Markbind.unwrapIncludeSrc
to the dynamic include build chain since it was missed before and my functional tests require it ( otherwisedata-included-from
would 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 test
should pass**._include_.html
files asMarkbind.unwrapIncludeSrc
was added. ( the wrapper div and spans withdata-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.