Giter Site home page Giter Site logo

Comments (3)

quilicicf avatar quilicicf commented on July 29, 2024 2

Hi,

Resurrecting this issue because I think I understand it and can provide an example.

my.multi.line.property=This is a property soooooo long that I had to \
  split into multiple lines, otherwise it would literally get unreadable.

The backslash-escape specifies a continuation line and is documented somewhat succinctly in Oracle's documentation (search for continuation line).

Currently, the reader extracts the continued lines as keys rather than continuations of the previous value.

Which means I end up with:

{
  _properties: {
    'my.multi.line.property': 'This is a property soooooo long that I had to \',
    'split into multiple lines, otherwise it would literally get unreadable.': '',
  }
}

from properties.

kiprobinson avatar kiprobinson commented on July 29, 2024 1

I found that the properties library handles this correctly.

Change from:

const Properties = require('properties-reader');
const props = new Properties('myfile').path();

To this:

const properties = require('properties');
const props = properties.parse(fs.readFileSync('myfile').toString(), {namespaces: true});

from properties.

steveukx avatar steveukx commented on July 29, 2024

I don't think that properties files support multi-line content, which is why this library doesn't. If you can add into the issue a reference for how a regular properties file represents multi-line content, I'll re-open this issue add it into the library for you (or please feel free to submit a pull request).

from properties.

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.