I'll fix the issue with the JSON formatting in the webhook response. The problem is that the webhook is returning JSON with a "formattedText" property, but we're not parsing it correctly.
I've fixed the issue with the JSON formatting in the webhook response. The problem was that the webhook is returning JSON with a "formattedText" property, but we weren't parsing it correctly.
JSON Detection and Parsing:
{ and ends with }){"formattedText":"content"}String Extraction Fallback:
Character Unescaping:
Clean Text Export:
getCleanTextForExport() function that extracts plain text without HTML tags{"formattedText":"..."}, it extracts the content using string manipulationThis implementation should properly handle the JSON response from your webhook and display the formatted content without the {"formattedText":" prefix and "} suffix.
i need to clean my output, this is how it looks, at the start and at the end of the ouput is unnecessary JSON data:
{"cleanOutput":"
Trip Summary
Destination: Dubai
Departure City: Zagreb
Travel Dates: May 9 - May 23, 2025
Travel Companions: 1 person
Flight Budget: 5000 EUR
Accommodation Budget: 150 EUR per day
Car Rental: Yes
Travel Type: Business
Flight Information
As of the latest updates, there is no specific direct flight information available from Zagreb to Dubai under 5000 EUR for the specified dates. For potential direct flights, please refer to:
50 New Routes Starting In May 2025 - Aviation Week
Accommodation Options
Finding accommodation in Dubai during your stay under the budget of 150 EUR per day may be challenging. However, you can consider the following options:
Dubai World Trade Centre Events:
A variety of events are taking place during your stay; booking accommodations nearby could be beneficial.
Event Information
Car Rental Options
For car rental in Dubai from May 9 to May 23, 2025, here are some popular providers:
Luxury Car Club:
Offers a variety of luxury vehicles for rental. Visit their website for membership and vehicle options.
Luxury Car Club Information
Local Rental Companies:
Various companies provide reliable rental services. It’s advisable to check options directly when booking.
Sample Business Itinerary for Dubai
Day 1: Arrival in Dubai
Arrive and check into your accommodation. Evening: Settle in and plan for your business meetings.
Day 2: Business Meetings
Breakfast at the hotel. Morning: Attend scheduled meetings with clients or partners. Afternoon: Visit local business sectors. Evening: Attend a networking dinner.
Day 3: Industry Conference
Early breakfast. Full day at an industry conference, engaging with peers and sharing insights. Evening: Cocktails with fellow attendees.
Day 4: Explore Local Business Opportunities
Morning: Continue meetings with potential partners. Afternoon: Explore local markets and exhibitions relevant to your business. Evening: Dinner at a prominent restaurant.
Day 5: Cultural Engagement and Networking
Morning: Visiting local cultural sites. Afternoon: Relaxation and leisure at your hotel. Evening: Participate in a local event.
Day 6: Departure
Final breakfast at the hotel. Wrap up any last-minute business plans before heading to the airport.
Conclusion
This itinerary offers a well-rounded blend of business engagements and cultural experiences in Dubai. For updates on flight options and accommodation as the date approaches, please keep checking. Safe travels!
"}
I'll update the code to specifically handle the JSON format with the "cleanOutput" property that you're receiving from the webhook.
I've updated the code to specifically handle the JSON format with the "cleanOutput" property that you're receiving from the webhook. This should properly clean and format your travel plan output.
Specific JSON Pattern Matching:
{"cleanOutput":"..."} format{"formattedText":"..."} formatEnhanced Text Formatting:
Intelligent Section Detection:
Consistent Styling:
If the content is not HTML, it processes the plain text to create a structured HTML layout:
This implementation should properly handle the JSON response from your webhook and display a clean, well-structured travel plan without any JSON wrapper.