@collectionscms/plugin-text-generator
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "@collectionscms/plugin-text-generator", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Text Generation Plugin for Collections.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -8,3 +8,4 @@ import * as deepl from "deepl-node"; | ||
[]; | ||
const orderTexts = paragraphs.map((p) => `- ${p}`).join("\n"); | ||
const plainTextParagraphs = paragraphs.filter((p) => !/<[^>]*>/.test(p)); | ||
const orderTexts = plainTextParagraphs.map((p) => `- ${p}`).join("\n"); | ||
const completion = await this.openai.chat.completions.create({ | ||
@@ -41,3 +42,3 @@ model: this.model, | ||
const codePlaceholders = []; | ||
const bodyWithPlaceholders = body.replace(/<code>(.*?)<\/code>/g, (_, codeContent) => { | ||
const bodyWithPlaceholders = body.replace(/<code>([\s\S]*?)<\/code>/g, (_, codeContent) => { | ||
// Save the original content | ||
@@ -44,0 +45,0 @@ codePlaceholders.push(codeContent); |
@@ -77,3 +77,5 @@ /* eslint-disable max-len */ | ||
subtitle: "", | ||
body: "<p>Go straight to the source</p><pre><code># Code1</code></pre><p>Chats now include links to sources, such as news articles and blog posts, giving you a way to learn more</p><pre><code># Code2</code></pre>", | ||
body: `<p>The importance of real database testing</p><p>Go straight to<br/>the source</p><pre><code># Mocked approach | ||
it 'creates a user (mocked)' do | ||
end</code>`, | ||
sourceLang: "en", | ||
@@ -80,0 +82,0 @@ targetLang: "ja", |
12579
287