@ethlete/core 5.0.0-next.17 → 5.0.0-next.18

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ethlete/core
2
2
 
3
+ ## 5.0.0-next.18
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d7c4fbe`](https://github.com/ethlete-io/ethdk/commit/d7c4fbe23359ebf68e4f769ac6eda05ce01f90c8) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix broken heading support in markdown utils
8
+
3
9
  ## 5.0.0-next.17
4
10
 
5
11
  ### Minor Changes
@@ -2758,9 +2758,10 @@ const htmlToMarkdown = (html) => {
2758
2758
  md = md.replace(/<pre[^>]*><code[^>]*class="language-([^"]+)"[^>]*>([\s\S]*?)<\/code><\/pre>/gi, (_, lang, code) => `\n\`\`\`${lang}\n${unescapeHtml(code.trim())}\n\`\`\`\n`);
2759
2759
  md = md.replace(/<pre[^>]*><code[^>]*>([\s\S]*?)<\/code><\/pre>/gi, (_, code) => `\n\`\`\`\n${unescapeHtml(code.trim())}\n\`\`\`\n`);
2760
2760
  md = md.replace(/<pre[^>]*>([\s\S]*?)<\/pre>/gi, (_, code) => `\n\`\`\`\n${unescapeHtml(code.trim())}\n\`\`\`\n`);
2761
- // Headings
2761
+ // Headings — keep the inner markup so the inline passes below turn any nested
2762
+ // bold/italic/link/code into markdown; leftover tags are stripped at the end.
2762
2763
  for (let i = 6; i >= 1; i--) {
2763
- md = md.replace(new RegExp(`<h${i}[^>]*>([\\s\\S]*?)<\\/h${i}>`, 'gi'), (_, content) => `\n${'#'.repeat(i)} ${stripTags(content).trim()}\n`);
2764
+ md = md.replace(new RegExp(`<h${i}[^>]*>([\\s\\S]*?)<\\/h${i}>`, 'gi'), (_, content) => `\n${'#'.repeat(i)} ${content.trim()}\n`);
2764
2765
  }
2765
2766
  // Bold + italic (combined before individual)
2766
2767
  md = md.replace(/<strong[^>]*><em[^>]*>([\s\S]*?)<\/em><\/strong>/gi, '***$1***');