Skip to content

Commit

Permalink
改行を追加した分だけをカット
Browse files Browse the repository at this point in the history
  • Loading branch information
komiyamma committed Jul 9, 2024
1 parent 29b11b0 commit 49a5d29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HmOpenAiGptLaunch/HmOpenAiGpt.mac
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function onHtmlEventHandler(command_name) {
if (!answer_text) { return; }
// テーブルを整形
answer_text = formatMarkdownTable(answer_text + "\n")
answer_text = answer_text.replace(/\n+$/, '');
answer_text = answer_text.replace(/\n$/, '');

// このファイルはC#が出力しているので、\nのまま。hidemaru.loadTextFile でも\r\n にはならない。
const normalizeNewLineText = answer_text.replaceAll("\r\n", "\n").replaceAll("\n", "\r\n");
Expand Down Expand Up @@ -404,7 +404,7 @@ function pasteAIAnswer() {
return;
}
answer_text = formatMarkdownTable(answer_text + "\n"); // 最後に改行を足した状態で分析。テーブルの解析も安定する。
answer_text = answer_text.replace(/\n+$/, '');
answer_text = answer_text.replace(/\n$/, '');
insert(answer_text);
}

Expand Down

0 comments on commit 49a5d29

Please sign in to comment.