lingo.dev 0.87.13 → 0.87.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.mjs CHANGED
@@ -3139,6 +3139,29 @@ function md5(input2) {
3139
3139
  import _20 from "lodash";
3140
3140
  var fenceRegex = /([ \t]*)(^>\s*)?```([\s\S]*?)```/gm;
3141
3141
  var inlineCodeRegex = /(?<!`)`([^`\r\n]+?)`(?!`)/g;
3142
+ var imageRegex = /([ \t]*)(^>\s*)?!\[[^\]]*?\]\([^\n\r]*?\)/gm;
3143
+ function ensureSurroundingImageNewlines(_content) {
3144
+ let found = false;
3145
+ let content = _content;
3146
+ let workingContent = content;
3147
+ do {
3148
+ found = false;
3149
+ const matches = workingContent.match(imageRegex);
3150
+ if (matches) {
3151
+ const match = matches[0];
3152
+ const replacement = match.trim().startsWith(">") ? match : `
3153
+
3154
+ ${match}
3155
+
3156
+ `;
3157
+ content = content.replaceAll(match, replacement);
3158
+ workingContent = workingContent.replaceAll(match, "");
3159
+ found = true;
3160
+ }
3161
+ } while (found);
3162
+ content = _20.chain(content).split("\n\n").map((section) => _20.trim(section, "\n")).filter(Boolean).join("\n\n").value();
3163
+ return content;
3164
+ }
3142
3165
  function ensureTrailingFenceNewline(_content) {
3143
3166
  let found = false;
3144
3167
  let content = _content;
@@ -3164,6 +3187,7 @@ ${match}
3164
3187
  function extractCodePlaceholders(content) {
3165
3188
  let finalContent = content;
3166
3189
  finalContent = ensureTrailingFenceNewline(finalContent);
3190
+ finalContent = ensureSurroundingImageNewlines(finalContent);
3167
3191
  const codePlaceholders = {};
3168
3192
  const codeBlockMatches = finalContent.matchAll(fenceRegex);
3169
3193
  for (const match of codeBlockMatches) {
@@ -5700,7 +5724,7 @@ function validateParams2(i18nConfig, flags) {
5700
5724
  // package.json
5701
5725
  var package_default = {
5702
5726
  name: "lingo.dev",
5703
- version: "0.87.13",
5727
+ version: "0.87.14",
5704
5728
  description: "Lingo.dev CLI",
5705
5729
  private: false,
5706
5730
  publishConfig: {