totaljs / Tangular

A simple JavaScript template engine like Angular.js for websites or node.js
MIT License
61 stars 21 forks source link

Quotes problem #13

Closed lcnvdl closed 5 years ago

lcnvdl commented 5 years ago

Hello! I'm trying to pass quotes to the template, but it is not showing them as I like.

I'm getting " instead of a normal quote (")

I've tried to use the raw pipe, but it didn't solve my problem

petersirka commented 5 years ago

Hi, can you show me your Tangular template?

lcnvdl commented 5 years ago

Hi! Thanks for your answer. Yes ,this is the template:

const { start } = require("emvicify"); const settingsFile = require("./settings.json"); const expressSettings = {{ expressSettings }};

start(__dirname, settings.port, { settingsFile, expressSettings }).then(() => { console.log(Listening on port ${settings.port}); }, err => { console.error("Application failed", err); });

The value that I'm passing as a parameter is "expressSettings". I'm trying to write a value like: { "settingA": "A" }

El mié., 28 ago. 2019 a las 14:27, Peter Širka (notifications@github.com) escribió:

Hi, can you show me your Tangular template?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/totaljs/Tangular/issues/13?email_source=notifications&email_token=ABGUZ7NNJS2WOZJSUBGLLKLQG2YRRA5CNFSM4IRIKP7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5L3VZQ#issuecomment-525843174, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGUZ7MA5RHFQ5R2O3T4MHLQG2YRRANCNFSM4IRIKP7A .

petersirka commented 5 years ago

Hi, I have tested it and everything works correctly.

The code below encodes quotes:

 {{ expressSettings }};

And this code below renders everything as it is (try it):

 {{ expressSettings | raw }};
lcnvdl commented 5 years ago

I thought that I've used | raw... Maybe I didn't save the file... I've tried again with | raw and it has worked as you said! thank you very much!