Found this rather interesting since pretty much everyone here uses dialogue.
Rules to Format Dialogue
1. Enclose the spoken words with double quotation marks.
“I love it when that happens.”
Note: The British use single quotation marks.
2. Dialogue tags (the he asked/she said portions) stay outside the quotes and get separated by a comma.
Sam said, “I’ll never do that again.”
“Don’t be a sissy,” said Bill. “Let’s get back in line and ride this beast again.”
Note: When dialogue ends in a question or exclamation mark, tags that follow start in lower case.
“What’s new?” she asked.
3. Actions that occur before or after the dialogue go in a separate sentence. For example, If Cindi screamed and then spoke, you write it this way:
Cindi screamed. “Oh my God!”
On the other hand, if Cindi screamed out the words, use a comma instead of a period (so that it’s all part of the same sentence).
Cindi screamed, “Oh my God!”
4. Punctuation goes inside the quotes.
Mary covered her mouth. “Oh no!” She looked like she had seen a vampire. “Did you see that?”
Note: If the dialogue ends with an ellipsis, do not add a comma or any other punctuation.
She stared at the dark horizon. “I guess you’ll go back to running your company and I will…” her voice drifted off.
5. If you have to quote something within the dialogue, use single quotation marks. (Brits reverse the use of double and single quotes.)
Bill laughed and pointed at him. “When that ghost jumped out and said, ‘Boo!’ you screamed like a little girl.”
6. Start a new paragraph every time you change speakers. If the speaker performs actions linked to the dialogue, keep everything in the same paragraph. Why? Readers easily lose track of which character is speaking. A new paragraph helps readers by signalling a change.Note: Indent the first line of these paragraphs, just like all other paragraphs.Couldn't get this to work with the post layout, and not many people do it here. This is more for manuscripts on pages.
“Did he hit you?” Deanna asked, looking at the cut and bruises on Laura’s face.
“No. I hurt myself.” Her brain scrambled to invent a story. “I, umm, fell.”
“No. You don’t understand. It was my fault.”
Deanna pointed her finger at Laura. “Battered women always say that.” She shook her head. “Please come with me. I don’t think you should be here when he comes back.”
7. If an action interrupts a sentence in the dialogue, use lower case on the first letter of the second fragment.
“I know,” he lowered his voice to a whisper, “what you said.”
8. If the same speaker talks long enough to require a new paragraph, place opening quotation marks at the beginning of each paragraph. However, closing quotation marks are placed only at the end of the final paragraph.
Tom explained the details. “The thread is a remarkable silk-wool blend, a new fabric named Allurotique. Some people compare it to the most expensive commercially available silk, Pashmina Silk; but that comparison is off base. Pashmina silk is made by weaving wool from pashmina goats with a silk produced by worms that eat only mulberry leaves.
“Allurotique is blended, not woven. And it’s made from the most expensive silk and a exotic wool spun into a fabric with extraordinary qualities.
“The silk in Allurotique is muga silk, which has a natural shimmering gold color. It absorbs water better than other silks, making it more comfortable to wear. It’s has a number of other nifty features: it’s more durable than other silks, it’s almost impossible to stain and it gets shinier with wear.
“The wool in Allurotique is harvested from vicuñas, a South American animal related to llamas. Vicuña wool is softer, lighter and warmer than any other wool in the world. Since the animals can only be sheared once every three years, it’s rare and outlandishly expensive.”