Skip to content

Commit

Permalink
fix bad newlines when posting listings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Dec 17, 2022
1 parent baf56e0 commit 360221a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/ia/models/CopyrightProblemsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,12 @@ export default class CopyrightProblemsPage {

const config = await window.InfringementAssistant.getWikiConfig();
const preloadText = config.ia.preload.get() ? `{{subst:${
config.ia.preload.get()
}}}` : '';
// Only trim last newline, if any.
config.ia.preload.get().replace( /\n$/, '' )
}}}\n` : '';

const textParameters = appendMode ? {
appendtext: content,
appendtext: '\n' + content,
nocreate: true
} : {
text: preloadText + content,
Expand Down

0 comments on commit 360221a

Please sign in to comment.