# Newlines do not persist in Custom code components

**URL:** <https://forum.builder.io/t/newlines-do-not-persist-in-custom-code-components/7680>\
**Category:** Bugs\
**Created:** [January 24, 2025, 10:07pm UTC](https://forum.builder.io/t/newlines-do-not-persist-in-custom-code-components/7680 "2025-01-24T22:07:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReavoEnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/reavoend/32/2058_2.png) [@ReavoEnd](https://forum.builder.io/u/ReavoEnd)\
**Post date:** [January 24, 2025, 10:07pm UTC](https://forum.builder.io/t/newlines-do-not-persist-in-custom-code-components/7680/1 "2025-01-24T22:07:48Z")

</div>

**Builder content link**  
[https://builder.io/content/01dd38ae10794d859c69f42341507b3f](https://builder.io/content/01dd38ae10794d859c69f42341507b3f)

**Builder public api key**  
`64dd5478e25746bf9db3b6c0319905f6`

**Bug description**  
Custom code components strip the custom code of all newlines. This causes problems. Here are some affected use cases relevant to me:

1. JavaScript using standard `//style` comments. Because newlines are removed, everything after the double slash is registered as a comment.
2. Users are entirely unable to leverage the [`{% liquid %}`](https://shopify.dev/docs/api/liquid/tags/liquid) tag from Shopify’s Liquid language, which (like Python) relies on newlines to distinguish different lines of code.

The issue can lead to frustrating debug sessions and hours of wasted time. I have been working around this since we started using [Builder.io](http://Builder.io) in early 2023. Now, I find that once again our ambitions are slowed by the issue. _Please enable Custom code components to retain their newlines._

**Detailed steps to reproduce the bug**  
Go to the editor, expand the “Code” section and add a `Custom code` component to your page. Update the new component’s code to the following:

```html
<script>
var builderTest = "BEFORE";
// simple comment
var builderTest = "AFTER";
</script>

```

Preview the page and open the dev console. Type `builderTest` and press enter. You’ll see that the variable contains the value “BEFORE” when it should be “AFTER”.

**Code stack you are integrating Builder with**  
React, Shopify
