There are, of course, rules for writing dialogue. The rules are fairly straight forward and easy to learn. If you follow these rules, your dialogue writing will become much clearer and your text will have much better flow.
When you use dialogue in your writing, you should keep it fairly short and concise. Dialogue should be a help to get to know your characters and it should be broken up with action.
DIALOGUE AND PARAGRAPHS, RULES
Start a new paragraph when a new speaker speaks.
CORRECT
Text, text, text... I happened to overhear a brief conversation the two teachers had in the corridor.
"Did you hear that all students were on time to their English class?" the first teacher said.
"Well, I am not surprised. Who would want to be late for English?" the second teacher replied.
INCORRECT
Text, text, text... I happened to overhear a brief conversation the two teachers had in the corridor. "Did you hear that all students were on time to their English class?" the first teacher said. "Well, I am not surprised. Who would want to be late for English?" the second teacher replied.
PUNCTUATION IN DIALOGUE, RULES AND Examples
Single line of dialogue, no dialogue tag
The entire sentence, including the period (or question mark or exclamation mark) is within the quotation marks.
“He loved you.”
"Did he love you?"
Single line with dialogue tag following
The dialogue is enclosed in quotation marks. A comma follows the dialogue and comes before the closing quotation mark. A period ends the sentence. Punctuation serves to separate the spoken words from other parts of the sentence. Because the dialogue tag—she said—is part of the same sentence, it is not capped (inte stor bokstav).
“He loved you,” she said.
Note: If it is obvious who says what, do not include ... , she said .... , he said etc. Too many he/she said will give poor flow to the text.
Single line with dialogue tag first
The comma still separates the dialogue tag from the spoken words, but it is outside the quotation marks, and the period is inside the quotation marks.
She said, “He loved you.”
Dialogue interrupted by dialogue tag
Dialogue can be interrupted by a tag and then resume in the same sentence. Commas go inside the first set of quotation marks and after the dialogue tag (or action).
“He loved you,” she said, “but you didn’t care.”
“He loved you,” she said, hoping to provoke a reaction, “but you didn’t care.”
Questions in dialogue, with dialogue tag
Question mark is inside quotation marks. There is no comma. The tag doesn’t begin with a cap since it’s part of the same sentence, even though there’s a question mark in the middle of the sentence. Use this same construction for the exclamation point (utropstecken).
“He loved you?” she asked, the loathing clear in her voice and posture.
“He loved you!” she said, pointing a finger at Sally.
MORE RULES FOR PUNCTUATION IN DIALOGUE - CLICK HERE
Rules and examples on punctuation have been copied from theeditorsblog.net