You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#116879 JCE removes Stripe Button Code

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Thursday, 26 September 2024 09:58 BST

tapiochre

Hi Ryan

When I paste in Stripe Button codes, parts are removed on save.

<script async
  src="https://js.stripe.com/v3/buy-button.js">
</script>

<stripe-buy-button
  buy-button-id="buy_btn_RANDOMCODESTRING"
  publishable-key="pk_live_RANDOMLONGCODESTRING"
>
</stripe-buy-button>

By enabling SCRIPTS in Editor Parameters > the first <script async...>...</script> block is retained on save but the <stripe-buy-button ...>BLAH BLAH</stripe-buy-button> is always stripped out.

 Can you suggest config to ensure these are retained on save?

Ryan

By enabling SCRIPTS in Editor Parameters > the first block is retained on save but the BLAH BLAH is always stripped out.

The <stripe-buy-button> code is not valid HTML in the HTML5 schema, so it is removed with the default editor settings.

There are 2 ways to retain this code, and I recommend the second as it is easier and neater.

Option 1

  1. In the Editor Global Configuration, set Validate HTML to No.
  2. In Editor Profiles -> Editor Parameters -> Advanced, set
    • Enable Code Blocks to No
    • Allow Javascript to Yes
    • Allow Custom XML to Yes
  3. In the Editor, click on the Code tab, then create a <div> tag. Paste your code inside this <div>. See below:

Option 2

  • In the Editor Global Configuration, set Validate HTML to Yes or No.
  • In Editor Profiles -> Editor Parameters -> Advanced, set
    • Enable Code Blocks to Yes
    • Allow Javascript to Yes
    • Allow Custom XML to Yes
  • In the Editor, paste your code directly into the editor. This will create 2 "Code Blocks" that protect the code while allowing you to edit it directly. See below:

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.