squirrellyjs / squirrelly

Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript β›Ί
https://squirrelly.js.org
MIT License
599 stars 82 forks source link

Add explanation of helper ref '../' test #70

Closed first-timers[bot] closed 5 years ago

first-timers[bot] commented 5 years ago

πŸ†•πŸ₯☝ First Timers Only.

This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you πŸ’

About First Timers Only.

πŸ€” What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

πŸ“‹ Step by Step

@@ -125,7 +125,7 @@ function Compile (str) {
     function helperRef (name, id, filters) {
       var prefix
       if (typeof id !== 'undefined') {
-        if (/(?:\.\.\/)+/g.test(id)) {
+        if (/(?:\.\.\/)+/g.test(id)) { // Test if the helper reference is prefixed with ../
           prefix = helperArray[helperNumber - (id.length / 3) - 1].id
         } else {
           prefix = id.slice(0, -1)
  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can edit files directly in your browser

πŸ€”β“ Questions

Leave a comment below!

This issue was created by First-Timers-Bot.

nebrelbug commented 5 years ago

Reserved for @Artistic18 if they want

Artistic18 commented 5 years ago

Yes i will take it.Thanks