Skip to content
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

Site: Initialize baseUrl before user variables #264

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

yamgent
Copy link
Member

@yamgent yamgent commented Jun 12, 2018

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] Bug fix

Fixes #261.

What is the rationale for this request?
If a user variable refers to baseUrl, the string is empty instead of the actual baseUrl.

What changes did you make? (Give an overview)
Shifted the order of the variable initialization such that baseUrl is initialized first. Thanks to @rachx for the fix suggestion.

Provide some example code that this change will affect:
https://github.com/yamgent/markbind-problems/tree/master/issue_261

Is there anything you'd like reviewers to focus on?
NIL

Testing instructions:

  1. Clone https://github.com/yamgent/markbind-problems.git.
  2. Navigate inside issue_261.
  3. Run markbind serve.
  4. The actual should match the expected.
    a. In the buggy version, the second line will render as The baseUrl that we are using is . (i.e. baseUrl does not render properly).

The baseUrl variable is only initialized after all user variables have
been processed.

If the content of the user variables refer to baseUrl, baseUrl will be
evaluated as empty because it is not initialized yet.

Let's rearrange the order of variable initialization such that baseUrl
is initialized first. That way, user variables that reference it will
not have an empty value since it is initialized by the time the user
variables are processed.
@yamgent yamgent merged commit c4bc206 into MarkBind:master Jun 18, 2018
@yamgent yamgent added this to the v1.8.2 milestone Jun 21, 2018
@yamgent yamgent deleted the 261-baseUrl-variable branch June 22, 2018 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

baseUrl cannot be used inside another variable
2 participants