Dealing with an issue and thought I would reach out here first just in case someone can help.
I have created a image slider as a custom module using Alpinejs for the functionality. Each image is group with a rich text field. The slider functions as it should, however, dumping the rich text field into my Alpinejs array is causing a syntax error. I am not sure how to resolve it.
Here is the code. As you can see, I am putting the rich text field contents into the caption object using the module hubl tag from the image group.
As is, it's causing the Alpinejs syntax error. If I manually type the html in, it works fine. Hubspot must be including some syntax and/or characters that Alpine doesn't like and that I can't see.
Update - After some additional testing, I was not able to resolve the above issue. As a result, came up with another option that still uses Alpinejs and has the same functionality. The new option eliminates the need for an array.
Kevin - I appreciate the suggestions you taking the time answer my post.
Update - After some additional testing, I was not able to resolve the above issue. As a result, came up with another option that still uses Alpinejs and has the same functionality. The new option eliminates the need for an array.
Kevin - I appreciate the suggestions you taking the time answer my post.
Based on testing, if I just have basic paragraph text in the rich text module, it works without any errors. However, as soon as I add a heading or link, it causes the syntax error. I have attached a screeshot of my dev tools console showing the errors as well as the output in the array from the module. You can see in my highlighted area, I added the H2 heading. It appears that Alpinejs doesn't like the line break that Hubspot is adding after the H2. If I manually type the same H2 & p code in the array with no line break, it works correctly. Not sure how to resolve this, if that's possible. Obviously, the goal is for the end-user to be able to use the rich text module as intended. If I can't get this resolved soon, I will explore the option of using some sort of JQuery slider with the same type of functionality.