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
635 stars 83 forks source link

Explain why we trim each filter #64

Closed first-timers[bot] closed 6 years ago

first-timers[bot] commented 6 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

@@ -78,7 +78,7 @@ export function parseFiltered (initialString, filterString) {
   if (filterString && filterString !== '') {
     filtersArray = filterString.split('|')
     for (var i = 0; i < filtersArray.length; i++) {
-      filtersArray[i] = filtersArray[i].trim()
+      filtersArray[i] = filtersArray[i].trim() // Just in case someone put | filter| or | filter | or something similar
       if (filtersArray[i] === '') continue
       if (filtersArray[i] === 'safe') {
         // If 'safe' is one of the filters, set safe to true but don't add Sqrl.F.safe
  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.

hkulur commented 6 years ago

Hey, First timer here! I want to claim this issue.

kcamozzi commented 6 years ago

I would like to claim this issue.

esslamben commented 6 years ago

Hi, I would like to claim this issue :)

nebrelbug commented 6 years ago

Reserved for @hkulur, since he commented first. @kcamozzi, @iRewiewer, and @Esslamb, hopefully there will be more opportunities for you soon :)

hkulur commented 6 years ago

Thanks @nebrelbug! Have raised a PR #81 for this.