Skip to content

Commit 5357923

Browse files
authored
Changed line break behaviour. (commons-app#5562)
Added line breaks to PageContentsCreator.java, CategoryEditHelperUnitTests.kt, and MediaDetailFragmentUnitTests.kt following the example given on issue commons-app#5523.
1 parent 0656c88 commit 5357923

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/src/main/java/fr/free/nrw/commons/upload/PageContentsCreator.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public String createFrom(final Contribution contribution) {
4444
.append("}}");
4545
}
4646
buffer
47-
.append("\n")
4847
.append("|source=").append("{{own}}\n")
4948
.append("|author=[[User:").append(media.getAuthor()).append("|")
5049
.append(media.getAuthor()).append("]]\n");
@@ -68,7 +67,9 @@ public String createFrom(final Contribution contribution) {
6867
Utils.getWikiLovesMonumentsYear(Calendar.getInstance()), contribution.getCountryCode()));
6968
}
7069

71-
buffer.append("== {{int:license-header}} ==\n")
70+
buffer
71+
.append("\n")
72+
.append("== {{int:license-header}} ==\n")
7273
.append(licenseTemplateFor(media.getLicense())).append("\n\n")
7374
.append("{{Uploaded from Mobile|platform=Android|version=")
7475
.append(ConfigUtils.getVersionNameWithSha(context)).append("}}\n");

app/src/test/kotlin/fr/free/nrw/commons/category/CategoryEditHelperUnitTests.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ class CategoryEditHelperUnitTests {
8787
helper.makeCategoryEdit(context, media, listOf("Test"), "== {{int:filedesc}} ==\n" +
8888
"{{Information\n" +
8989
"|description=\n" +
90-
"\n" +
9190
"|source={{own}}\n" +
9291
"|author=[[User:UserForthBeta|UserForthBeta]]\n" +
9392
"|date={{According to Exif data|2022-03-06}}\n" +
9493
"}}\n" +
9594
"{{Location|22.538830555555556|114.08847222222222}}\n" +
95+
"\n" +
9696
"== {{int:license-header}} ==\n" +
9797
"{{self|cc-zero}}\n" +
9898
"\n" +

app/src/test/kotlin/fr/free/nrw/commons/media/MediaDetailFragmentUnitTests.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class MediaDetailFragmentUnitTests {
383383
"|other versions=\n" +
384384
"}}\n" +
385385
"{{Location|27.043186|88.267003}}\n" +
386-
"{{Assessments|featured=1}}"
386+
"{{Assessments|featured=1}}\n"
387387
val map = linkedMapOf("en" to "Antique cash register in a cafe, Darjeeling")
388388
Assert.assertEquals(map, method.invoke(fragment, s))
389389
}
@@ -429,7 +429,7 @@ class MediaDetailFragmentUnitTests {
429429
"|Other fields = {{Credit line |Author = © [[User:Colin]] | Other = Wikimedia Commons |License = CC-BY-SA-4.0}}\n" +
430430
"}}\n" +
431431
"{{Location|51.519003|-0.138353}}\n" +
432-
"{{Assessments|featured=1}}"
432+
"{{Assessments|featured=1}}\n"
433433
val map = linkedMapOf("en" to "[[:en:Fitzrovia Chapel|Fitzrovia Chapel]] ceiling<br/>\n")
434434
Assert.assertEquals(map, method.invoke(fragment, s))
435435
}
@@ -487,7 +487,7 @@ class MediaDetailFragmentUnitTests {
487487
"|Date =2015-02-17\n" +
488488
"|Permission ={{Diliff/Licensing}}\n" +
489489
"|other_versions=\n" +
490-
"}}"
490+
"}}\n"
491491
val map = linkedMapOf("en" to "The interior of Sacred Heart RC Church, Wimbledon, London.")
492492
Assert.assertEquals(map, method.invoke(fragment, s))
493493
}

0 commit comments

Comments
 (0)