Git Product home page Git Product logo

Comments (7)

AliSoftware avatar AliSoftware commented on June 12, 2024

Mmmh good question. Is it:

  • The job of the replace filter itself
  • The job of Stencil itself (which would allow to fix that issue for all tags, but might be a breaking change too)
  • The job of SwiftGenKit (during parsing of the YAML/JSON/PLIST files)?

from stencilswiftkit.

djbe avatar djbe commented on June 12, 2024

Note: SGK correctly parses the files (the string value is as it should be, unchanged).

from stencilswiftkit.

AliSoftware avatar AliSoftware commented on June 12, 2024

Yeah the parsing itself shouldn't be changed, but should we or should we not convert newlines to \n when we build the context from those parsed content, or is that the job for Stencil or the template, that's the real question 😉

from stencilswiftkit.

djbe avatar djbe commented on June 12, 2024

Keep in mind that if we do that in SGK, those strings may be somewhere quite deep in some array/dictionary structure, and we'd need to check all strings. Seems quite the overhead on the context builder, where it's honestly an issue in Stencil(SwiftKit).

from stencilswiftkit.

djbe avatar djbe commented on June 12, 2024

Note: we also have a contains filter where this applies as well.
Note 2: and hasPrefix and hasSuffix also.

from stencilswiftkit.

AliSoftware avatar AliSoftware commented on June 12, 2024

Yeah which is why I'm starting to wonder if it shouldn't be Stencil's job to do that un-escape, instead of each filter individually…

from stencilswiftkit.

djbe avatar djbe commented on June 12, 2024

Right, so the culprit would be this line:
https://github.com/stencilproject/Stencil/blob/521a599a60206b61b1ac76dd0f01d20f95d3d588/Sources/Variable.swift#L53

Anyone know what's the best way to unescape something like "\\n" or "\\u5404\\u500b\\u90fd" (we may as well do this for unicode sequences)?

from stencilswiftkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.