Indentation/input tags go wrong in CsHtml (Razor)

Answered

Hi, I've been using Rider (mac os x) for almost 6 months now and I really love it. The only thing that really drives me crazy is the problems in csHtml, as I create alot of web-based applications.

The problems:

1. When i add a <input>, <br> or <hr> tag, the ending tag also appears (</input>,<br>, </hr>) but this is not valid html, and i have to end up cleaning it up EVERY TIME.

2. Indenting. Everytime I use the 'cleanup code' feature, the indentation goes wrong. I end up getting 3 <div> tags under eachother:

<div>
<div>
<div>
.... Awesome code ....
</div>
</div>
</div>

This should be:

<div>
<div>
<div>
... Awesome code ...
</div>
</div>
<div>

I think this has to do with the same problem as point 1., because the input tag is not closed, Rider does not see the need to indent. 

 

I would love to see this fixed because it has caused me alot of pain and anger (not really, but it is annoying to re-indent everything after a cleanup)

 

specs:

Rider Build 173.3994.2442 (toolbox installation)

Mac OS x  

 

Thank you !

 

 

 

 

 

4
5 comments

Ryder 2019.2: Problem still persists

0

Hi all. 

Unfortunately, I can't reproduce the issue, tags indents as describe. Could you please provide a bit more details, code snippet or screenshots? 

Thank you

0

Rider 2021.1, still having this problem... I have to go back to Visual Studio.

 

1

Hi Rosdi Kasim

Could you please provide some more details about your case? 

- How do you get this code? Do you type it or paste it? 

- If you typed it, did you have indentation while typing on a new line?

- Could you please share your settings? Here is a description of how to export them.   

- Can you share your solution with us? It'll help a lot. 

Please, attach all data to a new request via Help | Report a bug or Help | Contact support along with the answers. If you prefer to continue the forum thread, use our server to upload.  

Thank you in advance! 

0

Go to preferences > editor > ASP.Net (Razor) and set 'Do not indent children if element has more lines than' to something like 9999.

1

Please sign in to leave a comment.