Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nokazn
Copy link
Contributor

@nokazn nokazn commented Mar 23, 2022

Overview

Hi, there!

I run into a case that using <include> tag multiple times with locals defined globally causes uncorrect evaluation for locals. This PR is a patch for that case.

Example

<!-- parts.html -->
<div>{{ foo }}</div>
<include src="parts.html" locals='{ "foo": 1 }'></include>
<include src="parts.html" locals='{ "foo": 2 }'></include>

<!-- expected -->
<div>1</div>
<div>2</div>
<!-- actual -->
<div>1</div>
<div>1</div>

(See also test/expected/multiple-include.html.)

Points to change

  • fix merged locals options for posthtml-expressions & add test cases
  • fix xo error for missing extension (../lib../lib/index.js)

issues

fix #74

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.

Locals overwritten when using posthtmlExpressionsOptions

2 participants