@futurelastic/colab-handbook 1.12.0-rc.32 → 1.12.0-rc.33

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/package.json CHANGED
@@ -27,5 +27,5 @@
27
27
  "engines": {
28
28
  "node": ">=18"
29
29
  },
30
- "version": "1.12.0-rc.32"
30
+ "version": "1.12.0-rc.33"
31
31
  }
@@ -283,6 +283,7 @@ function lineRanges(nums, text = null) {
283
283
  }
284
284
 
285
285
  module.exports = {
286
+ stripCode,
286
287
  IMPORT_MAX_DEPTH,
287
288
  SHELL_IMPORT,
288
289
  ENTRY,
@@ -66,6 +66,7 @@
66
66
 
67
67
  const migrationPaths = require('./migration-paths');
68
68
  const releaseTag = require('./release-tag');
69
+ const { stripCode } = require('./instruction-file');
69
70
 
70
71
  const VERSION_RE = /^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/;
71
72
  const BUMPS = Object.freeze(['patch', 'minor']);
@@ -664,11 +665,16 @@ const MARKER_RE = /<!--\s*colab:switch\b([\s\S]*?)-->/g;
664
665
  * Returns { markers: [{ name, needs: [], role: null|'add'|'remove' }], malformed: [text] } — an
665
666
  * unknown token, a bad name, `needs` on a child, or two markers for one name disagreeing are all
666
667
  * `malformed`: "not cleared", reported, never defaulted.
668
+ *
669
+ * #466: fenced code blocks and inline code spans are blanked first (`stripCode`, the same reader
670
+ * the instruction-file import scan uses), so a body that QUOTES the marker family — prose such as
671
+ * "the `<!-- colab:switch -->` marker" — is documentation, not a malformed marker blocking every
672
+ * release. A real marker sits outside code, so it is still read, and still refused when malformed.
667
673
  */
668
674
  function parseSwitchMarkers(body) {
669
675
  const markers = [];
670
676
  const malformed = [];
671
- const text = String(body || '');
677
+ const text = stripCode(String(body || '')).join('\n');
672
678
  let m;
673
679
  MARKER_RE.lastIndex = 0;
674
680
  while ((m = MARKER_RE.exec(text)) !== null) {