# Raw string literals that can contain any arbitrary text without the need for special escape sequences

**URL:** <https://es.discourse.group/t/raw-string-literals-that-can-contain-any-arbitrary-text-without-the-need-for-special-escape-sequences/1757>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [July 20, 2023, 2:35am UTC](https://es.discourse.group/t/raw-string-literals-that-can-contain-any-arbitrary-text-without-the-need-for-special-escape-sequences/1757 "2023-07-20T02:35:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sken130](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/sken130/32/1811_2.png) [@sken130](https://es.discourse.group/u/sken130)\
**Post date:** [July 24, 2023, 2:20am UTC](https://es.discourse.group/t/raw-string-literals-that-can-contain-any-arbitrary-text-without-the-need-for-special-escape-sequences/1757/2 "2023-07-24T02:20:30Z")

</div>

I came across with several posts (mentioned in the latest proposal) and found that triple backticks `````` syntax is not backwards compatible.

Here is my testing:

```````js
function append(separator) {
  return typeof separator === "string" ? appender(separator, "") : appender("", "").apply(this, arguments);
}

function appender(separator, s) {
  return function tag(literalParts, ...computedParts) {
    s += literalParts[0];
    for (let i = 1; i < literalParts.length; ++i) {
      s += computedParts[i - 1] + literalParts[i];
    }
    return function(x) { return x == null ? s : appender(separator, s + separator).apply(this, arguments); };
  }
}

var combined = append
  `aaa`
  `bbb`
  `ccc`();
console.log("combined", combined);

var lines = append("\n")
  `first line`
  `second line`
  `third line`();
console.log("lines", lines);

console.log("chaining function result 1", append(", ")`acb``bcd`()) // chaining function result 1 acb, bcd
console.log("chaining function result 2", append(", ")``````()) // chaining function result 2 , , 

```````

Therefore, I am changing my proposed syntax to opening by

```javascript
@``

```

and closing by

```javascript
``

```

I have no permission to edit my original post above, so I will have to post my updated proposal below.

---

_[View the full topic](https://es.discourse.group/t/raw-string-literals-that-can-contain-any-arbitrary-text-without-the-need-for-special-escape-sequences/1757)._
