Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description doesn't allow new lines #62

Closed
DanFMoore opened this issue Jan 7, 2016 · 5 comments
Closed

Description doesn't allow new lines #62

DanFMoore opened this issue Jan 7, 2016 · 5 comments
Labels

Comments

@DanFMoore
Copy link

If I call Event->setDescription() with "\n" (so that the new line is rendered), then the description field ends up with a new line being inserted and appearing like this:

DESCRIPTION:First line of description
Second line of description

When this is imported into an application, then only the first line of the description appears.

If I call the same method with '\n' (a literal \n) then the description field ends up like this:

DESCRIPTION:First line of description\\nSecond line of description

When this is imported it results in a literal \n appearing.

What you want is this appearing in the file:

DESCRIPTION:First line of description\nSecond line of description

From digging around in the code it looks like you can swap this call in Eluceo\iCal\Property\Event\Description:

    public function getEscapedValue()
    {
        return PropertyValueUtil::escapeValueAllowNewLine((string) $this->value);
    }

with:

    public function getEscapedValue()
    {
        return PropertyValueUtil::escapeValue((string) $this->value);
    }

That appears to work, although I haven't tried running the tests

@navarr
Copy link
Contributor

navarr commented Jan 7, 2016

This is probably related to #61 and #53

@markuspoerschke
Copy link
Owner

Is this still relevant?

@nikosv
Copy link

nikosv commented Feb 2, 2017

Any solution or workaround on this?

@nikosv
Copy link

nikosv commented Feb 2, 2017

Sorry. it looks like the workaround is to use "dev-master" ;-)

@maskedjellybean
Copy link

maskedjellybean commented Mar 28, 2024

This is an issue again. It seems like \Eluceo\iCal\Component\Event::setDescription needs a parameter we can use as a flag to say whether we want the value run through \Eluceo\iCal\Property\StringValue::getEscapedValue. At the moment there's no way to use line breaks in the description because they're escaped by this method.

EDIT: I realized I'm using an outdated version (0.17.0), so maybe this is resolved in version 2.x. I can't verify this because I'm using this library via another library and don't have control over the version that's used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants