Emmet: Put line breaks in text

Created on 29 Dec 2013  路  5Comments  路  Source: emmetio/emmet

Hi,

I like to use Emmet multiplication operator combined with curly braces (for text), instead of making a multiple copy past. For example, let's say i have this line :
"This is a text I mean something I don't want or I can't write using Emmet syntax..."

What I do is just putting curly braces and a multiplier, like this, and expand :
{This is a text I mean something I don't want or I can't write using Emmet syntax...}*20
In most cases this is faster than copy-pasting 20 times or so...

Problem is that Emmet expand it on a single line, and I'd like to have it with line breaks. I tried putting "\n", "\t", "\n\t" and so on, at the end of the text, before the closing curly brace, but didn't work. Any idea? Is it possible?
ps : I'm using Emmet with Dreamweaver, but i think this issue is independent of the text editor.

Thanks!

Most helpful comment

Put ${newline} variable at the end of text, like so:

`{some text${newline}}*20

All 5 comments

Put ${newline} variable at the end of text, like so:

`{some text${newline}}*20

Thanks a lot! Works nicely.
Where does it come from? I can't find this syntax in the Emmet documentation.
Also, as Emmet is all about typing less, I was wondering why not using something shorter like $nl?

Ok, understood, thanks.
I found the variable definition in the original snippets.json https://github.com/emmetio/emmet/blob/master/snippets.json at line 7 : "newline": "\n" (I make it clear just in case this can be useful to a future reader).

not sure if will work on your editors but here in Editplus (editplus.com) the best editor since '98 ,
i edit snippets.json and i insert inside ..

"cc:noie": "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->", <-----this comma
            "php": "<?php\r\n\r\n?>"   <-------------------------that code
        },

        "abbreviations": {

so

,
"php": "<?php\r\n\r\n?>"

ans seems that php will transform in

<?php

?>

I REPEAT here in editplus work like that . now i should figure out how to move the cursor inside..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corysimmons picture corysimmons  路  5Comments

DanielRuf picture DanielRuf  路  5Comments

HeikoMamerow picture HeikoMamerow  路  16Comments

deathmood picture deathmood  路  15Comments

planetoftheweb picture planetoftheweb  路  3Comments