Skip to content
This repository was archived by the owner on May 21, 2022. It is now read-only.

Commit 45b409e

Browse files
committed
fix: fix wrong line space between
1 parent 1870c01 commit 45b409e

File tree

1 file changed

+5
-58
lines changed

1 file changed

+5
-58
lines changed

md2docx/md2docx.cs

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void Main(String[] args)
9696
FontTablePart fontTablePart1 = mainDocumentPart1.AddNewPart<FontTablePart>("rId6");
9797
GenerateFontTablePart1Content(fontTablePart1);
9898

99-
SetPackageProperties(document, name, filePath);
99+
SetPackageProperties(document, name, filename);
100100
}
101101
}
102102

@@ -210,18 +210,6 @@ static void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1,
210210
para.Append(run);
211211
body1.Append(para);
212212

213-
para = new Paragraph
214-
{
215-
ParagraphProperties = new ParagraphProperties
216-
{
217-
ParagraphStyleId = new ParagraphStyleId { Val = "BodyText" }
218-
}
219-
};
220-
run = new Run { RunProperties = new RunProperties() };
221-
txt = new Text { Text = "", Space = SpaceProcessingModeValues.Preserve };
222-
run.Append(txt);
223-
para.Append(run);
224-
body1.Append(para);
225213

226214
para = new Paragraph
227215
{
@@ -308,19 +296,6 @@ static void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1,
308296
para.Append(run);
309297
body1.Append(para);
310298

311-
para = new Paragraph
312-
{
313-
ParagraphProperties = new ParagraphProperties
314-
{
315-
ParagraphStyleId = new ParagraphStyleId { Val = "BodyText" }
316-
}
317-
};
318-
run = new Run { RunProperties = new RunProperties() };
319-
txt = new Text { Text = "", Space = SpaceProcessingModeValues.Preserve };
320-
run.Append(txt);
321-
para.Append(run);
322-
body1.Append(para);
323-
324299
para = new Paragraph
325300
{
326301
ParagraphProperties = new ParagraphProperties
@@ -339,20 +314,7 @@ static void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1,
339314
run.Append(txt);
340315
para.Append(run);
341316
body1.Append(para);
342-
343-
344-
para = new Paragraph
345-
{
346-
ParagraphProperties = new ParagraphProperties
347-
{
348-
ParagraphStyleId = new ParagraphStyleId { Val = "BodyText" }
349-
}
350-
};
351-
run = new Run { RunProperties = new RunProperties() };
352-
txt = new Text { Text = "", Space = SpaceProcessingModeValues.Preserve };
353-
run.Append(txt);
354-
para.Append(run);
355-
body1.Append(para);
317+
356318

357319
para = new Paragraph
358320
{
@@ -459,8 +421,7 @@ static void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1,
459421
run.Append(txt);
460422
para.Append(run);
461423
body1.Append(para);
462-
463-
424+
464425
para = new Paragraph
465426
{
466427
ParagraphProperties = new ParagraphProperties
@@ -474,20 +435,6 @@ static void GenerateMainDocumentPart1Content(MainDocumentPart mainDocumentPart1,
474435
para.Append(run);
475436
body1.Append(para);
476437

477-
para = new Paragraph
478-
{
479-
ParagraphProperties = new ParagraphProperties
480-
{
481-
ParagraphStyleId = new ParagraphStyleId { Val = "BodyText" }
482-
}
483-
};
484-
run = new Run { RunProperties = new RunProperties() };
485-
txt = new Text { Text = "", Space = SpaceProcessingModeValues.Preserve };
486-
run.Append(txt);
487-
para.Append(run);
488-
body1.Append(para);
489-
490-
491438
para = new Paragraph
492439
{
493440
ParagraphProperties = new ParagraphProperties
@@ -2255,7 +2202,7 @@ static void GenerateStyleDefinitionsPart1Content(StyleDefinitionsPart styleDefin
22552202
StyleParagraphProperties styleParagraphProperties3 = new StyleParagraphProperties();
22562203
KeepNext keepNext3 = new KeepNext();
22572204
KeepLines keepLines3 = new KeepLines();
2258-
SpacingBetweenLines spacingBetweenLines4 = new SpacingBetweenLines() { Before = "200", After = "0" };
2205+
SpacingBetweenLines spacingBetweenLines4 = new SpacingBetweenLines() { Before = "200", After = "0"};
22592206
OutlineLevel outlineLevel3 = new OutlineLevel() { Val = 2 };
22602207

22612208
styleParagraphProperties3.Append(keepNext3);
@@ -2292,7 +2239,7 @@ static void GenerateStyleDefinitionsPart1Content(StyleDefinitionsPart styleDefin
22922239
Rsid rsid5 = new Rsid() { Val = "00D9265A" };
22932240

22942241
StyleParagraphProperties styleParagraphProperties10 = new StyleParagraphProperties();
2295-
SpacingBetweenLines spacingBetweenLines11 = new SpacingBetweenLines() { Before = "180", After = "180" };
2242+
SpacingBetweenLines spacingBetweenLines11 = new SpacingBetweenLines() { Before = "180", After = "180", Line = "360", LineRule = LineSpacingRuleValues.Auto };
22962243

22972244
styleParagraphProperties10.Append(spacingBetweenLines11);
22982245
styleParagraphProperties10.Append(indentation1);

0 commit comments

Comments
 (0)