Coder Social home page Coder Social logo

YAML with emoji fails about yaml-js HOT 7 CLOSED

connec avatar connec commented on September 28, 2024
YAML with emoji fails

from yaml-js.

Comments (7)

connec avatar connec commented on September 28, 2024

Interesting! If you post the YAML document that's failing I'll look into it when I can 😄

from yaml-js.

syropian avatar syropian commented on September 28, 2024

Sure! You can grab it here http://d.pr/f/1kVn3

from yaml-js.

klokane avatar klokane commented on September 28, 2024

Hi, we have same problem with unicode char U+1F60E (Smiling face with sunglases). It comes from external source, but it cripple our processing tool.

I investigate for reason.

It is because https://github.com/connec/yaml-js/blob/master/src/lib/reader.coffee#L19

There is check for NON_PRINTABLE character set. But there is explicit range for allowed chars.
If I comment calling @check_printable() it is parsed correctly.

So I propose instead of checking for "allowed set" of unicode chars, check just for a few dangerous char, like \u2028 or \u2029

Is it acceptable solution for you @connec? I'm able to delivery PR in this case

Cheers

from yaml-js.

pksunkara avatar pksunkara commented on September 28, 2024

@connec Can we get a comment on this?

from yaml-js.

connec avatar connec commented on September 28, 2024

Sorry for the delay investigating this. I tweaked the NON_PRINTABLE regular expression to allow code points above 0xFFFF. For reference I tweaked a regex created by regenerate.

from yaml-js.

pksunkara avatar pksunkara commented on September 28, 2024

@connec Can we get a npm release please?

from yaml-js.

connec avatar connec commented on September 28, 2024

@pksunkara published 0.1.5!

from yaml-js.

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.