Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5b88e0

Browse files
rostawumpz
authored andcommitted
Proposal/issue 44 (#45)
* Correction of problemIt appears that the configuration reportLinesUnchanged has no effectwhen showInlineDiffs is true. That is '<' and '>' characters areconverted to HTML entities regardless.* Implement rawValues option* Revert "Implement rawValues option"This reverts commitd9c302c.
1 parentf3ff104 commitc5b88e0

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

‎src/main/java/com/github/difflib/text/DiffRowGenerator.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ private DiffRow buildDiffRowWithoutNormalizing(Tag type, String orgline, String
267267
}
268268

269269
List<String>normalizeLines(List<String>list) {
270-
returnlist.stream()
271-
.map(lineNormalizer::apply)
272-
.collect(toList());
270+
returnreportLinesUnchanged
271+
?list
272+
:list.stream()
273+
.map(lineNormalizer::apply)
274+
.collect(toList());
273275
}
274276

275277
/**

‎src/test/java/com/github/difflib/text/DiffRowGeneratorTest.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,16 @@ public void testGeneratorIssue41UserNormalizer() throws DiffException {
405405
rows =generator.generateDiffRows(Arrays.asList("\t<"),Arrays.asList("<"));
406406
assertEquals("[[CHANGE, <,<]]",rows.toString());
407407
}
408+
409+
@Test
410+
publicvoidtestGenerationIssue44reportLinesUnchangedProblem()throwsDiffException {
411+
DiffRowGeneratorgenerator =DiffRowGenerator.create()
412+
.showInlineDiffs(true)
413+
.reportLinesUnchanged(true)
414+
.oldTag(f ->"~~")
415+
.newTag(f ->"**")
416+
.build();
417+
List<DiffRow>rows =generator.generateDiffRows(Arrays.asList("<dt>To do</dt>"),Arrays.asList("<dt>Done</dt>"));
418+
assertEquals("[[CHANGE,<dt>~~T~~o~~ do~~</dt>,<dt>**D**o**ne**</dt>]]",rows.toString());
419+
}
408420
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp