Giter Club home page Giter Club logo

Comments (2)

minthemiddle avatar minthemiddle commented on August 30, 2024 2

It's got to do with \n-, newline and dash. The regex fails. When I enter an additional whitespace in between, it works. But I think it should be possible to start a line in notes with -.

from vobject.

wpercy avatar wpercy commented on August 30, 2024 1

This is actually happening because of how docstrings (multi-line strings) work with newlines. If I read that same vCard in from a file, it works just fine. What happens is that the newlines get interpreted before vObject has a chance to read in the lines, so your vCard looks like this:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Mac OS X 10.11.3//EN
N:XXX;;;
FN:XX XX
EMAIL;type=INTERNET;type=HOME;type=pref:[email protected]
TEL;type=CELL;type=VOICE;type=pref:+4915773321986
ADR;type=HOME;type=pref:;;;Berlin;Berlin;;Germany
BDAY:1986-11-17
UID:e0355606-117f-4388-bb6d-eda3a1f6449d
X-ABUID:E0355606-117F-4388-BB6D-EDA3A1F6449D:ABPerson
NOTE:- List1
- List2      # THIS LINE IS INVALID
- List3
END:VCARD

which is obviously invalid due to the line I pointed out.

If you want to perform the operation like you do above (using a multi-line string), you need to escape all of your newlines in your NOTE property with an extra backslash so they look like \\n.

from vobject.

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.