Disable autoformat for part of code like "<pre></pre>"
Hi,
I´m developing some RIA app in JavaScript based framework ExtJS, for wrapping up data into HTML templates are used.
They could be really complex as HTML tend to be and when CTRL + Shift + L is used to format code, all indents of tpl are lost.
Is there way how to tell PhpStorm not to format part of code? E.g. with some // <pre> markup? Double slash serves as comment so it will not breakup code and format can skip whole part between red lines.
It will make not only my life a lot easier :-) And surely force me to buy newer version as I´m using 3.x at this moment.
E.g.
Ext.define('ET.view.knowlet.ActivityStreamCommentList', {
extend:'Ext.view.View',
alias:['widget.knowlet', 'widget.widgetactivitystreamcommentlist'],
border:false,
itemSelector: '.root',
// <pre>
tpl:[
'<tpl for=".">',
'<!-- comment single -->',
'<div >',
'<div >',
'<a title="Title" href="#" >',
'<img alt="Alt" src="public/image/testPicture50x50.png" >',
'</a>',
'</div>',
'<div >',
'<h5 >',
'<a title="Title" href="#">{editorName}</a>',
'</h5>',
'<div >',
'<p>{title}</p>',
'<div >{createdDate:date(shareData.dateFormatLong)}</div>',
'</div>',
'</div>',
'</div>',
'<!-- /comment single -->',
'</tpl>'
]
// </pre>
});
Please sign in to leave a comment.
Hi Jan,
Unfortunately not.
http://youtrack.jetbrains.com/issue/IDEA-56995 I guess
Thanks for quick answ. Doesn´t make me happy but at least from now I know what issue ID I should follow :-)
When searching for how to handle indents in pre-tags, this page came high in the result, so I thought I should provide an answer.
As of IntelliJ 2023.2.5 (and possibly earlier versions as well), there is a “Do not indent children of:” setting in Editor > Code Style > HTML where “pre” can be added to make IntelliJ not indent the contents of this tag.
Yay!