An open API service indexing awesome lists of open source software.

https://github.com/rumkin/tc39-proposal-block-string

Block string
https://github.com/rumkin/tc39-proposal-block-string

Last synced: 4 months ago
JSON representation

Block string

Awesome Lists containing this project

README

          

# Block String

Add support of indentation string block to allow use a large block of strings into
the code without troubles with indentation.

Example:

```
let markdownString = @
There is a __string__ with several paragraphs

Without quote escaping and so

let ymlString = @
base: element
items:
- item 1
- item 2

let htmlString = @

Good news everyone!


console.log(htmlString); // => "

Good news everyone!

"

let page = 'Main';
let jadeTemplate = jade(@@ // with js placeholders
html
head
title ${page}
body
h1 Page
p Hi block text
);
```

This allow to avoid mess of quotation escaping and indentation for multiline strings.
So it allow to insert any other text inside js. Even js itself. Such string should get the first line
indentation and cut it from start of each following line.