question

Afrian avatar image
Afrian asked

String Replace/ Regex replace for APL not working

Hey,

im using a string that'll be rendered in a card. There it has \r\n to get newlines.
I currently added APL support and figured out apl needs a <br/> or <br>

So in the method where I add the APL text I wanted to replace the \r\n with <br> by using

stringToReplace.replace(/\\r\\n/g, "<br/>"); 

This works in every browser console and regex builder but not in APL and so not in the skill as well

Can sb tell me why and how to solve this issiue?

alexa skills kitaplnodejsask sdkjavascript
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

ffedericoni avatar image
ffedericoni answered

Why <br/> and not just <br> ?

Have you tried both ways?

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Afrian avatar image Afrian commented ·

Yes I tried both as well as

'<br>',
'<br/>'

and

/(\\r\\n|\\n|\\r)/g
0 Likes 0 ·