Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3662276
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:23:55+00:00 2026-05-19T01:23:55+00:00

Whenever I reformat html source code in Visual Studio with Ctrl-K, Ctrl-D it formats

  • 0

Whenever I reformat html source code in Visual Studio with Ctrl-K, Ctrl-D it formats my source code like this:

<p>
    text</p>
<p>
    more text</p>

How can I make it use the following format instead?

<p>
    text
</p>
<p>
    more text
</p>

I know that there are settings at Options-> Text Editor -> Html -> Formatting, but I could not find suitable there.

Thanks,

Adrian

Edit: I’ve checked the tag-specific settings, and page break for p tags is set to “Before opening, within, and after closing”. Also, the little preview shows exactly the format I want to have. But Visual Studio still does it wrong. Could this have anything to do with Resharper being installed on my system?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:23:56+00:00Added an answer on May 19, 2026 at 1:23 am

    The problem has nothing to do with ReSharper. This is a feature by design of the Visual Studio Source Formatter where it will attempt not to change the semantics of an element due to formatting options that you specify.

    So, you specified that you want the p tags to have breaks within the content, but a break after a p tag would change the semantics of the content within the tag, thus the formatter ends up putting the closing p tag right after the content. To have the closing tag on a separate line you will need to explicitly add a space just before the end of the content and the closing tag.

    Thus:

    <p>content</p>
    

    will produce:

    <p>
       content</p>
    

    While (note the explicit inclusion of a space between the content and the closing p tag):

    <p>content </p>
    

    will produce:

    <p>
       content
    </p>
    

    This is discussed in a blog post by Scott Guthrie in the 3rd paragraph from the bottom. Start counting from the paragraph right above the additional links section.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whenever I'm at a break point in a certain C#.NET application in Visual Studio
Whenever I use the Eclipse source code formatter / beautifier (via the menu item
Whenever I code the following inside an HTML document within PSPad (a free code
Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux
Whenever I install gems I see ri and rdoc follow. I know this is
Whenever I've received this error, I just increased the memory to fix it. I
Whenever I call os.path.exists(variable) it will return false but if I call os.path.exists('/this/is/my/path') it
Whenever I've worked with asp.net authentication / authorization in the past, I can remember
Whenever I try to create more than one table in actionscript, only the first
Whenever my cursor is over some text, I need it to remain as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.