Skip to content

Commit

Permalink
fix(discord): fix extra newlines, close koishijs/koishi#1247
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 4, 2023
1 parent 4753780 commit 7d2e604
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adapters/discord/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@satorijs/adapter-discord",
"description": "Discord Adapter for Satorijs",
"version": "4.1.3",
"version": "4.1.4",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down
1 change: 0 additions & 1 deletion adapters/discord/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export class DiscordMessageEncoder<C extends Context = Context> extends MessageE
if (!this.buffer.endsWith('\n')) this.buffer += '\n'
await this.render(children)
if (!this.buffer.endsWith('\n')) this.buffer += '\n'
this.buffer += '\n'
} else if (type === 'blockquote') {
if (!this.buffer.endsWith('\n')) this.buffer += '\n'
this.buffer += '> '
Expand Down
2 changes: 1 addition & 1 deletion adapters/zulip/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@satorijs/adapter-zulip",
"description": "Zulip Adapter for Satorijs",
"version": "1.0.1",
"version": "1.0.2",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions adapters/zulip/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export class ZulipMessageEncoder<C extends Context = Context> extends MessageEnc
if (type === 'text') {
this.buffer += escape(attrs.content)
} else if (type === 'p') {
this.buffer += '\n'
if (!this.buffer.endsWith('\n')) this.buffer += '\n'
await this.render(children)
this.buffer += '\n'
if (!this.buffer.endsWith('\n')) this.buffer += '\n'
} else if (type === 'b' || type === 'strong') {
this.buffer += ` **`
await this.render(children)
Expand Down

0 comments on commit 7d2e604

Please sign in to comment.