Home › Forums › Calendar Products › Event Aggregator › Broken newline support in iCal imports
- This topic has 11 replies, 5 voices, and was last updated 10 years, 1 month ago by
Geoff.
-
AuthorPosts
-
August 9, 2015 at 12:27 pm #994578
Sherry
ParticipantHi guys, just bought the iCal importer and gave it a run. Unfortunately we’re running into a show stopper. The iCal feed we are crawling has standard \n newline definitions per the spec. It appears the iCal Importer strips the \ leaving behind just an ‘n’ character which runs all of the paragraphs together creating a giant mess.
The feed looks like:
BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Pukka Software//iCal 2.0//EN CALSCALE:GREGORIAN METHOD:PUBLISH X-WR-CALNAME:MotorsportReg.com Events Calendar X-WR-TIMEZONE:US/Pacific X-WR-CALDESC:MotorsportReg.com provides online registration for club race\, track\, hpde, autocross and social events around the country free of charge. Tell a friend! BEGIN:VEVENT DTSTART:20150809T000000 DTEND:20150810T000000 DTSTAMP:20150809T072437Z SUMMARY:SFR 2015 Championship Round 11 DESCRIPTION:Detailed event info can be found on HERE \n \n Reminder: You have to work! We keep a running list of those of you have skipped out on work. Check it out HERE \;and make sure you aren't on it. \n \n Be sure to verify your number/class comination is available by comparing it to the taken class numbers found HERE \n \n Cancellations will not be accepted after registration closes. \n \nSee more: http://www.motorsportreg.com CATEGORIES:Autocross/Solo TRANSP:TRANSPARENT UID:D83A38FA-9418-DAC0-1732D0042AA29401-at-MotorsportReg.com LOCATION:Crows Landing\, Crows Landing\, CA US GEO:37.4121152834;-121.022045498 URL;VALUE=URI:http://www.motorsportreg.com/ END:VEVENT END:VCALENDARThe output winds up looking like: http://new.sfrscca.org/event/event-10-fresno-scca/
I think the iCal importer should convert \n to newlines on import so WordPress will apply it’s standard formatting to text. E.g., we would expect to see a
<p></p>wrap around each paragraph.Is this something that should work or does your importer need an enhancement?
August 10, 2015 at 8:05 am #994757George
ParticipantHey Brian,
Better handling forced newlines like the ones you’re using here would indeed be a useful feature for the iCal Importer. The iCal Importer is very new, so we’ve got lots of improvements in the pipeline for it. Stay tuned to udpates!
In the meantime, I’m curious – I used the .ics file data you posted here to create an .ics file and test importing it, and the iCal Importer didn’t even seem to register the event file as one that could be imported. In other words: I was not able to import the event using the iCal Importer altogether, so I couldn’t see how the newlines issue looked directly on my site.
The reason I wanted to see how it looked was because I’m curious: after import, are you at least able to go to the event directly in your WordPress admin area and manually edit the body of the event description to get rid of those ‘nn’ characters and form the new paragraphs as you desire?
Sorry about the disappointing handling of newlines thus far!
— George
August 14, 2015 at 9:14 am #996079Sherry
ParticipantIt’s because the forum software is adding a link around the URL;VALUE=URI – if you strip out the anchor tag, it validates and should be OK per my tests on the icalendar validator.
Yes, I can edit it and it will generate the formatting after the fact, but it’s a nasty train wreck.
August 15, 2015 at 1:39 pm #996358George
ParticipantThanks for the update Brian – just out of curiosity, how do imported events look for you if you don’t have the \n forced newlines? For me, importing events with paragraph breaks often works, so I’m curious if it works for you to just have the paragraphs broken up and line breaks in place (without even needing to add the additional force-linebreak characters).
Let me know what you find when you try that!
Thank you,
GeorgeAugust 16, 2015 at 4:13 pm #996509Sherry
ParticipantYou can’t have newlines without the \n according to the ical spec so the file wouldn’t be valid. If there are no newlines, I imagine it imports one long line successfully. However, be aware that iCal also has wrapping requirements per the spec so you could only have ~76 characters or so before you would be invalid.
August 17, 2015 at 2:06 pm #996733George
ParticipantAh, apologies for my lack of knowledge about that spec Brian!
I don’t have a way around this problem with the newlines, unfortunately – better handling of this by the plugin, perhaps wrapping with P tags like you suggested, is something that I would agree would make a lot of sense. I’ve made a ticket for our developers and hopefully some improvements for handling this make it into an upcoming release.
I’m sorry about this problem and the lack of immediate ways to address it. Please let me know if there’s anything else I can help with!
August 17, 2015 at 8:57 pm #996807Sherry
ParticipantI don’t think you need to do anything other than simply convert those escaped newlines into real newlines:
str_replace('\n', PHP_EOL, description_from_import);August 18, 2015 at 7:39 am #996973George
ParticipantThanks for sharing this Brian – I’ve made a ticket for our developers and have even suggested this fix you shared with us. Stay tuned for a fix or improvement, we have some releases rolling out over the next several weeks so a fix may very well be included within one.
For now, I’ll close up this thread, but if any other issues, questions, concerns, etc. arise, don’t hesitate to open a new thread to post about them!
Cheers,
GeorgeSeptember 2, 2015 at 7:05 am #1001222Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help.September 3, 2015 at 3:30 pm #1001842Leah
MemberHi there,
I wanted to report back to you on the status of this issue. Your report is tracked in our internal system and a fix is on our to-do list, but we were not able to fit it into our upcoming 3.12 release. Please know that the issue is still very much on our radar and we will be working on it for a future release. We appreciate your patience while we work to improve our plugins. Thank you for using The Events Calendar!
Best,
Leah
and The Events Calendar teamSeptember 4, 2015 at 3:24 pm #1002294George
Participant🙂
March 31, 2016 at 3:01 pm #1096682Geoff
MemberHey Brian,
I know it’s been a while, but I just wanted to follow up and let you know that we released version 4.1.1 last night and it included a fix for this issue. Please update to the latest version if you haven’t already and do let us know if you continue to see any issues from there. 🙂
Cheers and thanks for your patience while we worked on this!
Geoff
-
AuthorPosts
- The topic ‘Broken newline support in iCal imports’ is closed to new replies.
