lingo.dev 0.87.7 → 0.87.9

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.cjs CHANGED
@@ -3100,6 +3100,7 @@ function md5(input2) {
3100
3100
  // src/cli/loaders/mdx2/code-placeholder.ts
3101
3101
 
3102
3102
  var fenceRegex = /([ \t]*)(^>\s*)?```([\s\S]*?)```/gm;
3103
+ var inlineCodeRegex = /(?<!`)`([^`\r\n]+?)`(?!`)/g;
3103
3104
  function ensureTrailingFenceNewline(_content) {
3104
3105
  let found = false;
3105
3106
  let content = _content;
@@ -3114,8 +3115,8 @@ function ensureTrailingFenceNewline(_content) {
3114
3115
  ${match}
3115
3116
 
3116
3117
  `;
3117
- content = content.replace(match, replacement);
3118
- workingContent = workingContent.replace(match, "");
3118
+ content = content.replaceAll(match, replacement);
3119
+ workingContent = workingContent.replaceAll(match, "");
3119
3120
  found = true;
3120
3121
  }
3121
3122
  } while (found);
@@ -3130,9 +3131,19 @@ function extractCodePlaceholders(content) {
3130
3131
  for (const match of codeBlockMatches) {
3131
3132
  const codeBlock = match[0];
3132
3133
  const codeBlockHash = md5(codeBlock);
3133
- const placeholderId = `---CODE_PLACEHOLDER_${codeBlockHash}---`;
3134
- codePlaceholders[placeholderId] = codeBlock;
3135
- finalContent = finalContent.replace(codeBlock, placeholderId);
3134
+ const placeholder = `---CODE_PLACEHOLDER_${codeBlockHash}---`;
3135
+ codePlaceholders[placeholder] = codeBlock;
3136
+ const replacement = codeBlock.trim().startsWith(">") ? `> ${placeholder}` : `${placeholder}`;
3137
+ finalContent = finalContent.replace(codeBlock, replacement);
3138
+ }
3139
+ const inlineCodeMatches = finalContent.matchAll(inlineCodeRegex);
3140
+ for (const match of inlineCodeMatches) {
3141
+ const inlineCode = match[0];
3142
+ const inlineCodeHash = md5(inlineCode);
3143
+ const placeholder = `---INLINE_CODE_PLACEHOLDER_${inlineCodeHash}---`;
3144
+ codePlaceholders[placeholder] = inlineCode;
3145
+ const replacement = placeholder;
3146
+ finalContent = finalContent.replace(inlineCode, replacement);
3136
3147
  }
3137
3148
  return {
3138
3149
  content: finalContent,
@@ -3151,7 +3162,8 @@ function createMdxCodePlaceholderLoader() {
3151
3162
  for (const [placeholder, original] of Object.entries(
3152
3163
  response.codePlaceholders
3153
3164
  )) {
3154
- result = result.replaceAll(placeholder, original);
3165
+ const replacement = original.startsWith(">") ? _lodash2.default.trimStart(original, "> ") : original;
3166
+ result = result.replaceAll(placeholder, replacement);
3155
3167
  }
3156
3168
  return result;
3157
3169
  }
@@ -5646,7 +5658,7 @@ function validateParams2(i18nConfig, flags) {
5646
5658
  // package.json
5647
5659
  var package_default = {
5648
5660
  name: "lingo.dev",
5649
- version: "0.87.7",
5661
+ version: "0.87.9",
5650
5662
  description: "Lingo.dev CLI",
5651
5663
  private: false,
5652
5664
  publishConfig: {