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

Restore functionality of the 'replace' directive #3011

Merged
merged 2 commits into from
Sep 17, 2021
Merged

Restore functionality of the 'replace' directive #3011

merged 2 commits into from
Sep 17, 2021

Conversation

mvriel
Copy link
Member

@mvriel mvriel commented Sep 17, 2021

In the process of splitting the parsing from the rendering, we did not
take into account that variables were stored on the Environment class.
In the original implementation this Environment class shared state
between just about everything in the whole app.

By pushing the variables into the DocumentDescriptor and restoring it
when rendering, the replace functionality now works again.

Additionally, I found a slight bug in the DocumentParser; when a
Directive is followed by something other than a CodeNode we want to
ignore it and not pass it as a SpanNode to the directive's process
function. In that scenario, the deeper business logic will convert that
SpanNode into a piece of text on the page. Which you do not want.

Fixes #3006

In the process of splitting the parsing from the rendering, we did not
take into account that variables were stored on the Environment class.
In the original implementation this Environment class shared state
between just about everything in the whole app.

By pushing the variables into the DocumentDescriptor and restoring it
when rendering, the replace functionality now works again.

Additionally, I found a slight bug in the DocumentParser; when a
Directive is followed by something other than a CodeNode we want to
ignore it and not pass it as a SpanNode to the directive's process
function. In that scenario, the deeper business logic will convert that
SpanNode into a piece of text on the page. Which you do not want.
@jaapio jaapio merged commit 8f98b64 into master Sep 17, 2021
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.

Environment variables are empty at "renderVariables".
2 participants