Tentatively fixed #305: single line breaks are preserved between WikiMarkup-Visual and back switches.

This commit is contained in:
Dario Solera 2009-10-20 16:08:07 +00:00
parent 8fc1e66522
commit 1f665bda61
2 changed files with 6 additions and 5 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.1.408")]
[assembly: AssemblyFileVersion("3.0.1.408")]
[assembly: AssemblyVersion("3.0.1.409")]
[assembly: AssemblyFileVersion("3.0.1.409")]

View file

@ -843,7 +843,7 @@ namespace ScrewTurn.Wiki {
sb.Replace("</nowiki>", "");
}
ProcessLineBreaks(sb);
ProcessLineBreaks(sb, bareBones);
if(addedNewLineAtEnd) {
if(sb.ToString().EndsWith("<br />")) sb.Remove(sb.Length - 6, 6);
@ -1162,8 +1162,9 @@ namespace ScrewTurn.Wiki {
/// Processes line breaks.
/// </summary>
/// <param name="sb">The <see cref="T:StringBuilder" /> containing the text to process.</param>
private static void ProcessLineBreaks(StringBuilder sb) {
if(AreSingleLineBreaksToBeProcessed()) {
/// <param name="bareBones">A value indicating whether the formatting is being done in bare-bones mode.</param>
private static void ProcessLineBreaks(StringBuilder sb, bool bareBones) {
if(bareBones || AreSingleLineBreaksToBeProcessed()) {
// Replace new-lines only when not enclosed in <nobr> tags
Match match = NoSingleBr.Match(sb.ToString());