Keep spaces in empty tag for Razor files

How can I configure the Rider editor to maintain spaces in empty tags for Razor files?

There is a setting to support this for “HTML” and “XML” editor, but when enabling this and formatting the Razor file, the whitespaces are still removed.

0
7 comments

Hello Mathieu,

Thank you for contacting Rider support. 
Would you mind checking if disabling these two options help?

Have a nice day!

1

If that doesn't help, please let me know, in what kind of file you experience the issue and how you want Rider to format sample code snipped.

 

0

Thanks Dmitry, unchecking the “Space before ‘/>’” did the job! 
It seems I overlooked the setting because I was in search of the “in empty tag” similar to the HTML and XML settings

0
Hello Mathieu,

Thank you for keeping me posted! I am glad to hear that I was able to help.
Should you have any other questions or difficulties in the future, do not hesitate to contact support.

Have a nice day!
0

I don't see the option. Instead I see:

0

Hello Robert,

Thank you for reporting this. Indeed, a part of ASP.NET(Razor) code style settings become unavailable in the 2024.3 version. I submitted this bug to our tracker and described the available workaround there: RIDER-122944 A part of code style settings for ASP.NET(Razor) is missing.

Please watch the issue for further updates.

Have a nice day!

1

Dmitry Kazantsev 

Ok thanks for the update :)

0

Please sign in to leave a comment.